Packagecom.yworks.graph.input
Classpublic class GraphEditorInputMode
InheritanceGraphEditorInputMode Inheritance MainInputMode Inheritance MultiplexingInputMode Inheritance AbstractConcurrentInputMode Inheritance AbstractInputMode Inheritance flash.events.EventDispatcher
Implements mx.core.IMXMLObject, com.yworks.graph.input.IToggleGroupNodeStateInputMode

A complex IInputMode that can be used in a GraphCanvasComponent to edit an IGraph instance.

This class delegates most of the work to minor IInputMode implementations. However it contains a number of properties that influence the general behavior, too:

Also this instance can be instructed to automatically adjust the content rectangle of the CanvasControl whenever the graph is changed using gestures. This class contains a number of public methods that can be used to programmatically perform the corresponding actions, too. Setting the nodeCreator to another instance or null changes the way nodes are created. Also the various minor IInputMode instances can be disabled, to change the behavior, too.

Creation and installation of this input mode:

Actionscript:

     var geim:GraphEditorInputMode = new GraphEditorInputMode();
     graphCanvas.inputMode = geim;    // graphCanvas is an initialized GraphCanvasComponent
     

MXML SyntaxexpandedHide MXML Syntax
<yworks:GraphCanvasComponent id="graphCanvas"> <yworks:GraphEditorInputMode id="geim" installing="configureInputMode()"/> </yworks:GraphCanvasComponent> Further configurations on a mxml created input mode (e.g. setting the moveInputMode property) should be done in an event handler for the installing event. This event will be fired before the input mode is installed.

Note that the properties graph, graphCanvas, graphSelection, collectionModel, and selectionModel are only valid after this input mode is installed. Initialization operations depending on these properties (e.g. adding an event listener to the selectionModel) should be done in a listener for the installed event, which is fired immediately after the input mode is installed.



Public Properties
 PropertyDefined By
  autoAdjustContentRect : AdjustContentRectPolicy
Determines whether this instance should automatically adjust the canvas' contentRect if the graph changes.
GraphEditorInputMode
  autoRemoveEmptyLabels : Boolean
A value indicating whether this mode should automatically remove labels from the graph when a label text has been edited and the label text is empty.
GraphEditorInputMode
  autoSelectSelfloopBends : Boolean
A value indicating whether clicking on a node should automatically select all bends of self loops adjacent to that node.
GraphEditorInputMode
 InheritedbridgeUpdateMode : BridgeUpdateMode
Determines how bridges shall be rendered during a move or drag.
MainInputMode
 Inheritedcanvas : CanvasComponent
[read-only] The canvas instance this mode is currently installed in or null
AbstractInputMode
  clickableItems : uint
Determines for which types of items a GraphEditorEvent.ITEM_CLICKED should be dispatched upon mouse clicks.
GraphEditorInputMode
  clickHitTestOrder : Array
The order of the types of items that should be used to determine which item has been clicked during onClickInputModeClicked.
GraphEditorInputMode
 InheritedclickInputMode : ClickInputMode
The ClickInputMode property.
MainInputMode
 InheritedclickModeEnabled : Boolean
Whether the click input mode is enabled.
MainInputMode
 InheritedclickModePriority : int
The click mode priority.
MainInputMode
  clickSelectableItems : uint
Determines which types of items should be selectable through mouse clicks.
GraphEditorInputMode
  clipboardOperationsAllowed : Boolean
Determines whether clipboard operations with the usual shortcuts are enabled on the canvas.
GraphEditorInputMode
 InheritedcollectionModel : ICollectionModel
Gets or sets the ICollectionModel of the IModelItem that make up the elements in the view this mode is acting upon.
MainInputMode
  contentRectMargins : ImmutableRectangle
Gets or sets the margins to use for CanvasComponent.updateContentRect() in adjustContentRect() calls.
GraphEditorInputMode
 InheritedcontextMenuInputMode : ContextMenuInputMode
The contextMenuInputMode property.
MainInputMode
 InheritedcontextMenuModeEnabled : Boolean
Whether the context menu input mode is enabled.
MainInputMode
 InheritedcontextMenuModePriority : int
The context menu mode priority.
MainInputMode
 Inheritedcontroller : ConcurrencyController
Gets or injects the ConcurrencyController for this instance.
AbstractConcurrentInputMode
  createBendEdgeModePriority : Number
Deprecated: Please Use createBendModePriority
[write-only]
GraphEditorInputMode
  createBendInputMode : CreateBendInputMode
The createBendInputMode property.
GraphEditorInputMode
  createBendModeEnabled : Boolean
Whether the create bend input mode is enabled.
GraphEditorInputMode
  createBendModePriority : Number
The CreateBendInputModePriority property.
GraphEditorInputMode
  createEdgeInputMode : CreateEdgeInputMode
The createEdgeInputMode property.
GraphEditorInputMode
  createEdgeModeEnabled : Boolean
Whether the create edge input mode is enabled.
GraphEditorInputMode
  createEdgeModePriority : Number
The CreateEdgeInputModePriority property.
GraphEditorInputMode
 InheriteddefaultCursor : Cursor
The default cursor which is displayed if the active input mode does not have a preferred cursor.
MultiplexingInputMode
  deletableItems : uint
Determines which types of items may be deleted using the deleteSelection action.
GraphEditorInputMode
  deleteElementsAllowed : Boolean
Gets or sets the property that determines whether the user is allowed to delete currently selected elements using the Delete key.
GraphEditorInputMode
  detailSelectionRecognizer : Function
The event recognizer function that will be queried to decide if a click should select the item that is currently visible under the mouse cursor, without giving more important items higher priority.
GraphEditorInputMode
 Inheritedenabled : Boolean
Gets or sets the enabled state of this input mode.
AbstractConcurrentInputMode
  focusableItems : uint
The items that can be given focus via the setCurrentItem method.
GraphEditorInputMode
  graph : IGraph
[read-only] Gets the Graph this mode is acting upon.
GraphEditorInputMode
  graphCanvas : GraphCanvasComponent
[read-only] Gets the GraphControl this mode is working on or null.
GraphEditorInputMode
  graphSelection : IGraphSelection
[read-only] Returns the selectionModel as an IGraphSelection.
GraphEditorInputMode
  groupSelectionAllowed : Boolean
Determines whether Ctrl-G-presses should result in calls to groupSelection().
GraphEditorInputMode
 InheritedhandleInputMode : HandleInputMode
The HandleInputMode property.
MainInputMode
 InheritedhandleModeEnabled : Boolean
Whether the handle input mode is enabled.
MainInputMode
 InheritedhandleModePriority : int
The handle mode priority.
MainInputMode
  hitTestIterator : IHitTestIterator
Gets or sets the HitTestEnumerator property.
GraphEditorInputMode
  hitTestOrdering : Array
The hitTestOrdering.
GraphEditorInputMode
 InheritedinputModeCanvasGroup : ICanvasObjectGroup
The canvas group that can be used by input modes to add temporary top-level canvas objects to.
MainInputMode
 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
 InheritedkeyboardInputMode : KeyboardInputMode
The keyboard input mode.
MainInputMode
 InheritedkeyboardModeEnabled : Boolean
Whether the keyboard input mode is enabled.
MainInputMode
 InheritedkeyboardModePriority : int
The keyboard mode priority.
MainInputMode
  labelEditableItems : uint
Determines which types of items may have their labels edited.
GraphEditorInputMode
  labelEditingAllowed : Boolean
Gets or sets the LabelEditingAllowed property that determines whether the label editor will be automatically invoked if the F2 key is pressed.
GraphEditorInputMode
  marqueeSelectableItems : uint
Determines which types of items should be selected during marquee selections.
GraphEditorInputMode
 InheritedmarqueeSelectionInputMode : MarqueeSelectionInputMode
The MarqueeSelectionInputMode property.
MainInputMode
 InheritedmarqueeSelectionModeEnabled : Boolean
Whether the marquee selection input mode is enabled.
MainInputMode
 InheritedmarqueeSelectionModePriority : int
The marquee selection mode priority.
MainInputMode
  movableItems : uint
Determines which types of items should movable using the moveInputMode.
GraphEditorInputMode
 InheritedmoveInputMode : MoveInputMode
The MoveInputMode property.
MainInputMode
  moveLabelInputMode : MoveLabelInputMode
The MoveLabelInputMode property.
GraphEditorInputMode
  moveLabelModeEnabled : Boolean
Whether the move label input mode is enabled.
GraphEditorInputMode
 InheritedmoveModeEnabled : Boolean
Whether the move input mode is enabled.
MainInputMode
 InheritedmoveModePriority : int
The move mode priority.
MainInputMode
  multiSelectionRecognizer : Function
The event recognizer function that will be queried to decide if a click is deemed a multi selection gesture.
GraphEditorInputMode
  navigationInputMode : NavigationInputMode
The keyboard navigation input mode.
GraphEditorInputMode
  navigationModeEnabled : Boolean
Whether the keyboard navigation input mode is enabled.
GraphEditorInputMode
  navigationModePriority : Number
The keyboard navigation mode priority.
GraphEditorInputMode
  nodeCreationAllowed : Boolean
Whether createNode will be called when the canvas is clicked.
GraphEditorInputMode
  nodeCreator : Function
