|Constructor and Description|
|Modifier and Type||Method and Description|
This method accept or refuse the interaction in the diagram.
This method is called when the interaction is validated by the user.
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
public boolean acceptElement(IDiagramHandle diagramHandle, IDiagramGraphic targetNode)
This method is called until the interaction is validated by the user.
This default implementation always accept the interaction.
diagramHandle- the representation of the diagram in which the interaction occurs.
targetNode- the graphic that is below the mouse pointer.
public void actionPerformed(IDiagramHandle diagramHandle, IDiagramGraphic graphic, org.eclipse.draw2d.geometry.Rectangle rect)
This default implementation does nothing.
If the user click or click and drag in a graphic box the parent argument contains the diagram node container corresponding to graphic box. If the user click or click and drag in the diagram background parent is null.
The rect argument is the rectangle that result from the user interaction with the diagram. This rect should be used to manage the unmasking of the model element in the diagram.
diagramHandle- the representation of the diagram where the command has been triggered.
graphic- the graphic parent where the user has clicked.
rect- the rectangle of the object to create.
IDiagramHandle.unmask(MObject, int, int)
protected void postConfigure(IDiagramHandle diagramHandle, IDiagramGraphic parentGraphic, org.eclipse.draw2d.geometry.Rectangle rect, ModelElement parentElement, MObject newElement, List<IDiagramGraphic> newGraphics)
Does nothing by default. Sub classes may redefine this method to make additional modifications.
diagramHandle- the diagram handle
parentGraphic- the graphic under which the element was unmasked
rect- the new graphic bounds.
parentElement- the model element owning the new element.
newElement- the created model element.
newGraphics- the graphics relating the new element that were unmasked.