Packagecom.yworks.canvas.drawing
Interfacepublic interface IVisualStyle extends ICloneable
Implementors AbstractStyle, AbstractVoidStyle

The generic base interface used by visual styles implementations.

Visual styles are responsible for rendering IModelItem instances in a CanvasComponent. It is up to the implementation to interpret the visual appearance of an item. This interface extends the ICloneable interface. This allows clients to obtain a persistent copy of the current state of this style. Immutable style implementations may return themselves.



Public Properties
 PropertyDefined By
  styleRenderer : IStyleRenderer
[read-only] Gets the renderer implementation that has been supplied to this instance upon creation.
IVisualStyle
Public Methods
 MethodDefined By
 Inherited
clone():Object
Creates a clone of this instance.
ICloneable
  
install(canvas:CanvasComponent, group:ICanvasObjectGroup, modelItem:IModelItem):Array
Prepares the rendering of an IModelItem in a CanvasComponent by adding ICanvasObject's to the provided canvas.
IVisualStyle
Property Detail
styleRendererproperty
styleRenderer:IStyleRenderer  [read-only]

Gets the renderer implementation that has been supplied to this instance upon creation.


Implementation
    public function get styleRenderer():IStyleRenderer
Method Detail
install()method
public function install(canvas:CanvasComponent, group:ICanvasObjectGroup, modelItem:IModelItem):Array

Prepares the rendering of an IModelItem in a CanvasComponent by adding ICanvasObject's to the provided canvas.

Implementations may add zero or more ICanvasObject instances to the given CanvasComponent. The group parameter can be used as a hint for implementations. They can add their newly created canvas objects to the given group. However they are not obliged to do that.

Parameters

canvas:CanvasComponent — The canvas to install the canvas objects in.
 
group:ICanvasObjectGroup — A hint that tells the implementation where to add the canvas objects.
 
modelItem:IModelItem — The item to install a visual representation for.

Returns
Array — An array of zero or more canvas objects that have been installed in the canvas by this method or null if nothing was installed.