The callback that is responsible for creating a new node, e.g.
GraphEditorInputMode
  orthogonalEdgeEditingContext : OrthogonalEdgeEditingContext
Gets or sets the orthogonal edge editing context.
GraphEditorInputMode
  pasteDelta : IPoint
The offset for paste operation if clipboard operations are enabled.
GraphEditorInputMode
 InheritedpreferredCursor : Cursor
Gets or sets the cursor this mode would like to have displayed in the CanvasComponent.
AbstractConcurrentInputMode
  reparentNodeHandler : IReparentNodeHandler
Gets or sets the reparentNodeHandler property.
GraphEditorInputMode
  reparentNodesAllowed : Boolean
Gets or sets a property that determines whether the user may reparent nodes using a move gesture.
GraphEditorInputMode
  selectableItems : uint
Determines which types of items should be selectable at all.
GraphEditorInputMode
 InheritedselectionModel : ISelectionModel
Gets or sets the selectionModel property
MainInputMode
  showHandleItems : uint
Determines which types of items should have their IHandles shown.
GraphEditorInputMode
 InheritedsnapContext : SnapContext
The SnapContext instance which handles snapping of moving items to distinct coordinates.
MainInputMode
  textEditorInputMode : TextEditorInputMode
The textEditorInputMode property.
GraphEditorInputMode
  textEditorModeEnabled : Boolean
Whether the text editor input mode is enabled.
GraphEditorInputMode
  textEditorModePriority : Number
The TextEditorInputModePriority property.
GraphEditorInputMode
  undoOperationsAllowed : Boolean
Determines whether undo/redo operations with the usual shortcuts are enabled on the canvas.
GraphEditorInputMode
  ungroupSelectionAllowed : Boolean
Determines whether Ctrl-U-presses should result in calls to ungroupSelection().
GraphEditorInputMode
Protected Properties
 PropertyDefined By
 InheritedchildController : ConcurrencyController
[read-only] The ConcurrencyController that is used to manage the concurrency of the child input modes.
MultiplexingInputMode
 InheritedinputModeController : InputModeController
[read-only] Gets or sets the input mode controller helper instance.
MainInputMode
Public Methods
 MethodDefined By
  
GraphEditorInputMode(graph:IGraph = null, selectionModel:ISelectionModel = null)
Creates a new instance.
GraphEditorInputMode
 Inherited
add(inputMode:IInputMode, priority:int = 0):void
Adds an input mode using the given priority to this compound mode.
MultiplexingInputMode
 Inherited
addConcurrent(inputMode:IConcurrentInputMode, priority:int):void
Adds an input mode as a concurrent mode using the given priority to this compound mode.
MultiplexingInputMode
  
Updates the canvas' contentRect using CanvasComponent#updateContentRect() and contentRectMargins.
GraphEditorInputMode
 Inherited
Adjusts the cursor of the CanvasControl according to the current input mutex owner or the first mode in the list that returns a non-null preferredCursor.
MultiplexingInputMode
 Inherited
cancel():void
[override] Cancels all modes.
MultiplexingInputMode
 Inherited
Clears the selection on the current selectionModel.
MainInputMode
  
closeLabelEditor(cancel:Boolean):void
Closes the label editor if it is currently open.
GraphEditorInputMode
  
copy():void
Copies the currently selected elements to the clipboard.
GraphEditorInputMode
 Inherited
Callback that creates the IInputModeContext for the child modes of this mode.
MultiplexingInputMode
  
createLabel(labeledItem:ILabeledItem):void
Interactively creates a new label for the provided labeled item.
GraphEditorInputMode
  
createMoveUnselectedInputMode(modifierRecognizer:Function = null):MoveInputMode
[override]
GraphEditorInputMode
  
createNode(clickPoint:IPoint):INode
Creates a node given a certain click point.
GraphEditorInputMode
  
cut():void
Cuts and inserts the currently selected elements to the clipboard.
GraphEditorInputMode
  
This method deletes the currently selected elements.
GraphEditorInputMode
  
disableAll():void
[override] Disables all submodes.
GraphEditorInputMode
  
dispose():void
[override]
GraphEditorInputMode
  
dragBend(bend:IBend):void
Initiates the handleInputMode to drag the given bend.
GraphEditorInputMode
  
editLabel(label:ILabel):void
Triggers the editing of the given label.
GraphEditorInputMode
  
findHits(clickPoint:IPoint, tests:Array):IModelItem
Used as a callback to find hits underneath a certain clicked point.
GraphEditorInputMode
 Inherited
Returns an ICanvasGroupProvider instance for this input mode
MainInputMode
 Inherited
Finds the IConcurrentInputMode that currently owns the mutex or null.
MultiplexingInputMode
  
Creates a new group for all of the currently selected elements.
GraphEditorInputMode
 Inherited
initialized(document:Object, id:String):void
Called automatically by the MXML compiler when the instance is created using an MXML tag.
MainInputMode
 Inherited
Installs this mode into the canvas of the given context.
AbstractInputMode
 Inherited
marqueeSelect(marqueeRectangle:IRectangle, items:ICollectionModel):void
Selects the given elements in the editor inside the provided marquee selection rectangle.
MainInputMode
  
marqueeSelectElements(marqueeRectangle:IRectangle):void
[override] This method will marquee select the items in the graph.
GraphEditorInputMode
  
paste():void
Pastes the current clipboard contents.
GraphEditorInputMode
  
redo():void
Redoes the last Redoable change.
GraphEditorInputMode
 Inherited
remove(mode:IInputMode):void
Removes the given mode from this compound mode.
MultiplexingInputMode
  
selectAll():void
Clears the current selection and selects all nodes and bends in this graph.
GraphEditorInputMode
  
setCurrentItem(currentItem:IModelItem):void
Callback that is used by this instance to set the current item on the GraphCanvasComponent.currentItem.
GraphEditorInputMode
  
setLabelText(label:ILabel, text:String):void
Sets the label's text after it has been edited using editLabel.
GraphEditorInputMode
 Inherited
setSelected(item:IModelItem, selected:Boolean):void
Uses the selectionModel to select the given item.
MainInputMode
 Inherited
Returns a list of all modes managed by this instance in sorted order.
MultiplexingInputMode
 Inherited
stop():Boolean
[override] Tries to stop all modes.
MultiplexingInputMode
  
toggleGroupNodeState(groupNode:INode):void
Toggles the expanded state for the given group node in the IFoldedGraph.
GraphEditorInputMode
  
undo():void
Undoes the last undoable change.
GraphEditorInputMode
  
Makes each of the currently selected nodes a direct child of the root group (if not already).
GraphEditorInputMode
 Inherited
Uninstalls this mode from the canvas.
AbstractInputMode
Protected Methods
 MethodDefined By
 Inherited
canRequestMutex():Boolean
Determines whether this instance can request the InputMutex.
AbstractConcurrentInputMode
  
childInputModeContextLookup(type:Class):Object
[override]
GraphEditorInputMode
  
click(item:IModelItem, evt:ClickEvent):void
Actually performs the click operation on the given item.
GraphEditorInputMode
 Inherited
Create the ConcurrencyController that is used to manage the concurrency of the child input modes.
MultiplexingInputMode
 Inherited
Factory method for the ClickInputMode property.
MainInputMode
 Inherited
Factory method for the contextMenuInputMode property.
MainInputMode
  
Factory method for the createBendInputMode property.
GraphEditorInputMode
  
Factory method for the createEdgeInputMode property.
GraphEditorInputMode
  
Callback method to create a custom label configuration when a new label should be created.
GraphEditorInputMode
 Inherited
Factory method for the HandleInputMode property.
MainInputMode
  
Factory method for the hitTestEnumerator property.
GraphEditorInputMode
 Inherited
Creates the inputModeController that will be used to coordinate the selection and the handles, etc.
MainInputMode
 Inherited
Factory method that creates the keyboard input mode instance.
MainInputMode
 Inherited
Factory method for the marqueeSelectionInputMode property.
MainInputMode
  
[override]
GraphEditorInputMode
  
Factory method for the MoveLabelInputMode property.
GraphEditorInputMode
  
Factory method for the navigationInputMode property.
GraphEditorInputMode
  
Factory method for the ReparentNodeHandler property.
GraphEditorInputMode
  
Factory method for the textEditorInputMode property.
GraphEditorInputMode
  
finalizeNodeReparenting(reparentedNodes:Iterable):void
Called when a reparenting gesture is finished.
GraphEditorInputMode
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
 Inherited
AbstractInputMode
  
getClosestHits(modelItems:Iterator, location:IPoint):Iterator
This method filters the passed IModelItems and returns only those closest to the passed location.
GraphEditorInputMode
  
Called by click to query the item for a IActionButtonProvider in its lookup and handle it appropriately.
GraphEditorInputMode
 Inherited
hasMutex():Boolean
Determines whether this instance owns the input mutex.
AbstractConcurrentInputMode
  
initialize():void
[override]
GraphEditorInputMode
  
[override] Installs this mode into the given context.
GraphEditorInputMode
 Inherited
invalidate():void
Convenience method for subclass implementations that invalidates the canvasComponent this mode is currently installed in.
AbstractInputMode
 Inherited
onClickInputModeChanged(oldClickInputMode:ClickInputMode, newClickInputMode:ClickInputMode):void
Called when the clickInputMode property value changes and after initialization of the field.
MainInputMode
  
