org.jfree.ui

Class RectangleEdge

public final class RectangleEdge extends Object implements Serializable

Used to indicate the edge of a rectangle.

Author: David Gilbert

Field Summary
static RectangleEdgeBOTTOM
Bottom.
static RectangleEdgeLEFT
Left.
static RectangleEdgeRIGHT
Right.
static RectangleEdgeTOP
Top.
Method Summary
static doublecoordinate(Rectangle2D rectangle, RectangleEdge edge)
Returns the x or y coordinate of the specified edge.
booleanequals(Object o)
Returns true if this object is equal to the specified object, and false otherwise.
inthashCode()
Returns a hash code value for the object.
static booleanisLeftOrRight(RectangleEdge edge)
Returns true if the edge is LEFT or RIGHT, and false otherwise.
static booleanisTopOrBottom(RectangleEdge edge)
Returns true if the edge is TOP or BOTTOM, and false otherwise.
static RectangleEdgeopposite(RectangleEdge edge)
Returns the opposite edge.
StringtoString()
Returns a string representing the object.

Field Detail

BOTTOM

public static final RectangleEdge BOTTOM
Bottom.

LEFT

public static final RectangleEdge LEFT
Left.

RIGHT

public static final RectangleEdge RIGHT
Right.

TOP

public static final RectangleEdge TOP
Top.

Method Detail

coordinate

public static double coordinate(Rectangle2D rectangle, RectangleEdge edge)
Returns the x or y coordinate of the specified edge.

Parameters: rectangle the rectangle. edge the edge.

Returns: The coordinate.

equals

public boolean equals(Object o)
Returns true if this object is equal to the specified object, and false otherwise.

Parameters: o the other object.

Returns: A boolean.

hashCode

public int hashCode()
Returns a hash code value for the object.

Returns: the hashcode

isLeftOrRight

public static boolean isLeftOrRight(RectangleEdge edge)
Returns true if the edge is LEFT or RIGHT, and false otherwise.

Parameters: edge the edge.

Returns: A boolean.

isTopOrBottom

public static boolean isTopOrBottom(RectangleEdge edge)
Returns true if the edge is TOP or BOTTOM, and false otherwise.

Parameters: edge the edge.

Returns: A boolean.

opposite

public static RectangleEdge opposite(RectangleEdge edge)
Returns the opposite edge.

Parameters: edge an edge.

Returns: The opposite edge.

toString

public String toString()
Returns a string representing the object.

Returns: The string.