org.openbp.cockpit.modeler.figures.generic
Class CircleConstants

java.lang.Object
  extended by org.openbp.cockpit.modeler.figures.generic.CircleConstants

public class CircleConstants
extends java.lang.Object

Constants describing circle sections. There are three types of constants: The orthogonal constants (RIGHT/BOTTOM/LEFT/TOP) are the simplest ones. The quarter constants (QUARTER_*) are aliases of the orthogonal constants above and are used to desribe the circle quarters that are oriented in these directions. The EIGTH_* constants divide the circle in eight directions.

Author:
Heiko Erhardt

Field Summary
static int EIGHTH_E
          E (right)
static int EIGHTH_N
          N (top)
static int EIGHTH_NE
          NE (top left)
static int EIGHTH_NW
          NW (top left)
static int EIGHTH_S
          S (bottom)
static int EIGHTH_SE
          SE (bottom right)
static int EIGHTH_SW
          SW (bottom left)
static int EIGHTH_W
          W (left)
 
Method Summary
static int determineEighth(double angle, java.awt.Rectangle rect)
          Determines the eighth from a given angle.
static Orientation determineOrientation(double angle, java.awt.Rectangle rect)
          Determines the orientation from a given angle.
static Quarter determineQuarter(double angle, java.awt.Rectangle rect)
          Determines the quarter from a given angle.
static double normalizeAngle(double angle)
          Normalizes an angle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EIGHTH_E

public static final int EIGHTH_E
E (right)

See Also:
Constant Field Values

EIGHTH_SE

public static final int EIGHTH_SE
SE (bottom right)

See Also:
Constant Field Values

EIGHTH_S

public static final int EIGHTH_S
S (bottom)

See Also:
Constant Field Values

EIGHTH_SW

public static final int EIGHTH_SW
SW (bottom left)

See Also:
Constant Field Values

EIGHTH_W

public static final int EIGHTH_W
W (left)

See Also:
Constant Field Values

EIGHTH_NW

public static final int EIGHTH_NW
NW (top left)

See Also:
Constant Field Values

EIGHTH_N

public static final int EIGHTH_N
N (top)

See Also:
Constant Field Values

EIGHTH_NE

public static final int EIGHTH_NE
NE (top left)

See Also:
Constant Field Values
Method Detail

normalizeAngle

public static double normalizeAngle(double angle)
Normalizes an angle.

Parameters:
angle - Angle to normalize
Returns:
The angle in the range [0;2 * PI]

determineEighth

public static int determineEighth(double angle,
                                  java.awt.Rectangle rect)
Determines the eighth from a given angle.

Parameters:
angle - Angle to check
rect - Display box of the object in the center
Returns:
CircleConstants.EIGHT_*

determineQuarter

public static Quarter determineQuarter(double angle,
                                       java.awt.Rectangle rect)
Determines the quarter from a given angle.

Parameters:
angle - Angle to check
rect - Display box of the object in the center
Returns:
Quarter.SE/Quarter.SW/Quarter.NW/Quarter.NE

determineOrientation

public static Orientation determineOrientation(double angle,
                                               java.awt.Rectangle rect)
Determines the orientation from a given angle.

Parameters:
angle - Angle to check
rect - Display box of the object in the center
Returns:
Orientation.RIGHT/Orientation.BOTTOM/Orientation.LEFT/Orientation.TOP


Copyright © 2011. All Rights Reserved.