Packagecom.yworks.canvas.input
Classpublic class ClickInputMode
InheritanceClickInputMode Inheritance StateMachineInputMode Inheritance AbstractConcurrentInputMode Inheritance AbstractInputMode Inheritance flash.events.EventDispatcher

An input mode that recognizes mouse clicks.

Clients add listeners for the clicked event to get notified of mouse clicks.

If the doubleClick property is set to true, this input mode will handle double clicks instead of single clicks.



Public Properties
 PropertyDefined by
 InheritedcanceledState : State
Returns the canceled state of the state machine.
StateMachineInputMode
 Inheritedcanvas : CanvasComponent
The canvas instance this mode is currently installed in or null
AbstractInputMode
  clickPoint : IPoint
[read-only] The point, on whose coordinates the last click happened.
ClickInputMode
 Inheritedcontroller : ConcurrencyController
Gets or injects the ConcurrencyController for this instance.
AbstractConcurrentInputMode
  doubleClick : Boolean
Determines whether this input mode handles single (false) or double (true) mouse clicks.
ClickInputMode
 Inheritedenabled : Boolean
Gets or sets the enabled state of this input mode.
AbstractConcurrentInputMode
 InheritedinputModeContext : IInputModeContext
The context instance this mode is currently installed in or null if this instance is not installed.
AbstractInputMode
 Inheritedinstalled : Boolean
Whether this mode is currently installed, i.e.
AbstractInputMode
 InheritedlastMouseEvent : CanvasMouseEvent
Returns the last mouse event.
StateMachineInputMode
 InheritedpreferredCursor : Cursor
Gets or sets the cursor this mode would like to have displayed in the CanvasComponent.
AbstractConcurrentInputMode
 InheritedstartState : State
Returns the start state of the state machine.
StateMachineInputMode
 InheritedstateMachine : StateMachine
Gets the state machine.
StateMachineInputMode
 InheritedstoppedState : State
Returns the stopped state of the state machine.
StateMachineInputMode
  swallowFocusClick : Boolean
Gets or sets a property that determines whether clicks should be swallowed if they happen within a short amount of time after the CanvasComponent got focus.
ClickInputMode
Protected Properties
 PropertyDefined by
 Inherited_lastEvent : Event
The last Event that has been delivered to this instance.
StateMachineInputMode
 Inherited_lastMouseEvent : CanvasMouseEvent
The last MouseEvent that has been delivered to this instance.
StateMachineInputMode
 InheritedstopEventRecognizer : Function
An event recognizer for the state machine that is triggered if this mode has been stoppped.
StateMachineInputMode
Public Methods
 MethodDefined by
  
Standard constructor.
ClickInputMode
  
cancel():void
Runs the machine using the cancel and reset events, releases the input mutex and returns.
ClickInputMode
 Inherited
dispose():void
Disposes this input mode.
AbstractInputMode
 Inherited
install(context:IInputModeContext):void
Installs this mode into the given canvas.
StateMachineInputMode
 Inherited
resetMachine():void
Runs the machine using a special reset event.
StateMachineInputMode
 Inherited
run(evt:Event):void
Tries to run the virtual machine using the pair of source and event argument to determine which transition to take.
StateMachineInputMode
  
stop():Boolean
Runs the machine using a special stop event.
ClickInputMode
 Inherited
Uninstalls this mode from the canvas.
StateMachineInputMode
Protected Methods
 MethodDefined by
  
ClickInputMode
 Inherited
canRequestMutex():Boolean
Determines whether this instance can request the InputMutex.
AbstractConcurrentInputMode
 Inherited
Factory method that creates a canceled State for the given machine.
StateMachineInputMode
  
Create the context for the next ClickEvent.
ClickInputMode
  
Creates the event recognizer that is used to recognize the clicks for this instance.
ClickInputMode
  
Creates the event recognizer that is used to recognize the press event for this instance.
ClickInputMode
  
Creates the event recognizer that is used to recognize the release event for this instance.
ClickInputMode
 Inherited
Factory method that creates a start State for the given machine.
StateMachineInputMode
 Inherited
Factory method that creates the state machine.
StateMachineInputMode
 Inherited
Factory method that creates a stopped State for the given machine.
StateMachineInputMode
  
ClickInputMode
 Inherited
hasMutex():Boolean
Determines whether this instance owns the input mutex.
AbstractConcurrentInputMode
 Inherited
initialize():void
Performs one-time initialization of this instance.
AbstractInputMode
  
initializeStateMachine(machine:StateMachine, startState:State, canceledState:State, stoppedState:State, finishedState:State):void
Called to initialize the state machine.
ClickInputMode
  
Installs all necessary listeners to trigger the run method.
ClickInputMode
 Inherited
invalidate():void
Convenience method for subclass implementations that invalidates the canvasComponent this mode is currently installed in.
AbstractInputMode
 Inherited
isCancelEvent(evt:Event):Boolean
Method that identifies an event as a cancel event.
StateMachineInputMode
 Inherited
isDisabledEvent(evt:Event):Boolean
Method that identifies an event as a disabled event.
StateMachineInputMode
 Inherited
isEnabledEvent(evt:Event):Boolean
Method that identifies an event as an enabled event.
StateMachineInputMode
 Inherited
isMutexAquiredEvent(evt:Event):Boolean
Method that identifies an event as a mutexAquired event.
StateMachineInputMode
 Inherited
isMutexLostEvent(evt:Event):Boolean
Method that identifies an event as a mutexLost event.
StateMachineInputMode
 Inherited
isStopEvent(evt:Event):Boolean
Method that identifies an event as a stop event.
StateMachineInputMode
 Inherited