[override] Called when the mouse has been clicked at a given location.
GraphEditorInputMode
 Inherited
onCollectionModelChanged(oldCollectionModel:ICollectionModel, newCollectionModel:ICollectionModel):void
Callback that gets triggered once the collectionModel property changes.
MainInputMode
 Inherited
onContextMenuInputModeChanged(oldContextMenuInputMode:ContextMenuInputMode, newContextMenuInputMode:ContextMenuInputMode):void
Called when the contextMenuInputMode property value changes
MainInputMode
  
[override]
GraphEditorInputMode
  
Callback that is called as soon as createBendInputMode created a new bend.
GraphEditorInputMode
  
onCreateBendInputModeChanged(oldCreateBendInputMode:CreateBendInputMode, newCreateBendInputMode:CreateBendInputMode):void
Called when the createBendInputMode property value changes.
GraphEditorInputMode
  
onCreateEdgeInputModeChanged(oldCreateEdgeInputMode:CreateEdgeInputMode, newCreateEdgeInputMode:CreateEdgeInputMode):void
Called when the createEdgeInputMode property value changes
GraphEditorInputMode
  
Callback that is called as soon as createEdgeInputMode created a new edge.
GraphEditorInputMode
  
onCtrlAPressed(evt:KeyboardEvent):void
Callback that delegates to selectAll if selectElementsAllowed is true.
GraphEditorInputMode
  
onDeletePressed(evt:KeyboardEvent):void
Callback that delegates to deleteSelection if deleteElementsAllowed is true.
GraphEditorInputMode
 Inherited
onDisabled():void
[override] Called when the AbstractConcurrentInputMode.enabled property changes to false.
MultiplexingInputMode
  
Callback that is invoked if the F2 key is pressed and labelEditingAllowed is set to true.
GraphEditorInputMode
 Inherited
onEnabled():void
[override] Called when the AbstractConcurrentInputMode.enabled property changes to true.
MultiplexingInputMode
  
onF2KeyPressed(evt:KeyboardEvent):void
Callback that triggers OnEditLabel.
GraphEditorInputMode
  
Called when the graphCanvas property changes.
GraphEditorInputMode
  
onGraphChanged(oldGraph:IGraph, newGraph:IGraph):void
Called when the graph property changes.
GraphEditorInputMode
  
Called when the graphSelection property changes.
GraphEditorInputMode
  
onHandleInputModeChanged(oldHandleInputMode:HandleInputMode, newHandleInputMode:HandleInputMode):void
[override]
GraphEditorInputMode
 Inherited
Called when the inputModeCanvasGroup property changes.
MainInputMode
  
onKeyboardInputModeChanged(oldKeyboardInputMode:KeyboardInputMode, newKeyboardInputMode:KeyboardInputMode):void
[override]
GraphEditorInputMode
  
onLabelAdded(label:ILabel):void
Called when a new Label is added after pressing F2.
GraphEditorInputMode
 Inherited
onMarqueeSelectionInputModeChanged(oldMarqueeSelectionInputMode:MarqueeSelectionInputMode, newMarqueeSelectionInputMode:MarqueeSelectionInputMode):void
Called when the marqueeSelectionInputMode property value changes and after initialization of the field.
MainInputMode
 Inherited
Callback used by MarqueeSelectionInputMode if the user has finished creating the marquee selection.
MainInputMode
  
onMoveInputModeChanged(oldMoveInputMode:MoveInputMode, newMoveInputMode:MoveInputMode):void
[override]
GraphEditorInputMode
 Inherited
Callback method that will be triggered when a drag has been finished.
MainInputMode
  
Called when a drag operation is finished
GraphEditorInputMode
  
onMoveLabelInputModeChanged(oldMoveLabelInputMode:MoveLabelInputMode, newMoveLabelInputMode:MoveLabelInputMode):void
Called when the moveLabelInputMode property value changes and after initialization of the field.
GraphEditorInputMode
  
Callback that is called as soon as moveLabelInputMode has moved a label.
GraphEditorInputMode
 Inherited
Called when this instance obtains the InputMutex.
AbstractConcurrentInputMode
 Inherited
Called when this instance released the InputMutex.
AbstractConcurrentInputMode
  
onNavigationInputModeChanged(oldNavigationInputMode:NavigationInputMode, newNavigationInputMode:NavigationInputMode):void
Called when the navigationInputMode property value changes and after initialization of the field.
GraphEditorInputMode
  
onNodeCreated(node:INode):void
Called when a new node is created by this input mode.
GraphEditorInputMode
  
onNodeReparented(node:INode, oldParent:INode, newParent:INode):void
Called when a node is reparented by this input mode.
GraphEditorInputMode
 Inherited
onPreferredCursorChanged(oldValue:Cursor, newValue:Cursor):void
Called when the preferredCursor property changes.
AbstractConcurrentInputMode
  
Called when the reparentNodeHandler property value changes and after initialization of the field.
GraphEditorInputMode
 Inherited
onSelectionModelChanged(oldSelectionModel:ISelectionModel, newSelectionModel:ISelectionModel):void
Callback that gets triggered once the selectionModel property changes.
MainInputMode
 Inherited
onSnapContextChanged(oldSnapContext:SnapContext, newSnapContext:SnapContext):void
MainInputMode
  
onTextEditorInputModeChanged(oldTextEditorInputMode:TextEditorInputMode, newTextEditorInputMode:TextEditorInputMode):void
Called when the textEditorInputMode property value changes
GraphEditorInputMode
  
Called when a label's text was edited by the TextEditorInputMode.
GraphEditorInputMode
  
Called when text editing was cancelled by the TextEditorInputMode.
GraphEditorInputMode
 Inherited
Releases the mutex that is currently owned by this instance.
AbstractConcurrentInputMode
 Inherited
Potentially replaces the reported by the current owner's preferredCursor property before it is set on the canvas.
MultiplexingInputMode
 Inherited
Requests the InputMutex from the current controller.
AbstractConcurrentInputMode
  
setGraph(newGraph:IGraph):void
Set a new Graph for this mode.
GraphEditorInputMode
  
Sets the GraphCanvasComponent that is associated with this instance.
GraphEditorInputMode
  
Set a new GraphSelection for this mode.
GraphEditorInputMode
  
Callback that determines whether a GraphEditorEvent.ITEM_CLICKED should be dispatched for the provided IModelItem.
GraphEditorInputMode
  
Callback that determines whether the provided IModelItem should be selected upon mouse clicks.
GraphEditorInputMode
  
Determines whether the item should be deleted.
GraphEditorInputMode
  
[override] Callback that determines whether the provided IModelItem should be selected upon marquee selection.
GraphEditorInputMode
  
[override] Determines whether to make the item movable using the moveInputMode.
GraphEditorInputMode
  
Callback method that determines whether the label or the labels of the provided item should be edited in response to onEditLabel.
GraphEditorInputMode
  
Callback that determines whether the provided IModelItem should be set to the current item.
GraphEditorInputMode
  
[override] Determines whether to show the handles for the given item.
GraphEditorInputMode
  
[override] Unistalls this mode.
GraphEditorInputMode
Events
 Event Summary Defined By
  Dispatched when a new bend has been created by the user.GraphEditorInputMode
  Dispatched when bend has been deleted by the user.GraphEditorInputMode
  Dispatched when the current item changed.GraphEditorInputMode
  Dispatched before a bend will be deleted by the user.GraphEditorInputMode
  Dispatched before an edge will be deleted by the user.GraphEditorInputMode
  Dispatched before a label will be deleted by the user.GraphEditorInputMode
  Dispatched before a node will be deleted by the user.GraphEditorInputMode
  Dispatched when an edge is added by the user.GraphEditorInputMode
  Dispatched when an edge has been deleted by the user.GraphEditorInputMode
 InheritedDispatched after the input mode was installed.AbstractInputMode
 InheritedDispatched before the input mode will be installed.AbstractInputMode
  Dispatched when a graph item has been clicked.GraphEditorInputMode
  Dispatched when a label is changed by the user (after pressing F2 key).GraphEditorInputMode
  Dispatched when a label is added by the user (after pressing F2 key).GraphEditorInputMode
  Dispatched when a label has been deleted by the user.GraphEditorInputMode
  Dispatched when a node is added by the user.GraphEditorInputMode
  Dispatched when a node has been deleted by the user.GraphEditorInputMode
  Dispatched when a node is reparented by the user.GraphEditorInputMode
 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
 InheritedPREFERRED_CURSOR_CHANGED : String = preferredCursorChanged
[static]
AbstractConcurrentInputMode
 InheritedUNINSTALLED : String = uninstalled
[static]
AbstractInputMode
 InheritedUNINSTALLING : String = uninstalling
[static]
AbstractInputMode
Property Detail
autoAdjustContentRectproperty
autoAdjustContentRect:AdjustContentRectPolicy

Determines whether this instance should automatically adjust the canvas' contentRect if the graph changes.

The adjustContentRect method is called whenever the content changes and autoAdjustContentRect is set to AdjustContentRectPolicy.ALWAYS or AdjustContentRectPolicy.UNION.

Setting to AdjustContentRectPolicy.ALWAYS will adjust the content rect to fit the current graph bounds. Setting to AdjustContentRectPolicy.UNION will adjust the content rect to a union of the former and current graph bounds (the content rect will never shrink).

