Chapter 6. Connections

Connections are specialized figures that implement the Connection interface and draw a line between two locations on the canvas, typically “connecting” two figures. You could create your own implementation of the Connection interface, but most developers use the PolylineConnection class provided by Draw2D. Since many diagrams use connections to indicate direction, connections have a beginning, called the source, and an end, called the target. Both the source and the target must have their own anchor, which is responsible for calculating the location where the connection starts and ends respectively. Typically, an anchor is associated with an owner figure, but anchors can be fixed to a point on the canvas instead.

In the ...

Get The Eclipse Graphical Editing Framework (GEF) now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.