com.ijchart.xychart.ui
Class RectangleEdge

java.lang.Object
  extended by com.ijchart.xychart.ui.RectangleEdge
All Implemented Interfaces:
java.io.Serializable

public final class RectangleEdge
extends java.lang.Object
implements java.io.Serializable

Title: IJChart

Description: a chart library for the Java(tm) platform.

Used to indicate the edge of a rectangle.

Copyright: Copyright (c) 2013

Company:

Version:
1.0
Author:
zhang feng min,shanghai china. Contract me by email.
See Also:
Serialized Form

Field Summary
static RectangleEdge BOTTOM
           Bottom.
static RectangleEdge LEFT
           Left.
static RectangleEdge RIGHT
           Right.
static RectangleEdge TOP
           Top.
 
Method Summary
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)
           Returns true if this object is equal to the specified object, and false otherwise.
 int hashCode()
           Returns a hash code value for the object.
static boolean isLeftOrRight(RectangleEdge edge)
           Returns true if the edge is LEFT or RIGHT, and false otherwise.
static boolean isTopOrBottom(RectangleEdge edge)
           Returns true if the edge is TOP or BOTTOM, and false otherwise.
static RectangleEdge opposite(RectangleEdge edge)
           Returns the opposite edge.
 java.lang.String toString()
           Returns a string representing the object.
 void trim(java.awt.geom.Rectangle2D rect, double len)
           Shrinks the given rectangle by len.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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

hashCode

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

Overrides:
hashCode in class java.lang.Object
Returns:
the hashcode

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.

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.

opposite

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

Parameters:
edge - the 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 (null not permitted).
edge - The edge (null not permitted).
Returns:
The coordinate.

trim

public void trim(java.awt.geom.Rectangle2D rect,
                 double len)
Shrinks the given rectangle by len.

Parameters:
rect - Rectangle2D The rectangle (null not permitted).
len - double The length,must be greater than or equal to 0

toString

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

Overrides:
toString in class java.lang.Object
Returns:
The string.

equals

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

Overrides:
equals in class java.lang.Object
Parameters:
o - the other object.
Returns:
A boolean.