Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » [Zest] DirectedGraphLayoutAlgorithm - Nodes are not visible
[Zest] DirectedGraphLayoutAlgorithm - Nodes are not visible [message #481034] Wed, 19 August 2009 11:56 Go to next message
Philip Mayer is currently offline Philip MayerFriend
Messages: 17
Registered: July 2009
Junior Member
Hi,

I am trying to use the ZEST DirectedGraphLayoutAlgorithm for a typical
Labelled Transition System with a few loops. I have a couple of nodes
and connections in-between, which are provided by an
IGraphContentProvider; labels are provided by a LabelProvider.

The problem is that the nodes do not show up at all; all I see are
connections. Is the algorithm complete? (There are a lot of TODOs in the
code).

viewer= new GraphViewer(parent, SWT.NONE);
viewer.setContentProvider(new MyContentProvider());
viewer.setLabelProvider(new MyLabelProvider());
viewer.setLayoutAlgorithm(new DirectedGraphLayoutAlgorithm(SWT.VERTICAL));
viewer.setConnectionStyle(ZestStyles.CONNECTIONS_DIRECTED);

On a related note, can I use the SpringLayout for such a layout, too? It
seems to randomly distribute the nodes; I'd like to have it loosely from
top to bottom. Can this be done?

Thanks.

Philip
Re: [Zest] Follow-Up Question on Domain Objects [message #481319 is a reply to message #481034] Thu, 20 August 2009 13:02 Go to previous messageGo to next message
Philip Mayer is currently offline Philip MayerFriend
Messages: 17
Registered: July 2009
Junior Member
Dear all,

Wrote my own algorithm now.

Another question: Is there a "legal" way for finding out the underlying
domain object of a LayoutRelationship from the layouting classes (or at
all from outside the graph classes)?

Thanks,

Philip


Philip Mayer wrote:
> Hi,
>
> I am trying to use the ZEST DirectedGraphLayoutAlgorithm for a typical
> Labelled Transition System with a few loops. I have a couple of nodes
> and connections in-between, which are provided by an
> IGraphContentProvider; labels are provided by a LabelProvider.
>
> The problem is that the nodes do not show up at all; all I see are
> connections. Is the algorithm complete? (There are a lot of TODOs in the
> code).
>
> viewer= new GraphViewer(parent, SWT.NONE);
> viewer.setContentProvider(new MyContentProvider());
> viewer.setLabelProvider(new MyLabelProvider());
> viewer.setLayoutAlgorithm(new DirectedGraphLayoutAlgorithm(SWT.VERTICAL));
> viewer.setConnectionStyle(ZestStyles.CONNECTIONS_DIRECTED);
>
> On a related note, can I use the SpringLayout for such a layout, too? It
> seems to randomly distribute the nodes; I'd like to have it loosely from
> top to bottom. Can this be done?
>
> Thanks.
>
> Philip
Re: [Zest] Follow-Up Question on Domain Objects [message #481384 is a reply to message #481319] Thu, 20 August 2009 17:24 Go to previous message
Philip Mayer is currently offline Philip MayerFriend
Messages: 30
Registered: July 2009
Member
Dear all,

yes, there is: call .getGraphData() on LayoutEntity or LayoutConnection.
Cast the result to GraphNode or GraphConnection, then use .getData() to
access the domain model.

Thanks,

Philip


Philip Mayer wrote:
>
> Dear all,
>
> Wrote my own algorithm now.
>
> Another question: Is there a "legal" way for finding out the underlying
> domain object of a LayoutRelationship from the layouting classes (or at
> all from outside the graph classes)?
>
> Thanks,
>
> Philip
>
>
> Philip Mayer wrote:
>> Hi,
>>
>> I am trying to use the ZEST DirectedGraphLayoutAlgorithm for a typical
>> Labelled Transition System with a few loops. I have a couple of nodes
>> and connections in-between, which are provided by an
>> IGraphContentProvider; labels are provided by a LabelProvider.
>>
>> The problem is that the nodes do not show up at all; all I see are
>> connections. Is the algorithm complete? (There are a lot of TODOs in
>> the code).
>>
>> viewer= new GraphViewer(parent, SWT.NONE);
>> viewer.setContentProvider(new MyContentProvider());
>> viewer.setLabelProvider(new MyLabelProvider());
>> viewer.setLayoutAlgorithm(new
>> DirectedGraphLayoutAlgorithm(SWT.VERTICAL));
>> viewer.setConnectionStyle(ZestStyles.CONNECTIONS_DIRECTED);
>>
>> On a related note, can I use the SpringLayout for such a layout, too?
>> It seems to randomly distribute the nodes; I'd like to have it loosely
>> from top to bottom. Can this be done?
>>
>> Thanks.
>>
>> Philip
Previous Topic:Margin Rulers
Next Topic:Editing capabilities with GEF in Eclipse View
Goto Forum:
  


Current Time: Thu Mar 28 13:05:29 GMT 2024

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

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

Back to the top