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.

用来表示矩形上下左右方向.

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
          下边界.
static RectangleEdge LEFT
          左边界.
static RectangleEdge RIGHT
          右边界.
static RectangleEdge TOP
          上边界.
 
Method Summary
static double coordinate(java.awt.geom.Rectangle2D rectangle, RectangleEdge edge)
          根据边界值计算X或Y坐标的值.
 boolean equals(java.lang.Object o)
          覆盖equals方法.
 int hashCode()
          计算hashcode.
static boolean isLeftOrRight(RectangleEdge edge)
          是否是左边界或右边界.
static boolean isTopOrBottom(RectangleEdge edge)
          是否是上边界或下边界.
static RectangleEdge opposite(RectangleEdge edge)
          返回相反的边界值.
 java.lang.String toString()
          覆盖toString方法.
 void trim(java.awt.geom.Rectangle2D rect, double len)
          根据edge去掉矩形的某一边len长度.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TOP

public static final RectangleEdge TOP
上边界.


BOTTOM

public static final RectangleEdge BOTTOM
下边界.


LEFT

public static final RectangleEdge LEFT
左边界.


RIGHT

public static final RectangleEdge RIGHT
右边界.

Method Detail

hashCode

public int hashCode()
计算hashcode.

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

isTopOrBottom

public static boolean isTopOrBottom(RectangleEdge edge)
是否是上边界或下边界.

Parameters:
edge - 边界
Returns:
A boolean.

isLeftOrRight

public static boolean isLeftOrRight(RectangleEdge edge)
是否是左边界或右边界.

Parameters:
edge - 边界
Returns:
A boolean.

opposite

public static RectangleEdge opposite(RectangleEdge edge)
返回相反的边界值.

Parameters:
edge - 边界
Returns:
相反的边界值.

coordinate

public static double coordinate(java.awt.geom.Rectangle2D rectangle,
                                RectangleEdge edge)
根据边界值计算X或Y坐标的值.

Parameters:
rectangle - 矩形 (不可为null).
edge - 边界值 (不可为null).
Returns:
X或Y坐标.

trim

public void trim(java.awt.geom.Rectangle2D rect,
                 double len)
根据edge去掉矩形的某一边len长度.

Parameters:
rect - Rectangle2D 矩形 (不可为null).
len - double 长度,须大于等于0.

toString

public java.lang.String toString()
覆盖toString方法.

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

equals

public boolean equals(java.lang.Object o)
覆盖equals方法.

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