Getting the grid working [message #114736] |
Thu, 29 January 2004 13:14  |
Eclipse User |
|
|
|
Originally posted by: brian.fernandes.codito.com
I'm working with the latest CVS checkouts of GEF / Draw2d.
I want to know how I can get the grid working...
I've added the ToggleGridAction and added the grid to the view menu. the
menu entry toggles on and off just fine.
I've also set the properties of the gird like in the
LogicEditor#loadProperties.
Since I extended ScalableRootEditPart (for scaling only in the X direction),
I had to reimplement the GRID relavent portions in that.
But when I add the GRID_LAYER, my editor does not show up.. gives me an
"Error occured while creating this editor"
I think I traced this to a nullpointer exception in
ScrollingGraphicalViewer().getControl().setFocus() .. and control is null
for ScrollingGraphicalViewer..
I couldn't trace this further.. is there something else I need to be doing ?
Thanks,
Brian.
|
|
|
|
|
|
|
Re: Getting the grid working [message #114968 is a reply to message #114915] |
Fri, 30 January 2004 11:24   |
Eclipse User |
|
|
|
Originally posted by: brian.fernandes.codito.com
Hi Randy,
I just checked - it does not screw up if I fail to specify
PROPERTY_GIRD_ORIGIN.
My problem was, I had incorrectly specified a Point as a parameter to
PROPERTY_GRID_SPACING.
To make it clearer; instead of the following two lines,
getGraphicalViewer().setProperty(SnapToGrid.PROPERTY_GRID_SP ACING, new
Dimension(10,10));
getGraphicalViewer().setProperty(SnapToGrid.PROPERTY_GRID_OR IGIN, new
Point());
I had incorrectly used these two (forgot to change the property when I
copied the first line - spent hours debugging it)
getGraphicalViewer().setProperty(SnapToGrid.PROPERTY_GRID_SP ACING, new
Dimension(10,10));
getGraphicalViewer().setProperty(SnapToGrid.PROPERTY_GRID_SP ACING, new
Point());
Thanks,
Brian.
|
|
|
|
Re: Getting the grid working [message #115159 is a reply to message #114736] |
Mon, 02 February 2004 09:03   |
Eclipse User |
|
|
|
Originally posted by: brian.fernandes.codito.com
I have the grid layer working fine now (but I still need only vertical grid
lines).
My editor usually opens a very large diagram and after examing it, I clip
the diagram, by disregarding some models and moving the remaining models
forward along the X axis.
Unfortunately, the diagram remains as large as it was before the clipping.
If the diagram initally was 10000 pixels wide, and I clip all before 9000
pixels, the resulting diagram should be 1000 pixels wide. But it remains at
10000 pixels.
Since I'm using my own RootEditPart, I can remove the GRID layer - if I do,
and then clip the diagram, it is correctly sized at 1000 pixels wide and the
scrollbars behave appropriately.
Shouldn't the GRID layer be resizing itself ? Or is there anyway in which I
can force it to do so ?
Thanks,
Brian.
|
|
|
|
Re: Getting the grid working [message #115434 is a reply to message #115159] |
Tue, 03 February 2004 13:02   |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
It sounds like the grid layer is not implementing getPreferredSize(int, int)
correctly. Please open a bugzilla. This is an easy fix.
"Brian Fernandes" <brian.fernandes@codito.com> wrote in message
news:bvll79$pqt$1@eclipse.org...
> I have the grid layer working fine now (but I still need only vertical
grid
> lines).
>
> My editor usually opens a very large diagram and after examing it, I clip
> the diagram, by disregarding some models and moving the remaining models
> forward along the X axis.
> Unfortunately, the diagram remains as large as it was before the clipping.
> If the diagram initally was 10000 pixels wide, and I clip all before 9000
> pixels, the resulting diagram should be 1000 pixels wide. But it remains
at
> 10000 pixels.
>
> Since I'm using my own RootEditPart, I can remove the GRID layer - if I
do,
> and then clip the diagram, it is correctly sized at 1000 pixels wide and
the
> scrollbars behave appropriately.
>
> Shouldn't the GRID layer be resizing itself ? Or is there anyway in which
I
> can force it to do so ?
>
> Thanks,
> Brian.
>
>
>
>
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.07892 seconds