Called when the cancel state has been entered.
StateMachineInputMode
  
onClicked():void
ClickInputMode
 Inherited
onDisable():void
Runs the state machine using a disable event.
StateMachineInputMode
 Inherited
onDisabled():void
Called when the enabled property changes to false.
AbstractConcurrentInputMode
 Inherited
onEnable():void
Runs the state machine using a enable event.
StateMachineInputMode
 Inherited
onEnabled():void
Called when the enabled property changes to true.
AbstractConcurrentInputMode
  
ClickInputMode
 Inherited
Runs the state machine using a mutex obtained event.
StateMachineInputMode
 Inherited
Runs the state machine using a mutex lost event.
StateMachineInputMode
 Inherited
onPreferredCursorChanged(oldValue:Cursor, newValue:Cursor):void
Called when the preferredCursor property changes.
AbstractConcurrentInputMode
 Inherited
onRun(evt:Event):void
Callback method that will be called after the state machine has been run using the arguments provided.
StateMachineInputMode
 Inherited
Called when the cancel state has been entered.
StateMachineInputMode
 Inherited
releaseMutex():void
Releases the mutex that is currently owned by this instance.
AbstractConcurrentInputMode
 Inherited
requestMutex():void
Requests the InputMutex from the current controller.
AbstractConcurrentInputMode
 Inherited
StateMachineInputMode
 Inherited
setPreferredCursorTransition(cursorClass:Class):Function
Factory method that can be used to obtain an listener implementation that sets the given preferredCursor.
StateMachineInputMode
 Inherited
Factory method that can be used to obtain a listener implementation that resets the preferredCursor.
StateMachineInputMode
  
Uninstalls all listeners, this instance has installed on calling intallListeners()
ClickInputMode
Events
 EventSummaryDefined by
   Dispatched when the mouse has been clicked.ClickInputMode
 Inherited Dispatched when the default cursor changed.AbstractConcurrentInputMode
Public Constants
 ConstantDefined by
 InheritedPREFERRED_CURSOR_CHANGED : String = "preferredCursorChanged"
[static]
AbstractConcurrentInputMode
Property detail
clickPointproperty
clickPoint:IPoint  [read-only]

The point, on whose coordinates the last click happened.

This property may return null, if no mouse click was performed since initialization.

Implementation
    public function get clickPoint():IPoint
doubleClickproperty 
doubleClick:Boolean  [read-write]

Determines whether this input mode handles single (false) or double (true) mouse clicks.

Implementation
    public function get doubleClick():Boolean
    public function set doubleClick(value:Boolean):void
swallowFocusClickproperty 
swallowFocusClick:Boolean  [read-write]

Gets or sets a property that determines whether clicks should be swallowed if they happen within a short amount of time after the CanvasComponent got focus.

If set to true clicks are discarded within 100 ms after the focus entered.

The default value is true.

Implementation
    public function get swallowFocusClick():Boolean
    public function set swallowFocusClick(value:Boolean):void
Constructor detail
ClickInputMode()constructor
public function ClickInputMode()

Standard constructor.

Method detail
begin()method
protected function begin(t:TransitionEvent):void

Parameters
t:TransitionEvent
cancel()method 
public override function cancel():void

Runs the machine using the cancel and reset events, releases the input mutex and returns.

createClickInputModeContext()method 
protected function createClickInputModeContext():IInputModeContext

Create the context for the next ClickEvent.

Returns
IInputModeContext
createClickRecognizer()method 
protected function createClickRecognizer():Function

Creates the event recognizer that is used to recognize the clicks for this instance.

An event recognizer is a function that takes an event object as its only argument and returns a boolean that indicates whether the event was recognized.

Returns
Function

See also

createPressRecognizer()method 
protected function createPressRecognizer():Function

Creates the event recognizer that is used to recognize the press event for this instance.

An event recognizer is a function that takes an event object as its only argument and returns a boolean that indicates whether the event was recognized.

Returns
Function

See also

createReleaseRecognizer()method 
protected function createReleaseRecognizer():Function

Creates the event recognizer that is used to recognize the release event for this instance.

An event recognizer is a function that takes an event object as its only argument and returns a boolean that indicates whether the event was recognized.

Returns
Function

See also

end()method 
protected function end(t:TransitionEvent):void

Parameters
t:TransitionEvent
initializeStateMachine()method 
protected override function initializeStateMachine(machine:StateMachine, startState:State, canceledState:State, stoppedState:State, finishedState:State):void

Called to initialize the state machine.

This implementation does nothing.

Parameters
machine:StateMachine — The machine to initialize and configure
 
startState:State — The start state to use.
 
canceledState:State — The canceled state to use.
 
stoppedState:State — The stopped state to use.
 
finishedState:State — The finished state to use.
installListeners()method 
protected override function installListeners():void

Installs all necessary listeners to trigger the run method.

This implementation registers for all mouse events and keyboard events.

onClicked()method 
protected function onClicked():void

onMachineReset()method 
protected override function onMachineReset():void

stop()method 
public override function stop():Boolean

Runs the machine using a special stop event.

If the machine arrives at the startState, this method will release the input mutex and return true.

Returns
Booleantrue if the machine arrived at the start state and stopped.
uninstallListeners()method 
protected override function uninstallListeners():void

Uninstalls all listeners, this instance has installed on calling intallListeners()

Event detail
clickevent 
Event object type: com.yworks.canvas.input.ClickEvent
ClickEvent.type property = com.yworks.canvas.input.ClickEvent.CLICK

Dispatched when the mouse has been clicked.