Package org.eclipse.gef.editparts
Class AbstractConnectionEditPart
java.lang.Object
org.eclipse.gef.editparts.AbstractEditPart
org.eclipse.gef.editparts.AbstractGraphicalEditPart
org.eclipse.gef.editparts.AbstractConnectionEditPart
- All Implemented Interfaces:
- IAdaptable,- ConnectionEditPart,- EditPart,- GraphicalEditPart,- LayerConstants,- RequestConstants
public abstract class AbstractConnectionEditPart
extends AbstractGraphicalEditPart
implements ConnectionEditPart, LayerConstants
The base implementation for 
ConnectionEditPart.- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected final classProvides accessibility support for when connections are also themselves nodes.Nested classes/interfaces inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPartAbstractGraphicalEditPart.AccessibleGraphicalEditPartNested classes/interfaces inherited from class org.eclipse.gef.editparts.AbstractEditPartAbstractEditPart.EditPolicyIterator
- 
Field SummaryFields inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPartfigure, sourceConnections, targetConnectionsFields inherited from class org.eclipse.gef.editparts.AbstractEditPartchildren, FLAG_ACTIVE, FLAG_FOCUS, MAX_FLAGFields inherited from interface org.eclipse.gef.EditPartSELECTED, SELECTED_NONE, SELECTED_PRIMARYFields inherited from interface org.eclipse.gef.LayerConstantsCONNECTION_LAYER, FEEDBACK_LAYER, GRID_LAYER, GUIDE_LAYER, HANDLE_LAYER, PRIMARY_LAYER, PRINTABLE_LAYERS, SCALABLE_LAYERS, SCALED_FEEDBACK_LAYERFields inherited from interface org.eclipse.gef.RequestConstantsREQ_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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidActivates the Figure representing this, by setting up the start and end connections, and adding the figure to the Connection Layer.voidCalled after the EditPart has been added to its parent.protected IFigureReturns a newly created Figure to represent these type of EditParts.protected voidDeactivates the Figure representing this, by removing it from the connection layer, and resetting the source and target connections tonull.<T> TgetAdapter(Class<T> adapter) AbstractConnectionEditPartextends getAdapter() to overrides theAccessibleAnchorProvideradapter returned by the superclass.Convenience method for casting this GraphicalEditPart's Figure to aConnectiongetDragTracker(Request req) Overridden to return a defaultDragTrackerfor GraphicalEditParts.protected ConnectionAnchorReturns theConnectionAnchorfor the source end of the connection.protected ConnectionAnchorReturns theConnectionAnchorfor the target end of the connection.voidrefresh()Extended here to also refresh the ConnectionAnchors.protected voidUpdates the source ConnectionAnchor.protected voidUpdates the target ConnectionAnchor.voidExtended here to remove the ConnectionEditPart's connection figure from the connection layer.voidExtended to implement automatic addNotify and removeNotify handling.voidSets the source EditPart of this connection.voidSets the target EditPart of this connection.Methods inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPartactivate, addChildVisual, addNodeListener, addSourceConnection, addTargetConnection, createConnection, createOrFindConnection, deactivate, fireRemovingSourceConnection, fireRemovingTargetConnection, fireSourceConnectionAdded, fireTargetConnectionAdded, getChildren, getContentPane, getFigure, getLayer, getModelSourceConnections, getModelTargetConnections, getSourceConnections, getTargetConnections, isSelectable, primAddSourceConnection, primAddTargetConnection, primRemoveSourceConnection, primRemoveTargetConnection, refreshSourceConnections, refreshTargetConnections, registerVisuals, removeChildVisual, removeNodeListener, removeSourceConnection, removeTargetConnection, reorderChild, reorderSourceConnection, reorderTargetConnection, setFigure, setLayoutConstraint, unregisterVisualsMethods inherited from class org.eclipse.gef.editparts.AbstractEditPartactivateEditPolicies, addChild, addEditPartListener, createChild, createEditPolicies, deactivateEditPolicies, debug, debugFeedback, eraseSourceFeedback, eraseTargetFeedback, fireActivated, fireChildAdded, fireDeactivated, fireRemovingChild, fireSelectionChanged, getAccessibleEditPart, getCommand, getEditPolicy, getEditPolicyIterable, getEditPolicyIterator, getEventListeners, getEventListenersIterable, 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, unregisterModelMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.gef.EditPartactivate, addEditPartListener, deactivate, eraseSourceFeedback, eraseTargetFeedback, getCommand, getEditPolicy, getModel, getParent, getRoot, getSelected, getTargetEditPart, getViewer, hasFocus, installEditPolicy, isActive, isSelectable, performRequest, removeEditPartListener, removeEditPolicy, setFocus, setModel, setSelected, showSourceFeedback, showTargetFeedback, understandsRequestMethods inherited from interface org.eclipse.gef.GraphicalEditPartaddNodeListener, getChildren, getContentPane, getFigure, getSourceConnections, getTargetConnections, removeNodeListener, setLayoutConstraint
- 
Constructor Details- 
AbstractConnectionEditPartpublic AbstractConnectionEditPart()
 
