0

I want to create and apply different shapes for source and target decorations of a connection. I know that I have to extend the polyline class but I can't really undersatnd how it works. Could someone help. Are there any examples? I know that only a few people work with gmf and till now nobody has answered my questions related with gmf but please help!!!

1 Answer 1

0

You do not have to extend the Polyline class, just call the setTargetDecoration method (or setSourceDecoration) and pass the decoration figure as an argument. You could also pass different decorators based on some condition. For example, an 'arrowhead' decorator figure can be created like this:

PointList pl = new PointList();
pl.addPoint(0, 0);
pl.addPoint(-2, -1);
pl.addPoint(-2, 1);

PolygonDecoration df = new PolygonDecoration();
df.setFill(true);
df.setBackgroundColor(ColorConstants.white);
df.setTemplate(pl);

Be sure to remove the @generated tag from the modified methods.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.