Package | com.yworks.graph.input |
Class | public class GraphEditorInputMode |
Inheritance | GraphEditorInputMode MainInputMode MultiplexingInputMode AbstractConcurrentInputMode AbstractInputMode flash.events.EventDispatcher |
Implements | mx.core.IMXMLObject, com.yworks.graph.input.IToggleGroupNodeStateInputMode |
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:
marqueeSelectableItems
:Determines
the type of the items that can be selected with the MarqueeSelectionInputMode
clickSelectableItems
:
Determines the type of the items that can be selected with the mouse.movableItems
:
Determines the type of the items that can be moved with the mouse.showHandleItems
:
Determines the type of the items whose IHandle
s should be shown and
movable by the HandleInputMode
.deletableItems
: Determines the type
of the items that can be deleted by
deleteSelection
.focusableItems
:
Determines the type of the items that can be set as the GraphCanvasComponent
's
currentItem
.clickableItems
: Determines for which types
of items a GraphEditorEvent.ITEM_CLICKED
event will be dispatched upon mouse click.groupSelectionAllowed
:
Determines whether this input mode should allow grouping the current selection.ungroupSelectionAllowed
:
Determines whether this input mode should allow ungrouping the current selection.clearSelectionAllowed
:
Determines whether this input mode should allow clearing the selection.clipboardOperationsAllowed
:
Determines whether this input mode should enable graph clipboard operations.labelEditingAllowed
:
Determines whether this input mode should allow editing labels.reparentNodesAllowed
:
Determines whether this input mode should allow reparenting nodes to other groups.nodeCreationAllowed
:
Determines whether this input mode should allow creating new nodes.
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.
Actionscript:
var geim:GraphEditorInputMode = new GraphEditorInputMode(); graphCanvas.inputMode = geim; // graphCanvas is an initialized GraphCanvasComponent
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.
Property | Defined 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 | ||
bridgeUpdateMode : BridgeUpdateMode
Determines how bridges shall be rendered during a move or drag. | MainInputMode | ||
canvas : 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 | ||
clickInputMode : ClickInputMode
The ClickInputMode property. | MainInputMode | ||
clickModeEnabled : Boolean
Whether the click input mode is enabled. | MainInputMode | ||
clickModePriority : 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 | ||
collectionModel : 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 | ||
contextMenuInputMode : ContextMenuInputMode
The contextMenuInputMode property. | MainInputMode | ||
contextMenuModeEnabled : Boolean
Whether the context menu input mode is enabled. | MainInputMode | ||
contextMenuModePriority : int
The context menu mode priority. | MainInputMode | ||
controller : 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 | ||
defaultCursor : 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 | ||
enabled : 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 | ||
handleInputMode : HandleInputMode
The HandleInputMode property. | MainInputMode | ||
handleModeEnabled : Boolean
Whether the handle input mode is enabled. | MainInputMode | ||
handleModePriority : int
The handle mode priority. | MainInputMode | ||
hitTestIterator : IHitTestIterator
Gets or sets the HitTestEnumerator property. | GraphEditorInputMode | ||
hitTestOrdering : Array
The hitTestOrdering. | GraphEditorInputMode | ||
inputModeCanvasGroup : ICanvasObjectGroup
The canvas group that can be used by input modes to add temporary top-level
canvas objects to. | MainInputMode | ||
inputModeContext : IInputModeContext [read-only]
The context instance this mode is currently installed in or
null if this instance is not installed. | AbstractInputMode | ||
installed : Boolean [read-only]
Whether this mode is currently installed, i.e
if a call to the canvas property will yield a non-null result. | AbstractInputMode | ||
keyboardInputMode : KeyboardInputMode
The keyboard input mode. | MainInputMode | ||
keyboardModeEnabled : Boolean
Whether the keyboard input mode is enabled. | MainInputMode | ||
keyboardModePriority : 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 | ||
marqueeSelectionInputMode : MarqueeSelectionInputMode
The MarqueeSelectionInputMode property. | MainInputMode | ||
marqueeSelectionModeEnabled : Boolean
Whether the marquee selection input mode is enabled. | MainInputMode | ||
marqueeSelectionModePriority : int
The marquee selection mode priority. | MainInputMode | ||
movableItems : uint
Determines which types of
items should movable using the moveInputMode. | GraphEditorInputMode | ||
moveInputMode : MoveInputMode
The MoveInputMode property. | MainInputMode | ||
moveLabelInputMode : MoveLabelInputMode
The MoveLabelInputMode property. | GraphEditorInputMode | ||
moveLabelModeEnabled : Boolean
Whether the move label input mode is enabled. | GraphEditorInputMode | ||
moveModeEnabled : Boolean
Whether the move input mode is enabled. | MainInputMode | ||
moveModePriority : 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 | ||
preferredCursor : 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 | ||
selectionModel : ISelectionModel
Gets or sets the selectionModel property
| MainInputMode | ||
showHandleItems : uint
Determines which types of
items should have their IHandles shown. | GraphEditorInputMode | ||
snapContext : 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 |
Method | Defined By | ||
---|---|---|---|
Creates a new instance. | GraphEditorInputMode | ||
add(inputMode:IInputMode, priority:int = 0):void
Adds an input mode using the given priority to this compound mode. | MultiplexingInputMode | ||
addConcurrent(inputMode:IConcurrentInputMode, priority:int):void
Adds an input mode as a concurrent mode using the given priority to this compound mode. | MultiplexingInputMode | ||
adjustContentRect():void
Updates the canvas' contentRect using
CanvasComponent#updateContentRect() and
contentRectMargins. | GraphEditorInputMode | ||
adjustCursor():void
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 | ||
cancel():void [override]
Cancels all modes. | MultiplexingInputMode | ||
clearSelection():void
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 | ||
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 | ||
Creates a node given a certain click point. | GraphEditorInputMode | ||
cut():void
Cuts and inserts the currently selected elements to the clipboard. | GraphEditorInputMode | ||
deleteSelection():void
This method deletes the currently selected elements. | GraphEditorInputMode | ||
disableAll():void [override]
Disables all submodes. | GraphEditorInputMode | ||
dispose():void [override]
| GraphEditorInputMode | ||
Initiates the handleInputMode to drag the given bend. | GraphEditorInputMode | ||
Triggers the editing of the given label. | GraphEditorInputMode | ||
Used as a callback to find hits underneath a certain clicked point. | GraphEditorInputMode | ||
Returns an ICanvasGroupProvider instance for this input mode
| MainInputMode | ||
Finds the IConcurrentInputMode that currently
owns the mutex or null.
| MultiplexingInputMode | ||
Creates a new group for all of the currently selected elements. | GraphEditorInputMode | ||
initialized(document:Object, id:String):void
Called automatically by the MXML compiler when the instance is created
using an MXML tag. | MainInputMode | ||
install(context:IInputModeContext):void
Installs this mode into the canvas of the given context. | AbstractInputMode | ||
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 | ||
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 | ||
setSelected(item:IModelItem, selected:Boolean):void
Uses the selectionModel to select the given item. | MainInputMode | ||
Returns a list of all modes managed by this instance in sorted order. | MultiplexingInputMode | ||
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 | ||
ungroupSelection():void
Makes each of the currently selected nodes a direct child of the root group (if not already). | GraphEditorInputMode | ||
uninstall(context:IInputModeContext):void
Uninstalls this mode from the canvas. | AbstractInputMode |
Method | Defined By | ||
---|---|---|---|
canRequestMutex():Boolean
Determines whether this instance can request the InputMutex. | AbstractConcurrentInputMode | ||
childInputModeContextLookup(type:Class):Object [override]
| GraphEditorInputMode | ||
Actually performs the click operation on the given item. | GraphEditorInputMode | ||
Create the ConcurrencyController that is used to manage the concurrency of
the child input modes. | MultiplexingInputMode | ||
Factory method for the ClickInputMode property. | MainInputMode | ||
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 | ||
Factory method for the HandleInputMode property. | MainInputMode | ||
Factory method for the hitTestEnumerator property. | GraphEditorInputMode | ||
Creates the inputModeController that will
be used to coordinate the selection and the handles, etc. | MainInputMode | ||
Factory method that creates the keyboard input mode instance. | MainInputMode | ||
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 | ||
fireInstalled():void | AbstractInputMode | ||
fireInstalling():void | AbstractInputMode | ||
fireUninstalled():void | AbstractInputMode | ||
fireUninstalling():void | AbstractInputMode | ||
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 | ||
hasMutex():Boolean
Determines whether this instance owns the input mutex. | AbstractConcurrentInputMode | ||
initialize():void [override]
| GraphEditorInputMode | ||
installCore(context:IInputModeContext):void [override]
Installs this mode into the given context. | GraphEditorInputMode | ||
invalidate():void
Convenience method for subclass implementations that invalidates
the canvasComponent this mode is currently installed in. | AbstractInputMode | ||
Called when the clickInputMode property value changes
and after initialization of the field. | MainInputMode | ||
onClickInputModeClicked(evt:ClickEvent):void [override]
Called when the mouse has been clicked at a given location. | GraphEditorInputMode | ||
onCollectionModelChanged(oldCollectionModel:ICollectionModel, newCollectionModel:ICollectionModel):void
Callback that gets triggered once the collectionModel property changes. | MainInputMode | ||
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 | ||
onDisabled():void [override]
Called when the AbstractConcurrentInputMode.enabled property changes to
false. | MultiplexingInputMode | ||
onEditLabel():void
Callback that is invoked if the F2 key is pressed and labelEditingAllowed is
set to true. | GraphEditorInputMode | ||
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 | ||
Called when the graph property changes. | GraphEditorInputMode | ||
Called when the graphSelection property changes. | GraphEditorInputMode | ||
onHandleInputModeChanged(oldHandleInputMode:HandleInputMode, newHandleInputMode:HandleInputMode):void [override]
| GraphEditorInputMode | ||
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 | ||
onMarqueeSelectionInputModeChanged(oldMarqueeSelectionInputMode:MarqueeSelectionInputMode, newMarqueeSelectionInputMode:MarqueeSelectionInputMode):void
Called when the marqueeSelectionInputMode property value changes
and after initialization of the field. | MainInputMode | ||
onMarqueeSelectionInputModeMarqueeSelected(evt:Event):void
Callback used by MarqueeSelectionInputMode if the user
has finished creating the marquee selection. | MainInputMode | ||
[override]
| GraphEditorInputMode | ||
onMoveInputModeDragFinished(evt:Event):void
Callback method that will be triggered when a drag has been finished. | MainInputMode | ||
onMoveInputModeMoveFinished(evt:DragEvent):void
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 | ||
onMoveLabelInputModeMoveFinished(evt:DragEvent):void
Callback that is called as soon as moveLabelInputMode
has moved a label. | GraphEditorInputMode | ||
onMutexObtained():void
Called when this instance obtains the InputMutex. | AbstractConcurrentInputMode | ||
onMutexReleased():void
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 | ||
Called when a node is reparented by this input mode. | GraphEditorInputMode | ||
Called when the preferredCursor property changes. | AbstractConcurrentInputMode | ||
Called when the reparentNodeHandler property value changes
and after initialization of the field. | GraphEditorInputMode | ||
Callback that gets triggered once the selectionModel property changes. | MainInputMode | ||
MainInputMode | |||
onTextEditorInputModeChanged(oldTextEditorInputMode:TextEditorInputMode, newTextEditorInputMode:TextEditorInputMode):void
Called when the textEditorInputMode property value changes
| GraphEditorInputMode | ||
onTextEditorInputModeTextEdited(evt:Event):void
Called when a label's text was edited by the TextEditorInputMode. | GraphEditorInputMode | ||
onTextEditorInputModeTextEditingCanceled(evt:Event):void
Called when text editing was cancelled by the TextEditorInputMode. | GraphEditorInputMode | ||
releaseMutex():void
Releases the mutex that is currently owned by this instance. | AbstractConcurrentInputMode | ||
Potentially replaces the reported by the current owner's preferredCursor property before it is
set on the canvas. | MultiplexingInputMode | ||
requestMutex():void
Requests the InputMutex from the current controller. | AbstractConcurrentInputMode | ||
Set a new Graph for this mode. | GraphEditorInputMode | ||
setGraphCanvas(graphCanvas:GraphCanvasComponent):void
Sets the GraphCanvasComponent that is associated with this instance. | GraphEditorInputMode | ||
setGraphSelection(newSelection:IGraphSelection):void
Set a new GraphSelection for this mode. | GraphEditorInputMode | ||
shouldBeClickable(item:IModelItem):Boolean
Callback that determines whether a GraphEditorEvent.ITEM_CLICKED should
be dispatched for the provided IModelItem. | GraphEditorInputMode | ||
shouldBeClickSelectable(item:IModelItem):Boolean
Callback that determines whether the provided IModelItem should be
selected upon mouse clicks. | GraphEditorInputMode | ||
shouldBeDeleted(item:IModelItem):Boolean
Determines whether the item should be deleted. | GraphEditorInputMode | ||
shouldBeMarqueeSelectable(item:IModelItem):Boolean [override]
Callback that determines whether the provided IModelItem should be
selected upon marquee selection. | GraphEditorInputMode | ||
shouldBeMovable(item:IModelItem):Boolean [override]
Determines whether to make the item movable using the moveInputMode. | GraphEditorInputMode | ||
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. | GraphEditorInputMode | ||
shouldSetToCurrentItem(item:IModelItem):Boolean
Callback that determines whether the provided IModelItem should be
set to the current item. | GraphEditorInputMode | ||
shouldShowHandles(item:IModelItem):Boolean [override]
Determines whether to show the handles for the given item. | GraphEditorInputMode | ||
uninstallCore(context:IInputModeContext):void [override]
Unistalls this mode. | GraphEditorInputMode |
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 | |||
Dispatched after the input mode was installed. | AbstractInputMode | |||
Dispatched 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 | |||
Dispatched when the default cursor changed. | AbstractConcurrentInputMode | |||
Dispatched after the input mode was uninstalled. | AbstractInputMode | |||
Dispatched before the input mode will be uninstalled. | AbstractInputMode |
autoAdjustContentRect | property |
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
.
public function get autoAdjustContentRect():AdjustContentRectPolicy
public function set autoAdjustContentRect(value:AdjustContentRectPolicy):void
See also
autoRemoveEmptyLabels | property |
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
.
public function get autoRemoveEmptyLabels():Boolean
public function set autoRemoveEmptyLabels(value:Boolean):void
autoSelectSelfloopBends | property |
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
.
public function get autoSelectSelfloopBends():Boolean
public function set autoSelectSelfloopBends(value:Boolean):void
clickableItems | property |
clickableItems:uint
Determines for which types of items a GraphEditorEvent.ITEM_CLICKED
should be dispatched upon mouse clicks.
The default value is GraphItemTypes.ALL
.
public function get clickableItems():uint
public function set clickableItems(value:uint):void
See also
clickHitTestOrder | property |
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
HitTest.BEND
HitTest.EDGE_LABEL
HitTest.EDGE
HitTest.NODE
HitTest.NODE_LABEL
HitTest.PORT
HitTest.ALL
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.
public function get clickHitTestOrder():Array
public function set clickHitTestOrder(value:Array):void
See also
clickSelectableItems | property |
clickSelectableItems:uint
Determines which types of items should be selectable through mouse clicks.
The default value is GraphItemTypes.ALL
.
public function get clickSelectableItems():uint
public function set clickSelectableItems(value:uint):void
See also
clipboardOperationsAllowed | property |
clipboardOperationsAllowed:Boolean
Determines whether clipboard operations with the usual shortcuts are enabled on the canvas.
The default value is true
.
public function get clipboardOperationsAllowed():Boolean
public function set clipboardOperationsAllowed(value:Boolean):void
contentRectMargins | property |
contentRectMargins:ImmutableRectangle
Gets or sets the margins to use for CanvasComponent.updateContentRect()
in adjustContentRect()
calls.
public function get contentRectMargins():ImmutableRectangle
public function set contentRectMargins(value:ImmutableRectangle):void
See also
createBendEdgeModePriority | property |
createBendEdgeModePriority:Number
[write-only] public function set createBendEdgeModePriority(value:Number):void
createBendInputMode | property |
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.
public function get createBendInputMode():CreateBendInputMode
public function set createBendInputMode(value:CreateBendInputMode):void
IllegalOperationError — IllegalOperationError : if the mode
is set after the GraphEditorInputMode is installed.
|
createBendModeEnabled | property |
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.
public function get createBendModeEnabled():Boolean
public function set createBendModeEnabled(value:Boolean):void
createBendModePriority | property |
createBendModePriority:Number
The CreateBendInputModePriority property.
The default value is 42
.
public function get createBendModePriority():Number
public function set createBendModePriority(value:Number):void
createEdgeInputMode | property |
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.
public function get createEdgeInputMode():CreateEdgeInputMode
public function set createEdgeInputMode(value:CreateEdgeInputMode):void
IllegalOperationError — IllegalOperationError : if the mode
is set after the GraphEditorInputMode is installed.
|
createEdgeModeEnabled | property |
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.
public function get createEdgeModeEnabled():Boolean
public function set createEdgeModeEnabled(value:Boolean):void
createEdgeModePriority | property |
createEdgeModePriority:Number
The CreateEdgeInputModePriority property.
The default value is 45
.
public function get createEdgeModePriority():Number
public function set createEdgeModePriority(value:Number):void
deletableItems | property |
deletableItems:uint
Determines which types of
items may be deleted using the deleteSelection
action.
The default value is GraphItemTypes.ALL
.
public function get deletableItems():uint
public function set deletableItems(value:uint):void
See also
deleteElementsAllowed | property |
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
.
public function get deleteElementsAllowed():Boolean
public function set deleteElementsAllowed(value:Boolean):void
detailSelectionRecognizer | property |
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.
public function get detailSelectionRecognizer():Function
public function set detailSelectionRecognizer(value:Function):void
focusableItems | property |
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
.
public function get focusableItems():uint
public function set focusableItems(value:uint):void
See also
graph | property |
graph:IGraph
[read-only] Gets the Graph this mode is acting upon.
public function get graph():IGraph
graphCanvas | property |
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 install
ed in
a GraphCanvasComponent
.
public function get graphCanvas():GraphCanvasComponent
graphSelection | property |
graphSelection:IGraphSelection
[read-only]
Returns the selectionModel
as an IGraphSelection
.
public function get graphSelection():IGraphSelection
groupSelectionAllowed | property |
groupSelectionAllowed:Boolean
Determines whether Ctrl-G-presses should result in calls to groupSelection()
.
The default value is true
.
public function get groupSelectionAllowed():Boolean
public function set groupSelectionAllowed(value:Boolean):void
See also
hitTestIterator | property |
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.
public function get hitTestIterator():IHitTestIterator
public function set hitTestIterator(value:IHitTestIterator):void
hitTestOrdering | property |
hitTestOrdering:Array
The hitTestOrdering.
The hitTestOrdering is an array of HitTest
constants that determines
the ordering in which items are tested for click hits.
public function get hitTestOrdering():Array
public function set hitTestOrdering(value:Array):void
labelEditableItems | property |
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.
public function get labelEditableItems():uint
public function set labelEditableItems(value:uint):void
See also
labelEditingAllowed | property |
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
.
public function get labelEditingAllowed():Boolean
public function set labelEditingAllowed(value:Boolean):void
See also
marqueeSelectableItems | property |
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.
.
public function get marqueeSelectableItems():uint
public function set marqueeSelectableItems(value:uint):void
See also
movableItems | property |
movableItems:uint
Determines which types of
items should movable using the moveInputMode
.
The default value is GraphItemTypes.ALL
.
public function get movableItems():uint
public function set movableItems(value:uint):void
See also
moveLabelInputMode | property |
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.
public function get moveLabelInputMode():MoveLabelInputMode
public function set moveLabelInputMode(value:MoveLabelInputMode):void
IllegalOperationError — IllegalOperationError : if the mode
is set after the GraphEditorInputMode is installed.
|
moveLabelModeEnabled | property |
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.
public function get moveLabelModeEnabled():Boolean
public function set moveLabelModeEnabled(value:Boolean):void
multiSelectionRecognizer | property |
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.
public function get multiSelectionRecognizer():Function
public function set multiSelectionRecognizer(value:Function):void
navigationInputMode | property |
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.
public function get navigationInputMode():NavigationInputMode
public function set navigationInputMode(value:NavigationInputMode):void
IllegalOperationError — IllegalOperationError : if the mode
is set after the GraphEditorInputMode is installed.
|
navigationModeEnabled | property |
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.
public function get navigationModeEnabled():Boolean
public function set navigationModeEnabled(value:Boolean):void
navigationModePriority | property |
navigationModePriority:Number
The keyboard navigation mode priority.
The default value is 55
.
public function get navigationModePriority():Number
public function set navigationModePriority(value:Number):void
nodeCreationAllowed | property |
nodeCreationAllowed:Boolean
Whether createNode
will be called
when the canvas is clicked.
public function get nodeCreationAllowed():Boolean
public function set nodeCreationAllowed(value:Boolean):void
See also
nodeCreator | property |
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; }
public function get nodeCreator():Function
public function set nodeCreator(value:Function):void
orthogonalEdgeEditingContext | property |
orthogonalEdgeEditingContext:OrthogonalEdgeEditingContext
Gets or sets the orthogonal edge editing context.
The default value is
.null
.
public function get orthogonalEdgeEditingContext():OrthogonalEdgeEditingContext
public function set orthogonalEdgeEditingContext(value:OrthogonalEdgeEditingContext):void
pasteDelta | property |
pasteDelta:IPoint
The offset for paste operation if clipboard operations are enabled.
The default value is (15, 15)
.
public function get pasteDelta():IPoint
public function set pasteDelta(value:IPoint):void
reparentNodeHandler | property |
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.
public function get reparentNodeHandler():IReparentNodeHandler
public function set reparentNodeHandler(value:IReparentNodeHandler):void
See also
reparentNodesAllowed | property |
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
.
public function get reparentNodesAllowed():Boolean
public function set reparentNodesAllowed(value:Boolean):void
See also
selectableItems | property |
selectableItems:uint
Determines which types of items should be selectable at all.
The default value is GraphItemTypes.ALL
.
public function get selectableItems():uint
public function set selectableItems(value:uint):void
See also
showHandleItems | property |
showHandleItems:uint
Determines which types of
items should have their IHandle
s shown.
The default value is GraphItemTypes.ALL
.
public function get showHandleItems():uint
public function set showHandleItems(value:uint):void
See also
textEditorInputMode | property |
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.
public function get textEditorInputMode():TextEditorInputMode
public function set textEditorInputMode(value:TextEditorInputMode):void
IllegalOperationError — IllegalOperationError : if the mode
is set after the GraphEditorInputMode is installed.
|
textEditorModeEnabled | property |
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.
public function get textEditorModeEnabled():Boolean
public function set textEditorModeEnabled(value:Boolean):void
textEditorModePriority | property |
textEditorModePriority:Number
The TextEditorInputModePriority property.
The default value is 100
.
public function get textEditorModePriority():Number
public function set textEditorModePriority(value:Number):void
undoOperationsAllowed | property |
undoOperationsAllowed:Boolean
Determines whether undo/redo operations with the usual shortcuts are enabled on the canvas.
The default value is true
.
public function get undoOperationsAllowed():Boolean
public function set undoOperationsAllowed(value:Boolean):void
ungroupSelectionAllowed | property |
ungroupSelectionAllowed:Boolean
Determines whether Ctrl-U-presses should result in calls to ungroupSelection()
.
The default value is true
.
public function get ungroupSelectionAllowed():Boolean
public function set ungroupSelectionAllowed(value:Boolean):void
See also
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
.
graph:IGraph (default = null ) — The IGraph to work on.
| |
selectionModel:ISelectionModel (default = null ) — The ISelectionModel to work with.
|
See also
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 |
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.
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.
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.
|
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.
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 |
createMoveLabelInputMode | () | method |
protected function createMoveLabelInputMode():MoveLabelInputMode
Factory method for the MoveLabelInputMode property.
This method will be called upon first access to the moveLabelInputMode
property.
MoveLabelInputMode — a new instance of MoveLabelInputMode
|
createMoveUnselectedInputMode | () | method |
override public function createMoveUnselectedInputMode(modifierRecognizer:Function = null):MoveInputMode
Parameters
modifierRecognizer:Function (default = null )
|
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.
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.
|
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.
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.
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.
|
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 IModelItem
s 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.
|
Iterator — An iterator with those model items closest to the given location.
|
See also
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.
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.
|
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.
|
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.
|
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
|
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.
|
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.
|
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.
|
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 |
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.
|
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
|
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
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.
|
bendCreated | Event |
com.yworks.graph.input.GraphEditorEvent
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.
bendDeleted | Event |
com.yworks.graph.input.GraphEditorEvent
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 theGraphEditorInputMode
.
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 |
com.yworks.graph.input.GraphEditorEvent
com.yworks.graph.input.GraphEditorEvent.CURRENT_ITEM_CHANGED
Dispatched when the current item changed.
Only focusableItems
trigger this event.
deletingBend | Event |
com.yworks.graph.input.GraphEditorEvent
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 theGraphEditorInputMode
.
deletingEdge | Event |
com.yworks.graph.input.GraphEditorEvent
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 theGraphEditorInputMode
.
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 |
com.yworks.graph.input.GraphEditorEvent
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
.
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 |
com.yworks.graph.input.GraphEditorEvent
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.
GraphEditorInputMode
.
edgeCreated | Event |
com.yworks.graph.input.GraphEditorEvent
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.
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 |
com.yworks.graph.input.GraphEditorEvent
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 theGraphEditorInputMode
.
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 |
com.yworks.graph.input.GraphEditorEvent
com.yworks.graph.input.GraphEditorEvent.ITEM_CLICKED
Dispatched when a graph item has been clicked.
Only clickSelectableItems
trigger this event.
labelChanged | Event |
com.yworks.graph.input.GraphEditorEvent
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.
labelCreated | Event |
com.yworks.graph.input.GraphEditorEvent
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.
labelDeleted | Event |
com.yworks.graph.input.GraphEditorEvent
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
.
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 |
com.yworks.graph.input.GraphEditorEvent
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.
nodeDeleted | Event |
com.yworks.graph.input.GraphEditorEvent
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.
GraphEditorInputMode
.
nodeReparented | Event |
com.yworks.graph.input.GraphEditorHierarchyEvent
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.