Eclipse Draw2d
2.1

org.eclipse.draw2d.geometry
Class PrecisionRectangle

java.lang.Object
  |
  +--org.eclipse.draw2d.geometry.Rectangle
        |
        +--org.eclipse.draw2d.geometry.PrecisionRectangle
All Implemented Interfaces:
Cloneable, Serializable, Translatable

public final class PrecisionRectangle
extends Rectangle

See Also:
Serialized Form

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(Rectangle rect)
          Constructs a new PrecisionRectangle from the given integer Rectangle.
 
Method Summary
 Rectangle getCopy()
          Returns a new Rectangle which has the exact same parameters as this Rectangle.
 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.
 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.
 
Methods inherited from class org.eclipse.draw2d.geometry.Rectangle
bottom, contains, contains, crop, equals, expand, expand, getBottom, getBottomLeft, getBottomRight, getCenter, getCropped, getExpanded, getExpanded, getIntersection, getLeft, getLocation, getPosition, getResized, getResized, getRight, getSize, getTop, getTopLeft, getTopRight, getTranslated, getTranslated, getTransposed, getUnion, 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, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

preciseHeight

public double preciseHeight
Double value for height


preciseWidth

public double preciseWidth
Double value for width


preciseX

public double preciseX
Double value for X


preciseY

public double preciseY
Double value for Y

Constructor Detail

PrecisionRectangle

public PrecisionRectangle(Rectangle rect)
Constructs a new PrecisionRectangle from the given integer Rectangle.

Parameters:
rect - the base rectangle
Method Detail

getCopy

public Rectangle getCopy()
Description copied from class: Rectangle
Returns a new Rectangle which has the exact same parameters as this Rectangle.

Overrides:
getCopy in class Rectangle
Returns:
Copy of this Rectangle
See Also:
Rectangle.getCopy()

performScale

public void performScale(double factor)
Description copied from interface: Translatable
Scales this object by the scale factor.

Specified by:
performScale in interface Translatable
Overrides:
performScale in class Rectangle
See Also:
Rectangle.performScale(double)

performTranslate

public void performTranslate(int dx,
                             int dy)
Description copied from interface: Translatable
Translates this object horizontally by dx and vertically by dy.

Specified by:
performTranslate in interface Translatable
Overrides:
performTranslate in class Rectangle
See Also:
Rectangle.performTranslate(int, int)

resize

public Rectangle resize(Dimension sizeDelta)
Description copied from class: Rectangle
Resizes this Rectangle by the Dimension provided as input and returns this for convenience. This Rectange's width will become this.width + sizeDelta.width. Likewise for height.

Overrides:
resize in class Rectangle
Parameters:
sizeDelta - Resize data as a Dimension
Returns:
this for convenience
See Also:
Rectangle.resize(org.eclipse.draw2d.geometry.Dimension)

setHeight

public void setHeight(double value)
Sets the height.

Parameters:
value - the new height

setWidth

public void setWidth(double value)
Sets the width.

Parameters:
value - the new width

setX

public void setX(double value)
Sets the x value.

Parameters:
value - the new x value

setY

public void setY(double value)
Sets the y value.

Parameters:
value - the new y value

translate

public Rectangle translate(Point p)
Description copied from class: Rectangle
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.

Overrides:
translate in class Rectangle
Parameters:
p - Point which provides translation information
Returns:
this for convenience
See Also:
Rectangle.translate(org.eclipse.draw2d.geometry.Point)

Eclipse Draw2d
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.