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.AccessibleGraphicalEditPartAbstractEditPart.EditPolicyIteratorfigure, sourceConnections, targetConnectionschildren, FLAG_ACTIVE, FLAG_FOCUS, MAX_FLAGSELECTED, SELECTED_NONE, SELECTED_PRIMARYCONNECTION_LAYER, FEEDBACK_LAYER, GRID_LAYER, GUIDE_LAYER, HANDLE_LAYER, PRIMARY_LAYER, PRINTABLE_LAYERS, SCALABLE_LAYERS, SCALED_FEEDBACK_LAYERREQ_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, unregisterVisualsactivateEditPolicies, 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, unregisterModelclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddNodeListener, getContentPane, getFigure, getSourceConnections, getTargetConnections, removeNodeListener, setLayoutConstraintactivate, 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, understandsRequestprotected void activateFigure()
public void addNotify()
EditPartaddNotify in interface EditPartaddNotify in class AbstractGraphicalEditPartEditPart.addNotify()protected IFigure createFigure()
createFigure in class AbstractGraphicalEditPartprotected 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 IAdaptablegetAdapter in class AbstractGraphicalEditPartadapter - the adapter ClassAbstractConnectionEditPart.DefaultAccessibleAnchorProvider,
AbstractGraphicalEditPart.getAdapter(Class)public Connection getConnectionFigure()
Connectionpublic DragTracker getDragTracker(Request req)
AbstractGraphicalEditPartDragTracker for
GraphicalEditParts.getDragTracker in interface EditPartgetDragTracker in class AbstractGraphicalEditPartreq - a Request indicating the context of the dragnull or a DragTrackerEditPart.getDragTracker(Request)public EditPart getSource()
getSource in interface ConnectionEditPartConnectionEditPart.getSource()public EditPart getTarget()
getTarget in interface ConnectionEditPartConnectionEditPart.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 EditPartrefresh in class AbstractGraphicalEditPartEditPart.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 EditPartremoveNotify in class AbstractGraphicalEditPartEditPart.removeNotify()public void setParent(EditPart parent)
setParent in interface EditPartsetParent in class AbstractEditPartparent - the parent EditPartEditPart.setParent(EditPart)public void setSource(EditPart editPart)
setSource in interface ConnectionEditParteditPart - EditPart which is the source.public void setTarget(EditPart editPart)
setTarget in interface ConnectionEditParteditPart - EditPart which is the target.Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.