Search this API

y.view
Class MoveSnapContext.MovingInfo

java.lang.Object
  extended by y.view.MoveSnapContext.MovingInfo
Direct Known Subclasses:
MoveSnapContext.MovingBendInfo, MoveSnapContext.MovingPortInfo
Enclosing class:
MoveSnapContext

public abstract static class MoveSnapContext.MovingInfo
extends java.lang.Object

The abstract base class of the classes that describe items that will be moved in the context of the move operation that is described by the MoveSnapContext. There are specialized subclasses for both bends and ports.

 

Constructor Summary
protected MoveSnapContext.MovingInfo(YPoint originalLocation, byte mode)
          Creates a new instance using the provided original location and the movement mode.
 
Method Summary
abstract  void applyLocation(double dx, double dy)
          Moves the item described by this item according to the delta coordinates.
 YPoint getOriginalLocation()
          Yields the location of the item before the move operation was initiated.
 boolean isFreelyMovable()
          Tests whether the item is not constrained to movements along the x or y axis.
 boolean isHorizontallyFixed()
          Whether the x coordinate of the item is fixed during the move operation.
 boolean isVerticallyFixed()
          Whether the y coordinate of the item is fixed during the move operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MoveSnapContext.MovingInfo

protected MoveSnapContext.MovingInfo(YPoint originalLocation,
                                     byte mode)
Creates a new instance using the provided original location and the movement mode.

Parameters:
originalLocation - The location of the item before the movement started.
mode - The constant that describes the movement of the item - one of MoveSnapContext.MOVE_X, MoveSnapContext.MOVE_Y, or MoveSnapContext.MOVE_XY.
Method Detail

getOriginalLocation

public final YPoint getOriginalLocation()
Yields the location of the item before the move operation was initiated.


isFreelyMovable

public final boolean isFreelyMovable()
Tests whether the item is not constrained to movements along the x or y axis.

See Also:
MoveSnapContext.MOVE_XY

isVerticallyFixed

public final boolean isVerticallyFixed()
Whether the y coordinate of the item is fixed during the move operation.


isHorizontallyFixed

public final boolean isHorizontallyFixed()
Whether the x coordinate of the item is fixed during the move operation.


applyLocation

public abstract void applyLocation(double dx,
                                   double dy)
Moves the item described by this item according to the delta coordinates. The delta should be added to the getOriginalLocation()

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.