Packagecom.yworks.resources
Classpublic class Cursor
InheritanceCursor Inheritance Object

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
  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():void
Removes the activated instance of this cursor.
Cursor
Property Detail
activatedproperty
activated:Boolean  [read-only]

Returns whether this cursor is activated, i.e. activate had been 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
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

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():void

Removes the activated instance of this cursor.