| Package | com.yworks.graph.drawing |
| Class | public class ImageNodeStyle |
| Inheritance | ImageNodeStyle flash.events.EventDispatcher |
| Implements | INodeStyle |
If an url is passed, this style will delegate the painting to its fallbackStyle
until the image is completely loaded. The default fallback style is a ShapeNodeStyle instance.
yFiles.NET users should note that this style does not correspond to the yFiles.NET
ImageNodeStyle. Instead, the BitmapNodeStyle is (de)serialized
to/from the yFiles.NET ImageNodeStyle.
See also
| Property | Defined by | ||
|---|---|---|---|
| fallbackStyle : INodeStyle
The fallback style that is painted until an image
located at a given url is completely loaded.
| ImageNodeStyle | ||
| image : DisplayObject | ImageNodeStyle | ||
| imageClass : Class [write-only]
Set the image class that can be used as a factory to create
copies of the image that is to be painted by this style.
| ImageNodeStyle | ||
| imageClassName : String [read-only]
The name of the image class, if available
| ImageNodeStyle | ||
| loaded : Boolean [read-only]
Whether the image associated with this style is completely loaded.
| ImageNodeStyle | ||
| styleRenderer : IStyleRenderer
[read-only]
Gets the renderer implementation that has been supplied to
this instance upon creation.
| ImageNodeStyle | ||
| url : String
The URL this image is to be loaded from.
| ImageNodeStyle | ||
| Method | Defined by | ||
|---|---|---|---|
|
ImageNodeStyle(image:Object = null, styleRenderer:ImageNodeStyleRenderer = null)
Creates a new instance.
| ImageNodeStyle | ||
|
clone():Object
Creates a clone of this instance.
| ImageNodeStyle | ||
|
Prepares the rendering of an
IModelItem in a CanvasComponent by
adding ICanvasObject's to the provided canvas. | ImageNodeStyle | ||
| Method | Defined by | ||
|---|---|---|---|
|
Callback that creates the cloned instance for the clone() method.
| ImageNodeStyle | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
| Dispatched when the Image (loaded from an URL) is loaded. | ImageNodeStyle | |||
| fallbackStyle | property |
fallbackStyle:INodeStyle [read-write]The fallback style that is painted until an image located at a given url is completely loaded.
If the fallback style is null, nothing is painted while
loading the image.
public function get fallbackStyle():INodeStyle
public function set fallbackStyle(value:INodeStyle):void
| image | property |
image:DisplayObject [read-write]Implementation
public function get image():DisplayObject
public function set image(value:DisplayObject):void
| imageClass | property |
imageClass:Class [write-only]Set the image class that can be used as a factory to create copies of the image that is to be painted by this style.
Implementation public function set imageClass(value:Class):void
| imageClassName | property |
imageClassName:String [read-only]The name of the image class, if available
Implementation public function get imageClassName():String
| loaded | property |
loaded:Boolean [read-only]Whether the image associated with this style is completely loaded.
Implementation public function get loaded():Boolean
| styleRenderer | property |
styleRenderer:IStyleRenderer [read-only]Gets the renderer implementation that has been supplied to this instance upon creation.
Implementation public function get styleRenderer():IStyleRenderer
| url | property |
url:String [read-write]The URL this image is to be loaded from.
Setting an image url causes this style to load the image from the given url.
While the image is being loaded, this style will delegate the painting to its
fallbackStyle. If the fallbackStyle is null,
nothing is painted while loading.
public function get url():String
public function set url(value:String):void
| ImageNodeStyle | () | constructor |
public function ImageNodeStyle(image:Object = null, styleRenderer:ImageNodeStyleRenderer = null)Creates a new instance.
Parametersimage:Object (default = null) — the image to be used for the associated node.
The following types are allowed to specify the image that will be displayed be the style:
If a DisplayObject instance is passed that does not extend SpriteAsset or BitmapAsset and that does not implement ICloneable, the style instance can not be shared and printing may not work properly.
If a |
|
styleRenderer:ImageNodeStyleRenderer (default = null) |
| clone | () | method |
public function clone():ObjectCreates a clone of this instance.
ReturnsObject — A clone of this instance.
|
| createClone | () | method |
protected function createClone():ImageNodeStyleCallback that creates the cloned instance for the clone() method.
ReturnsImageNodeStyle |
| 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.
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.
|
| complete | event |