D - The diagram type.C - The handled canvas type.public abstract class BaseCanvasHandler<D extends Diagram,C extends AbstractCanvas> extends AbstractCanvasHandler<D,C>
AbstractCanvasHandler super-type.
You can use this type if:
- You need a custom graph index or graph index builder types.
- You need custom rule loading or do not want support for rules and their evaluations.
- You need custom draw logics.| Constructor and Description |
|---|
BaseCanvasHandler(DefinitionManager definitionManager,
GraphUtils graphUtils,
ShapeManager shapeManager,
TextPropertyProviderFactory textPropertyProviderFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(Element parent,
Element child)
This method sets the given
child instance as children for the given
given parent instance. |
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. |
void |
addShape(Shape shape) |
protected void |
afterDraw(Element element,
Shape shape) |
protected void |
afterElementAdded(Element element,
Shape shape) |
protected void |
afterElementDeleted(Element element,
Shape shape) |
protected void |
afterElementUpdated(Element element,
Shape shape) |
protected void |
applyElementMutation(ElementShape graphShape,
Element candidate,
boolean applyPosition,
boolean applyProperties,
MutationContext mutationContext) |
protected void |
applyElementMutation(Shape shape,
Element candidate) |
void |
applyElementMutation(Shape shape,
Element candidate,
boolean applyPosition,
boolean applyProperties,
MutationContext mutationContext) |
protected void |
applyElementTitle(ElementShape shape,
Element candidate,
MutationContext mutationContext) |
protected void |
beforeDraw(Element element,
Shape shape) |
protected void |
beforeElementDeleted(Element element,
Shape shape) |
protected void |
beforeElementUpdated(Element element,
Shape shape) |
protected abstract void |
buildGraphIndex(org.uberfire.mvp.Command loadCallback)
Build the graph index instance using any concrete index/builder types.
|
void |
deregister(Shape shape,
Element element,
boolean fireEvents) |
protected void |
destroyGraph(org.uberfire.mvp.Command callback) |
protected abstract void |
destroyGraphIndex(org.uberfire.mvp.Command loadCallback)
Destroys this instance' graph index.
|
boolean |
dock(Element parent,
Element child)
This method sets the given
child instance as docked child for the given
given parent instance. |
CanvasHandler<D,C> |
doClear()
Subtypes must clear this instance's state here.
|
void |
doDestroy()
Subtypes must destroy this instance's state here.
|
void |
draw(D diagram,
org.uberfire.mvp.ParameterizedCommand<CommandResult> loadCallback) |
abstract void |
draw(org.uberfire.mvp.ParameterizedCommand<CommandResult> loadCallback)
Delegates the draw behavior to the subtypes.
|
C |
getCanvas() |
protected String |
getDefinitionId(Object definition) |
DefinitionManager |
getDefinitionManager()
Provides a definition manager instance in this context.
|
D |
getDiagram() |
protected Optional<Element> |
getElement(String uuid) |
Optional<Element> |
getElementAt(double x,
double y)
Gets the Element at the specified Canvas coordinates
|
GraphUtils |
getGraphUtils() |
RuleSet |
getRuleSet()
Provides the ruleSet instance for this handler.
|
ShapeFactory<Object,Shape> |
getShapeFactory(String shapeSetId) |
ShapeManager |
getShapeManager() |
TextPropertyProviderFactory |
getTextPropertyProviderFactory()
Provides a Text Property Provider Factory instance in this context.
|
CanvasHandler<D,C> |
handle(C canvas) |
protected boolean |
isCanvasRoot(String pUUID) |
protected void |
loadRuleSet(org.uberfire.mvp.Command callback) |
void |
register(Shape shape,
Element<View<?>> candidate,
boolean fireEvents) |
void |
removeChild(Element parent,
Element child)
This method removes the given
child instance as children for the given
given parent instance. |
void |
removeShape(Shape shape) |
protected void |
showError(ClientRuntimeError error) |
void |
undock(Element target,
Element child)
This method removes the given
child instance as docked child for the given
given parent instance. |
addDomainObjectListener, addRegistrationListener, applyElementMutation, applyElementMutation, clear, clearCanvas, clearDomainObjectListeners, clearRegistrationListeners, deregister, deregister, destroy, equals, getAbstractCanvas, getGraphExecutionContext, getGraphIndex, getRuleManager, getUuid, hashCode, isCanvasRoot, notifyCanvasClear, notifyCanvasDomainObjectAdded, notifyCanvasDomainObjectClear, notifyCanvasDomainObjectRemoved, notifyCanvasDomainObjectUpdated, notifyCanvasElementAdded, notifyCanvasElementRemoved, notifyCanvasElementUpdated, register, register, removeDomainObjectListener, removeRegistrationListener, setGraphExecutionContext, toString, updateElementPosition, updateElementPropertiespublic BaseCanvasHandler(DefinitionManager definitionManager, GraphUtils graphUtils, ShapeManager shapeManager, TextPropertyProviderFactory textPropertyProviderFactory)
protected abstract void buildGraphIndex(org.uberfire.mvp.Command loadCallback)
loadCallback - Callback to run once load finishes. This kind of indexes could be loaded or
cached in/from server side as well.public abstract void draw(org.uberfire.mvp.ParameterizedCommand<CommandResult> loadCallback)
loadCallback - Callback to run once draw has finished. It must provide a result for
the draw operation/s.protected abstract void destroyGraphIndex(org.uberfire.mvp.Command loadCallback)
loadCallback - Callback to run once index has been destroyed.public CanvasHandler<D,C> handle(C canvas)
public void draw(D diagram, org.uberfire.mvp.ParameterizedCommand<CommandResult> loadCallback)
public RuleSet getRuleSet()
AbstractCanvasHandlergetRuleSet in class AbstractCanvasHandler<D extends Diagram,C extends AbstractCanvas>public C getCanvas()
public D getDiagram()
protected void loadRuleSet(org.uberfire.mvp.Command callback)
public ShapeFactory<Object,Shape> getShapeFactory(String shapeSetId)
getShapeFactory in class AbstractCanvasHandler<D extends Diagram,C extends AbstractCanvas>public void register(Shape shape, Element<View<?>> candidate, boolean fireEvents)
register in class AbstractCanvasHandler<D extends Diagram,C extends AbstractCanvas>public void deregister(Shape shape, Element element, boolean fireEvents)
deregister in class AbstractCanvasHandler<D extends Diagram,C extends AbstractCanvas>public void addShape(Shape shape)
public void removeShape(Shape shape)
public void applyElementMutation(Shape shape, Element candidate, boolean applyPosition, boolean applyProperties, MutationContext mutationContext)
applyElementMutation in class AbstractCanvasHandler<D extends Diagram,C extends AbstractCanvas>protected void applyElementMutation(ElementShape graphShape, Element candidate, boolean applyPosition, boolean applyProperties, MutationContext mutationContext)
protected void applyElementTitle(ElementShape shape, Element candidate, MutationContext mutationContext)
public void addChild(Element parent, Element child)
AbstractCanvasHandlerchild 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.addChild in class AbstractCanvasHandler<D extends Diagram,C extends AbstractCanvas>parent - The parent graph element.child - The graph element to set as child.public void addChild(Element parent, Element child, int index)
AbstractCanvasHandlerchild 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.addChild in class AbstractCanvasHandler<D extends Diagram,C extends AbstractCanvas>parent - The parent graph element.child - The graph element to set as child.index - The index of the child in the parent.public void removeChild(Element parent, Element child)
AbstractCanvasHandlerchild 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.removeChild in class AbstractCanvasHandler<D extends Diagram,C extends AbstractCanvas>parent - The parent graph element.child - The element to remove as a child from the parent.public Optional<Element> getElementAt(double x, double y)
AbstractCanvasHandlergetElementAt in class AbstractCanvasHandler<D extends Diagram,C extends AbstractCanvas>x - The X canvas coordinatey - The Y canvas coordinateprotected boolean isCanvasRoot(String pUUID)
public boolean dock(Element parent, Element child)
AbstractCanvasHandlerchild 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.dock in class AbstractCanvasHandler<D extends Diagram,C extends AbstractCanvas>parent - The parent graph element.child - The graph element to set as a docked child.public void undock(Element target, Element child)
AbstractCanvasHandlerchild 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.undock in class AbstractCanvasHandler<D extends Diagram,C extends AbstractCanvas>target - The parent graph element.child - The element to remove as a docked child from the parent.public CanvasHandler<D,C> doClear()
AbstractCanvasHandlerdoClear in class AbstractCanvasHandler<D extends Diagram,C extends AbstractCanvas>public void doDestroy()
AbstractCanvasHandlerdoDestroy in class AbstractCanvasHandler<D extends Diagram,C extends AbstractCanvas>protected void destroyGraph(org.uberfire.mvp.Command callback)
protected void showError(ClientRuntimeError error)
public DefinitionManager getDefinitionManager()
AbstractCanvasHandlergetDefinitionManager in class AbstractCanvasHandler<D extends Diagram,C extends AbstractCanvas>public TextPropertyProviderFactory getTextPropertyProviderFactory()
AbstractCanvasHandlergetTextPropertyProviderFactory in class AbstractCanvasHandler<D extends Diagram,C extends AbstractCanvas>public GraphUtils getGraphUtils()
public ShapeManager getShapeManager()
Copyright © 2001–2019 JBoss by Red Hat. All rights reserved.