Packagecom.yworks.resources
Classpublic class Cursor

Encapsulates a cursor icon and allows activation and deactivation of cursor icons.



Public Properties
 PropertyDefined by
  activated : Boolean
[read-only] Returns whether this cursor is activated, i.e.
Cursor
  iconClass : Class
[read-only] Returns the class object that represents the icon image.
Cursor
  ids : Array
[read-only] Returns the array of ids assigned to active instances of this cursor.
Cursor
  offsetX : Number
[read-only] Returns the x offset of the click point of a cursor image relative to its center.
Cursor
  offsetY : Number
[read-only] Returns the y offset of the click point of a cursor image relative to its center
Cursor
  priority : int
Gets or sets the priority that determines which cursor is shown when multiple cursors are active.
Cursor
Public Methods
 MethodDefined by
  
Cursor(iconClass:Class, offsetX:Number = 0, offsetY:Number = 0, priority:int = 2)
Creates a cursor instance.
Cursor
  
activate():void
Activates this cursor using CursorManager.setCursor.
Cursor
  
deactivate(allInstances:Boolean = true):void
Removes the last activated or all activated instances of this cursor.
Cursor
Property detail
activatedproperty
activated:Boolean  [read-only]

Returns whether this cursor is activated, i.e. activate was called more often than deactivate(false) or activate was called at least once after deactivate(true) was called.

Implementation
    public function get activated():Boolean
iconClassproperty 
iconClass:Class  [read-only]

Returns the class object that represents the icon image.

Implementation
    public function get iconClass():Class
idsproperty 
ids:Array  [read-only]

Returns the array of ids assigned to active instances of this cursor. These ids are the ids returned by CursorManager.setCursor.

Implementation
    public function get ids():Array
offsetXproperty 
offsetX:Number  [read-only]

Returns the x offset of the click point of a cursor image relative to its center.

Implementation
    public function get offsetX():Number
offsetYproperty 
offsetY:Number  [read-only]

Returns the y offset of the click point of a cursor image relative to its center

Implementation
    public function get offsetY():Number
priorityproperty 
priority:int  [read-write]

Gets or sets the priority that determines which cursor is shown when multiple cursors are active.

Implementation
    public function get priority():int
    public function set priority(value:int):void
Constructor detail
Cursor()constructor
public function Cursor(iconClass:Class, offsetX:Number = 0, offsetY:Number = 0, priority:int = 2)

Creates a cursor instance.

Parameters
iconClass:Class — The class object that represents the image icon of this cursor.
 
offsetX:Number (default = 0) — The relative offset of the click point of this cursor in x direction.
 
offsetY:Number (default = 0) — The relative offset of the click point of this cursor in y direction.
 
priority:int (default = 2) — The priority that determines which cursor is shown when multiple cursors are active.
Method detail
activate()method
public function activate():void

Activates this cursor using CursorManager.setCursor. Note that if iconClass is null, CursorManager.removeAllCursors() will be called.

deactivate()method 
public function deactivate(allInstances:Boolean = true):void

Removes the last activated or all activated instances of this cursor.

Parameters
allInstances:Boolean (default = true) — whether all instances (true) or just the last activated instance (false) should be removed.