Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Graph Layout?
Graph Layout? [message #144230] Sat, 24 July 2004 00:28 Go to next message
Eclipse UserFriend
Originally posted by: grant.hodgins.maketechnologies.com

Maybe I wasn't clear (see below).
I want to force a default layout the first time my figures are displayed
(with some kind of graph layout algorithm).

After the first display, I would like the diagram to not enforce the layout
(and thus be free form -which I have working well).

Can I accomplish a default graph layout on my rectangular figures with
connections?

Many Thanks,

Grant

"Grant Hodgins" <grant.hodgins@maketechnologies.com> wrote in message
news:cdoph3$hm3$1@eclipse.org...
> I'm a GEF Newbie.
>
> I have an existing model for which I need to provide a default graphical
> layout of figures. That is to say, I'd like to neatly organize and
> distribute figures on the canvas. I have no requirement to maintain this
> layout once the user manipulates the diagram.
>
> Assume the figures are simple rectangles.
>
> Is there a best practice approach or implementation to accomplish this?
>
> Thanks in advance,
> Grant Hodgins
>
>
Re: Graph Layout? [message #144335 is a reply to message #144230] Sun, 25 July 2004 03:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

> Can I accomplish a default graph layout on my rectangular figures with
> connections?

Yes, but this depends a lot on what your ractangles are and whether the
connections are directed or not. Are you doing class diagrams, ER, flow?
Re: Graph Layout? [message #144423 is a reply to message #144335] Mon, 26 July 2004 16:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: grant.hodgins.maketechnologies.com

I'm writing a simple GEF application to display class diagrams and assist in
the manipulation.

As such, my rectangles and connections, form the Draw2d perspective, are
quite similar to the famous "Displaying a UML Diagram with Draw2D" tutorial.

I was looking for somewhere to start as the only detailed article I could
find pertaining to GEF graph layout is written in Japanese
(http://www13.plala.or.jp/observe/draw2d/draw2d_graph.html). The diagrams
and snippets seem relevant but I can't read Japanese so I'm somewhat out of
luck to use this as a case study.

Thank you,
Grant

"Randy Hudson" <none@us.ibm.com> wrote in message
news:cdvamu$n19$1@eclipse.org...
> > Can I accomplish a default graph layout on my rectangular figures with
> > connections?
>
> Yes, but this depends a lot on what your ractangles are and whether the
> connections are directed or not. Are you doing class diagrams, ER, flow?
>
>
Re: Graph Layout? [message #144441 is a reply to message #144423] Mon, 26 July 2004 18:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

So, displaying inheritance is pretty easy because it is directed. But how
would you handle relationships between classes? They are undirected and
sometimes may even be on classes which are on the same row in the class
hierarchy. DirectedGraphLayout doesn't handle undirected edges.

Of course, you can remove those edges and then add them back in.

Have you seen the org.eclpise.draw2d.examples project in CVS?

"Grant Hodgins" <grant.hodgins@maketechnologies.com> wrote in message
news:ce3ak4$c8g$1@eclipse.org...
> I'm writing a simple GEF application to display class diagrams and assist
in
> the manipulation.
>
> As such, my rectangles and connections, form the Draw2d perspective, are
> quite similar to the famous "Displaying a UML Diagram with Draw2D"
tutorial.
>
> I was looking for somewhere to start as the only detailed article I could
> find pertaining to GEF graph layout is written in Japanese
> (http://www13.plala.or.jp/observe/draw2d/draw2d_graph.html). The diagrams
> and snippets seem relevant but I can't read Japanese so I'm somewhat out
of
> luck to use this as a case study.
>
> Thank you,
> Grant
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:cdvamu$n19$1@eclipse.org...
> > > Can I accomplish a default graph layout on my rectangular figures with
> > > connections?
> >
> > Yes, but this depends a lot on what your ractangles are and whether the
> > connections are directed or not. Are you doing class diagrams, ER,
flow?
> >
> >
>
>
Re: Graph Layout? [message #144481 is a reply to message #144441] Tue, 27 July 2004 00:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: grant.hodgins.maketechnologies.com

For the purposes of my diagram, the directed edges will suffice. We're not
handling undirected edges - at least for now.

After learning from the examples I am close (thank you).

Now my problem is pertaining to the preferred size of my classes.

Before attempting a DefaultLayout with the DirectedGraphLayout, I used the
Dimension(-1,-1) to set the preferred size of the model for the class.

Now, of course, if I do that, the nodes do not take on the preferred size. I
believe the layout manager is responsible for determining this on first
paint which happens after I create the contents for the viewer.

When I'm creating the contents for my viewer on first load, I would like to
somehow retain the preferred size while still utilizing the node layout.

I was wondering what you might suggest to accomplish this? I don't
understand where or how I can have access to the preferred size of the
complete figure before I perform my default layout.

I've attempted to do this within: initializeGraphicalViewer() after
constructing the diagram model. (To no avail)

Any help is appreciated,
Regards,
Grant



"Randy Hudson" <none@us.ibm.com> wrote in message
news:ce3ho4$mc2$1@eclipse.org...
> So, displaying inheritance is pretty easy because it is directed. But how
> would you handle relationships between classes? They are undirected and
> sometimes may even be on classes which are on the same row in the class
> hierarchy. DirectedGraphLayout doesn't handle undirected edges.
>
> Of course, you can remove those edges and then add them back in.
>
> Have you seen the org.eclpise.draw2d.examples project in CVS?
>
> "Grant Hodgins" <grant.hodgins@maketechnologies.com> wrote in message
> news:ce3ak4$c8g$1@eclipse.org...
> > I'm writing a simple GEF application to display class diagrams and
assist
> in
> > the manipulation.
> >
> > As such, my rectangles and connections, form the Draw2d perspective, are
> > quite similar to the famous "Displaying a UML Diagram with Draw2D"
> tutorial.
> >
> > I was looking for somewhere to start as the only detailed article I
could
> > find pertaining to GEF graph layout is written in Japanese
> > (http://www13.plala.or.jp/observe/draw2d/draw2d_graph.html). The
diagrams
> > and snippets seem relevant but I can't read Japanese so I'm somewhat out
> of
> > luck to use this as a case study.
> >
> > Thank you,
> > Grant
> >
> > "Randy Hudson" <none@us.ibm.com> wrote in message
> > news:cdvamu$n19$1@eclipse.org...
> > > > Can I accomplish a default graph layout on my rectangular figures
with
> > > > connections?
> > >
> > > Yes, but this depends a lot on what your ractangles are and whether
the
> > > connections are directed or not. Are you doing class diagrams, ER,
> flow?
> > >
> > >
> >
> >
>
>
Re: Graph Layout? [message #144490 is a reply to message #144481] Tue, 27 July 2004 02:23 Go to previous messageGo to next message
Sean Woodhouse is currently offline Sean WoodhouseFriend
Messages: 45
Registered: July 2009
Member
Check out https://bugs.eclipse.org/bugs/show_bug.cgi?id=54927

"Grant Hodgins" <grant.hodgins@maketechnologies.com> wrote in message
news:ce47rh$n7d$1@eclipse.org...
> For the purposes of my diagram, the directed edges will suffice. We're
not
> handling undirected edges - at least for now.
>
> After learning from the examples I am close (thank you).
>
> Now my problem is pertaining to the preferred size of my classes.
>
> Before attempting a DefaultLayout with the DirectedGraphLayout, I used the
> Dimension(-1,-1) to set the preferred size of the model for the class.
>
> Now, of course, if I do that, the nodes do not take on the preferred size.
I
> believe the layout manager is responsible for determining this on first
> paint which happens after I create the contents for the viewer.
>
> When I'm creating the contents for my viewer on first load, I would like
to
> somehow retain the preferred size while still utilizing the node layout.
>
> I was wondering what you might suggest to accomplish this? I don't
> understand where or how I can have access to the preferred size of the
> complete figure before I perform my default layout.
>
> I've attempted to do this within: initializeGraphicalViewer() after
> constructing the diagram model. (To no avail)
>
> Any help is appreciated,
> Regards,
> Grant
>
>
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:ce3ho4$mc2$1@eclipse.org...
> > So, displaying inheritance is pretty easy because it is directed. But
how
> > would you handle relationships between classes? They are undirected and
> > sometimes may even be on classes which are on the same row in the class
> > hierarchy. DirectedGraphLayout doesn't handle undirected edges.
> >
> > Of course, you can remove those edges and then add them back in.
> >
> > Have you seen the org.eclpise.draw2d.examples project in CVS?
> >
> > "Grant Hodgins" <grant.hodgins@maketechnologies.com> wrote in message
> > news:ce3ak4$c8g$1@eclipse.org...
> > > I'm writing a simple GEF application to display class diagrams and
> assist
> > in
> > > the manipulation.
> > >
> > > As such, my rectangles and connections, form the Draw2d perspective,
are
> > > quite similar to the famous "Displaying a UML Diagram with Draw2D"
> > tutorial.
> > >
> > > I was looking for somewhere to start as the only detailed article I
> could
> > > find pertaining to GEF graph layout is written in Japanese
> > > (http://www13.plala.or.jp/observe/draw2d/draw2d_graph.html). The
> diagrams
> > > and snippets seem relevant but I can't read Japanese so I'm somewhat
out
> > of
> > > luck to use this as a case study.
> > >
> > > Thank you,
> > > Grant
> > >
> > > "Randy Hudson" <none@us.ibm.com> wrote in message
> > > news:cdvamu$n19$1@eclipse.org...
> > > > > Can I accomplish a default graph layout on my rectangular figures
> with
> > > > > connections?
> > > >
> > > > Yes, but this depends a lot on what your ractangles are and whether
> the
> > > > connections are directed or not. Are you doing class diagrams, ER,
> > flow?
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Re: Graph Layout? [message #144638 is a reply to message #144481] Tue, 27 July 2004 18:16 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You shouldn't be calling setPreferredSize(-1, -1)
you should be calling getPreferredSize(-1, -1)

Setting the size overrides anything the layout would normally do. You can
query the preferred size of a figure even before it has painted. We do this
in the Flow example in GEF.

"Grant Hodgins" <grant.hodgins@maketechnologies.com> wrote in message
news:ce47rh$n7d$1@eclipse.org...
> For the purposes of my diagram, the directed edges will suffice. We're
not
> handling undirected edges - at least for now.
>
> After learning from the examples I am close (thank you).
>
> Now my problem is pertaining to the preferred size of my classes.
>
> Before attempting a DefaultLayout with the DirectedGraphLayout, I used the
> Dimension(-1,-1) to set the preferred size of the model for the class.
>
> Now, of course, if I do that, the nodes do not take on the preferred size.
I
> believe the layout manager is responsible for determining this on first
> paint which happens after I create the contents for the viewer.
>
> When I'm creating the contents for my viewer on first load, I would like
to
> somehow retain the preferred size while still utilizing the node layout.
>
> I was wondering what you might suggest to accomplish this? I don't
> understand where or how I can have access to the preferred size of the
> complete figure before I perform my default layout.
>
> I've attempted to do this within: initializeGraphicalViewer() after
> constructing the diagram model. (To no avail)
>
> Any help is appreciated,
> Regards,
> Grant
>
>
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:ce3ho4$mc2$1@eclipse.org...
> > So, displaying inheritance is pretty easy because it is directed. But
how
> > would you handle relationships between classes? They are undirected and
> > sometimes may even be on classes which are on the same row in the class
> > hierarchy. DirectedGraphLayout doesn't handle undirected edges.
> >
> > Of course, you can remove those edges and then add them back in.
> >
> > Have you seen the org.eclpise.draw2d.examples project in CVS?
> >
> > "Grant Hodgins" <grant.hodgins@maketechnologies.com> wrote in message
> > news:ce3ak4$c8g$1@eclipse.org...
> > > I'm writing a simple GEF application to display class diagrams and
> assist
> > in
> > > the manipulation.
> > >
> > > As such, my rectangles and connections, form the Draw2d perspective,
are
> > > quite similar to the famous "Displaying a UML Diagram with Draw2D"
> > tutorial.
> > >
> > > I was looking for somewhere to start as the only detailed article I
> could
> > > find pertaining to GEF graph layout is written in Japanese
> > > (http://www13.plala.or.jp/observe/draw2d/draw2d_graph.html). The
> diagrams
> > > and snippets seem relevant but I can't read Japanese so I'm somewhat
out
> > of
> > > luck to use this as a case study.
> > >
> > > Thank you,
> > > Grant
> > >
> > > "Randy Hudson" <none@us.ibm.com> wrote in message
> > > news:cdvamu$n19$1@eclipse.org...
> > > > > Can I accomplish a default graph layout on my rectangular figures
> with
> > > > > connections?
> > > >
> > > > Yes, but this depends a lot on what your ractangles are and whether
> the
> > > > connections are directed or not. Are you doing class diagrams, ER,
> > flow?
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Previous Topic:Is it possible to create a Panel(SWT) ,with SWT Widgets on top container and GEF Figures on Bottom c
Next Topic:packages not recognized in Eclipse 3.0
Goto Forum:
  


Current Time: Tue Apr 23 13:34:16 GMT 2024

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

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

Back to the top