Packagecom.yworks.graph.drawing
Classpublic class SimpleNodeStyle
InheritanceSimpleNodeStyle Inheritance Object
Implements INodeStyle
Deprecated: Please Use SimpleAbstractNodeStyle

Very simple abstract node style whose renderer refers to the paint implemented in the style.

To use this style, one has to subclass SimpleNodeStyle and override the paint method. This style's renderer uses the node's layout rectangle for hit tests and to determine the bounds and edge intersection.



Public Properties
 PropertyDefined By
  styleRenderer : IStyleRenderer
[read-only] Gets the renderer implementation that has been supplied to this instance upon creation.
SimpleNodeStyle
Public Methods
 MethodDefined By
  
Creates a new instance
SimpleNodeStyle
  
clone():Object
Returns this instance.
SimpleNodeStyle
  
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.
SimpleNodeStyle
  
paint(g:YGraphics, ctx:IPaintContext, node:INode):void
This style's renderer delegates the rendering to this method.
SimpleNodeStyle
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
Constructor Detail
SimpleNodeStyle()Constructor
public function SimpleNodeStyle()

Creates a new instance

Method Detail
clone()method
public function clone():Object

Returns this instance.

If subclasses implement properties which should be set in the clone, too, this method has to be overridden.

Returns
Objectthis;
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.
paint()method 
public function paint(g:YGraphics, ctx:IPaintContext, node:INode):void

This style's renderer delegates the rendering to this method.

Subclasses have to override this method and implement their own paint method.

Parameters

g:YGraphics — The graphics to paint to.
 
ctx:IPaintContext — The paint context.
 
node:INode — The node to render.


Throws
IllegalOperationError — if not overridden.