Package org.jfree.chart.ui
Class RectangleEdge
- java.lang.Object
-
- org.jfree.chart.ui.RectangleEdge
-
- All Implemented Interfaces:
java.io.Serializable
public final class RectangleEdge extends java.lang.Object implements java.io.Serializable
Used to indicate the edge of a rectangle.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static RectangleEdge
BOTTOM
Bottom.static RectangleEdge
LEFT
Left.private java.lang.String
name
The name.static RectangleEdge
RIGHT
Right.private static long
serialVersionUID
For serialization.static RectangleEdge
TOP
Top.
-
Constructor Summary
Constructors Modifier Constructor Description private
RectangleEdge(java.lang.String name)
Private constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static double
coordinate(java.awt.geom.Rectangle2D rectangle, RectangleEdge edge)
Returns the x or y coordinate of the specified edge.boolean
equals(java.lang.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.private java.lang.Object
readResolve()
Ensures that serialization returns the unique instances.java.lang.String
toString()
Returns a string representing the object.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
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.
-
name
private java.lang.String name
The name.
-
-
Method Detail
-
toString
public java.lang.String toString()
Returns a string representing the object.- Overrides:
toString
in classjava.lang.Object
- Returns:
- The string.
-
equals
public boolean equals(java.lang.Object o)
Returnstrue
if this object is equal to the specified object, andfalse
otherwise.- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- the other object.- Returns:
- A boolean.
-
hashCode
public int hashCode()
Returns a hash code value for the object.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- the hashcode
-
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(java.awt.geom.Rectangle2D rectangle, RectangleEdge edge)
Returns the x or y coordinate of the specified edge.- Parameters:
rectangle
- the rectangle.edge
- the edge.- Returns:
- The coordinate.
-
readResolve
private java.lang.Object readResolve() throws java.io.ObjectStreamException
Ensures that serialization returns the unique instances.- Returns:
- The object.
- Throws:
java.io.ObjectStreamException
- if there is a problem.
-
-