Package | com.yworks.graph.input |
Class | public class CroppedPortLocationModelParameterHandle |
Inheritance | CroppedPortLocationModelParameterHandle PortLocationModelParameterHandle Object |
PortLocationModelParameterHandle
that restricts the new location of the port to the bounding box
of it's owning INode
.
Method | Defined By | ||
---|---|---|---|
CroppedPortLocationModelParameterHandle | |||
cancelDrag(context:IInputModeContext, originalX:Number, originalY:Number):void
Called by clients to indicate that the dragging has been canceled by the user. | PortLocationModelParameterHandle | ||
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 | ||
initializeDrag(context:IInputModeContext):void
Called by clients to indicate that the element is going to be dragged. | PortLocationModelParameterHandle | ||
setPosition(x:Number, y:Number):void | PortLocationModelParameterHandle |
Method | Defined By | ||
---|---|---|---|
collectSnapResults(evt:CollectSnapResultEvent):void
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 | ||
Gets the graph to use for setting the parameter via IGraph.setPortLocationModelParameter from the context. | PortLocationModelParameterHandle | ||
getMoveType(port:IPort):uint
Determines the type of the movement for the given port. | PortLocationModelParameterHandle | ||
getNewParameter(port:IPort, model:IPortLocationModel, newLocation:IPoint):IPortLocationModelParameter
Callback method that obtains the new parameter for the given location and port. | PortLocationModelParameterHandle | ||
[override]
Callback method that applies the parameter
| CroppedPortLocationModelParameterHandle |
CroppedPortLocationModelParameterHandle | () | Constructor |
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.
|
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 |
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.
|