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) |
| 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 |
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(Shape shape,
Element candidate,
boolean applyPosition,
boolean applyProperties,
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.
|
protected void |
deregister(Shape shape,
Element element,
boolean fireEvents) |
protected abstract void |
destroyGraphIndex(org.uberfire.mvp.Command loadCallback)
Destroys this instance' graph index.
|
void |
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) |
protected 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() |
GraphUtils |
getGraphUtils() |
protected ShapeFactory<Object,AbstractCanvasHandler,Shape> |
getShapeFactory(String shapeSetId) |
ShapeManager |
getShapeManager() |
CanvasHandler<D,C> |
handle(C canvas) |
protected void |
handleParentChildZIndex(Element parent,
Element child,
Shape parentShape,
Shape childShape,
boolean add) |
protected void |
handleZIndex(Element child,
int zindex) |
protected void |
handleZIndex(Set<String> shapeUUIDs,
int zindex) |
protected void |
handleZIndex(Shape shape,
int zindex) |
protected boolean |
isCanvasRoot(String pUUID) |
protected abstract void |
loadRules(org.uberfire.mvp.Command loadCallback)
Load the necessary rules into the graph and model rules manager member instances.
|
protected 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 parent,
Element child)
This method removes the given
child instance as docked child for the given
given parent instance. |
addRegistrationListener, applyElementMutation, applyElementMutation, clear, clearCanvas, clearRegistrationListeners, deregister, deregister, destroy, equals, getAbstractCanvas, getGraphExecutionContext, getGraphIndex, getGraphRulesManager, getModelRulesManager, getUuid, hashCode, isCanvasRoot, notifyCanvasClear, notifyCanvasElementAdded, notifyCanvasElementRemoved, notifyCanvasElementUpdated, register, register, removeRegistrationListener, toString, updateElementPosition, updateElementPropertiespublic BaseCanvasHandler(DefinitionManager definitionManager, GraphUtils graphUtils, ShapeManager shapeManager)
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.protected abstract void loadRules(org.uberfire.mvp.Command loadCallback)
loadCallback - Callback to run once rules have been loaded, if any.protected 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 C getCanvas()
public D getDiagram()
protected ShapeFactory<Object,AbstractCanvasHandler,Shape> getShapeFactory(String shapeSetId)
getShapeFactory in class AbstractCanvasHandler<D extends Diagram,C extends AbstractCanvas>protected void register(Shape shape, Element<View<?>> candidate, boolean fireEvents)
register in class AbstractCanvasHandler<D extends Diagram,C extends AbstractCanvas>protected 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)
protected void applyElementMutation(Shape shape, Element candidate, boolean applyPosition, boolean applyProperties, MutationContext mutationContext)
applyElementMutation in class AbstractCanvasHandler<D extends Diagram,C extends AbstractCanvas>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 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.protected boolean isCanvasRoot(String pUUID)
public void 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 parent, 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>parent - The parent graph element.child - The element to remove as a docked child from the parent.protected void handleParentChildZIndex(Element parent, Element child, Shape parentShape, Shape childShape, boolean add)
protected void handleZIndex(Element child, int zindex)
protected void handleZIndex(Shape shape, int zindex)
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 showError(ClientRuntimeError error)
public DefinitionManager getDefinitionManager()
AbstractCanvasHandlergetDefinitionManager in class AbstractCanvasHandler<D extends Diagram,C extends AbstractCanvas>public GraphUtils getGraphUtils()
public ShapeManager getShapeManager()
Copyright © 2001–2017 JBoss by Red Hat. All rights reserved.