Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » ScalableFreeformRootEditPart
ScalableFreeformRootEditPart [message #195304] Fri, 09 September 2005 12:39 Go to next message
Eclipse UserFriend
Originally posted by: greg.gigon.tugulu.com

It looks like ScalableFreeformRootEditPart has GridLayer() in it but it
doesn't display.

How to make it work? Do I need to override some methods?

Greg
Re: ScalableFreeformRootEditPart [message #195319 is a reply to message #195304] Fri, 09 September 2005 13:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mvsteenbergen.eljakim.scratch-this.nl

Take a look at how ToggleGridAction does it.

Greg wrote:
> It looks like ScalableFreeformRootEditPart has GridLayer() in it but it
> doesn't display.
>
> How to make it work? Do I need to override some methods?
>
> Greg
Re: ScalableFreeformRootEditPart [message #195332 is a reply to message #195319] Fri, 09 September 2005 14:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: greg.gigon.tugulu.com

Is it enought to initiate class in order to make Grid visible?

What should be the moment to do that?

Greg


Martijn van Steenbergen wrote:
> Take a look at how ToggleGridAction does it.
>
> Greg wrote:
>
>> It looks like ScalableFreeformRootEditPart has GridLayer() in it but
>> it doesn't display.
>>
>> How to make it work? Do I need to override some methods?
>>
>> Greg
Re: ScalableFreeformRootEditPart [message #195364 is a reply to message #195332] Fri, 09 September 2005 15:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

Greg, as Martijn suggested, look at ToggleGridAction to see how to turn the
grid on and off. You can see how the logic example uses this. You can set
the grid enablement properties on the viewer in your editor's
configureGraphicalViewer() method. If the grid's still not visible you
probably have an opaque layer (such as your primary layer) above the grid
layer that's preventing it from being seen. If that is the case, snapping
to grid should still work (although the grid itself won't be visible). Just
ensure that you're not invoking setOpaque(true) on any of the layers.

"Greg" <greg.gigon@tugulu.com> wrote in message
news:dfs4ic$eh2$1@news.eclipse.org...
> Is it enought to initiate class in order to make Grid visible?
>
> What should be the moment to do that?
>
> Greg
>
>
> Martijn van Steenbergen wrote:
> > Take a look at how ToggleGridAction does it.
> >
> > Greg wrote:
> >
> >> It looks like ScalableFreeformRootEditPart has GridLayer() in it but
> >> it doesn't display.
> >>
> >> How to make it work? Do I need to override some methods?
> >>
> >> Greg
Re: ScalableFreeformRootEditPart [message #195598 is a reply to message #195364] Mon, 12 September 2005 08:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: greg.gigon.tugulu.com

I'm adding these two lines to my Editor:

ToggleGridAction grid = new ToggleGridAction(graphicalViewer);
getActionRegistry().registerAction(grid);

and I'm not setting any of layers by myself. I'm using
ScalableFreeformRootEditPart which seems to be seting Layers by itself.

Grid is still not visible. Do I need to use this registered action
somewhere in order to turn the GRID on??

Gregory

Ps. Sorry that my questions are so LAME :)


Pratik Shah wrote:
> Greg, as Martijn suggested, look at ToggleGridAction to see how to turn the
> grid on and off. You can see how the logic example uses this. You can set
> the grid enablement properties on the viewer in your editor's
> configureGraphicalViewer() method. If the grid's still not visible you
> probably have an opaque layer (such as your primary layer) above the grid
> layer that's preventing it from being seen. If that is the case, snapping
> to grid should still work (although the grid itself won't be visible). Just
> ensure that you're not invoking setOpaque(true) on any of the layers.
>
> "Greg" <greg.gigon@tugulu.com> wrote in message
> news:dfs4ic$eh2$1@news.eclipse.org...
>
>>Is it enought to initiate class in order to make Grid visible?
>>
>>What should be the moment to do that?
>>
>>Greg
>>
>>
>>Martijn van Steenbergen wrote:
>>
>>>Take a look at how ToggleGridAction does it.
>>>
>>>Greg wrote:
>>>
>>>
>>>>It looks like ScalableFreeformRootEditPart has GridLayer() in it but
>>>>it doesn't display.
>>>>
>>>>How to make it work? Do I need to override some methods?
>>>>
>>>>Greg
>
>
>
Re: ScalableFreeformRootEditPart [message #195653 is a reply to message #195598] Mon, 12 September 2005 16:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

"Greg" <greg.gigon@tugulu.com> wrote in message
news:dg3fe3$8mr$1@news.eclipse.org...
>
> I'm adding these two lines to my Editor:
>
> ToggleGridAction grid = new ToggleGridAction(graphicalViewer);
> getActionRegistry().registerAction(grid);
>
> and I'm not setting any of layers by myself. I'm using
> ScalableFreeformRootEditPart which seems to be seting Layers by itself.
>
> Grid is still not visible. Do I need to use this registered action
> somewhere in order to turn the GRID on??

The action is to turn the grid on or off. Creating that action doesn't turn
the grid on. You need to set the grid properties for that. The logic
editor does that in its loadProperties() method. The ToggleGridAction
toggles those properties in its run method. So you should look at either
one of those to see what properties you need to set.

>
> Gregory
>
> Ps. Sorry that my questions are so LAME :)
>
>
> Pratik Shah wrote:
> > Greg, as Martijn suggested, look at ToggleGridAction to see how to turn
the
> > grid on and off. You can see how the logic example uses this. You can
set
> > the grid enablement properties on the viewer in your editor's
> > configureGraphicalViewer() method. If the grid's still not visible you
> > probably have an opaque layer (such as your primary layer) above the
grid
> > layer that's preventing it from being seen. If that is the case,
snapping
> > to grid should still work (although the grid itself won't be visible).
Just
> > ensure that you're not invoking setOpaque(true) on any of the layers.
> >
> > "Greg" <greg.gigon@tugulu.com> wrote in message
> > news:dfs4ic$eh2$1@news.eclipse.org...
> >
> >>Is it enought to initiate class in order to make Grid visible?
> >>
> >>What should be the moment to do that?
> >>
> >>Greg
> >>
> >>
> >>Martijn van Steenbergen wrote:
> >>
> >>>Take a look at how ToggleGridAction does it.
> >>>
> >>>Greg wrote:
> >>>
> >>>
> >>>>It looks like ScalableFreeformRootEditPart has GridLayer() in it but
> >>>>it doesn't display.
> >>>>
> >>>>How to make it work? Do I need to override some methods?
> >>>>
> >>>>Greg
> >
> >
> >
Re: ScalableFreeformRootEditPart [message #195723 is a reply to message #195653] Tue, 13 September 2005 08:37 Go to previous message
Eclipse UserFriend
Originally posted by: greg.gigon.tugulu.com

Well that was good enought :)

Thank You Pratik.

It's shame there's no book that will say in order to provide "this" with
GEF do "that" :)

Java DOC doesn't explain a lot of simple actions in order to provide
simple functionality.


Greg


Pratik Shah wrote:
> "Greg" <greg.gigon@tugulu.com> wrote in message
> news:dg3fe3$8mr$1@news.eclipse.org...
>
>>I'm adding these two lines to my Editor:
>>
>>ToggleGridAction grid = new ToggleGridAction(graphicalViewer);
>>getActionRegistry().registerAction(grid);
>>
>>and I'm not setting any of layers by myself. I'm using
>>ScalableFreeformRootEditPart which seems to be seting Layers by itself.
>>
>>Grid is still not visible. Do I need to use this registered action
>>somewhere in order to turn the GRID on??
>
>
> The action is to turn the grid on or off. Creating that action doesn't turn
> the grid on. You need to set the grid properties for that. The logic
> editor does that in its loadProperties() method. The ToggleGridAction
> toggles those properties in its run method. So you should look at either
> one of those to see what properties you need to set.
>
>
>>Gregory
>>
>>Ps. Sorry that my questions are so LAME :)
>>
>>
>>Pratik Shah wrote:
>>
>>>Greg, as Martijn suggested, look at ToggleGridAction to see how to turn
>
> the
>
>>>grid on and off. You can see how the logic example uses this. You can
>
> set
>
>>>the grid enablement properties on the viewer in your editor's
>>>configureGraphicalViewer() method. If the grid's still not visible you
>>>probably have an opaque layer (such as your primary layer) above the
>
> grid
>
>>>layer that's preventing it from being seen. If that is the case,
>
> snapping
>
>>>to grid should still work (although the grid itself won't be visible).
>
> Just
>
>>>ensure that you're not invoking setOpaque(true) on any of the layers.
>>>
>>>"Greg" <greg.gigon@tugulu.com> wrote in message
>>>news:dfs4ic$eh2$1@news.eclipse.org...
>>>
>>>
>>>>Is it enought to initiate class in order to make Grid visible?
>>>>
>>>>What should be the moment to do that?
>>>>
>>>>Greg
>>>>
>>>>
>>>>Martijn van Steenbergen wrote:
>>>>
>>>>
>>>>>Take a look at how ToggleGridAction does it.
>>>>>
>>>>>Greg wrote:
>>>>>
>>>>>
>>>>>
>>>>>>It looks like ScalableFreeformRootEditPart has GridLayer() in it but
>>>>>>it doesn't display.
>>>>>>
>>>>>>How to make it work? Do I need to override some methods?
>>>>>>
>>>>>>Greg
>>>
>>>
>>>
>
>
Previous Topic:Starting a new GEF project
Next Topic:Draw Freehand
Goto Forum:
  


Current Time: Thu Apr 18 14:34:47 GMT 2024

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

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

Back to the top