Skip to main content



      Home
Home » Eclipse Projects » GEF » Inverse Graph Layout and Constraints
Inverse Graph Layout and Constraints [message #161314] Sun, 12 December 2004 14:56 Go to next message
Eclipse UserFriend
Originally posted by: filzmail.gmail.com

Hi,

I am trying to draw an UML Class Diagram - starting from a type and going
only upwards - using the DirectedGraphLayout class on a DirectedGraph with
some Nodes (=Types) and Edges (=Inheritance Relationships) on it.

The graph looks quite nice already, but I'd like to change two things:

1. The graph is "upside down" - is there any way to reverse the layouting,
so the base class is at the bottom? (I can reverse all the edges but then
source and destination are wrong).
2. I'd like to add the constraint of all classes being layed out in one
vertical line (as there is no multiple class inheritance in Java).

Is that possible?

Thanks!

Phil
Re: Inverse Graph Layout and Constraints [message #161388 is a reply to message #161314] Mon, 13 December 2004 11:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

If you are laying out class hierarchy (not interface), every node has a
single parent. This is a much simpler problem and you can just use a
org-chart layout machanism which will be faster and easy to tweak.

Otherwise, inverting edges should work for you. You just need to re-invert
them when you get the results back from the layout. I didn't understand #2

"Phil" <filzmail@gmail.com> wrote in message
news:cpi7qa$pk3$1@www.eclipse.org...
> Hi,
>
> I am trying to draw an UML Class Diagram - starting from a type and going
> only upwards - using the DirectedGraphLayout class on a DirectedGraph with
> some Nodes (=Types) and Edges (=Inheritance Relationships) on it.
>
> The graph looks quite nice already, but I'd like to change two things:
>
> 1. The graph is "upside down" - is there any way to reverse the layouting,
> so the base class is at the bottom? (I can reverse all the edges but then
> source and destination are wrong).
> 2. I'd like to add the constraint of all classes being layed out in one
> vertical line (as there is no multiple class inheritance in Java).
>
> Is that possible?
>
> Thanks!
>
> Phil
>
Re: Inverse Graph Layout and Constraints [message #161469 is a reply to message #161388] Mon, 13 December 2004 13:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: filzmail.gmail.com

Randy Hudson wrote:

> If you are laying out class hierarchy (not interface), every node has a
> single parent. This is a much simpler problem and you can just use a
> org-chart layout machanism which will be faster and easy to tweak.

I'm laying out the entire hierarchy, including interfaces.

> Otherwise, inverting edges should work for you. You just need to re-invert
> them when you get the results back from the layout.

Okay, thanks so far!!

>I didn't understand #2

I'll try to explain #2 again:

In a Java class hierarchy, every class has a single CLASS parent, as you
said, but may also have several INTERFACE parents. I want to tweak the
graph in such a way that all CLASS nodes are layed out in one column (same
X coordinate for all classes, so they are placed exactly above/beneath
each other). The interfaces can be placed anywhere to the side of the
classes.

Is that possible?

Thanks!

Phil
Re: Inverse Graph Layout and Constraints [message #161484 is a reply to message #161469] Mon, 13 December 2004 14:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Try giving them a large weight.

"Phil" <filzmail@gmail.com> wrote in message
news:cpkm60$l7u$1@www.eclipse.org...
> Randy Hudson wrote:
>
> > If you are laying out class hierarchy (not interface), every node has a
> > single parent. This is a much simpler problem and you can just use a
> > org-chart layout machanism which will be faster and easy to tweak.
>
> I'm laying out the entire hierarchy, including interfaces.
>
> > Otherwise, inverting edges should work for you. You just need to
re-invert
> > them when you get the results back from the layout.
>
> Okay, thanks so far!!
>
> >I didn't understand #2
>
> I'll try to explain #2 again:
>
> In a Java class hierarchy, every class has a single CLASS parent, as you
> said, but may also have several INTERFACE parents. I want to tweak the
> graph in such a way that all CLASS nodes are layed out in one column (same
> X coordinate for all classes, so they are placed exactly above/beneath
> each other). The interfaces can be placed anywhere to the side of the
> classes.
>
> Is that possible?
>
> Thanks!
>
> Phil
>
Re: Inverse Graph Layout and Constraints [message #161725 is a reply to message #161484] Thu, 16 December 2004 05:29 Go to previous message
Eclipse UserFriend
Originally posted by: filzmail.gmail.com

Randy Hudson wrote:

> Try giving them a large weight.

That did the trick! Thanks a lot!! :) :)

Phil
Previous Topic:Initializing model classes during startup
Next Topic:Cannot get editor to display my model
Goto Forum:
  


Current Time: Sun Jul 13 23:46:59 EDT 2025

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

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

Back to the top