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 name
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 Wenz
Messages: 1618
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 Oct 24 23:08:23 GMT 2014

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

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