| Package | com.yworks.canvas.input |
| Class | public class ConcurrencyController |
| Inheritance | ConcurrencyController flash.events.EventDispatcher |
IConcurrentInputMode
implementations.
Modes can request an InputMutex to disable other modes registered with this controller.
Releasing the mutex will reenable the other modes.
| Property | Defined by | ||
|---|---|---|---|
| currentOwner : IConcurrentInputMode
[read-only]
Gets the current owner of the input mutex or
null if no mode
currently owns the mutex. | ConcurrencyController | ||
| Method | Defined by | ||
|---|---|---|---|
|
canRequestMutex():Boolean
Determines if a mutex can be successfully requested currently.
| ConcurrencyController | ||
|
register(mode:IConcurrentInputMode):void
Registers the given mode with this controller.
| ConcurrencyController | ||
|
release(mutex:InputMutex):void
Releases the given mutex.
| ConcurrencyController | ||
|
Can be called to request an
InputMutex for the given mode. | ConcurrencyController | ||
|
unregister(mode:IConcurrentInputMode):void
Unregisters the given mode from this controller.
| ConcurrencyController | ||
| Method | Defined by | ||
|---|---|---|---|
|
onMutexReleased(oldOwner:IConcurrentInputMode):void
Callback method that will be triggered if a mode released the input mutex.
| ConcurrencyController | ||
|
onMutexRequested(newOwner:IConcurrentInputMode):void
Callback method that will be triggered if a mode requests the input mutex.
| ConcurrencyController | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
| Event that will be triggered if the mutex has been released. | ConcurrencyController | |||
| Event that will be triggered if the mutex has been successfully requested. | ConcurrencyController | |||
| currentOwner | property |
currentOwner:IConcurrentInputMode [read-only]
Gets the current owner of the input mutex or null if no mode
currently owns the mutex.
public function get currentOwner():IConcurrentInputMode
| canRequestMutex | () | method |
public function canRequestMutex():BooleanDetermines if a mutex can be successfully requested currently.
ReturnsBoolean — Whether requestMutex would currently succeed.
|
| onMutexReleased | () | method |
protected function onMutexReleased(oldOwner:IConcurrentInputMode):voidCallback method that will be triggered if a mode released the input mutex.
This will trigger the mutexReleased event.
ParametersoldOwner:IConcurrentInputMode — The old owner of the mutex.
|
| onMutexRequested | () | method |
protected function onMutexRequested(newOwner:IConcurrentInputMode):voidCallback method that will be triggered if a mode requests the input mutex.
This method will cancel and disable all other modes that
have been registered with this instance.
Finally, it triggers the mutexRequested event.
newOwner:IConcurrentInputMode — The new owner of the mutex.
|
| register | () | method |
public function register(mode:IConcurrentInputMode):voidRegisters the given mode with this controller.
This mode can now request the input mutex and will be disabled
once another mode acquires the mutex.
If another mode currently owns the mutex, this mode will be immediately
disabled.
This will automatically inject this instance into the mode using the
controller property.
mode:IConcurrentInputMode — The mode to register with this controller.
|
| release | () | method |
public function release(mutex:InputMutex):voidReleases the given mutex.
Modes should call this method when they have finished editing the contents exclusively. This will reenable those modes that had been disabled at the time the mutex was requested.
Parametersmutex:InputMutex — The mutex to release.
|
| requestMutex | () | method |
public function requestMutex(mode:IConcurrentInputMode):InputMutex
Can be called to request an InputMutex for the given mode.
Modes should call this method to request exclusive editing for a canvas control.
Parametersmode:IConcurrentInputMode — The mode that should be given the mutex
|
InputMutex —
The acquired mutex.
|
— If the mutex could not be obtained.
|
| unregister | () | method |
public function unregister(mode:IConcurrentInputMode):voidUnregisters the given mode from this controller.
This will reset the controller property
of the given mode to null.
mode:IConcurrentInputMode |
| mutexReleased | event |
com.yworks.canvas.input.MutexEvent
com.yworks.canvas.input.MutexEvent.MUTEX_RELEASED
Event that will be triggered if the mutex has been released.
| mutexRequested | event |
com.yworks.canvas.input.MutexEvent
com.yworks.canvas.input.MutexEvent.MUTEX_REQUESTED
Event that will be triggered if the mutex has been successfully requested.