edu.umd.cfar.lamp.viper.geometry
Interface Moveable

All Known Implementing Classes:
AbstractMoveable, BoundingBox, Circle, Ellipse, OrientedBox, Pnt, Polygon, Squiggle

public interface Moveable

Instances of this interface allow movement along the 8 cardinal directions.

Author:
clin

Field Summary
static int EAST
          East direction.
static int NORTH
          North direction.
static int NORTHEAST
          Northeast direction.
static int NORTHWEST
          Northwest direction.
static int SOUTH
          South direction.
static int SOUTHEAST
          Southeast direction.
static int SOUTHWEST
          Southwest direction.
static int WEST
          West direction.
 
Method Summary
 Moveable move(int direction, int distance)
          Creates a new copy of this movable item, shifted in the given direction by the given number of pixels.
 Moveable shift(int x, int y)
          Shifts the moveable by the given amount.
 

Field Detail

NORTH

public static final int NORTH
North direction.

See Also:
move(int, int), Constant Field Values

NORTHEAST

public static final int NORTHEAST
Northeast direction.

See Also:
move(int, int), Constant Field Values

EAST

public static final int EAST
East direction.

See Also:
move(int, int), Constant Field Values

SOUTHEAST

public static final int SOUTHEAST
Southeast direction.

See Also:
move(int, int), Constant Field Values

SOUTH

public static final int SOUTH
South direction.

See Also:
move(int, int), Constant Field Values

SOUTHWEST

public static final int SOUTHWEST
Southwest direction.

See Also:
move(int, int), Constant Field Values

WEST

public static final int WEST
West direction.

See Also:
move(int, int), Constant Field Values

NORTHWEST

public static final int NORTHWEST
Northwest direction.

See Also:
move(int, int), Constant Field Values
Method Detail

move

public Moveable move(int direction,
                     int distance)
Creates a new copy of this movable item, shifted in the given direction by the given number of pixels.

Parameters:
direction - the direction to move the item
distance - the distance to move it
Returns:
the new item, the same as the old one, but shifted

shift

public Moveable shift(int x,
                      int y)
Shifts the moveable by the given amount.

Parameters:
x -
y -
Returns: