Packagecom.yworks.graph.model
Classpublic class EdgeEndMoveHandle
InheritanceEdgeEndMoveHandle Inheritance Object
Implements IHandle, IPoint
Subclasses PortRelocationHandle

A sophisticated implementation of the 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

IEdgePortCandidateProvider
EdgeDecorator.edgePortCandidateProviderDecorator


Public Properties
 PropertyDefined 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
Protected Properties
 PropertyDefined 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
Public Methods
 MethodDefined By
  
EdgeEndMoveHandle(graph:IGraph, edge:IEdge, sourceEnd:Boolean)
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
  
Called by clients to indicate that the element is going to be dragged.
EdgeEndMoveHandle
Protected Methods
 MethodDefined By
  
configureDummy(dummy:DefaultEdge, edge:IEdge):void
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
Property Detail
cursorproperty
cursor:Cursor

Provides the cursor to display when the mouse hovers over or drags this handle.


Implementation
    public function get cursor():Cursor
    public function set cursor(value:Cursor):void
dummyEdgeproperty 
dummyEdge:DefaultEdge  [read-only]

Gets the dummy edge this instance uses during the edit.


Implementation
    protected function get dummyEdge():DefaultEdge
edgeproperty 
edge:IEdge  [read-only]

Gets the edge this instance acts upon.


Implementation
    protected function get edge():IEdge
inputModeContextproperty 
inputModeContext:IInputModeContext

Gets or sets the context to operate on.


Implementation
    protected function get inputModeContext():IInputModeContext
    protected function set inputModeContext(value:IInputModeContext):void
internalDummyEdgeproperty 
internalDummyEdge:DefaultEdge  [read-only]

Gets the dummy edge this instance uses during the edit.


Implementation
    yworks_internal function get internalDummyEdge():DefaultEdge
locationproperty 
location:IPoint  [read-only]

Returns a view of the location of the item. This implementation returns this.


Implementation
    public function get location():IPoint
showDummyEdgeproperty 
showDummyEdge:Boolean

Gets or sets a property that determines whether to show a dummy edge during the drag operation.

The default value is true.


Implementation
    public function get showDummyEdge():Boolean
    public function set showDummyEdge(value:Boolean):void
sourceEndproperty 
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.


Implementation
    protected function get sourceEnd():Boolean
typeproperty 
type:uint

Returns the type of the handle that can be used by the rendering engine to render types differently.


Implementation
    public function get type():uint
    public function set type(value:uint):void
xproperty 
x:Number  [read-only]

Gets the current x coordinate of this point.

Depending on context the values returned may change over time.


Implementation
    public function get x():Number
yproperty 
y:Number  [read-only]

Gets the current y coordinate of this point.

Depending on context the values returned may change over time.


Implementation
    public function get y():Number
Constructor Detail
EdgeEndMoveHandle()Constructor
public function EdgeEndMoveHandle(graph:IGraph, edge:IEdge, sourceEnd:Boolean)

Creates a new instance of the EdgeEndMoveHandle class.

Parameters
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

IInputModeContext
initializeDrag
Method Detail
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.

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

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

Returns
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

Returns
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