|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--y.geom.YDimension
|
+--y.geom.YRectangle
This class defines a rectangle und provides utility methods for it.
| Field Summary | |
double |
x
The x coordinate of the upper left corner. |
double |
y
The y coordinate of the upper left corner. |
| Fields inherited from class y.geom.YDimension |
height, width |
| Constructor Summary | |
YRectangle()
Creates a new rectangle with upper left corner (0,0) and size (0,0). |
|
YRectangle(double x,
double y,
double width,
double height)
Creates a new rectangle with given upper left corner and size. |
|
YRectangle(YPoint pos,
YDimension size)
Creates a new rectangle with given upper left corner and size. |
|
| Method Summary | |
int |
compareTo(Object o)
|
boolean |
contains(double x,
double y)
checks whether or not this YRectangle contains the
given point. |
boolean |
contains(YPoint p)
checks whether or not this YRectangle contains the
given point. |
boolean |
equals(Object o)
Tests a dimension to equality to another dimension. |
YRectangle |
getBoundingBox()
Returns this object. |
YPoint |
getLocation()
Returns coordinates of upper left corner. |
double |
getX()
Returns x-coordinate of upper left corner. |
double |
getY()
Returns y-coordinate of upper left corner. |
int |
hashCode()
|
static boolean |
intersects(YRectangle r1,
YRectangle r2)
Returns whether or not the given rectangles intersect. |
String |
toString()
Returns a string representation of this rectangle |
| Methods inherited from class y.geom.YDimension |
getHeight, getWidth |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public final double x
public final double y
| Constructor Detail |
public YRectangle()
public YRectangle(YPoint pos,
YDimension size)
pos - upper left corner of the rectangle.size - size of the rectangle.
public YRectangle(double x,
double y,
double width,
double height)
x - x-coordinate of upper left corner of the rectangle.y - y-coordiante of upper left corner of the rectangle.width - width of the rectangle.height - height of the rectangle.| Method Detail |
public final double getX()
public final double getY()
public final YPoint getLocation()
public YRectangle getBoundingBox()
getBoundingBox in interface PlaneObject
public boolean contains(double x,
double y)
YRectangle contains the
given point.
public boolean contains(YPoint p)
YRectangle contains the
given point.
public static boolean intersects(YRectangle r1,
YRectangle r2)
public String toString()
toString in class YDimensionpublic int hashCode()
hashCode in class YDimensionpublic boolean equals(Object o)
YDimension
equals in class YDimensionpublic int compareTo(Object o)
compareTo in interface ComparablecompareTo in class YDimension
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||