Skip to main content



      Home
Home » Modeling » Graphiti » Cannot create connections between nodes(Cannot create connections between nodes)
Cannot create connections between nodes [message #697222] Fri, 15 July 2011 16:22 Go to next message
Eclipse UserFriend
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 #697871 is a reply to message #697222] Mon, 18 July 2011 04:47 Go to previous messageGo to next message
Eclipse UserFriend
There's a NullPointerException when I try to create a Transition. It happens
because you directly try to access anchors in canCreate; these anchors do
not exist e.g. for the diagram. So you should make sure first that you are
hovering over a actor (or any other object you would like to allow).

HTH,
Michael

"vrm" schrieb im Newsbeitrag news:ivq709$vcv$1@news.eclipse.org...

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 #699107 is a reply to message #697871] Wed, 20 July 2011 16:42 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Cannot create connections between nodes [message #699363 is a reply to message #699107] Thu, 21 July 2011 08:14 Go to previous message
Eclipse UserFriend
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
Previous Topic:Disable guides
Next Topic:ImageProvider using provided images from third-party plugins
Goto Forum:
  


Current Time: Wed Jul 23 18:32:39 EDT 2025

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

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

Back to the top