|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfovis.visualization.Orientation
public class Orientation
Simple implementation of interface Orientable with conveninent static methods.
Field Summary |
---|
Fields inherited from interface infovis.visualization.Orientable |
---|
DIRECTION, NAME, ORIENTATION_CENTER, ORIENTATION_EAST, ORIENTATION_INVALID, ORIENTATION_NORTH, ORIENTATION_SOUTH, ORIENTATION_WEST, SQRT2 |
Fields inherited from interface javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Constructor Summary | |
---|---|
Orientation()
Create an Orientation to the SOUTH. |
|
Orientation(short orientation)
Creates an orientation by specifying its initial value. |
Method Summary | |
---|---|
static short |
directionOrientation(double dx,
double dy)
Returns the closest orientation to a speficied direction. |
static Point2D |
getDirection(short orientation)
Returns a direction vector for a specified orientation. |
short |
getOrientation()
Returns the orientation. |
static short |
inverse(short orientation)
Returns the inverse of a specified orientation. |
static boolean |
isHorizontal(short orientation)
Return true if the orientation is horizontal. |
static boolean |
isVertical(short orientation)
Return true if the orientation is vertical. |
void |
setOrientation(short orientation)
Sets the orientation. |
static String |
toString(short orientation)
Returns a printable representation for a specified orientation. |
static short |
turn90(short orientation)
Returns the orientation turned by 90 degrees. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Orientation()
public Orientation(short orientation)
orientation
- the initial valueMethod Detail |
---|
public short getOrientation()
getOrientation
in interface Orientable
public void setOrientation(short orientation)
setOrientation
in interface Orientable
orientation
- the new orientation setpublic static short directionOrientation(double dx, double dy)
dx
- the x component of the orientationdy
- the y component of the orientation
public static short inverse(short orientation)
orientation
- the orientation
public static short turn90(short orientation)
orientation
- the orientation
public static boolean isHorizontal(short orientation)
orientation
- the orientation
public static boolean isVertical(short orientation)
orientation
- the orientation
public static String toString(short orientation)
orientation
- the orientatio
public static Point2D getDirection(short orientation)
orientation
- the orientation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |