public abstract class AbstractConnectionEditPart extends AbstractGraphicalEditPart implements ConnectionEditPart, LayerConstants
ConnectionEditPart
.Modifier and Type | Class and Description |
---|---|
protected class |
AbstractConnectionEditPart.DefaultAccessibleAnchorProvider
Provides accessibility support for when connections are also themselves
nodes.
|
AbstractGraphicalEditPart.AccessibleGraphicalEditPart
AbstractEditPart.EditPolicyIterator
figure, sourceConnections, targetConnections
children, FLAG_ACTIVE, FLAG_FOCUS, MAX_FLAG
SELECTED, SELECTED_NONE, SELECTED_PRIMARY
CONNECTION_LAYER, FEEDBACK_LAYER, GRID_LAYER, GUIDE_LAYER, HANDLE_LAYER, PRIMARY_LAYER, PRINTABLE_LAYERS, SCALABLE_LAYERS, SCALED_FEEDBACK_LAYER
REQ_ADD, REQ_ALIGN, REQ_ALIGN_CHILDREN, REQ_CLONE, REQ_CONNECTION_END, REQ_CONNECTION_START, REQ_CREATE, REQ_CREATE_BENDPOINT, REQ_DELETE, REQ_DELETE_DEPENDANT, REQ_DIRECT_EDIT, REQ_MOVE, REQ_MOVE_BENDPOINT, REQ_MOVE_CHILDREN, REQ_OPEN, REQ_ORPHAN, REQ_ORPHAN_CHILDREN, REQ_RECONNECT_SOURCE, REQ_RECONNECT_TARGET, REQ_RESIZE, REQ_RESIZE_CHILDREN, REQ_SELECTION, REQ_SELECTION_HOVER
Constructor and Description |
---|
AbstractConnectionEditPart() |
Modifier and Type | Method and Description |
---|---|
protected void |
activateFigure()
Activates the Figure representing this, by setting up the start and end
connections, and adding the figure to the Connection Layer.
|
void |
addNotify()
Called after the EditPart has been added to its parent.
|
protected IFigure |
createFigure()
Returns a newly created Figure to represent these type of EditParts.
|
protected void |
deactivateFigure()
Deactivates the Figure representing this, by removing it from the
connection layer, and resetting the source and target connections to
null . |
java.lang.Object |
getAdapter(java.lang.Class adapter)
AbstractConnectionEditPart extends getAdapter() to overrides
the AccessibleAnchorProvider adapter returned by the superclass. |
Connection |
getConnectionFigure()
Convenience method for casting this GraphicalEditPart's Figure to a
Connection |
DragTracker |
getDragTracker(Request req)
Overridden to return a default
DragTracker for
GraphicalEditParts. |
EditPart |
getSource() |
protected ConnectionAnchor |
getSourceConnectionAnchor()
Returns the
ConnectionAnchor for the source end of
the connection. |
EditPart |
getTarget() |
protected ConnectionAnchor |
getTargetConnectionAnchor()
Returns the
ConnectionAnchor for the target end of
the connection. |
void |
refresh()
Extended here to also refresh the ConnectionAnchors.
|
protected void |
refreshSourceAnchor()
Updates the source ConnectionAnchor.
|
protected void |
refreshTargetAnchor()
Updates the target ConnectionAnchor.
|
void |
removeNotify()
Extended here to remove the ConnectionEditPart's connection figure from
the connection layer.
|
void |
setParent(EditPart parent)
Extended to implement automatic addNotify and removeNotify handling.
|
void |
setSource(EditPart editPart)
Sets the source EditPart of this connection.
|
void |
setTarget(EditPart editPart)
Sets the target EditPart of this connection.
|
activate, addChildVisual, addNodeListener, addSourceConnection, addTargetConnection, createConnection, createOrFindConnection, deactivate, fireRemovingSourceConnection, fireRemovingTargetConnection, fireSourceConnectionAdded, fireTargetConnectionAdded, getContentPane, getFigure, getLayer, getModelSourceConnections, getModelTargetConnections, getSourceConnections, getTargetConnections, isSelectable, primAddSourceConnection, primAddTargetConnection, primRemoveSourceConnection, primRemoveTargetConnection, refreshSourceConnections, refreshTargetConnections, registerVisuals, removeChildVisual, removeNodeListener, removeSourceConnection, removeTargetConnection, reorderChild, reorderSourceConnection, reorderTargetConnection, setFigure, setLayoutConstraint, unregisterVisuals
activateEditPolicies, addChild, addEditPartListener, createChild, createEditPolicies, deactivateEditPolicies, debug, debugFeedback, eraseSourceFeedback, eraseTargetFeedback, fireActivated, fireChildAdded, fireDeactivated, fireRemovingChild, fireSelectionChanged, getAccessibleEditPart, getChildren, getCommand, getEditPolicy, getEditPolicyIterator, getEventListeners, getFlag, getModel, getModelChildren, getParent, getRoot, getSelected, getTargetEditPart, getViewer, hasFocus, installEditPolicy, isActive, performRequest, refreshChildren, refreshVisuals, register, registerAccessibility, registerModel, removeChild, removeEditPartListener, removeEditPolicy, setFlag, setFocus, setModel, setSelected, showSourceFeedback, showTargetFeedback, toString, understandsRequest, unregister, unregisterAccessibility, unregisterModel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addNodeListener, getContentPane, getFigure, getSourceConnections, getTargetConnections, removeNodeListener, setLayoutConstraint
activate, addEditPartListener, deactivate, eraseSourceFeedback, eraseTargetFeedback, getChildren, getCommand, getEditPolicy, getModel, getParent, getRoot, getSelected, getTargetEditPart, getViewer, hasFocus, installEditPolicy, isActive, isSelectable, performRequest, removeEditPartListener, removeEditPolicy, setFocus, setModel, setSelected, showSourceFeedback, showTargetFeedback, understandsRequest
protected void activateFigure()
public void addNotify()
EditPart
addNotify
in interface EditPart
addNotify
in class AbstractGraphicalEditPart
EditPart.addNotify()
protected IFigure createFigure()
createFigure
in class AbstractGraphicalEditPart
protected void deactivateFigure()
null
.public java.lang.Object getAdapter(java.lang.Class adapter)
AbstractConnectionEditPart
extends getAdapter() to overrides
the AccessibleAnchorProvider
adapter returned by the superclass.
When treating a connection as a node for other connections, it makes
sense to target its midpoint, and not the edge of its bounds.getAdapter
in interface IAdaptable
getAdapter
in class AbstractGraphicalEditPart
adapter
- the adapter ClassAbstractConnectionEditPart.DefaultAccessibleAnchorProvider
,
AbstractGraphicalEditPart.getAdapter(Class)
public Connection getConnectionFigure()
Connection
public DragTracker getDragTracker(Request req)
AbstractGraphicalEditPart
DragTracker
for
GraphicalEditParts.getDragTracker
in interface EditPart
getDragTracker
in class AbstractGraphicalEditPart
req
- a Request
indicating the context of the dragnull
or a DragTrackerEditPart.getDragTracker(Request)
public EditPart getSource()
getSource
in interface ConnectionEditPart
ConnectionEditPart.getSource()
public EditPart getTarget()
getTarget
in interface ConnectionEditPart
ConnectionEditPart.getTarget()
protected ConnectionAnchor getSourceConnectionAnchor()
ConnectionAnchor
for the source end of
the connection. If the source is an instance of NodeEditPart
,
that interface will be used to determine the proper ConnectionAnchor. If
the source is not an instance of NodeEditPart
, this method
should be overridden to return the correct ConnectionAnchor. Failure to
do this will cause a default anchor to be used so that the connection
figure will be made visible to the developer.protected ConnectionAnchor getTargetConnectionAnchor()
ConnectionAnchor
for the target end of
the connection. If the target is an instance of NodeEditPart
,
that interface will be used to determine the proper ConnectionAnchor. If
the target is not an instance of NodeEditPart
, this method
should be overridden to return the correct ConnectionAnchor. Failure to
do this will cause a default anchor to be used so that the connection
figure will be made visible to the developer.public void refresh()
refresh
in interface EditPart
refresh
in class AbstractGraphicalEditPart
EditPart.refresh()
protected void refreshSourceAnchor()
getSourceConnectionAnchor()
if necessary, and not this method.protected void refreshTargetAnchor()
getTargetConnectionAnchor()
if necessary, and not this method.public void removeNotify()
removeNotify
in interface EditPart
removeNotify
in class AbstractGraphicalEditPart
EditPart.removeNotify()
public void setParent(EditPart parent)
setParent
in interface EditPart
setParent
in class AbstractEditPart
parent
- the parent EditPartEditPart.setParent(EditPart)
public void setSource(EditPart editPart)
setSource
in interface ConnectionEditPart
editPart
- EditPart which is the source.public void setTarget(EditPart editPart)
setTarget
in interface ConnectionEditPart
editPart
- EditPart which is the target.Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.