The default value is AdjustContentRectPolicy.UNION.


Implementation
    public function get autoAdjustContentRect():AdjustContentRectPolicy
    public function set autoAdjustContentRect(value:AdjustContentRectPolicy):void

See also

autoRemoveEmptyLabelsproperty 
autoRemoveEmptyLabels:Boolean

A value indicating whether this mode should automatically remove labels from the graph when a label text has been edited and the label text is empty.

The default value is false.


Implementation
    public function get autoRemoveEmptyLabels():Boolean
    public function set autoRemoveEmptyLabels(value:Boolean):void
autoSelectSelfloopBendsproperty 
autoSelectSelfloopBends:Boolean

A value indicating whether clicking on a node should automatically select all bends of self loops adjacent to that node.

The default value is true.


Implementation
    public function get autoSelectSelfloopBends():Boolean
    public function set autoSelectSelfloopBends(value:Boolean):void
clickableItemsproperty 
clickableItems:uint

Determines for which types of items a GraphEditorEvent.ITEM_CLICKED should be dispatched upon mouse clicks.

The default value is GraphItemTypes.ALL.


Implementation
    public function get clickableItems():uint
    public function set clickableItems(value:uint):void

See also

clickHitTestOrderproperty 
clickHitTestOrder:Array

The order of the types of items that should be used to determine which item has been clicked during onClickInputModeClicked.

Change this property to adjust which items will be selected if there are multiple items at a given location. The default order is

Examples:

         // select the topmost item
         mode.clickHitTestOrder = [HitTest.ALL];
         
         // select the topmost item but prefer nodes and edges (and edge labels and bends) over node labels and ports.
         mode.clickHitTestOrder = [HitTest.BEND|HitTest.EDGE_LABEL|HitTest.EDGE|HitTest.NODE, HitTest.NODE_LABEL, HitTest.PORT, HitTest.ALL];
         

This property can be used as the source for data binding.


Implementation
    public function get clickHitTestOrder():Array
    public function set clickHitTestOrder(value:Array):void

See also

clickSelectableItemsproperty 
clickSelectableItems:uint

Determines which types of items should be selectable through mouse clicks.

The default value is GraphItemTypes.ALL.


Implementation
    public function get clickSelectableItems():uint
    public function set clickSelectableItems(value:uint):void

See also

clipboardOperationsAllowedproperty 
clipboardOperationsAllowed:Boolean

Determines whether clipboard operations with the usual shortcuts are enabled on the canvas.

The default value is true.


Implementation
    public function get clipboardOperationsAllowed():Boolean
    public function set clipboardOperationsAllowed(value:Boolean):void
contentRectMarginsproperty 
contentRectMargins:ImmutableRectangle

Gets or sets the margins to use for CanvasComponent.updateContentRect() in adjustContentRect() calls.


Implementation
    public function get contentRectMargins():ImmutableRectangle
    public function set contentRectMargins(value:ImmutableRectangle):void

See also

createBendEdgeModePriorityproperty 
createBendEdgeModePriority:Number  [write-only]
Deprecated: Please Use createBendModePriority


Implementation
    public function set createBendEdgeModePriority(value:Number):void
createBendInputModeproperty 
createBendInputMode:CreateBendInputMode

The createBendInputMode property.

If the field has not yet been initialized upon first access, the factory method createCreateBendInputMode will be called. Upon change the onCreateBendInputModeChanged method will be called.

Setting a new CreateBendInputMode is not allowed after the GraphEditorInputMode is installed and will throw an exception.


Implementation
    public function get createBendInputMode():CreateBendInputMode
    public function set createBendInputMode(value:CreateBendInputMode):void

Throws
IllegalOperationError IllegalOperationError: if the mode is set after the GraphEditorInputMode is installed.
createBendModeEnabledproperty 
createBendModeEnabled:Boolean

Whether the create bend input mode is enabled.

The default value is true.

This property can be used as the source for data binding.


Implementation
    public function get createBendModeEnabled():Boolean
    public function set createBendModeEnabled(value:Boolean):void
createBendModePriorityproperty 
createBendModePriority:Number

The CreateBendInputModePriority property.

The default value is 42.


Implementation
    public function get createBendModePriority():Number
    public function set createBendModePriority(value:Number):void
createEdgeInputModeproperty 
createEdgeInputMode:CreateEdgeInputMode

The createEdgeInputMode property.

If the field has not yet been initialized upon first access, the factory method createCreateEdgeInputMode will be called. Upon change the onCreateEdgeInputModeChanged method will be called.

Setting a new CreateEdgeInputMode is not allowed after the GraphEditorInputMode is installed and will throw an exception.


Implementation
    public function get createEdgeInputMode():CreateEdgeInputMode
    public function set createEdgeInputMode(value:CreateEdgeInputMode):void

Throws
IllegalOperationError IllegalOperationError: if the mode is set after the GraphEditorInputMode is installed.
createEdgeModeEnabledproperty 
createEdgeModeEnabled:Boolean

Whether the create edge input mode is enabled.

The default value is true.

This property can be used as the source for data binding.


Implementation
    public function get createEdgeModeEnabled():Boolean
    public function set createEdgeModeEnabled(value:Boolean):void
createEdgeModePriorityproperty 
createEdgeModePriority:Number

The CreateEdgeInputModePriority property.

The default value is 45.


Implementation
    public function get createEdgeModePriority():Number
    public function set createEdgeModePriority(value:Number):void
deletableItemsproperty 
deletableItems:uint

Determines which types of items may be deleted using the deleteSelection action.

The default value is GraphItemTypes.ALL.


Implementation
    public function get deletableItems():uint
    public function set deletableItems(value:uint):void

See also

deleteElementsAllowedproperty 
deleteElementsAllowed:Boolean

Gets or sets the property that determines whether the user is allowed to delete currently selected elements using the Delete key.

The default value is true.


Implementation
    public function get deleteElementsAllowed():Boolean
    public function set deleteElementsAllowed(value:Boolean):void
detailSelectionRecognizerproperty 
detailSelectionRecognizer:Function

The event recognizer function that will be queried to decide if a click should select the item that is currently visible under the mouse cursor, without giving more important items higher priority.

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

If the value recognizes that the user wanted to use the detail clicking behavior, the hitTestIterator will be queried for the given item and the first item that is returned will be considered a hit. Otherwise all hit items are examined and are priorized by item type. E.g. by default clicking on a node will select the node, even if there is a node label which has been clicked at the same point. If detail selection is recognized, the label will be selected.

The default implementation will recognize events of type com.yworks.canvas.input.ClickEvent, if the shift key was pressed.


Implementation
    public function get detailSelectionRecognizer():Function
    public function set detailSelectionRecognizer(value:Function):void
focusableItemsproperty 
focusableItems:uint

The items that can be given focus via the setCurrentItem method.

The items types are defined using a bitwise combination of the constants defined in GraphItemTypes.

The default value is GraphItemTypes.NODE.


Implementation
    public function get focusableItems():uint
    public function set focusableItems(value:uint):void

See also

graphproperty 
graph:IGraph  [read-only]

Gets the Graph this mode is acting upon.


Implementation
    public function get graph():IGraph
graphCanvasproperty 
graphCanvas:GraphCanvasComponent  [read-only]

Gets the GraphControl this mode is working on or null.

his property is set by setGraphControl which is triggered if this mode is installed in a GraphCanvasComponent.


Implementation
    public function get graphCanvas():GraphCanvasComponent
graphSelectionproperty 
graphSelection:IGraphSelection  [read-only]

Returns the selectionModel as an IGraphSelection.


Implementation
    public function get graphSelection():IGraphSelection
groupSelectionAllowedproperty 
groupSelectionAllowed:Boolean

Determines whether Ctrl-G-presses should result in calls to groupSelection().

The default value is true.


Implementation
    public function get groupSelectionAllowed():Boolean
    public function set groupSelectionAllowed(value:Boolean):void

See also

hitTestIteratorproperty 
hitTestIterator:IHitTestIterator

Gets or sets the HitTestEnumerator property.

The enumerator will be queried for hit tests if the user clicks on the canvas. If the field has not yet been initialized upon first access, the factory method createHitTestEnumerator will be called.


Implementation
    public function get hitTestIterator():IHitTestIterator
    public function set hitTestIterator(value:IHitTestIterator):void
hitTestOrderingproperty 
hitTestOrdering:Array

The hitTestOrdering.

The hitTestOrdering is an array of HitTest constants that determines the ordering in which items are tested for click hits.


Implementation
    public function get hitTestOrdering():Array
    public function set hitTestOrdering(value:Array):void
labelEditableItemsproperty 
labelEditableItems:uint

Determines which types of items may have their labels edited.

One or a bitwise combination of the constants defined in GraphItemTypes.

The default is GraphItemTypes.LABELED_ITEM|GraphItemTypes.LABEL which allows for editing the labels of labeled items and existing labels.


Implementation
    public function get labelEditableItems():uint
    public function set labelEditableItems(value:uint):void

See also

labelEditingAllowedproperty 
labelEditingAllowed:Boolean

Gets or sets the LabelEditingAllowed property that determines whether the label editor will be automatically invoked if the F2 key is pressed.

If this flag is set to true pressing F2 will start the label editor.

The default value is true.


