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:how to invoke propertysheetpage change according to Model's change
Next Topic:How can I reverse the direction of the Y axis?
Goto Forum:
  


Current Time: Fri Apr 19 21:28:53 GMT 2024

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

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

Back to the top