| Package | com.yworks.graph.input |
| Class | public class StripeDropInputMode |
| Inheritance | StripeDropInputMode DropInputMode AbstractConcurrentInputMode AbstractInputMode flash.events.EventDispatcher |
DropInputMode specialized to drag 'n' drop of IStripes.
A dragged IStripe is optionally visualized during the drag operation.
See also
| Property | Defined By | ||
|---|---|---|---|
![]() | canvas : CanvasComponent [read-only]
The canvas instance this mode is currently installed in or null
| AbstractInputMode | |
![]() | controller : ConcurrencyController
Gets or injects the ConcurrencyController for this instance. | AbstractConcurrentInputMode | |
![]() | dropData : Object [read-only]
Gets the data carried by a drag operation. | DropInputMode | |
![]() | dropLocation : IPoint [read-only]
Gets the mouse position after dropping an item. | DropInputMode | |
![]() | enabled : Boolean
Gets or sets the enabled state of this input mode. | AbstractConcurrentInputMode | |
![]() | inputModeContext : IInputModeContext [read-only]
The context instance this mode is currently installed in or
null if this instance is not installed. | AbstractInputMode | |
![]() | installed : 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 | |
![]() | mousePosition : IPoint [read-only]
Gets the current mouse position during drag operations. | DropInputMode | |
![]() | preferredCursor : Cursor
Gets or sets the cursor this mode would like to have displayed in the CanvasComponent. | AbstractConcurrentInputMode | |
| showStripePreview : Boolean
Determines whether a preview of the dragged stripe is displayed during the drag. | StripeDropInputMode | ||
![]() | validDropHitTestable : IHitTestable
Gets or sets the IHitTestable that determines whether the given location is a valid drop location. | DropInputMode | |
| Method | Defined By | ||
|---|---|---|---|
StripeDropInputMode(expectedDataFormat:String = IStripe, expectedDragImageFormat:String = IFlexDisplayObject)
Creates a new instance of this input mode. | StripeDropInputMode | ||
cancel():void [override]
Cleanly cancels this mode. | StripeDropInputMode | ||
createStripe(context:IInputModeContext, newParent:IStripe, movedStripe:IStripe, index:int, gesture:ReparentGesture):IStripe
Create a new stripe as a result of the given ReparentGesture. | StripeDropInputMode | ||
![]() | dispose():void
Disposes this input mode. | AbstractInputMode | |
![]() | install(context:IInputModeContext):void
Installs this mode into the canvas of the given context. | AbstractInputMode | |
![]() | stop():Boolean [override]
Returns true if this input mode doesn't own
the mutex. | AbstractConcurrentInputMode | |
![]() | uninstall(context:IInputModeContext):void
Uninstalls this mode from the canvas. | AbstractInputMode | |
| Method | Defined By | ||
|---|---|---|---|
![]() | acceptDragEnter(e:DragEvent):Boolean
Callback that returns if the current drag may be accepted. | DropInputMode | |
![]() | canRequestMutex():Boolean
Determines whether this instance can request the InputMutex. | AbstractConcurrentInputMode | |
![]() | canvasControl_ViewPointChanged(evt:CanvasEvent):void
Callback that updates the drag location upon view point changes of the CanvasComponent
into which this input mode is installed. | DropInputMode | |
cleanupDrag():void [override]
This method is called by cancel and after a onDragDrop to cleanup any internal
state. | StripeDropInputMode | ||
Create a preview version of the table that is temporarily used to show the dragged stripe. | StripeDropInputMode | ||
![]() | dataForFormat(format:String):Object
Gets the data carried by a drag operation that has been registered with the given format. | DropInputMode | |
![]() | fireInstalled():void | AbstractInputMode | |
![]() | fireInstalling():void | AbstractInputMode | |
![]() | fireUninstalled():void | AbstractInputMode | |
![]() | fireUninstalling():void | AbstractInputMode | |
Gets the currently dragged IStripe instance;
This implementation simply tries to cast the DropInputMode.dropData
to IStripe. | StripeDropInputMode | ||
Calculates the layout of the new table. | StripeDropInputMode | ||
![]() | hasMutex():Boolean
Determines whether this instance owns the input mutex. | AbstractConcurrentInputMode | |
hideDragImage():void
Hides the drag image. | StripeDropInputMode | ||
![]() | initialize():void
Performs one-time initialization of this instance. | AbstractInputMode | |
installCore(context:IInputModeContext):void [override]
Installs this mode into the given canvas. | StripeDropInputMode | ||
![]() | invalidate():void
Convenience method for subclass implementations that invalidates
the canvasComponent this mode is currently installed in. | AbstractInputMode | |
![]() | onDisabled():void [override]
Called when the AbstractConcurrentInputMode.enabled property changes to false. | DropInputMode | |
onDragDrop(e:DragEvent):void [override]
Called whenever a drag is over the canvas. | StripeDropInputMode | ||
onDragEnter(e:DragEvent):void [override]
Called once a drag has entered the canvas. | StripeDropInputMode | ||
onDragExit(e:DragEvent):void [override]
Called whenever a drag is over the canvas. | StripeDropInputMode | ||
onDragOver(e:DragEvent):void [override]
Called whenever a drag is over the canvas. | StripeDropInputMode | ||
![]() | onEnabled():void [override]
Called when the AbstractConcurrentInputMode.enabled property changes to true. | DropInputMode | |
![]() | onMutexObtained():void
Called when this instance obtains the InputMutex. | AbstractConcurrentInputMode | |
![]() | onMutexReleased():void
Called when this instance released the InputMutex. | AbstractConcurrentInputMode | |
![]() |
Called when the preferredCursor property changes. | AbstractConcurrentInputMode | |
onStripeCreated(e:StripeEvent):void
Called whenever a new stripe is created. | StripeDropInputMode | ||
![]() | releaseMutex():void
Releases the mutex that is currently owned by this instance. | AbstractConcurrentInputMode | |
![]() | requestMutex():void
Requests the InputMutex from the current controller. | AbstractConcurrentInputMode | |
![]() | setAccepting(accept:Boolean):void
Tell the DragManager to accept canvas as drop target or sets the drop target to null. | DropInputMode | |
setDragLocation(coordinates:IPoint):void [override]
This method updates the mousePosition according to the coordinates passed in. | StripeDropInputMode | ||
showDragImage():void
Shows the previously hidden drag image. | StripeDropInputMode | ||
uninstallCore(context:IInputModeContext):void [override]
Uninstalls this mode from the canvas. | StripeDropInputMode | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
![]() | This event is raised, if a drag operation is dropped onto the CanvasComponent into which this instance is installed. | DropInputMode | ||
![]() | This event is raised, if a drag operation enters the CanvasComponent into which this instance is installed. | DropInputMode | ||
![]() | This event is raised, if a drag operation leaves the CanvasComponent into which this instance is installed. | DropInputMode | ||
![]() | This event is raised, if a drag operation drags over the CanvasComponent into which this instance is installed. | DropInputMode | ||
![]() | Dispatched after the input mode was installed. | AbstractInputMode | ||
![]() | Dispatched before the input mode will be installed. | AbstractInputMode | ||
![]() | Dispatched when the default cursor changed. | AbstractConcurrentInputMode | ||
| Dispatched when a new stripe (column or row) is created by this input mode. | StripeDropInputMode | |||
![]() | Dispatched after the input mode was uninstalled. | AbstractInputMode | ||
![]() | Dispatched before the input mode will be uninstalled. | AbstractInputMode | ||
| showStripePreview | property |
showStripePreview:Boolean
Determines whether a preview of the dragged stripe is displayed during the drag. If the drag image had been
added to the DragSource, it is hidden while the preview is displayed.
The default value is true.
public function get showStripePreview():Boolean public function set showStripePreview(value:Boolean):void| StripeDropInputMode | () | Constructor |
public function StripeDropInputMode(expectedDataFormat:String = IStripe, expectedDragImageFormat:String = IFlexDisplayObject)Creates a new instance of this input mode.
ParametersexpectedDataFormat:String (default = IStripe) — The class name of the type this mode expects as drop data.
| |
expectedDragImageFormat:String (default = IFlexDisplayObject) — The format the drag image is added to the DragSource. This format
is used to hide the drag image if an preview of the dragged stripe is displayed.
|
See also
| cancel | () | method |
override public function cancel():voidCleanly cancels this mode.
| cleanupDrag | () | method |
override protected function cleanupDrag():void
This method is called by cancel and after a onDragDrop to cleanup any internal
state.
| createPreviewTable | () | method |
protected function createPreviewTable():ITableCreate a preview version of the table that is temporarily used to show the dragged stripe.
ReturnsITable — The preview table.
|
| createStripe | () | method |
public function createStripe(context:IInputModeContext, newParent:IStripe, movedStripe:IStripe, index:int, gesture:ReparentGesture):IStripe
Create a new stripe as a result of the given ReparentGesture.
Parameters
context:IInputModeContext — The input mode context.
| |
newParent:IStripe — The parent to create the new stripe for.
| |
movedStripe:IStripe — The template stripe to create the new stripe from.
| |
index:int — The position of the newly created stripe.
| |
gesture:ReparentGesture — The gesture whose result is the stripe creation.
|
IStripe — The newly created stripe.
|
| getDraggedStripe | () | method |
protected function getDraggedStripe():IStripe
Gets the currently dragged IStripe instance;
This implementation simply tries to cast the DropInputMode.dropData
to IStripe.
IStripe — The currently dragged IStripe instance. May be null.
|
| getPreviewTableLayout | () | method |
protected function getPreviewTableLayout(mouseLocation:IPoint, size:ISize):IRectangleCalculates the layout of the new table. In this implementation the mouse location is used as center of the table.
Can be overridden in child class to implement a different layout.
Parameters
mouseLocation:IPoint — Current mouse position.
| |
size:ISize — Size of the table.
|
IRectangle — A rectangle with the given size and the mouse location as center.
|
| hideDragImage | () | method |
protected function hideDragImage():voidHides the drag image. This method is called when a stripe preview is displayed.
See also
| installCore | () | method |
override protected function installCore(context:IInputModeContext):voidInstalls this mode into the given canvas. Clients should not call this method as this is handled by the framework.
Parameters
context:IInputModeContext — The context to install this mode into.
|
| onDragDrop | () | method |
override protected function onDragDrop(e:DragEvent):voidCalled whenever a drag is over the canvas.
Parameters
e:DragEvent — The drag event with type DragEvent.DRAG_DROP.
|
| onDragEnter | () | method |
override protected function onDragEnter(e:DragEvent):voidCalled once a drag has entered the canvas.
Parameters
e:DragEvent — The drag event with type DragEvent.DRAG_ENTER.
|
| onDragExit | () | method |
override protected function onDragExit(e:DragEvent):voidCalled whenever a drag is over the canvas.
Parameters
e:DragEvent — The drag event with type DragEvent.DRAG_EXIT.
|
| onDragOver | () | method |
override protected function onDragOver(e:DragEvent):voidCalled whenever a drag is over the canvas.
Parameters
e:DragEvent — The drag event with type DragEvent.DRAG_OVER.
|
| onStripeCreated | () | method |
protected function onStripeCreated(e:StripeEvent):voidCalled whenever a new stripe is created.
Parameters
e:StripeEvent — A StripeEvent with the newly created stripe in its stripe property.
|
| setDragLocation | () | method |
override protected function setDragLocation(coordinates:IPoint):void
This method updates the mousePosition according to the coordinates passed in.
It is called prior to the onDragEnter, onDragOver and onDragDrop
methods.
Parameters
coordinates:IPoint — The current location of the mouse in world coordinates.
|
| showDragImage | () | method |
protected function showDragImage():voidShows the previously hidden drag image.
See also
| uninstallCore | () | method |
override protected function uninstallCore(context:IInputModeContext):voidUninstalls this mode from the canvas. Clients should not call this method as this is handled by the framework.
Parameters
context:IInputModeContext — The context.
|
| stripeCreated | Event |
com.yworks.graph.model.StripeEventcom.yworks.graph.model.StripeEvent.STRIPE_CREATEDDispatched when a new stripe (column or row) is created by this input mode.
The new stripe can be retrieved from the event's stripe property.