Implementation
    public function get labelEditingAllowed():Boolean
    public function set labelEditingAllowed(value:Boolean):void

See also

marqueeSelectableItemsproperty 
marqueeSelectableItems:uint

Determines which types of items should be selected during marquee selections.

The default value is A combination of GraphItemTypes.NODE, GraphItemTypes.EDGE and GraphItemTypes.BEND..


Implementation
    public function get marqueeSelectableItems():uint
    public function set marqueeSelectableItems(value:uint):void

See also

movableItemsproperty 
movableItems:uint

Determines which types of items should movable using the moveInputMode.

The default value is GraphItemTypes.ALL.


Implementation
    public function get movableItems():uint
    public function set movableItems(value:uint):void

See also

moveLabelInputModeproperty 
moveLabelInputMode:MoveLabelInputMode

The MoveLabelInputMode property.

This mode is responsible for moving labels to another candidate position. If the field has not yet been initialized upon first access, the factory method createMoveLabelInputMode will be called. Upon change the onMoveLabelInputModeChanged method will be called.

Setting a new MoveLabelInputMode is not allowed after the GraphEditorInputMode is installed and will throw an exception.


Implementation
    public function get moveLabelInputMode():MoveLabelInputMode
    public function set moveLabelInputMode(value:MoveLabelInputMode):void

Throws
IllegalOperationError IllegalOperationError: if the mode is set after the GraphEditorInputMode is installed.
moveLabelModeEnabledproperty 
moveLabelModeEnabled:Boolean

Whether the move label input mode is enabled.

The default value is true.

This property can be used as the source for data binding.


Implementation
    public function get moveLabelModeEnabled():Boolean
    public function set moveLabelModeEnabled(value:Boolean):void
multiSelectionRecognizerproperty 
multiSelectionRecognizer:Function

The event recognizer function that will be queried to decide if a click is deemed a multi selection gesture.

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

The default implementation will recognize events of type com.yworks.canvas.input.ClickEvent, if the ctrl key was pressed.


Implementation
    public function get multiSelectionRecognizer():Function
    public function set multiSelectionRecognizer(value:Function):void
navigationInputModeproperty 
navigationInputMode:NavigationInputMode

The keyboard navigation input mode.

This mode is responsible for navigating and traversing the elements in the IGraph. If the field has not yet been initialized upon first access, the factory method createNavigationInputMode will be called. Upon change the onNavigationInputModeChanged method will be called.

Setting a new NavigationInputMode is not allowed after the GraphEditorInputMode is installed and will throw an exception.


Implementation
    public function get navigationInputMode():NavigationInputMode
    public function set navigationInputMode(value:NavigationInputMode):void

Throws
IllegalOperationError IllegalOperationError: if the mode is set after the GraphEditorInputMode is installed.
navigationModeEnabledproperty 
navigationModeEnabled:Boolean

Whether the keyboard navigation input mode is enabled.

The default value is true.

This property can be used as the source for data binding.


Implementation
    public function get navigationModeEnabled():Boolean
    public function set navigationModeEnabled(value:Boolean):void
navigationModePriorityproperty 
navigationModePriority:Number

The keyboard navigation mode priority.

The default value is 55.


Implementation
    public function get navigationModePriority():Number
    public function set navigationModePriority(value:Number):void
nodeCreationAllowedproperty 
nodeCreationAllowed:Boolean

Whether createNode will be called when the canvas is clicked.


Implementation
    public function get nodeCreationAllowed():Boolean
    public function set nodeCreationAllowed(value:Boolean):void

See also

nodeCreatorproperty 
nodeCreator:Function

The callback that is responsible for creating a new node, e.g. in response to a mouse click.

The node creator function has to take the current context and IGraph instance and the IPoint location as arguments, and returns the created node:

		 var nodeCreator:Function = function( context:IInputModeContext, graph:IGraph, location:IPoint ):INode {
		   var node:INode = ..
		   ..
		   return node;
		 }
		 


Implementation
    public function get nodeCreator():Function
    public function set nodeCreator(value:Function):void
orthogonalEdgeEditingContextproperty 
orthogonalEdgeEditingContext:OrthogonalEdgeEditingContext

Gets or sets the orthogonal edge editing context.

The default value is null..


Implementation
    public function get orthogonalEdgeEditingContext():OrthogonalEdgeEditingContext
    public function set orthogonalEdgeEditingContext(value:OrthogonalEdgeEditingContext):void
pasteDeltaproperty 
pasteDelta:IPoint

The offset for paste operation if clipboard operations are enabled.

The default value is (15, 15).


Implementation
    public function get pasteDelta():IPoint
    public function set pasteDelta(value:IPoint):void
reparentNodeHandlerproperty 
reparentNodeHandler:IReparentNodeHandler

Gets or sets the reparentNodeHandler property.

This handler will be delegated to by an implementation of the IReparentNodeHandler interface that this class puts into the childInputModeContextLookup. The child input modes will query this interface to perform node reparenting operations if the graph is an IGroupedGraph. If the field has not yet been initialized upon first access, the factory method createReparentNodeHandler will be called. Upon change the onReparentNodeHandlerChanged method will be called.


Implementation
    public function get reparentNodeHandler():IReparentNodeHandler
    public function set reparentNodeHandler(value:IReparentNodeHandler):void

See also

reparentNodesAllowedproperty 
reparentNodesAllowed:Boolean

Gets or sets a property that determines whether the user may reparent nodes using a move gesture.

This setting is only of relevance if the graph is a hierarchic graph. This setting overrides the currently set reparentNodeHandler if set to false.

The default value is true.


Implementation
    public function get reparentNodesAllowed():Boolean
    public function set reparentNodesAllowed(value:Boolean):void

See also

selectableItemsproperty 
selectableItems:uint

Determines which types of items should be selectable at all.

The default value is GraphItemTypes.ALL.


Implementation
    public function get selectableItems():uint
    public function set selectableItems(value:uint):void

See also

showHandleItemsproperty 
showHandleItems:uint

Determines which types of items should have their IHandles shown.

The default value is GraphItemTypes.ALL.


Implementation
    public function get showHandleItems():uint
    public function set showHandleItems(value:uint):void

See also

textEditorInputModeproperty 
textEditorInputMode:TextEditorInputMode

The textEditorInputMode property.

If the field has not yet been initialized upon first access, the factory method createTextEditorInputMode will be called. Upon change the onTextEditorInputModeChanged method will be called.

Setting a new TextEditorInputMode is not allowed after the GraphEditorInputMode is installed and will throw an exception.


Implementation
    public function get textEditorInputMode():TextEditorInputMode
    public function set textEditorInputMode(value:TextEditorInputMode):void

Throws
IllegalOperationError IllegalOperationError: if the mode is set after the GraphEditorInputMode is installed.
textEditorModeEnabledproperty 
textEditorModeEnabled:Boolean

Whether the text editor input mode is enabled.

The default value is true.

This property can be used as the source for data binding.


Implementation
    public function get textEditorModeEnabled():Boolean
    public function set textEditorModeEnabled(value:Boolean):void
textEditorModePriorityproperty 
textEditorModePriority:Number

The TextEditorInputModePriority property.

The default value is 100.


Implementation
    public function get textEditorModePriority():Number
    public function set textEditorModePriority(value:Number):void
undoOperationsAllowedproperty 
undoOperationsAllowed:Boolean

Determines whether undo/redo operations with the usual shortcuts are enabled on the canvas.

The default value is true.


Implementation
    public function get undoOperationsAllowed():Boolean
    public function set undoOperationsAllowed(value:Boolean):void
ungroupSelectionAllowedproperty 
ungroupSelectionAllowed:Boolean

Determines whether Ctrl-U-presses should result in calls to ungroupSelection().

The default value is true.


Implementation
    public function get ungroupSelectionAllowed():Boolean
    public function set ungroupSelectionAllowed(value:Boolean):void

See also

Constructor Detail
GraphEditorInputMode()Constructor
public function GraphEditorInputMode(graph:IGraph = null, selectionModel:ISelectionModel = null)

Creates a new instance.

When no graph and no selection model is provided, they will be set when the input mode is installed on a GraphCanvasComponent.

Parameters
graph:IGraph (default = null) — The IGraph to work on.
 
selectionModel:ISelectionModel (default = null) — The ISelectionModel to work with.

See also

Method Detail
adjustContentRect()method
public function adjustContentRect():void

Updates the canvas' contentRect using CanvasComponent#updateContentRect() and contentRectMargins.

This method is called whenever the content changes and autoAdjustContentRect is set to AdjustContentRectPolicy.ALWAYS or AdjustContentRectPolicy.UNION.

See also

childInputModeContextLookup()method 
override protected function childInputModeContextLookup(type:Class):Object

Parameters

type:Class

Returns
Object
click()method 
protected function click(item:IModelItem, evt:ClickEvent):void

Actually performs the click operation on the given item.

This will dispatch the GraphEditorEvent.ITEM_CLICKED event and unless the event is handled by any of the event handlers (event.isDefaultPrevented()), this will ultimately select the item and possibly self loop bends, if autoSelectSelfloopBends is enabled. The previous selection will be cleared, unless the multiSelectionRecognizer is triggered.

Parameters

item:IModelItem — The item that has been clicked.
 
evt:ClickEvent — The ClickEvent that is being processed.

See also

closeLabelEditor()method 
public function closeLabelEditor(cancel:Boolean):void

Closes the label editor if it is currently open.

Parameters

cancel:Boolean — Whether to cancel the editor and discard changes.

copy()method 
public function copy():void

Copies the currently selected elements to the clipboard.

createCreateBendInputMode()method 
protected function createCreateBendInputMode():CreateBendInputMode

Factory method for the createBendInputMode property.

This method will be called upon first access to the createBendInputMode property.

Returns
CreateBendInputMode — A new instance of CreateBendInputMode.
createCreateEdgeInputMode()method 
protected function createCreateEdgeInputMode():CreateEdgeInputMode

Factory method for the createEdgeInputMode property.

This method will be called upon first access to the createEdgeInputMode property.

Returns
CreateEdgeInputMode — A new instance of CreateEdgeInputMode.
createDefaultLabelConfiguration()method 
protected function createDefaultLabelConfiguration(labeledItem:ILabeledItem):ILabelConfiguration

Callback method to create a custom label configuration when a new label should be created.

Parameters

labeledItem:ILabeledItem — the item a new label will be created for.

Returns
ILabelConfiguration — A default label configuration
createHitTestIterator()method 
protected function createHitTestIterator():IHitTestIterator

Factory method for the hitTestEnumerator property.

This method will be called upon first access to the hitTestIterator property. The hit test iterator is responsible for enumerating possible hits for a given coordinate in the world coordinate system given the current state of the canvas.

Returns
IHitTestIterator
createLabel()method 
public function createLabel(labeledItem:ILabeledItem):void

Interactively creates a new label for the provided labeled item.

this method will invoke the text editor that will let the user edit the text of the label. If the user commits the label text the label will be added to the labeled item.

Parameters

labeledItem:ILabeledItem — The item to create a new label for.

See also

createMoveInputMode()method 
override protected function createMoveInputMode():MoveInputMode

Returns
MoveInputMode
createMoveLabelInputMode()method 
protected function createMoveLabelInputMode():MoveLabelInputMode

Factory method for the MoveLabelInputMode property.

This method will be called upon first access to the moveLabelInputMode property.

Returns
MoveLabelInputMode — a new instance of MoveLabelInputMode
createMoveUnselectedInputMode()method 
override public function createMoveUnselectedInputMode(modifierRecognizer:Function = null):MoveInputMode

Parameters

modifierRecognizer:Function (default = null)

Returns
MoveInputMode
createNavigationInputMode()method 
protected function createNavigationInputMode():NavigationInputMode

Factory method for the navigationInputMode property.

This method will be called upon first access to the navigationInputMode property.

Returns
NavigationInputMode — a new instance of NavigationInputMode
createNode()method 
public function createNode(clickPoint:IPoint):INode

Creates a node given a certain click point.

This implementation delegates to the current nodeCreator or simply returns null if there is no such callback.

Parameters

clickPoint:IPoint — The point where the mouse had been clicked.

Returns
INode — The newly created node or null.
createReparentNodeHandler()method 
protected function createReparentNodeHandler():IReparentNodeHandler

Factory method for the ReparentNodeHandler property. This method will be called upon first access to the reparentNodeHandler property.

Returns
IReparentNodeHandler — a new instance of ReparentNodeHandler

See also

createTextEditorInputMode()method 
protected function createTextEditorInputMode():TextEditorInputMode

Factory method for the textEditorInputMode property.

This method will be called upon first access to the textEditorInputMode property.

Returns
TextEditorInputMode — A new instance of TextEditorInputMode.
cut()method 
public function cut():void

Cuts and inserts the currently selected elements to the clipboard.

deleteSelection()method 
public function deleteSelection():void

This method deletes the currently selected elements.

disableAll()method 
override public function disableAll():void

Disables all submodes.

dispose()method 
override public function dispose():void

dragBend()method 
public function dragBend(bend:IBend):void

Initiates the handleInputMode to drag the given bend.

Parameters

bend:IBend — The bend to drag.

editLabel()method 
public function editLabel(label:ILabel):void

Triggers the editing of the given label.

This implementation uses the canvas.input.TextEditorInputMode to display en editor to edit the label.

Parameters

label:ILabel — The label to edit.

See also

finalizeNodeReparenting()method 
protected function finalizeNodeReparenting(reparentedNodes:Iterable):void

Called when a reparenting gesture is finished.

This method moves the reparented nodes to the front.

Parameters

reparentedNodes:Iterable — The nodes that have been reparented.

See also

findHits()method 
public function findHits(clickPoint:IPoint, tests:Array):IModelItem

Used as a callback to find hits underneath a certain clicked point.

This implementation uses the hitTestIterator to determine the hits and getClosestHits to find the closest of several possible hits.

Parameters

clickPoint:IPoint — The point where the click occurred
 
tests:Array — An array of HitTest constants that encode for which model items the click should be recognized.

Returns
IModelItem — The model item which has been hit

See also

getClosestHits()method 
protected function getClosestHits(modelItems:Iterator, location:IPoint):Iterator

This method filters the passed IModelItems and returns only those closest to the passed location. It is used by the method findHits and delegates to HitTestUtil.getClosestHits.

Parameters

modelItems:Iterator — The model items to filter.
 
location:IPoint — The location the model items shall be closest to.

Returns
Iterator — An iterator with those model items closest to the given location.

See also

findHits
HitTestUtil.getClosestHits
groupSelection()method 
public function groupSelection():INode

Creates a new group for all of the currently selected elements.

This implementation will delegate the actual creation of the group to the graph's IGroupedGraph's groupNodes() implementation found in the lookup of the graph. By default, this method will be called in response to a Ctrl-G-key press recognized by the keyboardInputMode. This method will also clear the selection and select the newly created group node.

Returns
INode

See also

handleActionButtonProvider()method 
protected function handleActionButtonProvider(context:IInputModeContext, item:IModelItem):Boolean

Called by click to query the item for a IActionButtonProvider in its lookup and handle it appropriately.

This method will query the IActionButtonProvider and check whether the click occured inside the provided button bounds, and if so, will invoke the action and and return true.

Parameters

context:IInputModeContext — The context for the click.
 
item:IModelItem — The item that has been clicked.

Returns
Boolean — Whether the action has been invoked and handling should be stopped.

See also

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

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

Installs this mode into the given context.

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

Parameters

context:IInputModeContext — The input mode context that this instance shall be installed into.

marqueeSelectElements()method 
override public function marqueeSelectElements(marqueeRectangle:IRectangle):void

This method will marquee select the items in the graph.

Parameters

marqueeRectangle:IRectangle — The selection rectangle

See also

onClickInputModeClicked()method 
override protected function onClickInputModeClicked(evt:ClickEvent):void

Called when the mouse has been clicked at a given location.

This implementation will use the findHits method to determine what has been clicked and then invoke click if clickSelectableItems is set to values other than GraphItemTypes.NONE. If an item has been hit, the current selection will be cleared, unless the multiSelectionRecognizer is triggered. If nothing has been hit, it will clear the current selection.

Otherwise, if nodeCreationAllowed is true, a node will be created using the createNode callback.

Parameters

evt:ClickEvent

See also

onContextMenuInputModeMenuSelect()method 
override protected function onContextMenuInputModeMenuSelect(evt:CanvasContextMenuEvent):void

Parameters

evt:CanvasContextMenuEvent

onCreateBendInputModeBendCreated()method 
protected function onCreateBendInputModeBendCreated(evt:BendCreatedEvent):void

Callback that is called as soon as createBendInputMode created a new bend.

This method selects the bend and starts the handleInputMode using the handle for the newly created bend. The bend is created using the hit edge's IBendCreator implementation, as obtained from the edge's ILookup.lookup and calls dragBend.

Parameters

evt:BendCreatedEvent — the Event dispatched by the createBendInputMode.

onCreateBendInputModeChanged()method 
protected function onCreateBendInputModeChanged(oldCreateBendInputMode:CreateBendInputMode, newCreateBendInputMode:CreateBendInputMode):void

Called when the createBendInputMode property value changes.

Parameters

oldCreateBendInputMode:CreateBendInputMode — The old input mode
 
newCreateBendInputMode:CreateBendInputMode — The new input mode

onCreateEdgeInputModeChanged()method 
protected function onCreateEdgeInputModeChanged(oldCreateEdgeInputMode:CreateEdgeInputMode, newCreateEdgeInputMode:CreateEdgeInputMode):void

Called when the createEdgeInputMode property value changes

Parameters

oldCreateEdgeInputMode:CreateEdgeInputMode — The old input mode
 
newCreateEdgeInputMode:CreateEdgeInputMode — The new input mode

onCreateEdgeInputModeEdgeCreated()method 
protected function onCreateEdgeInputModeEdgeCreated(evt:GraphEditorEvent):void

Callback that is called as soon as createEdgeInputMode created a new edge.

Parameters

evt:GraphEditorEvent — the Event dispatched by the createEdgeInputMode.

onCtrlAPressed()method 
protected function onCtrlAPressed(evt:KeyboardEvent):void

Callback that delegates to selectAll if selectElementsAllowed is true.

Parameters

evt:KeyboardEvent

onDeletePressed()method 
protected function onDeletePressed(evt:KeyboardEvent):void

Callback that delegates to deleteSelection if deleteElementsAllowed is true.

Parameters

