|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.swtlayeredgraph.GraphRectangle
public class GraphRectangle
Defines a rectangle that uses coordinate types.
Constructor Summary | |
---|---|
GraphRectangle()
Default constructor. |
|
GraphRectangle(GraphPoint origin,
java.lang.Double width,
java.lang.Double height,
CoordinateType type)
Builds a graph rectangle with the specified attributes. |
Method Summary | |
---|---|
java.lang.Boolean |
contains(GraphPoint point)
Checks if this rectangle contains the given point. |
java.lang.Boolean |
contains(GraphRectangle rectangle)
Checks if this rectangle fully contains the specified rectangle. |
boolean |
equals(java.lang.Object other)
Checks if this rectangle is equal to another. |
CoordinateType |
getCoordinateType()
Gets the coordinate system type for width and height. |
java.lang.Double |
getHeight()
Gets the height of this rectangle. |
GraphPoint |
getOrigin()
Gets the point that is relative to width/height. |
java.lang.Double |
getWidth()
Gets the width of this rectangle. |
GraphPoint |
getX2Y2()
Gets the point opposite of origin (origin + GraphPoint(width, height)). |
void |
merge(GraphRectangle toMerge)
Merges the two rectangles. |
java.lang.Boolean |
overlaps(GraphRectangle rectangle)
Checks if this rectangle overlaps the one passed in. |
void |
setCoordinateType(CoordinateType type)
Sets the coordinate system for this rectangle. |
void |
setHeight(java.lang.Double height)
Sets the new height for this rectangle. |
void |
setOrigin(GraphPoint origin)
Sets the new origin/reference point for width/height. |
void |
setWidth(java.lang.Double width)
Sets the new width for this rectangle. |
java.lang.String |
toString()
Converts this rectangle to a human readable version. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GraphRectangle()
public GraphRectangle(GraphPoint origin, java.lang.Double width, java.lang.Double height, CoordinateType type)
origin
- The starting point (upper left) relative to width/height.width
- Width of the rectangle.height
- Height of the rectangle.type
- Type of units for width and height. The origin will also be
converted to this system.
java.lang.IllegalArgumentException
- If any of the arguments are null.Method Detail |
---|
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public CoordinateType getCoordinateType()
public java.lang.Double getHeight()
public GraphPoint getOrigin()
public java.lang.Double getWidth()
public GraphPoint getX2Y2()
public void merge(GraphRectangle toMerge)
toMerge
- Rectangle to merge into this one.
java.lang.IllegalArgumentException
- If toMerge is null.public void setCoordinateType(CoordinateType type)
type
- New coordinate system to use.
java.lang.IllegalArgumentException
- If type is null.public void setHeight(java.lang.Double height)
height
- New height for rectangle.
java.lang.IllegalArgumentException
- If height is null.public void setOrigin(GraphPoint origin)
origin
- New reference point.
java.lang.IllegalArgumentException
- If origin is null.public void setWidth(java.lang.Double width)
width
- New width for this rectangle.
java.lang.IllegalArgumentException
- If width is null.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Boolean contains(GraphPoint point)
point
- Point to test.
java.lang.IllegalArgumentException
- If point is null.public java.lang.Boolean contains(GraphRectangle rectangle)
rectangle
- Rectangle to test for inclusion
java.lang.IllegalArgumentException
- If rectangle is null.public java.lang.Boolean overlaps(GraphRectangle rectangle)
rectangle
- Rectangle to test for overlap.
java.lang.IllegalArgumentException
- If rectangle is null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |