Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 20:22 Go to next message
vrm  is currently offline vrm Friend
Messages: 31
Registered: June 2011
Member
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 08:47 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1921
Registered: July 2009
Location: Walldorf, Germany
Senior Member
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 20:42 Go to previous messageGo to next message
vrm  is currently offline vrm Friend
Messages: 31
Registered: June 2011
Member
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 12:14 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1921
Registered: July 2009
Location: Walldorf, Germany
Senior Member
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: Sun Jul 12 14:20:28 GMT 2020

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

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

Back to the top