Search this API

y.view
Class MoveSnapContext.MovingPortInfo

java.lang.Object
  extended by y.view.MoveSnapContext.MovingInfo
      extended by y.view.MoveSnapContext.MovingPortInfo
Enclosing class:
MoveSnapContext

public static class MoveSnapContext.MovingPortInfo
extends MoveSnapContext.MovingInfo

Concrete subclass of MoveSnapContext.MovingInfo that describes the movement of a Port.

 
Your browser does not support SVG content.

Constructor Summary
MoveSnapContext.MovingPortInfo(Port port, YPoint originalLocation, byte mode)
          Creates a new instance for the given port, location and mode
 
Method Summary
 void applyLocation(double dx, double dy)
          Calls Port.setOffsets(double, double) according to the movement constraints.
 Port getPort()
          Yields the port this instance acts on.
 
Methods inherited from class y.view.MoveSnapContext.MovingInfo
getOriginalLocation, isFreelyMovable, isHorizontallyFixed, isVerticallyFixed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MoveSnapContext.MovingPortInfo

public MoveSnapContext.MovingPortInfo(Port port,
                                      YPoint originalLocation,
                                      byte mode)
Creates a new instance for the given port, location and mode

Parameters:
port - The port to move
originalLocation - The absolute location of the port before the move started.
mode - The mode of the movement, which is a bitwise combination of MoveSnapContext.MOVE_X, MoveSnapContext.MOVE_Y, or MoveSnapContext.MOVE_XY.
Method Detail

getPort

public Port getPort()
Yields the port this instance acts on.


applyLocation

public void applyLocation(double dx,
                          double dy)
Calls Port.setOffsets(double, double) according to the movement constraints.

Specified by:
applyLocation in class MoveSnapContext.MovingInfo
Parameters:
dx - The delta in x coordinate direction of the move since the movement started.
dy - The delta in y coordinate direction of the move since the movement started.

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.