Packagecom.yworks.graph.input
Classpublic class StripeDropInputMode
InheritanceStripeDropInputMode Inheritance DropInputMode Inheritance AbstractConcurrentInputMode Inheritance AbstractInputMode Inheritance flash.events.EventDispatcher

A DropInputMode specialized to drag 'n' drop of IStripes.

A dragged IStripe is optionally visualized during the drag operation.

See also

com.yworks.graph.model.IStripe
com.yworks.canvas.input.DropInputMode


Public Properties
 PropertyDefined By
 Inheritedcanvas : CanvasComponent
[read-only] The canvas instance this mode is currently installed in or null
AbstractInputMode
 Inheritedcontroller : ConcurrencyController
Gets or injects the ConcurrencyController for this instance.
AbstractConcurrentInputMode
 InheriteddropData : Object
[read-only] Gets the data carried by a drag operation.
DropInputMode
 InheriteddropLocation : IPoint
[read-only] Gets the mouse position after dropping an item.
DropInputMode
 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
 InheritedmousePosition : IPoint
[read-only] Gets the current mouse position during drag operations.
DropInputMode
 InheritedpreferredCursor : 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
 InheritedvalidDropHitTestable : IHitTestable
Gets or sets the IHitTestable that determines whether the given location is a valid drop location.
DropInputMode
Protected Properties
 PropertyDefined By
 InheriteddragSource : DragSource
[read-only] The DragSource object containing the data being dragged.
DropInputMode
Public Methods
 MethodDefined 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
 Inherited
dispose():void
Disposes this input mode.
AbstractInputMode
 Inherited
Installs this mode into the canvas of the given context.
AbstractInputMode
 Inherited
stop():Boolean
[override] Returns true if this input mode doesn't own the mutex.
AbstractConcurrentInputMode
 Inherited
Uninstalls this mode from the canvas.
AbstractInputMode
Protected Methods
 MethodDefined By
 Inherited
acceptDragEnter(e:DragEvent):Boolean
Callback that returns if the current drag may be accepted.
DropInputMode
 Inherited
canRequestMutex():Boolean
Determines whether this instance can request the InputMutex.
AbstractConcurrentInputMode
 Inherited
Callback that updates the drag location upon view point changes of the CanvasComponent into which this input mode is installed.
DropInputMode
  
[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
 Inherited
dataForFormat(format:String):Object
Gets the data carried by a drag operation that has been registered with the given format.
DropInputMode
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
 Inherited
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
 Inherited
hasMutex():Boolean
Determines whether this instance owns the input mutex.
AbstractConcurrentInputMode
  
Hides the drag image.
StripeDropInputMode
 Inherited
initialize():void
Performs one-time initialization of this instance.
AbstractInputMode
  
[override] Installs this mode into the given canvas.
StripeDropInputMode
 Inherited
invalidate():void
Convenience method for subclass implementations that invalidates the canvasComponent this mode is currently installed in.
AbstractInputMode
 Inherited
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
 Inherited
onEnabled():void
[override] Called when the AbstractConcurrentInputMode.enabled property changes to true.
DropInputMode
 Inherited
Called when this instance obtains the InputMutex.
AbstractConcurrentInputMode
 Inherited
Called when this instance released the InputMutex.
AbstractConcurrentInputMode
 Inherited
onPreferredCursorChanged(oldValue:Cursor, newValue:Cursor):void
Called when the preferredCursor property changes.
AbstractConcurrentInputMode
  
Called whenever a new stripe is created.
StripeDropInputMode
 Inherited
Releases the mutex that is currently owned by this instance.
AbstractConcurrentInputMode
 Inherited
Requests the InputMutex from the current controller.
AbstractConcurrentInputMode
 Inherited
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
  
Shows the previously hidden drag image.
StripeDropInputMode
  
[override] Uninstalls this mode from the canvas.
StripeDropInputMode
Events
 Event Summary Defined By
 InheritedThis event is raised, if a drag operation is dropped onto the CanvasComponent into which this instance is installed.DropInputMode
 InheritedThis event is raised, if a drag operation enters the CanvasComponent into which this instance is installed.DropInputMode
 InheritedThis event is raised, if a drag operation leaves the CanvasComponent into which this instance is installed.DropInputMode
 InheritedThis event is raised, if a drag operation drags over the CanvasComponent into which this instance is installed.DropInputMode
 InheritedDispatched after the input mode was installed.AbstractInputMode
 InheritedDispatched before the input mode will be installed.AbstractInputMode
 InheritedDispatched when the default cursor changed.AbstractConcurrentInputMode
  Dispatched when a new stripe (column or row) is created by this input mode.StripeDropInputMode
 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
 InheritedPREFERRED_CURSOR_CHANGED : String = preferredCursorChanged
[static]
AbstractConcurrentInputMode
 InheritedUNINSTALLED : String = uninstalled
[static]
AbstractInputMode
 InheritedUNINSTALLING : String = uninstalling
[static]
AbstractInputMode
Property Detail
showStripePreviewproperty
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.


Implementation
    public function get showStripePreview():Boolean
    public function set showStripePreview(value:Boolean):void
Constructor Detail
StripeDropInputMode()Constructor
public function StripeDropInputMode(expectedDataFormat:String = IStripe, expectedDragImageFormat:String = IFlexDisplayObject)

Creates a new instance of this input mode.

Parameters
expectedDataFormat: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

Method Detail
cancel()method
override public function cancel():void

Cleanly 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():ITable

Create a preview version of the table that is temporarily used to show the dragged stripe.

Returns
ITable — 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.

Returns
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.

Returns
IStripe — The currently dragged IStripe instance. May be null.
getPreviewTableLayout()method 
protected function getPreviewTableLayout(mouseLocation:IPoint, size:ISize):IRectangle

Calculates 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.

Returns
IRectangle — A rectangle with the given size and the mouse location as center.
hideDragImage()method 
protected function hideDragImage():void

Hides the drag image. This method is called when a stripe preview is displayed.

See also

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

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

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

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

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

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

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

Shows the previously hidden drag image.

See also

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

Uninstalls this mode from the canvas. Clients should not call this method as this is handled by the framework.

Parameters

context:IInputModeContext — The context.

Event Detail
stripeCreated Event
Event Object Type: com.yworks.graph.model.StripeEvent
StripeEvent.type property = com.yworks.graph.model.StripeEvent.STRIPE_CREATED

Dispatched 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.

Event which is dispatched when a new stripe (column or row) is created.