| Package | com.yworks.graph.drawing |
| Class | public class TemplateNodeStyle |
| Inheritance | TemplateNodeStyle TemplateStyle Object |
| Implements | INodeStyle |
The template class is aware of the current context.
If a TemplateNodeStyle component uses a resource that is loaded asynchronously,
printing and image export might not work as expected, because the printing/image export
might be executed before the component is ready. Therefore, component implementations
can provide a "complete" property that reflects whether the component can be considered
completely rendered.
If this property exists and the value of the property is false,
the component is expected to dispatch a complete event (a flash.events.Event
of type flash.events.Event.COMPLETE) when the component is ready for export/printing.
| Method | Defined By | ||
|---|---|---|---|
TemplateNodeStyle(templateClass:Class, dataPropertyName:String = dataObject, contextPropertyName:String = context, hideSelectionPaintable:Boolean = false, styleRenderer:TemplateNodeStyleRenderer = null)
Creates a new instance. | TemplateNodeStyle | ||
![]() | 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 | ||
|---|---|---|---|
[override]
Creates a new instance of this. | TemplateNodeStyle | ||
| TemplateNodeStyle | () | Constructor |
public function TemplateNodeStyle(templateClass:Class, dataPropertyName:String = dataObject, contextPropertyName:String = context, hideSelectionPaintable:Boolean = false, styleRenderer:TemplateNodeStyleRenderer = null)Creates a new instance.
ParameterstemplateClass: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 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.
| |
styleRenderer:TemplateNodeStyleRenderer (default = null) — The style renderer to use with this style. If none is provided,
a new instance of TemplateNodeStyleRenderer will be created.
|
| createClone | () | method |
override protected function createClone():TemplateStyleCreates a new instance of this.
Subclasses have to override this to return a new instance of them.
ReturnsTemplateStyle |
<fx:Script><![CDATA[
public var complete:Boolean = false;
private function setComplete():void {
complete = true;
dispatchEvent(new Event(Event.COMPLETE));
}
]]></fx:Script>
<s:VGroup width="100%" height="100%">
<mx:Image source="http://www.yworks.com/img/yfiles_web/yfilesflex-orgchart.png" complete="setComplete()"/>
</s:VGroup>
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.