Bug 224753 - GraphViewer overwrites edge label on bidirectional graphs
Summary: GraphViewer overwrites edge label on bidirectional graphs
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Zest (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-28 19:55 EDT by Erkki Lindpere CLA
Modified: 2015-01-22 02:44 EST (History)
3 users (show)

See Also:
irbull: galileo+


Attachments
Edge exists in both directions (3.76 KB, image/png)
2008-03-28 20:00 EDT, Erkki Lindpere CLA
no flags Details
GraphViz rendering without labels (25.84 KB, image/png)
2008-03-29 06:09 EDT, Erkki Lindpere CLA
no flags Details
GraphViz rendering with labels for the bidirectional connection (33.24 KB, image/png)
2008-03-29 06:09 EDT, Erkki Lindpere CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erkki Lindpere CLA 2008-03-28 19:55:05 EDT
When GraphViewer is drawing directed connections and a connection exists in both directions, then the labels of the two connections will (may) overlap.
This was with SpringLayout, and the viewer was created like this:

viewer = new GraphViewer(parent, SWT.NONE);
viewer.setContentProvider(new ViewContentProvider());
viewer.setLabelProvider(new ViewLabelProvider());
viewer.setLayoutAlgorithm(new SpringLayoutAlgorithm(LayoutStyles.NONE));
viewer.setConnectionStyle(ZestStyles.CONNECTIONS_DIRECTED);
viewer.setNodeStyle(ZestStyles.NODES_NO_LAYOUT_RESIZE);
Comment 1 Erkki Lindpere CLA 2008-03-28 20:00:35 EDT
Created attachment 94085 [details]
Edge exists in both directions

This screenshot shows the labels of edges f -> n and n -> f overlapping. The labels should be DirEdge(f,n) and DirEdge(n,f) respectively.
Comment 2 Ian Bull CLA 2008-03-28 20:07:43 EDT
I have been experimenting with an API to set the location of the label on a line (from 0..100).  This way you could set the labels to be 75% of the way across the line (so the labels would appear close to the target nodes).  Do you think this would help you?

Comment 3 Erkki Lindpere CLA 2008-03-29 06:09:13 EDT
Created attachment 94096 [details]
GraphViz rendering without labels
Comment 4 Erkki Lindpere CLA 2008-03-29 06:09:49 EDT
Created attachment 94097 [details]
GraphViz rendering with labels for the bidirectional connection
Comment 5 Erkki Lindpere CLA 2008-03-29 06:10:05 EDT
Yes, I think that would help. Also I think it would be good if bidirectional edges were a little apart from each other or you could create a control point and drag it manually. But maybe that would make the GraphViewer more complex than necessary? I'm not familiar with GEF -- perhaps more complex things should be done with other GEF components? I don't have a big need for this feature, I was just experimenting with Zest and found this issue.

Anyway, I attached two screenshots of the same graph rendered with GraphViz, one where the bidirectional relation has labels and one where it doesn't.
Comment 6 Oliver Schäfer CLA 2009-02-04 02:24:56 EST
(In reply to comment #5)
> Also I think it would be good if bidirectional edges were a little apart from each other ...

This would be a very helpful feature.

Comment 7 Tim Baumgartner CLA 2010-06-14 07:05:53 EDT
(In reply to comment #5)
> Also I think it would be good if bidirectional edges were a little apart from each other...

I would like this, too. The same applies if one has multiple edges between two nodes (e.g. when implementing IGraphEntityRelationshipContentProvider) regardless of their direction.
Comment 8 Alexander Nyßen CLA 2015-01-22 02:44:33 EST
Re-assigning back to inbox, as Ian is no longer active committer.