Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » SnapToGrid
SnapToGrid [message #168468] Wed, 16 February 2005 10:05 Go to next message
Eclipse UserFriend
Originally posted by: awm_abu.yahoo.com

Hi,

I have been reading the GEF section at the end of "SWT/JFace in Action" =
=

and I saw mention of the Grid Layout.
The idea of allowing the user to force the editor's figures to position =
=

themselves according to the grids points
is one that I may have use for in my application.

However the book doesn't go into any detail on how to do this.
So where do I start : any articles or anything else out there to help me=
=

get started in this area ?

Thanks a lot,
Alan.

-- =

Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
Re: SnapToGrid [message #168508 is a reply to message #168468] Wed, 16 February 2005 14:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

The function is very simple to use. It is demonstrated in the Logic
example. I think that you simply need to return a SnapToGridHelper in the
editpart's getAdapter() method, and GEF's provided tools do the rest.
Enabling and displaying the grid is straightforward too.

"Alan Morgan" <awm_abu@yahoo.com> escreveu na mensagem
news:opsmabnfgx4f1agp@pc-amorgan.ie.uk.pilz.local...
Hi,

I have been reading the GEF section at the end of "SWT/JFace in Action"
and I saw mention of the Grid Layout.
The idea of allowing the user to force the editor's figures to position
themselves according to the grids points
is one that I may have use for in my application.

However the book doesn't go into any detail on how to do this.
So where do I start : any articles or anything else out there to help me
get started in this area ?

Thanks a lot,
Alan.

--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
Re: SnapToGrid [message #168681 is a reply to message #168508] Thu, 17 February 2005 16:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: a.morgan.pilz.ie

Hi,

Thanks for the reply. I have implemented the getAdapter() method in my
EditPart ala Logic example.
However after debugging I have confirmed that the code never gets called in
my application.
Is there something I have to turn on to enable this or something ?

Thanks again,
Alan.


"Randy Hudson" <none@us.ibm.com> wrote in message
news:cuvldh$hgp$1@www.eclipse.org...
> The function is very simple to use. It is demonstrated in the Logic
> example. I think that you simply need to return a SnapToGridHelper in the
> editpart's getAdapter() method, and GEF's provided tools do the rest.
> Enabling and displaying the grid is straightforward too.
>
> "Alan Morgan" <awm_abu@yahoo.com> escreveu na mensagem
> news:opsmabnfgx4f1agp@pc-amorgan.ie.uk.pilz.local...
> Hi,
>
> I have been reading the GEF section at the end of "SWT/JFace in Action"
> and I saw mention of the Grid Layout.
> The idea of allowing the user to force the editor's figures to position
> themselves according to the grids points
> is one that I may have use for in my application.
>
> However the book doesn't go into any detail on how to do this.
> So where do I start : any articles or anything else out there to help me
> get started in this area ?
>
> Thanks a lot,
> Alan.
>
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
>
>
Re: SnapToGrid [message #168969 is a reply to message #168681] Mon, 21 February 2005 04:45 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
Did you set the property on the viewer? Look at
LogicEditor#loadProperties() where it sets the grid properties on the
viewer. I'll update the javadoc for SnapToGrid so that it lists what needs
to be done to get the grid working.

"news.eclipse.org" <a.morgan@pilz.ie> wrote in message
news:cv2i6i$eh5$1@www.eclipse.org...
> Hi,
>
> Thanks for the reply. I have implemented the getAdapter() method in my
> EditPart ala Logic example.
> However after debugging I have confirmed that the code never gets called
in
> my application.
> Is there something I have to turn on to enable this or something ?
>
> Thanks again,
> Alan.
>
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:cuvldh$hgp$1@www.eclipse.org...
> > The function is very simple to use. It is demonstrated in the Logic
> > example. I think that you simply need to return a SnapToGridHelper in
the
> > editpart's getAdapter() method, and GEF's provided tools do the rest.
> > Enabling and displaying the grid is straightforward too.
> >
> > "Alan Morgan" <awm_abu@yahoo.com> escreveu na mensagem
> > news:opsmabnfgx4f1agp@pc-amorgan.ie.uk.pilz.local...
> > Hi,
> >
> > I have been reading the GEF section at the end of "SWT/JFace in Action"
> > and I saw mention of the Grid Layout.
> > The idea of allowing the user to force the editor's figures to position
> > themselves according to the grids points
> > is one that I may have use for in my application.
> >
> > However the book doesn't go into any detail on how to do this.
> > So where do I start : any articles or anything else out there to help me
> > get started in this area ?
> >
> > Thanks a lot,
> > Alan.
> >
> > --
> > Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
> >
> >
>
>
Re: SnapToGrid [message #170032 is a reply to message #168969] Tue, 01 March 2005 12:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: a.morgan.pilz.ie

Hi Pratik,

I copied some of the stuff from loadProperties as suggested and now I can
see getAdapter() getting called and a SnapToHelper being returned. However I
still cannot see the grid.

Not sure what else to do here...how can I access the updated javadoc for
SnapToGrid ?

Regards,
Alan.


"Pratik Shah" <ppshah@us.ibm.com> wrote in message
news:cvbp0s$6lu$1@www.eclipse.org...
> Did you set the property on the viewer? Look at
> LogicEditor#loadProperties() where it sets the grid properties on the
> viewer. I'll update the javadoc for SnapToGrid so that it lists what
needs
> to be done to get the grid working.
>
> "news.eclipse.org" <a.morgan@pilz.ie> wrote in message
> news:cv2i6i$eh5$1@www.eclipse.org...
> > Hi,
> >
> > Thanks for the reply. I have implemented the getAdapter() method in my
> > EditPart ala Logic example.
> > However after debugging I have confirmed that the code never gets called
> in
> > my application.
> > Is there something I have to turn on to enable this or something ?
> >
> > Thanks again,
> > Alan.
> >
> >
> > "Randy Hudson" <none@us.ibm.com> wrote in message
> > news:cuvldh$hgp$1@www.eclipse.org...
> > > The function is very simple to use. It is demonstrated in the Logic
> > > example. I think that you simply need to return a SnapToGridHelper in
> the
> > > editpart's getAdapter() method, and GEF's provided tools do the rest.
> > > Enabling and displaying the grid is straightforward too.
> > >
> > > "Alan Morgan" <awm_abu@yahoo.com> escreveu na mensagem
> > > news:opsmabnfgx4f1agp@pc-amorgan.ie.uk.pilz.local...
> > > Hi,
> > >
> > > I have been reading the GEF section at the end of "SWT/JFace in
Action"
> > > and I saw mention of the Grid Layout.
> > > The idea of allowing the user to force the editor's figures to
position
> > > themselves according to the grids points
> > > is one that I may have use for in my application.
> > >
> > > However the book doesn't go into any detail on how to do this.
> > > So where do I start : any articles or anything else out there to help
me
> > > get started in this area ?
> > >
> > > Thanks a lot,
> > > Alan.
> > >
> > > --
> > > Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
> > >
> > >
> >
> >
>
>
Re: SnapToGrid [message #170201 is a reply to message #170032] Wed, 02 March 2005 16:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: a.morgan.pilz.ie

Following on from below - I finally managed to get the grid to show.
This occured when I changed my top level figure from being a FreefromLayer
to being a ScrollPane.
Does this make sense to you as to why this would happen ?

"Alan Morgan" <a.morgan@pilz.ie> wrote in message
news:d01m7g$i1m$1@www.eclipse.org...
> Hi Pratik,
>
> I copied some of the stuff from loadProperties as suggested and now I can
> see getAdapter() getting called and a SnapToHelper being returned. However
I
> still cannot see the grid.
>
> Not sure what else to do here...how can I access the updated javadoc for
> SnapToGrid ?
>
> Regards,
> Alan.
>
>
> "Pratik Shah" <ppshah@us.ibm.com> wrote in message
> news:cvbp0s$6lu$1@www.eclipse.org...
> > Did you set the property on the viewer? Look at
> > LogicEditor#loadProperties() where it sets the grid properties on the
> > viewer. I'll update the javadoc for SnapToGrid so that it lists what
> needs
> > to be done to get the grid working.
> >
> > "news.eclipse.org" <a.morgan@pilz.ie> wrote in message
> > news:cv2i6i$eh5$1@www.eclipse.org...
> > > Hi,
> > >
> > > Thanks for the reply. I have implemented the getAdapter() method in my
> > > EditPart ala Logic example.
> > > However after debugging I have confirmed that the code never gets
called
> > in
> > > my application.
> > > Is there something I have to turn on to enable this or something ?
> > >
> > > Thanks again,
> > > Alan.
> > >
> > >
> > > "Randy Hudson" <none@us.ibm.com> wrote in message
> > > news:cuvldh$hgp$1@www.eclipse.org...
> > > > The function is very simple to use. It is demonstrated in the Logic
> > > > example. I think that you simply need to return a SnapToGridHelper
in
> > the
> > > > editpart's getAdapter() method, and GEF's provided tools do the
rest.
> > > > Enabling and displaying the grid is straightforward too.
> > > >
> > > > "Alan Morgan" <awm_abu@yahoo.com> escreveu na mensagem
> > > > news:opsmabnfgx4f1agp@pc-amorgan.ie.uk.pilz.local...
> > > > Hi,
> > > >
> > > > I have been reading the GEF section at the end of "SWT/JFace in
> Action"
> > > > and I saw mention of the Grid Layout.
> > > > The idea of allowing the user to force the editor's figures to
> position
> > > > themselves according to the grids points
> > > > is one that I may have use for in my application.
> > > >
> > > > However the book doesn't go into any detail on how to do this.
> > > > So where do I start : any articles or anything else out there to
help
> me
> > > > get started in this area ?
> > > >
> > > > Thanks a lot,
> > > > Alan.
> > > >
> > > > --
> > > > Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Re: SnapToGrid [message #170605 is a reply to message #170032] Sun, 06 March 2005 01:27 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
So, you have set both the visibility and the enablement properties on the
viewer, right? In the case below, if you can't see it, can you still snap
to it? That is, when moving figures around in your editor do you see them
snapping? Maybe your grid was showing, but you couldn't actually see it
because there was some opaque figure in the way. Was your freeform layer
opaque? You should investigate why returning a scrollpane works, whereas
the freeform layer doesn't. You shouldn't have to return the scrollpane.
Were you setting the freeform layer's layout to a FreeformLayout? Is your
editor using a ScalableFreeformRootEditPart?

"Alan Morgan" <a.morgan@pilz.ie> wrote in message
news:d01m7g$i1m$1@www.eclipse.org...
> Hi Pratik,
>
> I copied some of the stuff from loadProperties as suggested and now I can
> see getAdapter() getting called and a SnapToHelper being returned. However
I
> still cannot see the grid.
>
> Not sure what else to do here...how can I access the updated javadoc for
> SnapToGrid ?
>
> Regards,
> Alan.
>
>
> "Pratik Shah" <ppshah@us.ibm.com> wrote in message
> news:cvbp0s$6lu$1@www.eclipse.org...
> > Did you set the property on the viewer? Look at
> > LogicEditor#loadProperties() where it sets the grid properties on the
> > viewer. I'll update the javadoc for SnapToGrid so that it lists what
> needs
> > to be done to get the grid working.
> >
> > "news.eclipse.org" <a.morgan@pilz.ie> wrote in message
> > news:cv2i6i$eh5$1@www.eclipse.org...
> > > Hi,
> > >
> > > Thanks for the reply. I have implemented the getAdapter() method in my
> > > EditPart ala Logic example.
> > > However after debugging I have confirmed that the code never gets
called
> > in
> > > my application.
> > > Is there something I have to turn on to enable this or something ?
> > >
> > > Thanks again,
> > > Alan.
> > >
> > >
> > > "Randy Hudson" <none@us.ibm.com> wrote in message
> > > news:cuvldh$hgp$1@www.eclipse.org...
> > > > The function is very simple to use. It is demonstrated in the Logic
> > > > example. I think that you simply need to return a SnapToGridHelper
in
> > the
> > > > editpart's getAdapter() method, and GEF's provided tools do the
rest.
> > > > Enabling and displaying the grid is straightforward too.
> > > >
> > > > "Alan Morgan" <awm_abu@yahoo.com> escreveu na mensagem
> > > > news:opsmabnfgx4f1agp@pc-amorgan.ie.uk.pilz.local...
> > > > Hi,
> > > >
> > > > I have been reading the GEF section at the end of "SWT/JFace in
> Action"
> > > > and I saw mention of the Grid Layout.
> > > > The idea of allowing the user to force the editor's figures to
> position
> > > > themselves according to the grids points
> > > > is one that I may have use for in my application.
> > > >
> > > > However the book doesn't go into any detail on how to do this.
> > > > So where do I start : any articles or anything else out there to
help
> me
> > > > get started in this area ?
> > > >
> > > > Thanks a lot,
> > > > Alan.
> > > >
> > > > --
> > > > Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Re: SnapToGrid [message #170791 is a reply to message #170605] Mon, 07 March 2005 15:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: a.morgan.pilz.ie

> So, you have set both the visibility and the enablement properties on the
> viewer, right?

Right

> In the case below, if you can't see it, can you still snap
> to it? That is, when moving figures around in your editor do you see them
> snapping? Maybe your grid was showing, but you couldn't actually see it
> because there was some opaque figure in the way.

Not quite sure what snapping looks like but no they don't seem to be
snapping. They seem to be moving as before I ever tried the SnapToGrid.

>Was your freeform layer opaque? You should investigate why returning a
scrollpane works, whereas
> the freeform layer doesn't. You shouldn't have to return the scrollpane.
> Were you setting the freeform layer's layout to a FreeformLayout? Is your
> editor using a ScalableFreeformRootEditPart?

Yes my freeform layer was opaque all along and yes I've just seen that the
freeform layer's layout was set to FreeformLayout
A big part of my problem here is that I'm getting my info on this subject
piecemeal.
Is there a how-to guide, article or any kind of documentation somewhere that
I can use to help me ?



"Pratik Shah" <ppshah@us.ibm.com> wrote in message
news:d0dm9g$e3u$1@www.eclipse.org...
> So, you have set both the visibility and the enablement properties on the
> viewer, right? In the case below, if you can't see it, can you still snap
> to it? That is, when moving figures around in your editor do you see them
> snapping? Maybe your grid was showing, but you couldn't actually see it
> because there was some opaque figure in the way. Was your freeform layer
> opaque? You should investigate why returning a scrollpane works, whereas
> the freeform layer doesn't. You shouldn't have to return the scrollpane.
> Were you setting the freeform layer's layout to a FreeformLayout? Is your
> editor using a ScalableFreeformRootEditPart?
>
> "Alan Morgan" <a.morgan@pilz.ie> wrote in message
> news:d01m7g$i1m$1@www.eclipse.org...
> > Hi Pratik,
> >
> > I copied some of the stuff from loadProperties as suggested and now I
can
> > see getAdapter() getting called and a SnapToHelper being returned.
However
> I
> > still cannot see the grid.
> >
> > Not sure what else to do here...how can I access the updated javadoc for
> > SnapToGrid ?
> >
> > Regards,
> > Alan.
> >
> >
> > "Pratik Shah" <ppshah@us.ibm.com> wrote in message
> > news:cvbp0s$6lu$1@www.eclipse.org...
> > > Did you set the property on the viewer? Look at
> > > LogicEditor#loadProperties() where it sets the grid properties on the
> > > viewer. I'll update the javadoc for SnapToGrid so that it lists what
> > needs
> > > to be done to get the grid working.
> > >
> > > "news.eclipse.org" <a.morgan@pilz.ie> wrote in message
> > > news:cv2i6i$eh5$1@www.eclipse.org...
> > > > Hi,
> > > >
> > > > Thanks for the reply. I have implemented the getAdapter() method in
my
> > > > EditPart ala Logic example.
> > > > However after debugging I have confirmed that the code never gets
> called
> > > in
> > > > my application.
> > > > Is there something I have to turn on to enable this or something ?
> > > >
> > > > Thanks again,
> > > > Alan.
> > > >
> > > >
> > > > "Randy Hudson" <none@us.ibm.com> wrote in message
> > > > news:cuvldh$hgp$1@www.eclipse.org...
> > > > > The function is very simple to use. It is demonstrated in the
Logic
> > > > > example. I think that you simply need to return a
SnapToGridHelper
> in
> > > the
> > > > > editpart's getAdapter() method, and GEF's provided tools do the
> rest.
> > > > > Enabling and displaying the grid is straightforward too.
> > > > >
> > > > > "Alan Morgan" <awm_abu@yahoo.com> escreveu na mensagem
> > > > > news:opsmabnfgx4f1agp@pc-amorgan.ie.uk.pilz.local...
> > > > > Hi,
> > > > >
> > > > > I have been reading the GEF section at the end of "SWT/JFace in
> > Action"
> > > > > and I saw mention of the Grid Layout.
> > > > > The idea of allowing the user to force the editor's figures to
> > position
> > > > > themselves according to the grids points
> > > > > is one that I may have use for in my application.
> > > > >
> > > > > However the book doesn't go into any detail on how to do this.
> > > > > So where do I start : any articles or anything else out there to
> help
> > me
> > > > > get started in this area ?
> > > > >
> > > > > Thanks a lot,
> > > > > Alan.
> > > > >
> > > > > --
> > > > > Using Opera's revolutionary e-mail client:
http://www.opera.com/m2/
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Re: SnapToGrid [message #170828 is a reply to message #170791] Mon, 07 March 2005 19:25 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
There you have it. Your FreeformLayer shouldn't be opaque. The GridLayer
is underneath the primary layers, so if your layer is opaque, any layers
underneath wouldn't be visible.

"Alan Morgan" <a.morgan@pilz.ie> wrote in message
news:d0hqem$bf3$1@www.eclipse.org...
> > So, you have set both the visibility and the enablement properties on
the
> > viewer, right?
>
> Right
>
> > In the case below, if you can't see it, can you still snap
> > to it? That is, when moving figures around in your editor do you see
them
> > snapping? Maybe your grid was showing, but you couldn't actually see it
> > because there was some opaque figure in the way.
>
> Not quite sure what snapping looks like but no they don't seem to be
> snapping. They seem to be moving as before I ever tried the SnapToGrid.
>
> >Was your freeform layer opaque? You should investigate why returning a
> scrollpane works, whereas
> > the freeform layer doesn't. You shouldn't have to return the
scrollpane.
> > Were you setting the freeform layer's layout to a FreeformLayout? Is
your
> > editor using a ScalableFreeformRootEditPart?
>
> Yes my freeform layer was opaque all along and yes I've just seen that the
> freeform layer's layout was set to FreeformLayout
> A big part of my problem here is that I'm getting my info on this subject
> piecemeal.
> Is there a how-to guide, article or any kind of documentation somewhere
that
> I can use to help me ?
>
>
>
> "Pratik Shah" <ppshah@us.ibm.com> wrote in message
> news:d0dm9g$e3u$1@www.eclipse.org...
> > So, you have set both the visibility and the enablement properties on
the
> > viewer, right? In the case below, if you can't see it, can you still
snap
> > to it? That is, when moving figures around in your editor do you see
them
> > snapping? Maybe your grid was showing, but you couldn't actually see it
> > because there was some opaque figure in the way. Was your freeform
layer
> > opaque? You should investigate why returning a scrollpane works,
whereas
> > the freeform layer doesn't. You shouldn't have to return the
scrollpane.
> > Were you setting the freeform layer's layout to a FreeformLayout? Is
your
> > editor using a ScalableFreeformRootEditPart?
> >
> > "Alan Morgan" <a.morgan@pilz.ie> wrote in message
> > news:d01m7g$i1m$1@www.eclipse.org...
> > > Hi Pratik,
> > >
> > > I copied some of the stuff from loadProperties as suggested and now I
> can
> > > see getAdapter() getting called and a SnapToHelper being returned.
> However
> > I
> > > still cannot see the grid.
> > >
> > > Not sure what else to do here...how can I access the updated javadoc
for
> > > SnapToGrid ?
> > >
> > > Regards,
> > > Alan.
> > >
> > >
> > > "Pratik Shah" <ppshah@us.ibm.com> wrote in message
> > > news:cvbp0s$6lu$1@www.eclipse.org...
> > > > Did you set the property on the viewer? Look at
> > > > LogicEditor#loadProperties() where it sets the grid properties on
the
> > > > viewer. I'll update the javadoc for SnapToGrid so that it lists
what
> > > needs
> > > > to be done to get the grid working.
> > > >
> > > > "news.eclipse.org" <a.morgan@pilz.ie> wrote in message
> > > > news:cv2i6i$eh5$1@www.eclipse.org...
> > > > > Hi,
> > > > >
> > > > > Thanks for the reply. I have implemented the getAdapter() method
in
> my
> > > > > EditPart ala Logic example.
> > > > > However after debugging I have confirmed that the code never gets
> > called
> > > > in
> > > > > my application.
> > > > > Is there something I have to turn on to enable this or something ?
> > > > >
> > > > > Thanks again,
> > > > > Alan.
> > > > >
> > > > >
> > > > > "Randy Hudson" <none@us.ibm.com> wrote in message
> > > > > news:cuvldh$hgp$1@www.eclipse.org...
> > > > > > The function is very simple to use. It is demonstrated in the
> Logic
> > > > > > example. I think that you simply need to return a
> SnapToGridHelper
> > in
> > > > the
> > > > > > editpart's getAdapter() method, and GEF's provided tools do the
> > rest.
> > > > > > Enabling and displaying the grid is straightforward too.
> > > > > >
> > > > > > "Alan Morgan" <awm_abu@yahoo.com> escreveu na mensagem
> > > > > > news:opsmabnfgx4f1agp@pc-amorgan.ie.uk.pilz.local...
> > > > > > Hi,
> > > > > >
> > > > > > I have been reading the GEF section at the end of "SWT/JFace in
> > > Action"
> > > > > > and I saw mention of the Grid Layout.
> > > > > > The idea of allowing the user to force the editor's figures to
> > > position
> > > > > > themselves according to the grids points
> > > > > > is one that I may have use for in my application.
> > > > > >
> > > > > > However the book doesn't go into any detail on how to do this.
> > > > > > So where do I start : any articles or anything else out there to
> > help
> > > me
> > > > > > get started in this area ?
> > > > > >
> > > > > > Thanks a lot,
> > > > > > Alan.
> > > > > >
> > > > > > --
> > > > > > Using Opera's revolutionary e-mail client:
> http://www.opera.com/m2/
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Previous Topic:A treeviewer within a figure?
Next Topic:TAB Layer
Goto Forum:
  


Current Time: Thu Apr 25 06:15:05 GMT 2024

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

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

Back to the top