- 
- 
Method Details- 
activateFigureprotected void activateFigure()Activates the Figure representing this, by setting up the start and end connections, and adding the figure to the Connection Layer.- See Also:
 
- 
addNotifypublic void addNotify()Description copied from interface:EditPartCalled after the EditPart has been added to its parent. This is used to indicate to the EditPart that it should refresh itself for the first time.- Specified by:
- addNotifyin interface- EditPart
- Overrides:
- addNotifyin class- AbstractGraphicalEditPart
- See Also:
 
- 
createFigureReturns a newly created Figure to represent these type of EditParts.- Specified by:
- createFigurein class- AbstractGraphicalEditPart
- Returns:
- The created Figure.
 
- 
deactivateFigureprotected void deactivateFigure()Deactivates the Figure representing this, by removing it from the connection layer, and resetting the source and target connections tonull.
- 
getAdapterAbstractConnectionEditPartextends getAdapter() to overrides theAccessibleAnchorProvideradapter 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.- Specified by:
- getAdapterin interface- IAdaptable
- Overrides:
- getAdapterin class- AbstractGraphicalEditPart
- Parameters:
- adapter- the adapter Class
- Returns:
- the adapter
- See Also:
 
- 
getConnectionFigureConvenience method for casting this GraphicalEditPart's Figure to aConnection- Returns:
- the Figure as a Connection
 
- 
getDragTrackerDescription copied from class:AbstractGraphicalEditPartOverridden to return a defaultDragTrackerfor GraphicalEditParts.- Specified by:
- getDragTrackerin interface- EditPart
- Overrides:
- getDragTrackerin class- AbstractGraphicalEditPart
- Parameters:
- req- a- Requestindicating the context of the drag
- Returns:
- nullor a DragTracker
- See Also:
 
- 
getSource- Specified by:
- getSourcein interface- ConnectionEditPart
- Returns:
- the EditPart at the source end of this connection.
- See Also:
 
- 
getTarget- Specified by:
- getTargetin interface- ConnectionEditPart
- Returns:
- the EditPart at the target end of this connection.
- See Also:
 
- 
getSourceConnectionAnchorReturns theConnectionAnchorfor the source end of the connection. If the source is an instance ofNodeEditPart, that interface will be used to determine the proper ConnectionAnchor. If the source is not an instance ofNodeEditPart, 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.- Returns:
- ConnectionAnchor for the source end of the Connection
 
- 
getTargetConnectionAnchorReturns theConnectionAnchorfor the target end of the connection. If the target is an instance ofNodeEditPart, that interface will be used to determine the proper ConnectionAnchor. If the target is not an instance ofNodeEditPart, 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.- Returns:
- ConnectionAnchor for the target end of the Connection
 
- 
refreshpublic void refresh()Extended here to also refresh the ConnectionAnchors.- Specified by:
- refreshin interface- EditPart
- Overrides:
- refreshin class- AbstractGraphicalEditPart
- See Also:
 
- 
refreshSourceAnchorprotected void refreshSourceAnchor()Updates the source ConnectionAnchor. Subclasses should overridegetSourceConnectionAnchor()if necessary, and not this method.
- 
refreshTargetAnchorprotected void refreshTargetAnchor()Updates the target ConnectionAnchor. Subclasses should overridegetTargetConnectionAnchor()if necessary, and not this method.
- 
removeNotifypublic void removeNotify()Extended here to remove the ConnectionEditPart's connection figure from the connection layer.- Specified by:
- removeNotifyin interface- EditPart
- Overrides:
- removeNotifyin class- AbstractGraphicalEditPart
- See Also:
 
- 
setParentExtended to implement automatic addNotify and removeNotify handling.- Specified by:
- setParentin interface- EditPart
- Overrides:
- setParentin class- AbstractEditPart
- Parameters:
- parent- the parent EditPart
- See Also:
 
- 
setSourceSets the source EditPart of this connection.- Specified by:
- setSourcein interface- ConnectionEditPart
- Parameters:
- editPart- EditPart which is the source.
 
- 
setTargetSets the target EditPart of this connection.- Specified by:
- setTargetin interface- ConnectionEditPart
- Parameters:
- editPart- EditPart which is the target.
 
 
-