|
GEF (MVC) 3.9.0.201308190730 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 line.
In GEF, ConnectionEditParts are structural features 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
getModelSourceConnections()
and
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 if:
Field Summary |
---|
Fields inherited from interface org.eclipse.gef.EditPart |
---|
SELECTED, SELECTED_NONE, SELECTED_PRIMARY |
Method Summary | |
---|---|
EditPart |
getSource()
|
EditPart |
getTarget()
|
void |
setSource(EditPart source)
Sets the source of this connection. |
void |
setTarget(EditPart target)
Sets thetarget of this connection. |
Methods inherited from interface org.eclipse.gef.GraphicalEditPart |
---|
addNodeListener, getContentPane, getFigure, getSourceConnections, getTargetConnections, removeNodeListener, setLayoutConstraint |
Methods inherited from interface org.eclipse.gef.EditPart |
---|
activate, addEditPartListener, addNotify, deactivate, eraseSourceFeedback, eraseTargetFeedback, getChildren, getCommand, getDragTracker, getEditPolicy, getModel, getParent, getRoot, getSelected, getTargetEditPart, getViewer, hasFocus, installEditPolicy, isActive, isSelectable, performRequest, refresh, removeEditPartListener, removeEditPolicy, removeNotify, setFocus, setModel, setParent, setSelected, showSourceFeedback, showTargetFeedback, understandsRequest |
Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
---|
getAdapter |
Method Detail |
---|
EditPart getSource()
EditPart getTarget()
void setSource(EditPart source)
source
- the source of this connectionvoid setTarget(EditPart target)
target
- the target of this connection
|
GEF (MVC) 3.9.0.201308190730 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |