Packagecom.yworks.canvas.input
Classpublic class MarqueeSelectionInputMode
InheritanceMarqueeSelectionInputMode Inheritance StateMachineInputMode Inheritance AbstractConcurrentInputMode Inheritance AbstractInputMode Inheritance flash.events.EventDispatcher

An IInputMode implementation that can handle marquee selections performed by the user with a mouse.

This implementation will request the InputMutex as soon as it recognizes a mouse drag.



Public Properties
 PropertyDefined By
 InheritedcanceledState : State
[read-only] Returns the canceled state of the state machine.
StateMachineInputMode
 Inheritedcanvas : CanvasComponent
[read-only] The canvas instance this mode is currently installed in or null
AbstractInputMode
  canvasGroupProvider : ICanvasGroupProvider
Gets or sets the canvas object group provider this mode should render the visual representations of the marquee in.
MarqueeSelectionInputMode
 Inheritedcontroller : ConcurrencyController
Gets or injects the ConcurrencyController for this instance.
AbstractConcurrentInputMode
  displayObjectCreator : IDisplayObjectCreator
[read-only] Gets the display object creator for display object representing the marquee selection.
MarqueeSelectionInputMode
  draggedRecognizer : Function
Gets or sets the "dragged" state recognizer.
MarqueeSelectionInputMode
 Inheritedenabled : Boolean
Gets or sets the enabled state of this input mode.
AbstractConcurrentInputMode
 InheritedinputModeContext : IInputModeContext
[read-only] The context instance this mode is currently installed in or null if this instance is not installed.
AbstractInputMode
 Inheritedinstalled : Boolean
[read-only] Whether this mode is currently installed, i.e if a call to the canvas property will yield a non-null result.
AbstractInputMode
 InheritedlastMouseEvent : CanvasMouseEvent
[read-only] Returns the last mouse event.
StateMachineInputMode
 InheritedpreferredCursor : Cursor
Gets or sets the cursor this mode would like to have displayed in the CanvasComponent.
AbstractConcurrentInputMode
  pressedRecognizer : Function
Gets or sets the "pressed" state recognizer.
MarqueeSelectionInputMode
  releasedRecognizer : Function
Gets or sets the "released" state recognizer.
MarqueeSelectionInputMode
 InheritedstartState : State
[read-only] Returns the start state of the state machine.
StateMachineInputMode
 InheritedstateMachine : StateMachine
[read-only] Gets the state machine.
StateMachineInputMode
 InheritedstoppedState : State
[read-only] Returns the stopped state of the state machine.
StateMachineInputMode
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
[read-only] An event recognizer for the state machine that is triggered if this mode has been stoppped.
StateMachineInputMode
Public Methods
 MethodDefined By
  
Constructor.
MarqueeSelectionInputMode
 Inherited
cancel():void
[override] Runs the machine using the cancel and reset events, releases the input mutex and returns.
StateMachineInputMode
 Inherited
dispose():void
Disposes this input mode.
AbstractInputMode
  
Returns a copy of the state of the current or last marquee selection rectangle.
MarqueeSelectionInputMode
 Inherited
Installs this mode into the canvas of the given context.
AbstractInputMode
 Inherited
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
 Inherited
stop():Boolean
[override] Runs the machine using a special stop event.
StateMachineInputMode
 Inherited
Uninstalls this mode from the canvas.
AbstractInputMode
Protected Methods
 MethodDefined By
  
Called by the state machine to begin the marquee selection when the mouse is dragged.
MarqueeSelectionInputMode
 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
  
Creates the IDisplayObjectCreator for the DisplayObject that renders the marquee selection box.
MarqueeSelectionInputMode
 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
  
Called by the state machine to drag the marquee selection.
MarqueeSelectionInputMode
  
Called by the state machine once the selection has been finished.
MarqueeSelectionInputMode
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
 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
[override] Called to initialize the state machine.
MarqueeSelectionInputMode
  
[override] Installs this mode into the given canvas.
MarqueeSelectionInputMode
 Inherited
Installs all necessary listeners to trigger the run method.
StateMachineInputMode
  
invalidate():void
[override] Convenience method for subclass implementations that invalidates the canvasComponent this mode is currently installed in.
MarqueeSelectionInputMode
 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
 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
 Inherited
StateMachineInputMode
  
Called when the marquee selection has been finished.
MarqueeSelectionInputMode
 Inherited
[override] Runs the state machine using a mutex obtained event.
StateMachineInputMode
 Inherited
[override] 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
  
Called by the state machine to prepare the marquee selection when the mouse is pressed.
MarqueeSelectionInputMode
 Inherited
Releases the mutex that is currently owned by this instance.
AbstractConcurrentInputMode
 Inherited
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
  
[override] Uninstalls this mode from the given canvas.
MarqueeSelectionInputMode
 Inherited
Uninstalls all listeners, this instance has installed on calling intallListeners()
StateMachineInputMode
Events
 Event Summary Defined By
 InheritedDispatched after the input mode was installed.AbstractInputMode
 InheritedDispatched before the input mode will be installed.AbstractInputMode
  Dispatched when the marquee selection has finished.MarqueeSelectionInputMode
 InheritedDispatched when the default cursor changed.AbstractConcurrentInputMode
 InheritedDispatched after the input mode was uninstalled.AbstractInputMode
 InheritedDispatched before the input mode will be uninstalled.AbstractInputMode
Public Constants
 ConstantDefined By
 InheritedINSTALLED : String = installed
[static]
AbstractInputMode
 InheritedINSTALLING : String = installing
[static]
AbstractInputMode
  MARQUEE_SELECTED : String = marqueeSelected
[static]
MarqueeSelectionInputMode
 InheritedPREFERRED_CURSOR_CHANGED : String = preferredCursorChanged
[static]
AbstractConcurrentInputMode
 InheritedUNINSTALLED : String = uninstalled
[static]
AbstractInputMode
 InheritedUNINSTALLING : String = uninstalling
[static]
AbstractInputMode
Property Detail
canvasGroupProviderproperty
canvasGroupProvider:ICanvasGroupProvider

Gets or sets the canvas object group provider this mode should render the visual representations of the marquee in.

The default is an instance of DefaultCanvasGroupProviders.createTopGroupProvider().


Implementation
    public function get canvasGroupProvider():ICanvasGroupProvider
    public function set canvasGroupProvider(value:ICanvasGroupProvider):void
displayObjectCreatorproperty 
displayObjectCreator:IDisplayObjectCreator  [read-only]

Gets the display object creator for display object representing the marquee selection.


Implementation
    public function get displayObjectCreator():IDisplayObjectCreator
draggedRecognizerproperty 
draggedRecognizer:Function

Gets or sets the "dragged" state recognizer.

This recognizer instance determines when the user is dragging the marquee.


Implementation
    public function get draggedRecognizer():Function
    public function set draggedRecognizer(value:Function):void
pressedRecognizerproperty 
pressedRecognizer:Function

Gets or sets the "pressed" state recognizer.

This recognizer instance will be used to determine when the user begins to draw the marquee.


Implementation
    public function get pressedRecognizer():Function
    public function set pressedRecognizer(value:Function):void
releasedRecognizerproperty 
releasedRecognizer:Function

Gets or sets the "released" state recognizer.

This instance determines when the user has finished creating the marquee.


Implementation
    public function get releasedRecognizer():Function
    public function set releasedRecognizer(value:Function):void
Constructor Detail
MarqueeSelectionInputMode()Constructor
public function MarqueeSelectionInputMode()

Constructor.

Method Detail
begin()method
protected function begin(evt:TransitionEvent):void

Called by the state machine to begin the marquee selection when the mouse is dragged.

Parameters

evt:TransitionEvent

createDisplayObjectCreator()method 
protected function createDisplayObjectCreator(p1:IPoint, p2:IPoint):IDisplayObjectCreator

Creates the IDisplayObjectCreator for the DisplayObject that renders the marquee selection box.

Parameters

p1:IPoint — A live point implementation that will always point to the initial point where the user started the marquee selection.
 
p2:IPoint — A live point implementation that will always point to the current location of the mouse when the user drags the marquee.

Returns
IDisplayObjectCreator — An implementation that renders the marquee selection box.
drag()method 
protected function drag(evt:TransitionEvent):void

Called by the state machine to drag the marquee selection.

Parameters

evt:TransitionEvent

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

Called by the state machine once the selection has been finished.

Parameters

evt:TransitionEvent

getSelectionRectangle()method 
public function getSelectionRectangle():IRectangle

Returns a copy of the state of the current or last marquee selection rectangle.

Returns
IRectangle — A copy of the state of the marquee box.
initializeStateMachine()method 
override protected 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.

installCore()method 
override protected function installCore(context:IInputModeContext):void

Installs this mode into the given canvas.

Installation usually means registering some event listeners on the canvasComponent or on canvasComponent.root.

Parameters

context:IInputModeContext — The context containing the graph canvas that this instance shall be installed into

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

Convenience method for subclass implementations that invalidates the canvasComponent this mode is currently installed in.

onMarqueeSelected()method 
protected function onMarqueeSelected():void

Called when the marquee selection has been finished.

prepare()method 
protected function prepare(evt:TransitionEvent):void

Called by the state machine to prepare the marquee selection when the mouse is pressed.

Parameters

evt:TransitionEvent — The transition event

uninstallCore()method 
override protected function uninstallCore(context:IInputModeContext):void

Uninstalls this mode from the given canvas. This code should clean up all changes made to the canvas in the install method. After a mode has been uninstalled it can be installed again into the same or another canvas.

Parameters

context:IInputModeContext — The context containing the canvas to deregister from

Event Detail
marqueeSelected Event
Event Object Type: flash.events.Event
Event.type property = com.yworks.canvas.input.MarqueeSelectionInputMode.MARQUEE_SELECTED

Dispatched when the marquee selection has finished.

Constant Detail
MARQUEE_SELECTEDConstant
public static const MARQUEE_SELECTED:String = marqueeSelected