| Package | com.yworks.graph.drawing |
| Class | public class TemplateStyle |
| Inheritance | TemplateStyle Object |
| Implements | ITemplateStyle |
| Subclasses | TemplateLabelStyle, TemplateNodeStyle |
| Property | Defined By | ||
|---|---|---|---|
| contextPropertyName : String [read-only]
The name of the property of the template class to write the context to. | TemplateStyle | ||
| dataPropertyName : String [read-only]
The name of the property of the template class to write the user data to. | TemplateStyle | ||
| hideSelectionPaintable : Boolean
Whether this style should return a void implementation when
it is queried for an ISelectionPaintable implementation. | TemplateStyle | ||
| styleRenderer : IStyleRenderer [read-only]
Gets the renderer implementation that has been supplied to
this instance upon creation. | TemplateStyle | ||
| styleTag : Object
A user tag which is associated with that style instance. | TemplateStyle | ||
| templateClass : Class [read-only]
The template class which is used to render the item. | TemplateStyle | ||
| userTagProvider : IUserTagProvider
The IUserTagProvider to retrieve user defined data
which is associated with the model item. | TemplateStyle | ||
| Method | Defined By | ||
|---|---|---|---|
TemplateStyle(templateClass:Class, styleRenderer:AbstractStyleRenderer, dataPropertyName:String = null, contextPropertyName:String = null, hideSelectionPaintable:Boolean = false)
Creates a new instance. | TemplateStyle | ||
clone():Object
Creates a clone of this instance. | TemplateStyle | ||
Prepares the rendering of an IModelItem in a CanvasComponent by
adding ICanvasObject's to the provided canvas. | TemplateStyle | ||
| Method | Defined By | ||
|---|---|---|---|
Creates a new instance of this. | TemplateStyle | ||
| contextPropertyName | property |
contextPropertyName:String [read-only] The name of the property of the template class to write the context to.
The default value is context.
public function get contextPropertyName():String| dataPropertyName | property |
dataPropertyName:String [read-only] The name of the property of the template class to write the user data to.
The default value is dataObject.
public function get dataPropertyName():String| hideSelectionPaintable | property |
hideSelectionPaintable:Boolean
Whether this style should return a void implementation when
it is queried for an ISelectionPaintable implementation.
If a template component implements it's own selection state visualization,
set this property to true, in order to hide the default selection paintable.
public function get hideSelectionPaintable():Boolean public function set hideSelectionPaintable(value:Boolean):voidSee also
| styleRenderer | property |
styleRenderer:IStyleRenderer [read-only] Gets the renderer implementation that has been supplied to this instance upon creation.
public function get styleRenderer():IStyleRenderer| styleTag | property |
styleTag:ObjectA user tag which is associated with that style instance.
An arbitrary user-defined object.
public function get styleTag():Object public function set styleTag(value:Object):void| templateClass | property |
templateClass:Class [read-only] The template class which is used to render the item.
public function get templateClass():Class| userTagProvider | property |
userTagProvider:IUserTagProvider
The IUserTagProvider to retrieve user defined data
which is associated with the model item.
public function get userTagProvider():IUserTagProvider public function set userTagProvider(value:IUserTagProvider):void| TemplateStyle | () | Constructor |
public function TemplateStyle(templateClass:Class, styleRenderer:AbstractStyleRenderer, dataPropertyName:String = null, contextPropertyName:String = null, hideSelectionPaintable:Boolean = false)Creates a new instance.
ParameterstemplateClass:Class — The template class. Must be a subclass of UIComponent.
| |
styleRenderer:AbstractStyleRenderer — The name of the property of the template class to set the user object to.
| |
dataPropertyName:String (default = null) — The name of the property of the template class to set the context to.
| |
contextPropertyName:String (default = null) — Whether to hide the ISelectionPaintable. If set to true,
no selection paintable will be drawn. In this case, the component itself has to take care of the
selection highlighting.
| |
hideSelectionPaintable:Boolean (default = false) — The style renderer to use with this style. If none is provided,
a new instance of TemplateNodeStyleRenderer will be created.
|
| clone | () | method |
public function clone():ObjectCreates a clone of this instance.
ReturnsObject — A clone of this instance.
|
| createClone | () | method |
protected function createClone():TemplateStyleCreates a new instance of this.
Subclasses have to override this to return a new instance of them.
ReturnsTemplateStyle |
| 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.
|
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.
|