Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Connection as polyline with arrow at the end
Connection as polyline with arrow at the end [message #650050] Fri, 21 January 2011 14:39 Go to next message
Dobrou Mising name is currently offline Dobrou Mising nameFriend
Messages: 16
Registered: December 2010
Junior Member
Is there any standard solution for drawing polyline with arrow at the end?

I would like to visualise direction of connection between two elements in diagram.

Now I create just polyline:
Connection connection = peCreateService.createFreeFormConnection(getDiagram());
connection.setStart(addConContext.getSourceAnchor());
connection.setEnd(addConContext.getTargetAnchor());

Polyline polyline = Graphiti.getGaService().createPolyline(connection);

---
I would like to add something like small triangle at the end of polyline, so it would look like arrow. Triangle must synchronize its position and angle to polyline shape.

I could not find any simple solution yet, had anyone done something similar in graphiti diagram?
Re: Connection as polyline with arrow at the end [message #650061 is a reply to message #650050] Fri, 21 January 2011 15:14 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1640
Registered: July 2009
Location: Walldorf, Germany
Senior Member
You should use ConnectionDecorators for that purpose. Please see the
TutorialAddEReferenceFeature class in the Graphiti Tutorial for details
(methods add and createArrow).

Michael


"Dobrou" wrote in message news:ihc5h7$10r$1@news.eclipse.org...

Is there any standard solution for drawing polyline with arrow at the end?

I would like to visualise direction of connection between two elements in
diagram.

Now I create just polyline:
Connection connection =
peCreateService.createFreeFormConnection(getDiagram());
connection.setStart(addConContext.getSourceAnchor());
connection.setEnd(addConContext.getTargetAnchor());

Polyline polyline =
Graphiti.getGaService().createPolyline(connection);

---
I would like to add something like small triangle at the end of polyline, so
it would look like arrow. Triangle must synchronize its position and angle
to polyline shape.

I could not find any simple solution yet, had anyone done something similar
in graphiti diagram?
Previous Topic:Drag and Drop
Next Topic:DirectEditingFeature with white text
Goto Forum:
  


Current Time: Fri Dec 19 01:47:42 GMT 2014

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

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