Package | com.yworks.graph.drawing |
Class | public class ImageIcon |
Inheritance | ImageIcon Object |
Implements | IIcon |
IIcon
interface that paints an image.
Property | Defined By | ||
---|---|---|---|
className : String [read-only]
The name of the image class
| ImageIcon | ||
height : Number
The height of the icon. | ImageIcon | ||
image : DisplayObject [read-only]
The displayed image. | ImageIcon | ||
loaded : Boolean [read-only]
Whether the image associated with this style is completely loaded. | ImageIcon | ||
url : String
The URL this image is to be loaded from. | ImageIcon | ||
width : Number
The width of the icon. | ImageIcon |
Method | Defined By | ||
---|---|---|---|
ImageIcon(image:Object, width:Number = -1, height:Number = -1)
Creates a new Icon with the given image. | ImageIcon | ||
createDisplayObject(context:IDisplayObjectContext):DisplayObject
Creates a new DisplayObject from scratch. | ImageIcon | ||
updateDisplayObject(oldDisplayObject:DisplayObject, context:IDisplayObjectContext):DisplayObject
Updates the given DisplayObject or creates a new one. | ImageIcon |
Method | Defined By | ||
---|---|---|---|
setImageTransform(theImage:DisplayObject):void | ImageIcon |
className | property |
className:String
[read-only] The name of the image class
public function get className():String
height | property |
height:Number
The height of the icon.
public function get height():Number
public function set height(value:Number):void
image | property |
image:DisplayObject
[read-only] The displayed image.
public function get image():DisplayObject
loaded | property |
loaded:Boolean
[read-only] Whether the image associated with this style is completely loaded.
public function get loaded():Boolean
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.
public function get url():String
public function set url(value:String):void
width | property |
width:Number
The width of the icon.
public function get width():Number
public function set width(value:Number):void
ImageIcon | () | Constructor |
public function ImageIcon(image:Object, width:Number = -1, height:Number = -1)
Creates a new Icon with the given image.
Parametersimage:Object — An object which specifies an image.
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 | |
width:Number (default = -1 )
| |
height:Number (default = -1 )
|
createDisplayObject | () | method |
public function createDisplayObject(context:IDisplayObjectContext):DisplayObject
Creates a new DisplayObject
from scratch.
Parameters
context:IDisplayObjectContext — The context for which the display object is created.
|
DisplayObject — A DisplayObject .
|
setImageTransform | () | method |
protected function setImageTransform(theImage:DisplayObject):void
Parameters
theImage:DisplayObject |
updateDisplayObject | () | method |
public function updateDisplayObject(oldDisplayObject:DisplayObject, context:IDisplayObjectContext):DisplayObject
Updates the given DisplayObject
or creates a new one.
Implementors can decide whether they update the given display object or create a new one. Updating can mean re-rendering or updating size and/or coordinates.
Parameters
oldDisplayObject:DisplayObject — The display object to update.
| |
context:IDisplayObjectContext — The context for which the display object should be updated.
|
DisplayObject — The updated display object or a completely new display object.
|