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 07:56 Go to next message
Philip Mayer is currently offline Philip Mayer
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 09:02 Go to previous messageGo to next message
Philip Mayer is currently offline Philip Mayer
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 13:24 Go to previous message
Philip Mayer is currently offline Philip Mayer
Messages: 29
Registered: July 2009
Junior 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:meassuring performance and optimization of figure painting
Next Topic:Editing capabilities with GEF in Eclipse View
Goto Forum:
  


Current Time: Fri Jul 25 07:19:16 EDT 2014

Powered by FUDForum. Page generated in 0.02840 seconds