Class DefaultReconnectionFeature
java.lang.Object
org.eclipse.graphiti.features.impl.AbstractFeature
org.eclipse.graphiti.features.impl.DefaultReconnectionFeature
- All Implemented Interfaces:
IFeature,IFeatureProviderHolder,IReconnectionFeature,IReconnection,IDescription,IName
The default implementation for the
IReconnectionFeature interface. Is
used by default by the framework for any reconnection requests triggered in
the diagram. May be subclassed and adapted by clients.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcanceledReconnect(IReconnectionContext context) Called by the framework in case a started reconnection operation has been cancelled, e.g.booleancanExecute(IContext context) Called by the framework to check if this feature can perform the currently triggered reconnection request.booleancanReconnect(IReconnectionContext context) Called by the framework to check if this feature can perform the currently triggered reconnection request.booleancanStartReconnect(IReconnectionContext context) Called by the framework after the connection has been selected.voidCalled by the framework to execute this feature to perform the currently triggered reconnection request.getName()Returns the display name of the feature to use e.g.protected AnchorgetNewAnchor(IReconnectionContext context) Can be overridden by the user to influence the target anchor to use for the reconnect.voidpostReconnect(IReconnectionContext context) Hook that is called by thereconnect(IReconnectionContext)method after the actual reconnect is done.voidpreReconnect(IReconnectionContext context) Hook that is called by thereconnect(IReconnectionContext)method before the actual reconnect is done.final voidreconnect(IReconnectionContext context) Called by the framework to perform the currently triggered reconnection request.Methods inherited from class org.eclipse.graphiti.features.impl.AbstractFeature
addGraphicalRepresentation, canUndo, getAllBusinessObjectsForPictogramElement, getBusinessObjectForPictogramElement, getDescription, getDiagram, getDiagramBehavior, getFeatureProvider, getProgressCallback, getUserDecision, hasDoneChanges, isAvailable, layoutPictogramElement, link, link, manageColor, manageColor, manageDefaultFont, manageFont, manageFont, setProgressCallback, toString, updatePictogramElementMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.graphiti.IDescription
getDescriptionMethods inherited from interface org.eclipse.graphiti.features.IFeature
canUndo, hasDoneChanges, isAvailableMethods inherited from interface org.eclipse.graphiti.features.IFeatureProviderHolder
getFeatureProvider
-
Constructor Details
-
DefaultReconnectionFeature
Creates a newDefaultReconnectionFeature.- Parameters:
fp- the feature provider to use
-
-
Method Details
-
canReconnect
Called by the framework to check if this feature can perform the currently triggered reconnection request. The default implementation checks if- A connection and a new target anchor are passed in the given
IReconnectionContext - The connection passed in the context has a start and end anchor
- The new anchor is not located directly in the diagram
- Specified by:
canReconnectin interfaceIReconnection- Parameters:
context- the context object holding all the reconnection information- Returns:
trueif the feature is able to deal with the reconnection request,falseotherwise or if the tool needs to prohibit the reconnection for the given situation.
- A connection and a new target anchor are passed in the given
-
getNewAnchor
Can be overridden by the user to influence the target anchor to use for the reconnect.- Parameters:
context- the context holding the reconnection information- Returns:
- the new anchor to use as target for the reconnect
-
reconnect
Called by the framework to perform the currently triggered reconnection request. The default implementation calls thepreReconnect(IReconnectionContext)andpostReconnect(IReconnectionContext)hooks. The reconnect is done by either replacing the start anchor (in case it matches the old anchor passed in the context) or the end anchor with the new anchor.- Specified by:
reconnectin interfaceIReconnection- Parameters:
context- the context object holding all the reconnection information
-
preReconnect
Hook that is called by thereconnect(IReconnectionContext)method before the actual reconnect is done. Can be overridden by clients to add additional functionality.- Specified by:
preReconnectin interfaceIReconnection- Parameters:
context- the context object holding all the reconnection information
-
postReconnect
Hook that is called by thereconnect(IReconnectionContext)method after the actual reconnect is done. Can be overridden by clients to add additional functionality.- Specified by:
postReconnectin interfaceIReconnection- Parameters:
context- the context object holding all the reconnection information
-
canExecute
Called by the framework to check if this feature can perform the currently triggered reconnection request. Delegates to thecanReconnect(IReconnectionContext)method in case the passed context is aIReconnectionContext.- Specified by:
canExecutein interfaceIFeature- Parameters:
context- the context object holding all the reconnection information- Returns:
trueif the feature is able to deal with the reconnection request,falseotherwise or if the tool needs to prohibit the reconnection for the given situation.- See Also:
-
execute
Called by the framework to execute this feature to perform the currently triggered reconnection request. Delegates to thereconnect(IReconnectionContext)method in case the passed context is aIReconnectionContext. -
getName
Returns the display name of the feature to use e.g. within a context menu.- Specified by:
getNamein interfaceIName- Overrides:
getNamein classAbstractFeature- Returns:
- the display name of the feature
-
canceledReconnect
Called by the framework in case a started reconnection operation has been cancelled, e.g. by pressing ESC, selecting another tool from the palette etc.- Specified by:
canceledReconnectin interfaceIReconnection- Parameters:
context- the context object holding all the reconnection information- Since:
- 0.9
-
canStartReconnect
Called by the framework after the connection has been selected. Determines whether connection endpoint can be dragged to start reconnection.- Specified by:
canStartReconnectin interfaceIReconnection- Parameters:
context- the context object holding information about the connection and old anchor- Returns:
true- Since:
- 0.11
-