public class GenericLinkTool extends DefaultLinkTool
Constructor and Description |
---|
GenericLinkTool() |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptFirstElement(IDiagramHandle diagramHandle,
IDiagramGraphic targetNode)
This method accept or refuse the interaction in the diagram for the origin of the link.
|
boolean |
acceptSecondElement(IDiagramHandle diagramHandle,
IDiagramGraphic originNode,
IDiagramGraphic targetNode)
This method accept or refuse the interaction with the diagram for the destination element of the link.
|
void |
actionPerformed(IDiagramHandle diagramHandle,
IDiagramGraphic originNode,
IDiagramGraphic targetNode,
IDiagramLink.LinkRouterKind routerType,
ILinkPath path)
This method is invoked when the command is launched.
|
protected void |
postConfigure(IDiagramHandle diagramHandle,
IDiagramGraphic originNode,
IDiagramGraphic targetNode,
ModelElement source,
ModelElement target,
MObject newElement,
IDiagramLink newLink,
java.util.List<IDiagramGraphic> newGraphics,
IDiagramLink.LinkRouterKind routerType,
ILinkPath path)
Hook called once the element is created, configured, unmasked and before the transaction is committed.
|
decorate, findStereotypeFromSpec, getBitmap, getLabel, getModule, getParameter, getParameters, getSourceScopes, getTargetScopes, getTooltip, initialize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
decorate, getBitmap, getLabel, getModule, getParameters, getSourceScopes, getTargetScopes, getTooltip, initialize
public boolean acceptFirstElement(IDiagramHandle diagramHandle, IDiagramGraphic targetNode)
DefaultLinkTool
This method is called until the user clicks on an element.
This default implementation always accept the interaction.
acceptFirstElement
in interface ILinkTool
acceptFirstElement
in class DefaultLinkTool
diagramHandle
- the representation of the diagram in which the interaction occurs.targetNode
- the graphic that is below the mouse pointer.public boolean acceptSecondElement(IDiagramHandle diagramHandle, IDiagramGraphic originNode, IDiagramGraphic targetNode)
DefaultLinkTool
This method is called after the user has choosen the origin of the link.
This default implementation always accept the interaction.
acceptSecondElement
in interface ILinkTool
acceptSecondElement
in class DefaultLinkTool
diagramHandle
- the representation of the diagram in which the interaction occurs.originNode
- the graphic that is the origin of the link.targetNode
- the graphic the is below the mouse pointer.public void actionPerformed(IDiagramHandle diagramHandle, IDiagramGraphic originNode, IDiagramGraphic targetNode, IDiagramLink.LinkRouterKind routerType, ILinkPath path)
DefaultLinkTool
The actionPerformed is called after user has choosen the destination of the link.
This default implementation does nothing.
actionPerformed
in interface ILinkTool
actionPerformed
in class DefaultLinkTool
diagramHandle
- the representation of the diagram where the command has been triggered.originNode
- the origin graphic of the link to create.targetNode
- the destination graphic of the link to create.routerType
- the router type that is currently defined to compute the path of the link.path
- the link path deduced from the user interactions.IDiagramHandle.unmask(MObject, int, int)
protected void postConfigure(IDiagramHandle diagramHandle, IDiagramGraphic originNode, IDiagramGraphic targetNode, ModelElement source, ModelElement target, MObject newElement, IDiagramLink newLink, java.util.List<IDiagramGraphic> newGraphics, IDiagramLink.LinkRouterKind routerType, ILinkPath path)
Does nothing by default. Sub classes may redefine this method to make additional modifications.
diagramHandle
- the diagram handleoriginNode
- the source graphic nodetargetNode
- the target graphic nodesource
- the source model elementtarget
- the target model elementnewElement
- the created link elementnewLink
- the unmasked link graphicnewGraphics
- the graphics relating the new element that were unmasked. The first in this list is 'newLink'.routerType
- the router type that is currently defined to compute the path of the link.path
- the link path deduced from the user interactions.