D - The diagram type.C - The handled canvas type.public abstract class AbstractCanvasHandler<D extends Diagram,C extends AbstractCanvas> extends Object implements CanvasHandler<D,C>, HasCanvasListeners<CanvasElementListener>
AbstractCanvasHandler, so most of the different IOC resolutions that Stunner requires
on other areas will be, at least, resolved with the default implementations that rely on subtypes
for AbstractCanvasHandler.| Constructor and Description |
|---|
AbstractCanvasHandler() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
addChild(Element parent,
Element child)
This method sets the given
child instance as children for the given
given parent instance. |
abstract void |
addChild(Element parent,
Element child,
int index)
This method sets the given
child instance as children for the given
given parent instance at the given index. |
HasCanvasListeners<CanvasElementListener> |
addRegistrationListener(CanvasElementListener instance)
Adds a listener instance in order to be notified about graph element structure updates.
|
void |
applyElementMutation(Element candidate,
boolean applyPosition,
boolean applyProperties,
MutationContext mutationContext) |
void |
applyElementMutation(Element element,
MutationContext mutationContext)
When an element has been changed, this method produces to update the handler and the canvas
and mutates the shape bind to the given element using new properties and/or values.
|
abstract void |
applyElementMutation(Shape shape,
Element candidate,
boolean applyPosition,
boolean applyProperties,
MutationContext mutationContext) |
CanvasHandler<D,C> |
clear()
Clears this handler state and the handled canvas instance.
|
void |
clearCanvas() |
HasCanvasListeners<CanvasElementListener> |
clearRegistrationListeners()
Clears all the registered listeners.
|
void |
deregister(Element element)
Deregisters an element from the graph structure and from the canvas.
|
void |
deregister(Element element,
boolean fireEvents)
De-registers an element from the graph structure and from the canvas.
|
abstract void |
deregister(Shape shape,
Element element,
boolean fireEvents) |
void |
destroy()
Destroys this handler state and the handled canvas instance.
|
abstract void |
dock(Element parent,
Element child)
This method sets the given
child instance as docked child for the given
given parent instance. |
abstract CanvasHandler<D,C> |
doClear()
Subtypes must clear this instance's state here.
|
abstract void |
doDestroy()
Subtypes must destroy this instance's state here.
|
boolean |
equals(Object o) |
AbstractCanvas |
getAbstractCanvas()
Used to avoid forcing specifying the generic for the canvas type
from other beans.
|
abstract DefinitionManager |
getDefinitionManager()
Provides a definition manager instance in this context.
|
abstract Optional<Element> |
getElementAt(double x,
double y)
Gets the Element at the specified Canvas coordinates
|
abstract GraphCommandExecutionContext |
getGraphExecutionContext()
Should return a graph execution context to perform the model updates applied by the graph command executions.
|
abstract Index<?,?> |
getGraphIndex()
Returns the graph index instance to perform lookups over the graph structure
foe this canvas handler's diagram instance loaded.
|
abstract RuleManager |
getRuleManager()
Provides the rule manager instance.
|
abstract RuleSet |
getRuleSet()
Provides the ruleSet instance for this handler.
|
abstract ShapeFactory<Object,AbstractCanvasHandler,Shape> |
getShapeFactory(String shapeSetId) |
String |
getUuid() |
int |
hashCode() |
boolean |
isCanvasRoot(Element parent) |
void |
notifyCanvasClear()
Notifies a clean canvas to the listeners.
|
void |
notifyCanvasElementAdded(Element candidate)
Notifies an element added to the listeners.
|
void |
notifyCanvasElementRemoved(Element candidate)
Notifies an element removed to the listeners.
|
void |
notifyCanvasElementUpdated(Element candidate)
Notifies an element updated to the listeners.
|
abstract void |
register(Shape shape,
Element<View<?>> candidate,
boolean fireEvents) |
void |
register(ShapeFactory<Object,AbstractCanvasHandler,Shape> factory,
Element<View<?>> candidate,
boolean fireEvents)
It does:
- Registers a new graph element into the structure
- Creates the shape for the element to register, using the given shape factory.
|
void |
register(String shapeSetId,
Element<View<?>> candidate)
It does:
- Registers a new graph element into the structure
- Creates the shape for the element to register, using the shape factory provided
for the given
shapeSetId value. |
abstract void |
removeChild(Element parent,
Element child)
This method removes the given
child instance as children for the given
given parent instance. |
HasCanvasListeners<CanvasElementListener> |
removeRegistrationListener(CanvasElementListener instance)
Removes a previously register listener instance.
|
String |
toString() |
abstract void |
undock(Element parent,
Element child)
This method removes the given
child instance as docked child for the given
given parent instance. |
void |
updateElementPosition(Element element,
MutationContext mutationContext)
When an element has been changed, this method produces to update the coordinates for
the shape bind to the given element.
|
void |
updateElementProperties(Element element,
MutationContext mutationContext)
When an element has been changed, this method produces to update the handler and the canvas
and mutates the shape bind to the given element using new properties and/or values.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitdraw, getCanvas, getDiagram, handlepublic abstract DefinitionManager getDefinitionManager()
public abstract RuleManager getRuleManager()
public abstract RuleSet getRuleSet()
public abstract Index<?,?> getGraphIndex()
public abstract GraphCommandExecutionContext getGraphExecutionContext()
null or an empty context type.public abstract void addChild(Element parent, Element child)
child instance as children for the given
given parent instance.
It sets the shape for the child instance as child shape for the
parent instance's shape.parent - The parent graph element.child - The graph element to set as child.public abstract void addChild(Element parent, Element child, int index)
child instance as children for the given
given parent instance at the given index. The default
implementation adds the child to the parent and index is unused. The Child's
Shape is also set as a sibling of the Parent Shape.parent - The parent graph element.child - The graph element to set as child.index - The index of the child in the parent.public abstract void removeChild(Element parent, Element child)
child instance as children for the given
given parent instance.
It removes the shape for the child instance as child shape for the
parent instance's shape.parent - The parent graph element.child - The element to remove as a child from the parent.public abstract Optional<Element> getElementAt(double x, double y)
x - The X canvas coordinatey - The Y canvas coordinatepublic abstract void dock(Element parent, Element child)
child instance as docked child for the given
given parent instance.
It sets the shape for the child instance as a docked child shape for the
parent instance's shape.parent - The parent graph element.child - The graph element to set as a docked child.public abstract void undock(Element parent, Element child)
child instance as docked child for the given
given parent instance.
It removes the shape for the child instance as a docked child shape for the
parent instance's shape.parent - The parent graph element.child - The element to remove as a docked child from the parent.public abstract CanvasHandler<D,C> doClear()
public abstract void doDestroy()
public abstract void applyElementMutation(Shape shape, Element candidate, boolean applyPosition, boolean applyProperties, MutationContext mutationContext)
public abstract ShapeFactory<Object,AbstractCanvasHandler,Shape> getShapeFactory(String shapeSetId)
public void register(String shapeSetId, Element<View<?>> candidate)
shapeSetId value.shapeSetId - The identifier for the ShapeSet to use.candidate - The graph element to register.public void register(ShapeFactory<Object,AbstractCanvasHandler,Shape> factory, Element<View<?>> candidate, boolean fireEvents)
factory - The shape factory to use.candidate - The graph element to register.fireEvents - If canvas and canvas handled registration events must be fired.public void deregister(Element element)
element - The element to deregister and remove from the canvas.public void deregister(Element element, boolean fireEvents)
element - The element to de-register and remove from the canvas.fireEvents - If canvas and canvas handled registration events must be fired.public void applyElementMutation(Element element, MutationContext mutationContext)
element - The element that has been updated.mutationContext - The context for the shape mutations.public void updateElementPosition(Element element, MutationContext mutationContext)
element - The element that has been updated.mutationContext - The context for the shape mutations.public void updateElementProperties(Element element, MutationContext mutationContext)
element - The element that has been updated.mutationContext - The context for the shape mutations.public void applyElementMutation(Element candidate, boolean applyPosition, boolean applyProperties, MutationContext mutationContext)
public HasCanvasListeners<CanvasElementListener> addRegistrationListener(CanvasElementListener instance)
addRegistrationListener in interface HasCanvasListeners<CanvasElementListener>instance - The listener instance.public HasCanvasListeners<CanvasElementListener> removeRegistrationListener(CanvasElementListener instance)
removeRegistrationListener in interface HasCanvasListeners<CanvasElementListener>instance - The listener instance.public HasCanvasListeners<CanvasElementListener> clearRegistrationListeners()
clearRegistrationListeners in interface HasCanvasListeners<CanvasElementListener>public void notifyCanvasElementRemoved(Element candidate)
public void notifyCanvasElementAdded(Element candidate)
public void notifyCanvasElementUpdated(Element candidate)
public void notifyCanvasClear()
public void clearCanvas()
public CanvasHandler<D,C> clear()
clear in interface CanvasHandler<D extends Diagram,C extends AbstractCanvas>public void destroy()
destroy in interface CanvasHandler<D extends Diagram,C extends AbstractCanvas>public AbstractCanvas getAbstractCanvas()
public boolean isCanvasRoot(Element parent)
public String getUuid()
Copyright © 2001–2017 JBoss by Red Hat. All rights reserved.