grid and background image [message #210297] |
Thu, 23 February 2006 20:33  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.03629 seconds