Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » grid and background image
grid and background image [message #210297] Thu, 23 February 2006 20:33 Go to next message
Martin Rosenthal is currently offline Martin RosenthalFriend
Messages: 18
Registered: July 2009
Junior Member
Hello there,

there is an background image and an grid (cause of snaptogrid) in my
editor. the image is painted with graphics.drawImage().
How is it possible to get the grid on the image?

Thanks for your help.

Regards Martin
Re: grid and background image [message #210305 is a reply to message #210297] Fri, 24 February 2006 10:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: a.hoess.bachmann.info

Hi,

look in your RootEditPart, there is a layer called GRID_LAYER. This layer
should be added after your layer with the background image is added.

Greets,
Alex
Re: grid and background image [message #210313 is a reply to message #210305] Fri, 24 February 2006 12:17 Go to previous message
Martin Rosenthal is currently offline Martin RosenthalFriend
Messages: 18
Registered: July 2009
Junior Member
Ok, i added a grid_layer to the figure, which paints the image. e.g.

MyEditPart(){
IFigure createFigure() {
Figure f = new FreeformLayer() {
protected void paintFigure(Graphics graphics) {
graphics.drawImage(foo_image,0,0);
}
}
return f;
}
}

The grid can be toggled with

IAction showGrid = new ToggleGridAction(getGraphicalViewer());

So when i add an other grid_layer to the Figure, the grid cant be hidden
by the action.
Previous Topic:Problem to draw a vertical Label
Next Topic:TextFlow doesn't return correct height from getPreferredSize()
Goto Forum:
  


Current Time: Sun Dec 04 10:11:07 GMT 2022

Powered by FUDForum. Page generated in 0.02521 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top