public class DoubleRect
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
double |
bottom |
double |
left |
double |
right |
double |
top |
Constructor and Description |
---|
DoubleRect() |
DoubleRect(double left,
double top,
double right,
double bottom)
Construct a new Rect with specified left, top, right, and bottom.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
boolean |
contains(Point p) |
void |
expandBottom(double bottom,
double thick)
Push the Rect's bottom boundary downward if necessary.
|
void |
expandHorizontal(double h,
double thick) |
void |
expandLeft(double left,
double thick)
Push the Rect's left boundary leftward if necessary.
|
void |
expandPoint(Point point,
double thick) |
void |
expandRight(double right,
double thick)
Push the Rect's righthand boundary rightward if necessary.
|
void |
expandTop(double top,
double thick)
Push the Rect's top boundary upward if necessary.
|
void |
expandVertical(double v,
double thick) |
Dim |
getDim() |
double |
getHeight() |
DoublePoint |
getMidPoint() |
DoubleRect |
getScaled(int scale) |
double |
getWidth() |
void |
setRect(double newleft,
double newtop,
double newright,
double newbottom) |
Rect |
toRect(Dim scale) |
java.lang.String |
toString() |
DoubleRect |
unionRect(DoubleRect r)
Expand this rectangle where necessary so that it encompasses the given
rectangle.
|
void |
zero() |
void |
zeroRect() |
public double left
public double right
public double top
public double bottom
public DoubleRect()
public DoubleRect(double left, double top, double right, double bottom)
left
- left edge of the rectangle.top
- top edge of the rectangle.right
- right edge of the rectangle.bottom
- bottom edge of the rectangle.public java.lang.Object clone()
clone
in class java.lang.Object
public void zero()
public void expandLeft(double left, double thick)
left
- the potential new lefthand boundarythick
- the thickness of the drawing primitivepublic void expandRight(double right, double thick)
right
- the potential new righthand boundarythick
- the thickness of the drawing primitivepublic void expandTop(double top, double thick)
top
- the potential new top boundarythick
- the thickness of the drawing primitivepublic void expandBottom(double bottom, double thick)
bottom
- the potential new bottom boundarythick
- the thickness of the drawing primitivepublic void expandPoint(Point point, double thick)
public void expandHorizontal(double h, double thick)
public void expandVertical(double v, double thick)
public DoublePoint getMidPoint()
public java.lang.String toString()
toString
in class java.lang.Object
public DoubleRect unionRect(DoubleRect r)
r
- the rectangle to be union'ed with this one.public double getWidth()
public double getHeight()
public Dim getDim()
public void setRect(double newleft, double newtop, double newright, double newbottom)
public void zeroRect()
public boolean contains(Point p)
public DoubleRect getScaled(int scale)