Cannot create connections between nodes [message #697222] |
Fri, 15 July 2011 16:22  |
Eclipse User |
|
|
|
Hello All,
I'm using Graphiti at the moment to develop a graphic editor for a simple flowchart diagram.I'm at a stage where I can successfully create nodes (Actions and Decisions) but my editor does not allow me to draw transitions ( as in connections ) between them.
Another problem,not severe at this time , is with the location of the Decision node.The editor does not place the node exactly where I want it to be.I'm quite sure I'm doing some silly mistake somewhere.Attached is the code.
I appreciate if someone could help me and correct me if something is wrong.
|
|
|
|
|
Re: Cannot create connections between nodes [message #699363 is a reply to message #699107] |
Thu, 21 July 2011 08:14  |
Eclipse User |
|
|
|
Sorry, I simply forgot the 2. question after answering the 1. one...
The coordinates you provide for the xy points of the polygon are wrong.
Since the polygon belongs to an active ContainerShape the coordinates must
be relative to the left top corner of the ContainerShape resp. its Polygon x
and y coordinates.
Using
int xy[] = new int[] { 0, height / 2, width / 2, 0, width, height / 2, width
/ 2, height };
in AddDecisionFeature.add should do the trick (modulo rounding issues).
Michael
"vrm" schrieb im Newsbeitrag news:j07e00$bds$1@news.eclipse.org...
Thanks Michael,
Thanks for your suggestion.I finally did manage to create connections
between the nodes.I was just wondering if you have any suggestion for the
second problem I mentioned in the initial thread about the incorrect
location of the diamond node.
Thanks
|
|
|
Powered by
FUDForum. Page generated in 0.32195 seconds