evt:KeyboardEvent

onEditLabel()method 
protected function onEditLabel():void

Callback that is invoked if the F2 key is pressed and labelEditingAllowed is set to true.

This method determines the label to edit and delegates to editLabel .

onF2KeyPressed()method 
protected function onF2KeyPressed(evt:KeyboardEvent):void

Callback that triggers OnEditLabel.

Parameters

evt:KeyboardEvent

onGraphCanvasChanged()method 
protected function onGraphCanvasChanged(oldCanvas:GraphCanvasComponent, newCanvas:GraphCanvasComponent):void

Called when the graphCanvas property changes.

This will update the internal state of the modes.

Parameters

oldCanvas:GraphCanvasComponent — The old canvas
 
newCanvas:GraphCanvasComponent — The new canvas

onGraphChanged()method 
protected function onGraphChanged(oldGraph:IGraph, newGraph:IGraph):void

Called when the graph property changes. This will update the internal state of the modes.

Parameters

oldGraph:IGraph — The old graph instance.
 
newGraph:IGraph — The new graph instance.

onGraphSelectionChanged()method 
protected function onGraphSelectionChanged(oldSelection:IGraphSelection, newSelection:IGraphSelection):void

Called when the graphSelection property changes.

This will update the internal state of the modes.

Parameters

oldSelection:IGraphSelection — The old selection
 
newSelection:IGraphSelection — The new selection

onHandleInputModeChanged()method 
override protected function onHandleInputModeChanged(oldHandleInputMode:HandleInputMode, newHandleInputMode:HandleInputMode):void

Parameters

oldHandleInputMode:HandleInputMode
 
newHandleInputMode:HandleInputMode

onKeyboardInputModeChanged()method 
override protected function onKeyboardInputModeChanged(oldKeyboardInputMode:KeyboardInputMode, newKeyboardInputMode:KeyboardInputMode):void

Parameters

oldKeyboardInputMode:KeyboardInputMode
 
newKeyboardInputMode:KeyboardInputMode

onLabelAdded()method 
protected function onLabelAdded(label:ILabel):void

Called when a new Label is added after pressing F2.

Parameters

label:ILabel — The new label.

onMoveInputModeChanged()method 
override protected function onMoveInputModeChanged(oldMoveInputMode:MoveInputMode, newMoveInputMode:MoveInputMode):void

Parameters

oldMoveInputMode:MoveInputMode
 
newMoveInputMode:MoveInputMode

onMoveInputModeMoveFinished()method 
protected function onMoveInputModeMoveFinished(evt:DragEvent):void

Called when a drag operation is finished

Parameters

evt:DragEvent — The DragEvent which was fired upon finishing

onMoveLabelInputModeChanged()method 
protected function onMoveLabelInputModeChanged(oldMoveLabelInputMode:MoveLabelInputMode, newMoveLabelInputMode:MoveLabelInputMode):void

Called when the moveLabelInputMode property value changes and after initialization of the field.

Parameters

oldMoveLabelInputMode:MoveLabelInputMode — the old value, which may be null the first time
 
newMoveLabelInputMode:MoveLabelInputMode — the new value

onMoveLabelInputModeMoveFinished()method 
protected function onMoveLabelInputModeMoveFinished(evt:DragEvent):void

Callback that is called as soon as moveLabelInputMode has moved a label.

Parameters

evt:DragEvent — the Event dispatched by the moveLabelInputMode.

onNavigationInputModeChanged()method 
protected function onNavigationInputModeChanged(oldNavigationInputMode:NavigationInputMode, newNavigationInputMode:NavigationInputMode):void

Called when the navigationInputMode property value changes and after initialization of the field.

Parameters

oldNavigationInputMode:NavigationInputMode — the old value, which may be null the first time
 
newNavigationInputMode:NavigationInputMode — the new value

onNodeCreated()method 
protected function onNodeCreated(node:INode):void

Called when a new node is created by this input mode.

Dispatches a NodeCreatedEvent.NODE_CREATED event.

Parameters

node:INode — The newly created node.

onNodeReparented()method 
protected function onNodeReparented(node:INode, oldParent:INode, newParent:INode):void

Called when a node is reparented by this input mode.

Dispatches a GraphEditorHierarchyEvent.NODE_REPARENTED event.

Parameters

node:INode — The node that has been reparented.
 
oldParent:INode — The old parent of the node.
 
newParent:INode — The new parent of the node.

onReparentNodeHandlerChanged()method 
protected function onReparentNodeHandlerChanged(oldHandler:IReparentNodeHandler, newHandler:IReparentNodeHandler):void

Called when the reparentNodeHandler property value changes and after initialization of the field.

Parameters

oldHandler:IReparentNodeHandler — the old value, which may be null the first time
 
newHandler:IReparentNodeHandler — the new value

See also

onTextEditorInputModeChanged()method 
protected function onTextEditorInputModeChanged(oldTextEditorInputMode:TextEditorInputMode, newTextEditorInputMode:TextEditorInputMode):void

Called when the textEditorInputMode property value changes

Parameters

oldTextEditorInputMode:TextEditorInputMode
 
newTextEditorInputMode:TextEditorInputMode

onTextEditorInputModeTextEdited()method 
protected function onTextEditorInputModeTextEdited(evt:Event):void

Called when a label's text was edited by the TextEditorInputMode.

Parameters

evt:Event

onTextEditorInputModeTextEditingCanceled()method 
protected function onTextEditorInputModeTextEditingCanceled(evt:Event):void

Called when text editing was cancelled by the TextEditorInputMode.

Parameters

evt:Event

paste()method 
public function paste():void

Pastes the current clipboard contents.

redo()method 
public function redo():void

Redoes the last Redoable change.

Delegates to the graph's undoEngine's UndoEngine.redo method.

selectAll()method 
public function selectAll():void

Clears the current selection and selects all nodes and bends in this graph.

By default, this method will be called in response to a Ctrl-A-key press recognized by the keyboardInputMode

setCurrentItem()method 
public function setCurrentItem(currentItem:IModelItem):void

Callback that is used by this instance to set the current item on the GraphCanvasComponent.currentItem.

Parameters

currentItem:IModelItem — The item to set as the new "current" item.

setGraph()method 
protected function setGraph(newGraph:IGraph):void

Set a new Graph for this mode.

Triggers onGraphChanged.

Parameters

newGraph:IGraph

setGraphCanvas()method 
protected function setGraphCanvas(graphCanvas:GraphCanvasComponent):void

Sets the GraphCanvasComponent that is associated with this instance.

This will register a listener for the graphChanged and selectionChanged events to upgrade the graph and graphSelection property accordingly.

Parameters

graphCanvas:GraphCanvasComponent — the control to set.

setGraphSelection()method 
protected function setGraphSelection(newSelection:IGraphSelection):void

Set a new GraphSelection for this mode.

Triggers onGraphSelectionChanged.

Parameters

newSelection:IGraphSelection

setLabelText()method 
public function setLabelText(label:ILabel, text:String):void

Sets the label's text after it has been edited using editLabel.

This method gets called by onTextEditorInputModeTextEdited and depending on autoRemoveEmptyLabels it will either set the label's text or remove it from the graph.

Parameters

label:ILabel — The label to set the text or remove.
 
text:String — The new text.

shouldBeClickable()method 
protected function shouldBeClickable(item:IModelItem):Boolean

Callback that determines whether a GraphEditorEvent.ITEM_CLICKED should be dispatched for the provided IModelItem.

This implementation uses the clickableItems property to determine whether the item can be set to the current item.

Parameters

item:IModelItem — The item to check.

Returns
Boolean — Whether to select the item.
shouldBeClickSelectable()method 
protected function shouldBeClickSelectable(item:IModelItem):Boolean

Callback that determines whether the provided IModelItem should be selected upon mouse clicks.

This implementation uses the clickSelectableItems property to determine whether the item can be set to the current item.

Parameters

item:IModelItem — The item to check.

Returns
Boolean — Whether to select the item.
shouldBeDeleted()method 
protected function shouldBeDeleted(item:IModelItem):Boolean

Determines whether the item should be deleted.

Parameters

item:IModelItem — The item to check

Returns
Boolean — Whether to delete the item based on the setting of the corresponding deletableItems property.
shouldBeMarqueeSelectable()method 
override protected function shouldBeMarqueeSelectable(item:IModelItem):Boolean

Callback that determines whether the provided IModelItem should be selected upon marquee selection.

This implementation uses the marqueeSelectableItems property to determine whether the item can be set to the current item.

Parameters

item:IModelItem — The item to check.

Returns
Boolean — Whether to select the item.
shouldBeMovable()method 
override protected function shouldBeMovable(item:IModelItem):Boolean

Determines whether to make the item movable using the moveInputMode.

Parameters

item:IModelItem — The item to check.

Returns
Boolean — Whether to allow the item being moved by moveInputMode based on the setting of the movableItems property.

See also

shouldLabelBeEdited()method 
protected function shouldLabelBeEdited(item:IModelItem):Boolean

Callback method that determines whether the label or the labels of the provided item should be edited in response to onEditLabel.

This implementation returns true if the type of the given item is among the labelEditableItems.

Parameters

item:IModelItem — The item.

Returns
Boolean — Whether to edit the label or the labels for that item.

See also

