Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 09:30 Go to next message
Djordje Stanojevic is currently offline Djordje StanojevicFriend
Messages: 14
Registered: February 2014
Junior Member
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;


Djordje Stanojevic
Re: Width of polyline doesn't reflect on the diagram [message #1252803 is a reply to message #1252504] Fri, 21 February 2014 16:19 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
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 13:26 Go to previous message
Djordje Stanojevic is currently offline Djordje StanojevicFriend
Messages: 14
Registered: February 2014
Junior Member
Michael,

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

Djordje


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


Current Time: Fri Apr 26 06:05:08 GMT 2024

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

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

Back to the top