public abstract class EdgeDecorationInstaller extends Object implements ISelectionIndicatorInstaller, IHighlightIndicatorInstaller, IFocusIndicatorInstaller
ICanvasObjectInstaller
interface that can decorate the visual appearence of an
IEdge
.
This will install an ICanvasObject
during
installation
, that will
render the path and the bends of an edge using a pen
for the path and a drawing
for the bends.
Constructor and Description |
---|
EdgeDecorationInstaller() |
Modifier and Type | Method and Description |
---|---|
ICanvasObject |
addCanvasObject(ICanvasContext context,
ICanvasObjectGroup group,
Object item)
Installs a rendering for the
item if it is an IEdge that will use the getBendDrawing(CanvasControl, IEdge)
and getPen(CanvasControl, IEdge) to render the path and bends. |
protected abstract IVisualTemplate |
getBendDrawing(CanvasControl canvas,
IEdge edge)
Callback method that retrieves the drawing of the bend for the context.
|
protected abstract String |
getDecoratorStyleClass(CanvasControl canvas,
IEdge edge)
Callback method that retrieves the style class for the context.
|
protected abstract Pen |
getPen(CanvasControl canvas,
IEdge edge)
Callback method that retrieves the pen for the context.
|
public final ICanvasObject addCanvasObject(ICanvasContext context, ICanvasObjectGroup group, Object item)
item
if it is an IEdge
that will use the getBendDrawing(CanvasControl, IEdge)
and getPen(CanvasControl, IEdge)
to render the path and bends.addCanvasObject
in interface ICanvasObjectInstaller
context
- The canvas context.group
- The ICanvasObjectGroup
to add the new canvas object to.item
- The item to install.protected abstract IVisualTemplate getBendDrawing(CanvasControl canvas, IEdge edge)
This implementation will use the EdgeSelectionIndicatorInstaller.BEND_TEMPLATE_KEY
resource to find a IVisualTemplate
instance. If null
is yielded, a default drawing will be used.
canvas
- The canvas for which the drawing shall be returned.edge
- The edge for which the rendering will be used.protected abstract String getDecoratorStyleClass(CanvasControl canvas, IEdge edge)
protected abstract Pen getPen(CanvasControl canvas, IEdge edge)
This implementation will use the EdgeSelectionIndicatorInstaller.PEN_KEY
resource to find
a Pen
instance. If null
is yielded, a default pen will be used.
edge
- The edge for which the rendering will be used.canvas
- The canvas for which the pen shall be returned.