shouldLabelBeEditedInternal()method 
yworks_internal function shouldLabelBeEditedInternal(item:IModelItem):Boolean

Parameters

item:IModelItem

Returns
Boolean
shouldSetToCurrentItem()method 
protected function shouldSetToCurrentItem(item:IModelItem):Boolean

Callback that determines whether the provided IModelItem should be set to the current item.

This implementation uses the focusableItems property to determine whether the item can be set to the current item.

Parameters

item:IModelItem — The item to check.

Returns
Boolean — Whether to set the item as the current item.
shouldShowHandles()method 
override protected function shouldShowHandles(item:IModelItem):Boolean

Determines whether to show the handles for the given item.

Parameters

item:IModelItem — The item to check

Returns
Boolean — Whether to show the item's handles based on the setting of the corresponding showHandleItems property.
toggleGroupNodeState()method 
public function toggleGroupNodeState(groupNode:INode):void

Toggles the expanded state for the given group node in the IFoldedGraph.

Parameters

groupNode:INode — The group node to toggle the state for.

See also

undo()method 
public function undo():void

Undoes the last undoable change.

Delegates to the graph's undoEngine's UndoEngine.undo method.

ungroupSelection()method 
public function ungroupSelection():void

Makes each of the currently selected nodes a direct child of the root group (if not already).

This implementation will delegate the actual re-parenting of nodes to the graph's IGroupedGraph's setParent() implementation found in the lookup of the graph.

By default, this method will be called in response to a Ctrl-U-key press recognized by the keyboardInputMode.

See also

com.yworks.model.IGroupedGraph.setParent()
uninstallCore()method 
override protected function uninstallCore(context:IInputModeContext):void

Unistalls this mode.

Deregisters event listeners from the graph canvas and sets the graph canvas for this input mode to null.

Parameters

context:IInputModeContext — The input mode context that this instance has been installed into.

Event Detail
bendCreated Event
Event Object Type: com.yworks.graph.input.GraphEditorEvent
GraphEditorEvent.type property = com.yworks.graph.input.GraphEditorEvent.BEND_CREATED

Dispatched when a new bend has been created by the user. The item property of the event contains the newly added bend.

Dispatched when a new bend has been created.
bendDeleted Event  
Event Object Type: com.yworks.graph.input.GraphEditorEvent
GraphEditorEvent.type property = com.yworks.graph.input.GraphEditorEvent.BEND_DELETED

Dispatched when bend has been deleted by the user. The item property of the event contains the bend which has been removed. Note that the item is not part of the graph anymore at the time this event is dispatched.

This event will only be dispatched if the bend is explicitly deleted by the user. It will not be dispatched if the bend is removed because its edge is removed.

Dispatched when a bend has been deleted by the GraphEditorInputMode.

This event will only be dispatched for bends which will be deleted by direct user interaction, i.e. which were selected when the delete key was pressed. It will not be dispatched if a bend is removed because its edge is removed.

currentItemChanged Event  
Event Object Type: com.yworks.graph.input.GraphEditorEvent
GraphEditorEvent.type property = com.yworks.graph.input.GraphEditorEvent.CURRENT_ITEM_CHANGED

Dispatched when the current item changed.

Only focusableItems trigger this event.

Dispatched when a when the current item has changed.
deletingBend Event  
Event Object Type: com.yworks.graph.input.GraphEditorEvent
GraphEditorEvent.type property = com.yworks.graph.input.GraphEditorEvent.DELETING_BEND

Dispatched before a bend will be deleted by the user. The item property of the event contains the bend which will be removed.

This event will only be dispatched if the bend is explicitly deleted by the user. It will not be dispatched if the bend is removed because its edge is removed.

Dispatched when a bend will be deleted by the GraphEditorInputMode.
deletingEdge Event  
Event Object Type: com.yworks.graph.input.GraphEditorEvent
GraphEditorEvent.type property = com.yworks.graph.input.GraphEditorEvent.DELETING_EDGE

Dispatched before an edge will be deleted by the user. The item property of the event contains the edge which will be removed.

This event will only be dispatched if the edge is explicitly deleted by the user. It will not be dispatched if the edge is removed because its source or target node is removed.

Dispatched when an edge will be deleted by the GraphEditorInputMode.

This event will only be dispatched for edges which will be deleted by direct user interaction, i.e. which were selected when the delete key was pressed. It will not be dispatched if an edge is removed because its source or parent node is removed.

deletingLabel Event  
Event Object Type: com.yworks.graph.input.GraphEditorEvent
GraphEditorEvent.type property = com.yworks.graph.input.GraphEditorEvent.DELETING_LABEL

Dispatched before a label will be deleted by the user. The item property of the event contains the label which will be deleted.

This event will only be dispatched if the label is explicitly deleted by the user. It will not be dispatched if the label is removed because its owner is removed or because its text is set to null.

Dispatched when a label will be deleted by the GraphEditorInputMode.

This event will only be dispatched for labels which will be deleted by direct user interaction, i.e. which were selected when the delete key was pressed. It will not be dispatched if a label is removed because its owner is removed.

deletingNode Event  
Event Object Type: com.yworks.graph.input.GraphEditorEvent
GraphEditorEvent.type property = com.yworks.graph.input.GraphEditorEvent.DELETING_NODE

Dispatched before a node will be deleted by the user. The item property of the event contains the node which will be deleted.

Dispatched when a node will be deleted by the GraphEditorInputMode.
edgeCreated Event  
Event Object Type: com.yworks.graph.input.GraphEditorEvent
GraphEditorEvent.type property = com.yworks.graph.input.GraphEditorEvent.EDGE_CREATED

Dispatched when an edge is added by the user. The item property of the event contains the newly added edge.

Dispatched when a new edge has been created.

This event will only be dispatched for bends which have been deleted by direct user interaction, i.e. which were selected when the delete key was pressed. It will not be dispatched if a bend is removed because its edge is removed.

edgeDeleted Event  
Event Object Type: com.yworks.graph.input.GraphEditorEvent
GraphEditorEvent.type property = com.yworks.graph.input.GraphEditorEvent.EDGE_DELETED

Dispatched when an edge has been deleted by the user. The item property of the event contains the edge which has been removed. Note that the item is not part of the graph anymore at the time this event is dispatched.

This event will only be dispatched if the edge is explicitly deleted by the user. It will not be dispatched if the edge is removed because its source or target node is removed.

Dispatched when an edge has been deleted by the GraphEditorInputMode.

This event will only be dispatched for edges which will be deleted by direct user interaction, i.e. which were selected when the delete key was pressed. It will not be dispatched if an edge is removed because its source or parent node is removed.

itemClicked Event  
Event Object Type: com.yworks.graph.input.GraphEditorEvent
GraphEditorEvent.type property = com.yworks.graph.input.GraphEditorEvent.ITEM_CLICKED

Dispatched when a graph item has been clicked.

Only clickSelectableItems trigger this event.

Dispatched when a graph element has been clicked.
labelChanged Event  
Event Object Type: com.yworks.graph.input.GraphEditorEvent
GraphEditorEvent.type property = com.yworks.graph.input.GraphEditorEvent.LABEL_CHANGED

Dispatched when a label is changed by the user (after pressing F2 key). The item property of the event contains the changed label.

Dispatched when a label has been edited.
labelCreated Event  
Event Object Type: com.yworks.graph.input.GraphEditorEvent
GraphEditorEvent.type property = com.yworks.graph.input.GraphEditorEvent.LABEL_CREATED

Dispatched when a label is added by the user (after pressing F2 key). The item property of the event contains the newly added label.

Dispatched when a new label has been created.
labelDeleted Event  
Event Object Type: com.yworks.graph.input.GraphEditorEvent
GraphEditorEvent.type property = com.yworks.graph.input.GraphEditorEvent.LABEL_DELETED

Dispatched when a label has been deleted by the user. The item property of the event contains the label which has been removed. Note that the item is not part of the graph anymore at the time this event is dispatched.

This event will only be dispatched if the label is explicitly deleted by the user. It will not be dispatched if the label is removed because its owner is removed or because its text is set to null.

Dispatched when a label has been deleted by the GraphEditorInputMode.

This event will only be dispatched for labels which were deleted by direct user interaction, i.e. which were selected when the delete key was pressed. It will not be dispatched if a label is removed because its owner is removed.

nodeCreated Event  
Event Object Type: com.yworks.graph.input.GraphEditorEvent
GraphEditorEvent.type property = com.yworks.graph.input.GraphEditorEvent.NODE_CREATED

Dispatched when a node is added by the user. The item property of the event contains the newly added node.

Dispatched when a new node has been created.
nodeDeleted Event  
Event Object Type: com.yworks.graph.input.GraphEditorEvent
GraphEditorEvent.type property = com.yworks.graph.input.GraphEditorEvent.NODE_DELETED

Dispatched when a node has been deleted by the user. The item property of the event contains the node which has been removed. Note that the item is not part of the graph anymore at the time this event is dispatched.

Dispatched when a node has been deleted by the GraphEditorInputMode.
nodeReparented Event  
Event Object Type: com.yworks.graph.input.GraphEditorHierarchyEvent
GraphEditorHierarchyEvent.type property = com.yworks.graph.input.GraphEditorHierarchyEvent.NODE_REPARENTED

Dispatched when a node is reparented by the user.

Dispatched when a node has been assigned to a new parent.