Packagecom.yworks.graph.drawing
Classpublic class TemplateNodeStyle
InheritanceTemplateNodeStyle Inheritance TemplateStyle Inheritance Object
Implements INodeStyle

A node style that uses a template class to define the visual appearance of the node.

The template class is aware of the current context.

Note that this style can not be used with the CollapsibleNodeStyle. Instead, to add expand/collapse functionality for group nodes, a button should be added directly to the templateClass. This makes it easy to customize the visual appearance of the expand/collapse button.



Public Properties
 PropertyDefined By
 InheritedcontextPropertyName : String
[read-only] The name of the property of the template class to write the context to.
TemplateStyle
 InheriteddataPropertyName : String
[read-only] The name of the property of the template class to write the user data to.
TemplateStyle
 InheritedhideSelectionPaintable : Boolean
Whether this style should return a void implementation when it is queried for an ISelectionPaintable implementation.
TemplateStyle
 InheritedstyleRenderer : IStyleRenderer
[read-only] Gets the renderer implementation that has been supplied to this instance upon creation.
TemplateStyle
 InheritedstyleTag : Object
A user tag which is associated with that style instance.
TemplateStyle
 InheritedtemplateClass : Class
[read-only] The template class which is used to render the item.
TemplateStyle
 InheriteduserTagProvider : IUserTagProvider
The IUserTagProvider to retrieve user defined data which is associated with the model item.
TemplateStyle
Public Methods
 MethodDefined By
  
TemplateNodeStyle(templateClass:Class, dataPropertyName:String = dataObject, contextPropertyName:String = context, hideSelectionPaintable:Boolean = false, styleRenderer:TemplateNodeStyleRenderer = null)
Creates a new instance.
TemplateNodeStyle
 Inherited
clone():Object
Creates a clone of this instance.
TemplateStyle
 Inherited
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.
TemplateStyle
Protected Methods
 MethodDefined By
  
[override] Creates a new instance of this.
TemplateNodeStyle
Constructor Detail
TemplateNodeStyle()Constructor
public function TemplateNodeStyle(templateClass:Class, dataPropertyName:String = dataObject, contextPropertyName:String = context, hideSelectionPaintable:Boolean = false, styleRenderer:TemplateNodeStyleRenderer = null)

Creates a new instance.

Parameters
templateClass:Class — The template class. Must be a subclass of UIComponent.
 
dataPropertyName:String (default = dataObject) — The name of the property of the template class to set the user object to.
 
contextPropertyName:String (default = context) — The name of the property of the template class to set the context to.
 
hideSelectionPaintable:Boolean (default = false) — Whether to hide the selection paintable. If set to true, no selection paintable will be drawn. In this case, the component itself has to take care of the selection highlighting.
 
styleRenderer:TemplateNodeStyleRenderer (default = null) — The style renderer to use with this style. If none is provided, a new instance of TemplateNodeStyleRenderer will be created.
Method Detail
createClone()method
override protected function createClone():TemplateStyle

Creates a new instance of this.

Subclasses have to override this to return a new instance of them.

Returns
TemplateStyle