Skip to main content



      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 09:39 Go to next message
Eclipse UserFriend
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 10:14 Go to previous message
Eclipse UserFriend
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: Thu Jul 17 07:57:21 EDT 2025

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

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

Back to the top