Package | com.yworks.graph.model |
Class | public class EdgeEndMoveHandle |
Inheritance | EdgeEndMoveHandle Object |
Implements | IHandle, IPoint |
Subclasses | PortRelocationHandle |
IHandle
interface the can be used to relocate a port.
This class heavily relies on the implementation of the IEdgePortCandidateProvider
that is
queried from the IEdge
this handle is acting on.
See also
Property | Defined By | ||
---|---|---|---|
cursor : Cursor
Provides the cursor to display when the mouse hovers over or drags this
handle. | EdgeEndMoveHandle | ||
location : IPoint [read-only]
Returns a view of the location of the item. | EdgeEndMoveHandle | ||
showDummyEdge : Boolean
Gets or sets a property that determines whether to show a dummy edge
during the drag operation. | EdgeEndMoveHandle | ||
type : uint
Returns the type of the handle that can be used by the rendering engine
to render types differently. | EdgeEndMoveHandle | ||
x : Number [read-only]
Gets the current x coordinate of this point. | EdgeEndMoveHandle | ||
y : Number [read-only]
Gets the current y coordinate of this point. | EdgeEndMoveHandle |
Property | Defined By | ||
---|---|---|---|
dummyEdge : DefaultEdge [read-only]
Gets the dummy edge this instance uses during the edit. | EdgeEndMoveHandle | ||
edge : IEdge [read-only]
Gets the edge this instance acts upon. | EdgeEndMoveHandle | ||
inputModeContext : IInputModeContext
Gets or sets the context to operate on. | EdgeEndMoveHandle | ||
sourceEnd : Boolean [read-only]
Gets a value indicating whether the source end of the edge is handled by this instance. | EdgeEndMoveHandle |
Method | Defined By | ||
---|---|---|---|
Creates a new instance of the EdgeEndMoveHandle class. | EdgeEndMoveHandle | ||
cancelDrag(context:IInputModeContext, originalX:Number, originalY:Number):void
Called by clients to indicate that the dragging has been canceled by the user. | EdgeEndMoveHandle | ||
dragFinished(context:IInputModeContext, originalX:Number, originalY:Number, newX:Number, newY:Number):void
Called by clients to indicate that the repositioning has just been finished. | EdgeEndMoveHandle | ||
handleMove(context:IInputModeContext, originalX:Number, originalY:Number, newX:Number, newY:Number):Boolean
Called by clients to indicate that the element has been dragged and its position
should be updated. | EdgeEndMoveHandle | ||
initializeDrag(context:IInputModeContext):void
Called by clients to indicate that the element is going to be dragged. | EdgeEndMoveHandle |
Method | Defined By | ||
---|---|---|---|
Configures the dummy edge to look like the given edge. | EdgeEndMoveHandle | ||
Factory method that creates the dummy edge that will be shown during the drag operation. | EdgeEndMoveHandle | ||
Factory method that creates a dummy display object creator for the dummy edge during the drag operation. | EdgeEndMoveHandle | ||
Gets the graph to use from the context. | EdgeEndMoveHandle | ||
Hides the original edge during the drag operation. | EdgeEndMoveHandle | ||
setPosition(x:Number, y:Number):void
Updates the position of the handle. | EdgeEndMoveHandle | ||
Unhides the original edge that was hidden during the drag operation. | EdgeEndMoveHandle |
cursor | property |
cursor:Cursor
Provides the cursor to display when the mouse hovers over or drags this handle.
public function get cursor():Cursor
public function set cursor(value:Cursor):void
dummyEdge | property |
dummyEdge:DefaultEdge
[read-only] Gets the dummy edge this instance uses during the edit.
protected function get dummyEdge():DefaultEdge
edge | property |
edge:IEdge
[read-only] Gets the edge this instance acts upon.
protected function get edge():IEdge
inputModeContext | property |
inputModeContext:IInputModeContext
Gets or sets the context to operate on.
protected function get inputModeContext():IInputModeContext
protected function set inputModeContext(value:IInputModeContext):void
internalDummyEdge | property |
internalDummyEdge:DefaultEdge
[read-only] Gets the dummy edge this instance uses during the edit.
yworks_internal function get internalDummyEdge():DefaultEdge
location | property |
location:IPoint
[read-only]
Returns a view of the location of the item.
This implementation returns this
.
public function get location():IPoint
showDummyEdge | property |
showDummyEdge:Boolean
Gets or sets a property that determines whether to show a dummy edge during the drag operation.
The default value is true
.
public function get showDummyEdge():Boolean
public function set showDummyEdge(value:Boolean):void
sourceEnd | property |
sourceEnd:Boolean
[read-only]
Gets a value indicating whether the source end of the edge is handled by this instance.
true
, if the source port will be subject to relocation, otherwise false
.
protected function get sourceEnd():Boolean
type | property |
type:uint
Returns the type of the handle that can be used by the rendering engine to render types differently.
public function get type():uint
public function set type(value:uint):void
x | property |
x:Number
[read-only] Gets the current x coordinate of this point.
Depending on context the values returned may change over time.
public function get x():Number
y | property |
y:Number
[read-only] Gets the current y coordinate of this point.
Depending on context the values returned may change over time.
public function get y():Number
EdgeEndMoveHandle | () | Constructor |
public function EdgeEndMoveHandle(graph:IGraph, edge:IEdge, sourceEnd:Boolean)
Creates a new instance of the EdgeEndMoveHandle
class.
graph:IGraph — The graph or null . If the graph is null , the handle will try to
receive the graph from the IInputModeContext it is used in during initializeDrag .
| |
edge:IEdge — The edge.
| |
sourceEnd:Boolean — If set to true the source port will be subject to relocation, otherwise it will
be the target port
|
See also
cancelDrag | () | method |
public function cancelDrag(context:IInputModeContext, originalX:Number, originalY:Number):void
Called by clients to indicate that the dragging has been canceled by the user.
This method may be called after the initial initializeDrag
and zero or
more invocations of handleMove
.
Implementations should reset the position of the items they modify to their initial state.
Alternatively to this method the dragFinished
method might be called.
Parameters
context:IInputModeContext — The context to retrieve information about the drag from.
| |
originalX:Number — The value of the x property at the time of initializeDrag .
| |
originalY:Number — The value of the y property at the time of initializeDrag .
|
configureDummy | () | method |
protected function configureDummy(dummy:DefaultEdge, edge:IEdge):void
Configures the dummy edge to look like the given edge.
Parameters
dummy:DefaultEdge — The dummy edge that should mimic the given edge.
| |
edge:IEdge — The edge to mimic.
|
See also
createDummyEdge | () | method |
protected function createDummyEdge():DefaultEdge
Factory method that creates the dummy edge that will be shown during the drag operation.
ReturnsDefaultEdge — The dummy edge instance to use.
|
See also
createDummyEdgeCreator | () | method |
protected function createDummyEdgeCreator(dummy:DefaultEdge):IDisplayObjectCreator
Factory method that creates a dummy display object creator for the dummy edge during the drag operation.
Parameters
dummy:DefaultEdge — The dummy edge to create a display object creator for.
|
IDisplayObjectCreator — A display object creator that visualizes the dummy edge.
|
See also
dragFinished | () | method |
public function dragFinished(context:IInputModeContext, originalX:Number, originalY:Number, newX:Number, newY:Number):void
Called by clients to indicate that the repositioning has just been finished.
This method may be called after the initial initializeDrag
and zero or
more invocations of handleMove
.
Alternatively to this method the cancelDrag
method might be called.
Parameters
context:IInputModeContext — The context to retrieve information about the drag from.
| |
originalX:Number — The value of the x property at the time of initializeDrag .
| |
originalY:Number — The value of the y property at the time of initializeDrag .
| |
newX:Number — The value of the x coordinate in the world coordinate system that the client wants the handle to be at.
Depending on the implementation the x and y properties or may not be modified to reflect the new value.
This is the same value as delivered in the last invocation of handleMove .
| |
newY:Number — The value of the y coordinate in the world coordinate system that the client wants the handle to be at.
Depending on the implementation the x and y properties or may not be modified to reflect the new value.
This is the same value as delivered in the last invocation of handleMove .
|
getGraph | () | method |
protected function getGraph(modeContext:IInputModeContext):IGraph
Gets the graph to use from the context.
Parameters
modeContext:IInputModeContext — The input mode context.
|
IGraph — A graph instance or null .
|
handleMove | () | method |
public function handleMove(context:IInputModeContext, originalX:Number, originalY:Number, newX:Number, newY:Number):Boolean
Called by clients to indicate that the element has been dragged and its position should be updated.
This method may be called more than once after an initial initializeDrag
and will be followed by either dragFinished
or cancelDrag
.
Parameters
context:IInputModeContext — The value of the x property at the time of initializeDrag .
| |
originalX:Number — The value of the y property at the time of initializeDrag .
| |
originalY:Number — The value of the x coordinate in the world coordinate system that the client wants the handle to be at.
Depending on the implementation the x property may or may not be modified to reflect the new value.
| |
newX:Number — The value of the y coordinate in the world coordinate system that the client wants the handle to be at.
Depending on the implementation the y property may or may not be modified to reflect the new value.
| |
newY:Number |
Boolean — Whether the move had any visual effect. This is a hint to the engine to optimize invalidation.
|
hideOriginalEdge | () | method |
protected function hideOriginalEdge(context:IInputModeContext, edge:IEdge):void
Hides the original edge during the drag operation.
Parameters
context:IInputModeContext — The edge to hide.
| |
edge:IEdge — The context to get the canvas the edge should be hidden from.
|
See also
initializeDrag | () | method |
public function initializeDrag(context:IInputModeContext):void
Called by clients to indicate that the element is going to be dragged.
This call will be followed by one or more calls to handleMove
,
and a final dragFinished
or cancelDrag
.
Parameters
context:IInputModeContext — The context to retrieve information about the drag from.
|
setPosition | () | method |
protected function setPosition(x:Number, y:Number):void
Updates the position of the handle.
Parameters
x:Number | |
y:Number |
unhideOriginalEdge | () | method |
protected function unhideOriginalEdge(edge:IEdge, canvas:CanvasComponent):void
Unhides the original edge that was hidden during the drag operation.
Parameters
edge:IEdge — The edge to unhide.
| |
canvas:CanvasComponent — The canvas the edge was hidden from.
|
See also