Package org.jfree.ui
Class RectangleEdge
- java.lang.Object
-
- org.jfree.ui.RectangleEdge
-
- All Implemented Interfaces:
Serializable
public final class RectangleEdge extends Object implements Serializable
Used to indicate the edge of a rectangle.- Author:
- David Gilbert
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static RectangleEdge
BOTTOM
Bottom.static RectangleEdge
LEFT
Left.static RectangleEdge
RIGHT
Right.static RectangleEdge
TOP
Top.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static double
coordinate(Rectangle2D rectangle, RectangleEdge edge)
Returns the x or y coordinate of the specified edge.boolean
equals(Object o)
Returnstrue
if this object is equal to the specified object, andfalse
otherwise.int
hashCode()
Returns a hash code value for the object.static boolean
isLeftOrRight(RectangleEdge edge)
Returnstrue
if the edge isLEFT
orRIGHT
, andfalse
otherwise.static boolean
isTopOrBottom(RectangleEdge edge)
Returnstrue
if the edge isTOP
orBOTTOM
, andfalse
otherwise.static RectangleEdge
opposite(RectangleEdge edge)
Returns the opposite edge.String
toString()
Returns a string representing the object.
-
-
-
Field Detail
-
TOP
public static final RectangleEdge TOP
Top.
-
BOTTOM
public static final RectangleEdge BOTTOM
Bottom.
-
LEFT
public static final RectangleEdge LEFT
Left.
-
RIGHT
public static final RectangleEdge RIGHT
Right.
-
-
Method Detail
-
toString
public String toString()
Returns a string representing the object.
-
equals
public boolean equals(Object o)
Returnstrue
if this object is equal to the specified object, andfalse
otherwise.
-
hashCode
public int hashCode()
Returns a hash code value for the object.
-
isTopOrBottom
public static boolean isTopOrBottom(RectangleEdge edge)
Returnstrue
if the edge isTOP
orBOTTOM
, andfalse
otherwise.- Parameters:
edge
- the edge.- Returns:
- A boolean.
-
isLeftOrRight
public static boolean isLeftOrRight(RectangleEdge edge)
Returnstrue
if the edge isLEFT
orRIGHT
, andfalse
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.
-
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.
-
-