Packagecom.yworks.graph.input
Classpublic class CroppedPortLocationModelParameterHandle
InheritanceCroppedPortLocationModelParameterHandle Inheritance PortLocationModelParameterHandle Inheritance Object

A PortLocationModelParameterHandle that restricts the new location of the port to the bounding box of it's owning INode.



Public Properties
 PropertyDefined By
 Inheritedcursor : Cursor
[read-only] Provides the cursor to display when the mouse hovers over or drags this handle.
PortLocationModelParameterHandle
 Inheritedtype : uint
[read-only] Returns the type of the handle that can be used by the rendering engine to render types differently.
PortLocationModelParameterHandle
 Inheritedx : Number
[read-only] Returns the x coordinate of the current position of the element.
PortLocationModelParameterHandle
 Inheritedy : Number
[read-only] Returns the y coordinate of the current position of the element.
PortLocationModelParameterHandle
Protected Properties
 PropertyDefined By
 Inherited_cursor : Cursor
PortLocationModelParameterHandle
 Inherited_dummyLocation : IPoint
PortLocationModelParameterHandle
 Inherited_graph : IGraph
PortLocationModelParameterHandle
 Inherited_lastParameter : IPortLocationModelParameter
PortLocationModelParameterHandle
 Inherited_model : IPortLocationModel
PortLocationModelParameterHandle
 Inherited_oldParameter : IPortLocationModelParameter
PortLocationModelParameterHandle
 Inherited_port : IPort
PortLocationModelParameterHandle
 Inheritedport : IPort
[read-only] The port this handle does move.
PortLocationModelParameterHandle
 Inherited_type : uint = 0x001
PortLocationModelParameterHandle
Public Methods
 MethodDefined By
  
CroppedPortLocationModelParameterHandle
 Inherited
cancelDrag(context:IInputModeContext, originalX:Number, originalY:Number):void
Called by clients to indicate that the dragging has been canceled by the user.
PortLocationModelParameterHandle
 Inherited
dragFinished(context:IInputModeContext, originalX:Number, originalY:Number, newX:Number, newY:Number):void
Called by clients to indicate that the repositioning has just been finished.
PortLocationModelParameterHandle
  
handleMove(context:IInputModeContext, originalX:Number, originalY:Number, newX:Number, newY:Number):Boolean
[override] Crops the new location to the port's owning INode's layout before handling the move.
CroppedPortLocationModelParameterHandle
 Inherited
Called by clients to indicate that the element is going to be dragged.
PortLocationModelParameterHandle
 Inherited
setPosition(x:Number, y:Number):void
PortLocationModelParameterHandle
Protected Methods
 MethodDefined By
 Inherited
Called during the drag to collect snap results.
PortLocationModelParameterHandle
  
Crops the location to the next closest one inside the port's owning INode's layout.
CroppedPortLocationModelParameterHandle
 Inherited
Gets the graph to use for setting the parameter via IGraph.setPortLocationModelParameter from the context.
PortLocationModelParameterHandle
 Inherited
getMoveType(port:IPort):uint
Determines the type of the movement for the given port.
PortLocationModelParameterHandle
 Inherited
Callback method that obtains the new parameter for the given location and port.
PortLocationModelParameterHandle
  
setParameter(graph:IGraph, port:IPort, newParameter:IPortLocationModelParameter):void
[override] Callback method that applies the parameter
CroppedPortLocationModelParameterHandle
Constructor Detail
CroppedPortLocationModelParameterHandle()Constructor
public function CroppedPortLocationModelParameterHandle(port:IPort)



Parameters
port:IPort
Method Detail
cropLocation()method
protected function cropLocation(location:IPoint):IPoint

Crops the location to the next closest one inside the port's owning INode's layout.

Parameters

location:IPoint — The location to crop.

Returns
IPoint — A new location where the horizontal and vertical coordinates have been moved towards the node's bounds until they were inside these bounds.
handleMove()method 
override public function handleMove(context:IInputModeContext, originalX:Number, originalY:Number, newX:Number, newY:Number):Boolean

Crops the new location to the port's owning INode's layout before handling the move. 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.

See also

setParameter()method 
override protected function setParameter(graph:IGraph, port:IPort, newParameter:IPortLocationModelParameter):void

Callback method that applies the parameter

Parameters

graph:IGraph — The graph to use for applying.
 
port:IPort — The port to apply the parameter to.
 
newParameter:IPortLocationModelParameter — The new parameter to apply.