All Known Implementing Classes:
- public interface ConnectionEditPart
A specialization of
GraphicalEditPart for representing
connections. ConnectionEditParts must join a source and target EditPart.
Its Figure is typically a line between two "nodes", with possible decorations on that
In GEF, ConnectionEditParts are
of their source
and target "nodes", which are EditParts. However, the model does not have this
requirement. The application may store the connection model in any way, or there may
even be no real model. The burden is on the source and target EditPart to obtain their
appropriate connections in the methods
getModelTargetConnections(). How this is done is application specific.
Since ConnectionEditParts are features of their node EditPart, it is those EditParts
that must create and manage the connection. Creation is performed by whichever end
happens to "intialize" itself first. Therefore an end always looks first in the
EditPartRegistry to see if the
connection was already created by the other end.
ConnectionEditParts are EditParts, and therefore can have children. This is a common
way to implement labels and other selectable decorations on connections. Similarly, a
ConnectionEditPart can also be a "node", meaning it can serve as the source or target
of some other ConnectionEditPart. This makes connection to connection possible.
IMPORTANT: The need to display something as a line does not automatically mean that
a ConnectionEditPart is required. There are several situations in which
ConnectionEditParts should not be used. You should use ConnectionEditParts in general
- The connection should be selectable by the user independant of its "nodes".
- The connection can be deleted, leaving the source and target intact.
- The connection cannot exist without a source and target. A instance of when
this is not true is assocations. Associations are top-level object
that are children of the diagram. They are probably only valid if they have a source
and target, but many applications allow you to create things in any order.
Methods inherited from interface org.eclipse.gef.
- the EditPart at the source end of this connection.
- the EditPart at the target end of this connection.
public void setSource(
- Sets the source of this connection.
source - the source of this connection
public void setTarget(
- Sets thetarget of this connection.
target - the target of this connection
Copyright (c) IBM Corp. and others 2000, 2007. All Rights Reserved.