Package | com.yworks.graph.drawing |
Class | public class ImageNodeStyle |
Inheritance | ImageNodeStyle flash.events.EventDispatcher |
Implements | INodeStyle |
This style supports the vector-based FXG, SVG, and SWF formats, as well as GIF, JPEG and PNG bitmap images.
The following types are supported to specify the image that will be displayed be the style:
SpriteVisualElement
(embedded scalable image: FXG)SpriteAsset
(embedded scalable image: SVG or SWF)MovieClipLoaderAsset
(embedded movie clip: SWF)BitmapAsset
(embedded bitmap image)Class
(embedded scalable or bitmap image, or FXG Class)String
(url to an image file that will be loaded at runtime)BitmapData
DisplayObject
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
Get or set the image display object that is used for the associated node. | ImageNodeStyle | ||
imageClass : Class
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 data (loaded from an URL or embedded SWF) is loaded. | ImageNodeStyle |
fallbackStyle | property |
fallbackStyle:INodeStyle
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
Get or set the image display object that is used for the associated node.
public function get image():DisplayObject
public function set image(value:DisplayObject):void
imageClass | property |
imageClass:Class
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.
public function get imageClass():Class
public function set imageClass(value:Class):void
imageClassName | property |
imageClassName:String
[read-only] The name of the image class, if available
public function get imageClassName():String
loaded | property |
loaded:Boolean
[read-only] Whether the image associated with this style is completely loaded.
public function get loaded():Boolean
styleRenderer | property |
styleRenderer:IStyleRenderer
[read-only] Gets the renderer implementation that has been supplied to this instance upon creation.
public function get styleRenderer():IStyleRenderer
url | property |
url:String
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, SpriteVisualElement 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():Object
Creates a clone of this instance.
ReturnsObject — A clone of this instance.
|
createClone | () | method |
protected function createClone():ImageNodeStyle
Callback 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.
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.
|
complete | Event |
flash.events.Event
flash.events.Event.COMPLETE
Dispatched when the Image data (loaded from an URL or embedded SWF) is loaded.