Skip to main content



      Home
Home » Eclipse Projects » GEF » Getting the grid working
Getting the grid working [message #114736] Thu, 29 January 2004 13:14 Go to next message
Eclipse UserFriend
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 #114814 is a reply to message #114736] Fri, 30 January 2004 06:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brian.fernandes.codito.com

I made a silly mistake, I had 2 lines setting the rulers
PROPERTY_GRID_SPACING. Once to a Dimension and once to a Point.
While copying the line, I forgot to change PROPERTY_GRID_SPACING to
PROPERTY_GRID_ORIGIN. aargh.

Brian.
Re: Getting the grid working [message #114826 is a reply to message #114736] Fri, 30 January 2004 06:50 Go to previous messageGo to next message
Eclipse UserFriend
> I couldn't trace this further.. is there something else I need to be doing
?n

No, that's it. You're doing everything you're supposed to do. Can you
provide a stack trace of the NPE?


"Brian Fernandes" <brian.fernandes@codito.com> wrote in message
news:bvbieo$649$1@eclipse.org...
> 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 #114889 is a reply to message #114736] Fri, 30 January 2004 10:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brian.fernandes.codito.com

I got the GRID working, the error was what I mentioned in the last post -
forgot to mention that that was the cause of the NPE.

I would like to be able to have only vertical grid lines - for my app. the
horizontal grid lines are useless...
Since the GRID is still being developed, could you add that option in ? To
have either only horizontal or vertical grid lines ?

Thanks,
Brian.
Re: Getting the grid working [message #114915 is a reply to message #114814] Fri, 30 January 2004 11:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Pratik, the grid layer shouldn't barf from a missing property. Does it work
without setting the origin?

"Brian Fernandes" <brian.fernandes@codito.com> wrote in message
news:bvdfpc$7pl$1@eclipse.org...
> I made a silly mistake, I had 2 lines setting the rulers
> PROPERTY_GRID_SPACING. Once to a Dimension and once to a Point.
> While copying the line, I forgot to change PROPERTY_GRID_SPACING to
> PROPERTY_GRID_ORIGIN. aargh.
>
> Brian.
>
>
Re: Getting the grid working [message #114968 is a reply to message #114915] Fri, 30 January 2004 11:24 Go to previous messageGo to next message
Eclipse UserFriend
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 #115006 is a reply to message #114889] Fri, 30 January 2004 13:07 Go to previous messageGo to next message
Eclipse UserFriend
Please open a feature request for that.

"Brian Fernandes" <brian.fernandes@codito.com> wrote in message
news:bvdude$q78$1@eclipse.org...
> I got the GRID working, the error was what I mentioned in the last post -
> forgot to mention that that was the cause of the NPE.
>
> I would like to be able to have only vertical grid lines - for my app. the
> horizontal grid lines are useless...
> Since the GRID is still being developed, could you add that option in ?
To
> have either only horizontal or vertical grid lines ?
>
> Thanks,
> Brian.
>
>
Re: Getting the grid working [message #115159 is a reply to message #114736] Mon, 02 February 2004 09:03 Go to previous messageGo to next message
Eclipse UserFriend
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 #115172 is a reply to message #115006] Mon, 02 February 2004 09:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brian.fernandes.codito.com

Here is my feature request for a GRID with only horizontal or vertical grid
lines.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=51012
Re: Getting the grid working [message #115434 is a reply to message #115159] Tue, 03 February 2004 13:02 Go to previous messageGo to next message
Eclipse UserFriend
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.
>
>
>
>
>
>
Re: Getting the grid working [message #115547 is a reply to message #115434] Wed, 04 February 2004 07:34 Go to previous message
Eclipse UserFriend
Originally posted by: brian.fernandes.codito.com

Bug reported here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=51153

Hope that that is the problem, and it is indeed an easy fix.
Previous Topic:how can contentoutline responds to platformUI change
Next Topic:gef bendpoints problem
Goto Forum:
  


Current Time: Tue May 06 19:24:18 EDT 2025

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

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

Back to the top