Skip to main content



      Home
Home » Modeling » Graphiti » Width of polyline doesn't reflect on the diagram
Width of polyline doesn't reflect on the diagram [message #1252504] Fri, 21 February 2014 04:30 Go to next message
Eclipse UserFriend
Hi all,

I have set width of polyline in add method of my AddConnectionFeature, but it is not reflected on the diagram. The line is still very thin. Does anybody know where the problem is? Here is my add method

public PictogramElement add(IAddContext context) {
IAddConnectionContext addConContext = (IAddConnectionContext) context;
EReference addedEReference = (EReference) context.getNewObject();
IPeCreateService peCreateService = Graphiti.getPeCreateService();

// CONNECTION WITH POLYLINE
Connection connection = peCreateService.createManhattanConnection(getDiagram());
connection.setStart(addConContext.getSourceAnchor());
connection.setEnd(addConContext.getTargetAnchor());

IGaService gaService = Graphiti.getGaService();
Polyline polyline = gaService.createPolyline(connection);
polyline.setWidth(2);
polyline.setForeground(manageColor(E_REFERENCE_FOREGROUND));

link(connection, addedEReference);

return connection;
Re: Width of polyline doesn't reflect on the diagram [message #1252803 is a reply to message #1252504] Fri, 21 February 2014 11:19 Go to previous messageGo to next message
Eclipse UserFriend
Djorde,

you should set the attribute lineWidth not width. Width is inherited from
the generic graphics algorithm but does not really make much sense for
ploylines.

Michael
Re: Width of polyline doesn't reflect on the diagram [message #1277793 is a reply to message #1252803] Wed, 26 March 2014 09:26 Go to previous message
Eclipse UserFriend
Michael,

I already saw where the problem was, and I replaced setWidth method with setLineWidth.
Anyway thanks for fast reply.

Djordje
Previous Topic:Dynamic "Refreshing" of Palette on Object Selection
Next Topic:CustomEditor not getting invoked in Graphiti *.ui.editors extension
Goto Forum:
  


Current Time: Tue Jul 15 16:51:01 EDT 2025

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

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

Back to the top