Package | com.yworks.graph.input |
Class | public class CreateBendInputMode |
Inheritance | CreateBendInputMode EdgeDragInputModeBase StateMachineInputMode AbstractConcurrentInputMode AbstractInputMode flash.events.EventDispatcher |
IInputMode
used for recognizing the gesture of creating IBend
s in an IGraph
.
This mode is used by GraphEditorInputMode
but can be used stand-alone, too.
Client code should register with the BendCreated
event to
perform additional actions after the bend has been created.
See also
Property | Defined By | ||
---|---|---|---|
beginHitTestable : IHitTestable
Gets or sets the IHitTestable that determines where bends may be created. | EdgeDragInputModeBase | ||
canceledState : State [read-only]
Returns the canceled state of the state machine. | StateMachineInputMode | ||
cancelRecognizer : Function
Gets or sets the "cancel" recognizer. | EdgeDragInputModeBase | ||
canvas : CanvasComponent [read-only]
The canvas instance this mode is currently installed in or null
| AbstractInputMode | ||
controller : ConcurrencyController
Gets or injects the ConcurrencyController for this instance. | AbstractConcurrentInputMode | ||
draggedRecognizer : Function
Gets or sets the "dragged" recognizer. | EdgeDragInputModeBase | ||
enabled : Boolean
Gets or sets the enabled state of this input mode. | AbstractConcurrentInputMode | ||
graph : IGraph
Gets the Graph this mode is acting upon. | EdgeDragInputModeBase | ||
graphCanvas : GraphCanvasComponent [read-only]
Gets the GraphCanvasComponent this mode is working on or null. | CreateBendInputMode | ||
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 | ||
lastMouseEvent : CanvasMouseEvent [read-only]
Returns the last mouse event. | StateMachineInputMode | ||
location : IPoint [read-only]
Gets the location where the bend creation gesture was initialized. | EdgeDragInputModeBase | ||
preferredCursor : Cursor
Gets or sets the cursor this mode would like to have displayed in the CanvasComponent. | AbstractConcurrentInputMode | ||
pressedRecognizer : Function
Gets or sets the "pressed" state recognizer. | EdgeDragInputModeBase | ||
releasedRecognizer : Function
Gets or sets the "released" recognizer. | EdgeDragInputModeBase | ||
returnExistingBend : Boolean
Gets or sets a property that determines whether this mode should return an existing bend in
createBend if there is one found at the given location. | CreateBendInputMode | ||
splitOrthogonalSegment : Boolean [read-only]
Gets a value indicating whether an orthogonal segment should be split by the last bend creation. | CreateBendInputMode | ||
splitOrthogonalSegmentRecognizer : Function
Gets or sets the event recognizer that determines whether during the call to dragSegment
the bend creation should be treated as a split segment operation for orthogonal segments. | CreateBendInputMode | ||
startState : State [read-only]
Returns the start state of the state machine. | StateMachineInputMode | ||
stateMachine : StateMachine [read-only]
Gets the state machine. | StateMachineInputMode | ||
stoppedState : State [read-only]
Returns the stopped state of the state machine. | StateMachineInputMode |
Property | Defined By | ||
---|---|---|---|
_beginHitTestable : IHitTestable | EdgeDragInputModeBase | ||
_cancelRecognizer : Function | EdgeDragInputModeBase | ||
_draggedRecognizer : Function | EdgeDragInputModeBase | ||
_firstPoint : YPoint | EdgeDragInputModeBase | ||
_graph : IGraph | EdgeDragInputModeBase | ||
_lastEvent : Event
The last Event that has been delivered to this instance. | StateMachineInputMode | ||
_lastMouseEvent : CanvasMouseEvent
The last MouseEvent that has been delivered to this instance. | StateMachineInputMode | ||
_pressedRecognizer : Function | EdgeDragInputModeBase | ||
_releasedRecognizer : Function | EdgeDragInputModeBase | ||
_splitOrthogonalSegment : Boolean | CreateBendInputMode | ||
stopEventRecognizer : Function [read-only]
An event recognizer for the state machine
that is triggered if this mode has been stoppped. | StateMachineInputMode |
Method | Defined By | ||
---|---|---|---|
CreateBendInputMode(graph:IGraph)
Creates a new instance using the given graph to create the bends in. | CreateBendInputMode | ||
cancel():void [override]
Runs the machine using the cancel and reset events,
releases the input mutex and returns. | StateMachineInputMode | ||
dispose():void
Disposes this input mode. | AbstractInputMode | ||
Finds the edge at the given coordinate. | EdgeDragInputModeBase | ||
install(context:IInputModeContext):void
Installs this mode into the canvas of the given context. | AbstractInputMode | ||
resetMachine():void
Runs the machine using a special reset event. | StateMachineInputMode | ||
run(evt:Event):void
Tries to run the virtual machine using the pair of source and event argument
to determine which transition to take. | StateMachineInputMode | ||
stop():Boolean [override]
Runs the machine using a special stop event. | StateMachineInputMode | ||
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 | ||
Creates the bend. | CreateBendInputMode | ||
Factory method that creates a canceled State
for the given machine. | StateMachineInputMode | ||
Creates an IInputModeContext for use in CreateBendInputMode#createBend. | EdgeDragInputModeBase | ||
Factory method that creates a start State for the given machine. | StateMachineInputMode | ||
Factory method that creates the state machine. | StateMachineInputMode | ||
Factory method that creates a stopped State
for the given machine. | StateMachineInputMode | ||
[override]
Updates the splitOrthogonalSegment property and then delegates to createBend. | CreateBendInputMode | ||
dragSegment(te:TransitionEvent):void
Callback that is triggered when a drag on an edge segment has been recognized. | EdgeDragInputModeBase | ||
fireInstalled():void | AbstractInputMode | ||
fireInstalling():void | AbstractInputMode | ||
fireUninstalled():void | AbstractInputMode | ||
fireUninstalling():void | AbstractInputMode | ||
hasMutex():Boolean
Determines whether this instance owns the input mutex. | AbstractConcurrentInputMode | ||
initialize():void
Performs one-time initialization of this instance. | AbstractInputMode | ||
initializeStateMachine(machine:StateMachine, startState:State, canceledState:State, stoppedState:State, finishedState:State):void [override]
Called to initialize the state machine. | EdgeDragInputModeBase | ||
installCore(context:IInputModeContext):void [override]
Installs this mode into the given canvas. | CreateBendInputMode | ||
installListeners():void
Installs all necessary listeners to trigger the run method. | StateMachineInputMode | ||
invalidate():void
Convenience method for subclass implementations that invalidates
the canvasComponent this mode is currently installed in. | AbstractInputMode | ||
isCancelEvent(evt:Event):Boolean
Method that identifies an event as a cancel event. | StateMachineInputMode | ||
isDisabledEvent(evt:Event):Boolean
Method that identifies an event as a disabled event. | StateMachineInputMode | ||
isEnabledEvent(evt:Event):Boolean
Method that identifies an event as an enabled event. | StateMachineInputMode | ||
isMutexAquiredEvent(evt:Event):Boolean
Method that identifies an event as a mutexAquired event. | StateMachineInputMode | ||
isMutexLostEvent(evt:Event):Boolean
Method that identifies an event as a mutexLost event. | StateMachineInputMode | ||
isStopEvent(evt:Event):Boolean
Method that identifies an event as a stop event. | StateMachineInputMode | ||
isValidBegin(evt:Event):Boolean
Determines whether the current location and event is valid to begin a bend creation gesture. | EdgeDragInputModeBase | ||
onBendCreated(bend:IBend):void
Triggers the bendCreated event. | CreateBendInputMode | ||
onCancel(te:TransitionEvent):void [override] | CreateBendInputMode | ||
onCancelStateEntered(evt:StateChangeEvent):void
Called when the cancel state has been entered. | StateMachineInputMode | ||
onDisable():void
Runs the state machine using a disable event. | StateMachineInputMode | ||
onDisabled():void
Called when the enabled property changes to false. | AbstractConcurrentInputMode | ||
onEnable():void
Runs the state machine using a enable event. | StateMachineInputMode | ||
onEnabled():void
Called when the enabled property changes to true. | AbstractConcurrentInputMode | ||
Called when the graph property changes. | EdgeDragInputModeBase | ||
onMachineReset():void | StateMachineInputMode | ||
onMutexObtained():void [override]
Runs the state machine using a mutex obtained event. | StateMachineInputMode | ||
onMutexReleased():void [override]
Runs the state machine using a mutex lost event. | StateMachineInputMode | ||
Called when the preferredCursor property changes. | AbstractConcurrentInputMode | ||
onReleased(te:TransitionEvent):void [override] | CreateBendInputMode | ||
onRun(evt:Event):void
Callback method that will be called after the state machine has
been run using the arguments provided. | StateMachineInputMode | ||
onStopStateEntered(evt:StateChangeEvent):void
Called when the cancel state has been entered. | StateMachineInputMode | ||
releaseMutex():void
Releases the mutex that is currently owned by this instance. | AbstractConcurrentInputMode | ||
requestMutex():void
Requests the InputMutex from the current controller. | AbstractConcurrentInputMode | ||
Sets a new graph for this mode. | EdgeDragInputModeBase | ||
setGraphCanvas(graphCanvas:GraphCanvasComponent):void
Sets the GraphCanvasComponent that is associated with this instance. | CreateBendInputMode | ||
setLastMouseEvent(evt:CanvasMouseEvent):void | StateMachineInputMode | ||
setPreferredCursorTransition(cursorClass:Class):Function
Factory method that can be used to obtain an listener
implementation that sets the given preferredCursor. | StateMachineInputMode | ||
setResetCursorTransition():Function
Factory method that can be used to obtain a listener implementation
that resets the preferredCursor. | StateMachineInputMode | ||
uninstallCore(context:IInputModeContext):void [override]
Uninstalls this mode. | CreateBendInputMode | ||
uninstallListeners():void
Uninstalls all listeners, this instance has installed on calling intallListeners()
| StateMachineInputMode |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched when a new bend creation gesture has been recognized. | CreateBendInputMode | |||
Dispatched after the input mode was installed. | AbstractInputMode | |||
Dispatched before the input mode will be installed. | AbstractInputMode | |||
Dispatched when the default cursor changed. | AbstractConcurrentInputMode | |||
Dispatched after the input mode was uninstalled. | AbstractInputMode | |||
Dispatched before the input mode will be uninstalled. | AbstractInputMode |
_splitOrthogonalSegment | property |
protected var _splitOrthogonalSegment:Boolean
graphCanvas | property |
graphCanvas:GraphCanvasComponent
[read-only]
Gets the GraphCanvasComponent this mode is working on or null
.
This property is set by setGraphControl
which is
triggered if this mode is installed in
a GraphCanvasComponent
.
public function get graphCanvas():GraphCanvasComponent
returnExistingBend | property |
returnExistingBend:Boolean
Gets or sets a property that determines whether this mode should return an existing bend in
createBend
if there is one found at the given location.
The default value is
.true
public function get returnExistingBend():Boolean
public function set returnExistingBend(value:Boolean):void
splitOrthogonalSegment | property |
splitOrthogonalSegment:Boolean
[read-only]
Gets a value indicating whether an orthogonal segment should be split by the last bend creation.
This property can be read by implementations of IBendCreator
if they retrieve this instance
from their IInputModeContext.parentInputMode
.
If this property is true
, implementation are advised to treat the bend creation as a
gesture that splits the segment into two.
public function get splitOrthogonalSegment():Boolean
See also
splitOrthogonalSegmentRecognizer | property |
splitOrthogonalSegmentRecognizer:Function
Gets or sets the event recognizer that determines whether during the call to dragSegment
the bend creation should be treated as a split segment operation for orthogonal segments.
The default value is EventRecognizers#MODIFIER_SHIFT
.
public function get splitOrthogonalSegmentRecognizer():Function
public function set splitOrthogonalSegmentRecognizer(value:Function):void
See also
CreateBendInputMode | () | Constructor |
public function CreateBendInputMode(graph:IGraph)
Creates a new instance using the given graph to create the bends in. It is recommended to omit the graph parameter in which case the instance retrieves the graph instance from the context.
Parametersgraph:IGraph — The graph to create the bends in and query the edges from.
|
See also
createBend | () | method |
protected function createBend(hitEdge:IEdge, x:Number, y:Number):IBend
Creates the bend.
The bend is created using the hit edge's IBendCreator
implementation,
as obtained from the edge's ILookup.Lookup
.
Parameters
hitEdge:IEdge — The hit edge.
| |
x:Number — The x coordinate of the hit.
| |
y:Number — The y coordinate of the hit.
|
IBend — The created bend or null .
|
See also
dragEdgeSegment | () | method |
override protected function dragEdgeSegment(edge:IEdge, dragLocation:IPoint):void
Updates the splitOrthogonalSegment
property and then delegates to createBend
.
This method triggers the bendCreated
event if a bend is created.
Parameters
edge:IEdge — The edge to create a bend for.
| |
dragLocation:IPoint — The location at which the user initiated the gesture.
|
installCore | () | method |
override protected function installCore(context:IInputModeContext):void
Installs this mode into the given canvas.
Subclasses should override this method and call super.install(canvas)
, first.
One-time initialization should be performed in the initialize
method.
The install
method will call the initialize
method the first
time this mode gets installed.
This implementation calls installListeners
.
Parameters
context:IInputModeContext — The canvas to install this mode into
|
onBendCreated | () | method |
protected function onBendCreated(bend:IBend):void
Triggers the bendCreated
event.
Parameters
bend:IBend — The bend, which was created.
|
onCancel | () | method |
onReleased | () | method |
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 event to upgrade the graph
property accordingly.
Parameters
graphCanvas:GraphCanvasComponent — the control to set.
|
uninstallCore | () | method |
override protected function uninstallCore(context:IInputModeContext):void
Uninstalls 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.BendCreatedEvent
com.yworks.graph.input.BendCreatedEvent.BEND_CREATED
Dispatched when a new bend creation gesture has been recognized.
Dispatched when a new bend has been created.