|
Eclipse Draw2d 3.2 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.eclipse.draw2d.geometry.Rectangle
org.eclipse.draw2d.geometry.PrecisionRectangle
A Rectangle implementation using floating point values which are truncated into the inherited integer fields. The use of floating point prevents rounding errors from accumulating.
| Field Summary | |
double |
preciseHeight
Double value for height |
double |
preciseWidth
Double value for width |
double |
preciseX
Double value for X |
double |
preciseY
Double value for Y |
| Fields inherited from class org.eclipse.draw2d.geometry.Rectangle |
height, SINGLETON, width, x, y |
| Constructor Summary | |
PrecisionRectangle()
Constructs a new PrecisionRectangle with all values 0. |
|
PrecisionRectangle(Rectangle rect)
Constructs a new PrecisionRectangle from the given integer Rectangle. |
|
| Method Summary | |
Rectangle |
crop(Insets insets)
Crops this rectangle by the amount specified in insets. |
boolean |
equals(Object o)
Returns whether the input object is equal to this Rectangle or not. |
Rectangle |
getCopy()
Returns a new Rectangle which has the exact same parameters as this Rectangle. |
PrecisionRectangle |
getPreciseCopy()
Returns a precise copy of this. |
void |
performScale(double factor)
Scales this object by the scale factor. |
void |
performTranslate(int dx,
int dy)
Translates this object horizontally by dx and vertically by
dy. |
double |
preciseBottom()
Returns the bottom coordinte in double precision. |
double |
preciseRight()
Returns the right side in double precision. |
Rectangle |
resize(Dimension sizeDelta)
Resizes this Rectangle by the Dimension provided as input and returns this for convenience. |
void |
setHeight(double value)
Sets the height. |
void |
setWidth(double value)
Sets the width. |
void |
setX(double value)
Sets the x value. |
void |
setY(double value)
Sets the y value. |
Rectangle |
translate(Point p)
Moves this Rectangle horizontally by the x value of the given Point and vertically by the y value of the given Point, then returns this Rectangle for convenience. |
PrecisionRectangle |
union(PrecisionRectangle other)
Unions the given PrecisionRectangle with this rectangle and returns this
for convenience. |
void |
updateInts()
Updates the integer values based on the current precise values. |
| Methods inherited from class org.eclipse.draw2d.geometry.Rectangle |
bottom, contains, contains, contains, expand, expand, getBottom, getBottomLeft, getBottomRight, getCenter, getCropped, getExpanded, getExpanded, getIntersection, getLeft, getLocation, getPosition, getResized, getResized, getRight, getSize, getTop, getTopLeft, getTopRight, getTranslated, getTranslated, getTransposed, getUnion, hashCode, intersect, intersects, isEmpty, resize, right, scale, scale, setBounds, setLocation, setLocation, setSize, setSize, shrink, toString, touches, translate, transpose, union, union, union, union, union |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public double preciseHeight
public double preciseWidth
public double preciseX
public double preciseY
| Constructor Detail |
public PrecisionRectangle()
public PrecisionRectangle(Rectangle rect)
rect - the base rectangle| Method Detail |
public Rectangle getCopy()
Rectangle
getCopy in class RectangleRectangle.getCopy()public PrecisionRectangle getPreciseCopy()
public Rectangle crop(Insets insets)
Rectangleinsets.
crop in class Rectangleinsets - Insets to be removed from the Rectangle
this for convenienceRectangle.crop(org.eclipse.draw2d.geometry.Insets)public boolean equals(Object o)
Rectangle
equals in class Rectangleo - Object being tested for equality
Rectangle.equals(Object)public void performScale(double factor)
Translatable
performScale in interface TranslatableperformScale in class RectangleRectangle.performScale(double)
public void performTranslate(int dx,
int dy)
Translatabledx and vertically by
dy.
performTranslate in interface TranslatableperformTranslate in class RectangleRectangle.performTranslate(int, int)public double preciseBottom()
public double preciseRight()
public Rectangle resize(Dimension sizeDelta)
Rectangle
resize in class RectanglesizeDelta - Resize data as a Dimension
this for convenienceRectangle.resize(org.eclipse.draw2d.geometry.Dimension)public void setHeight(double value)
value - the new heightpublic void setWidth(double value)
value - the new widthpublic void setX(double value)
value - the new x valuepublic void setY(double value)
value - the new y valuepublic Rectangle translate(Point p)
Rectangle
translate in class Rectanglep - Point which provides translation information
this for convenienceRectangle.translate(org.eclipse.draw2d.geometry.Point)public PrecisionRectangle union(PrecisionRectangle other)
this
for convenience.
other - the rectangle being unioned
this for conveniencepublic void updateInts()
|
Eclipse Draw2d 3.2 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||