|
Eclipse Draw2d 3.8.0.201206011245 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.draw2d.geometry.Dimension
org.eclipse.draw2d.geometry.PrecisionDimension
public class PrecisionDimension
Field Summary | |
---|---|
double |
preciseHeight
Deprecated. Use setPreciseHeight(double) and
preciseHeight() instead. This field will become
private in the future. |
double |
preciseWidth
Deprecated. Use setPreciseWidth(double) and
preciseWidth() instead. This field will become
private in the future. |
Fields inherited from class org.eclipse.draw2d.geometry.Dimension |
---|
height, SINGLETON, width |
Constructor Summary | |
---|---|
PrecisionDimension()
Constructs a new precision dimension. |
|
PrecisionDimension(Dimension d)
Constructs a precision representation of the given dimension. |
|
PrecisionDimension(double w,
double h)
Constructs a new precision dimension with the given values. |
Method Summary | |
---|---|
boolean |
contains(Dimension d)
Returns true if the input Dimension fits into this
Dimension. |
boolean |
containsProper(Dimension d)
Returns true if this Dimension properly contains the one
specified. |
boolean |
equals(Object o)
Returns whether the input Object is equivalent to this Dimension. |
Dimension |
expand(Dimension d)
Expands the size of this Dimension by the specified amount. |
Dimension |
expand(double w,
double h)
Expands the size of this Dimension by the specified width and height. |
Dimension |
expand(int w,
int h)
Expands the size of this Dimension by the specified width and height. |
Dimension |
getCopy()
Creates and returns a copy of this Dimension. |
PrecisionDimension |
getPreciseCopy()
Returns a precise copy of this. |
Dimension |
intersect(Dimension d)
This Dimension is intersected with the one specified. |
void |
performScale(double factor)
Scales this object by the scale factor. |
double |
preciseHeight()
Returns double height |
double |
preciseWidth()
Returns double width |
Dimension |
scale(double widthFactor,
double heightFactor)
Scales the width of this Dimension by w and scales the height of this Dimension by h. |
Dimension |
setHeight(int h)
Sets the height of this Rectangle to the specified one. |
PrecisionDimension |
setPreciseHeight(double h)
Sets the height. |
PrecisionDimension |
setPreciseSize(double w,
double h)
Sets the size of this PrecisionDimension to the given width and height. |
PrecisionDimension |
setPreciseSize(PrecisionDimension d)
Sets the size of this Dimension to the width and height of the given one. |
PrecisionDimension |
setPreciseWidth(double w)
Sets the width. |
void |
setSize(Dimension d)
Copies the width and height values of the input Dimension to this Dimension. |
Dimension |
setSize(int w,
int h)
Sets the size of this dimension to the specified width and height. |
Dimension |
setWidth(int width)
Sets the width of this Rectangle to the specified one. |
Dimension |
shrink(Dimension d)
Shrinks the size of this Dimension by the width and height values of the given Dimension. |
Dimension |
shrink(double w,
double h)
Reduces the width of this Dimension by w, and reduces the height of this Dimension by h. |
Dimension |
shrink(int w,
int h)
Reduces the width of this Dimension by w, and reduces the height of this Dimension by h. |
Dimension |
transpose()
Swaps the width and height of this Dimension, and returns this for convenience. |
Dimension |
union(Dimension d)
Sets the width of this Dimension to the greater of this Dimension's width and d.width. |
void |
updateInts()
Deprecated. This method should not be accessed by clients any more (it will be made private in future releases). The update of integer and precision fields is performed automatically if preciseWidth and preciseHeight field values
are not manipulated directly, but only via respective methods
offered by this class. |
Methods inherited from class org.eclipse.draw2d.geometry.Dimension |
---|
equals, expand, getArea, getDifference, getExpanded, getExpanded, getExpanded, getIntersected, getNegated, getScaled, getShrinked, getShrinked, getShrinked, getTransposed, getUnioned, hashCode, height, isEmpty, max, min, negate, performTranslate, scale, toString, width |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public double preciseHeight
setPreciseHeight(double)
and
preciseHeight()
instead. This field will become
private in the future.
public double preciseWidth
setPreciseWidth(double)
and
preciseWidth()
instead. This field will become
private in the future.
Constructor Detail |
---|
public PrecisionDimension()
public PrecisionDimension(Dimension d)
d
- the reference dimensionpublic PrecisionDimension(double w, double h)
w
- the widthh
- the heightMethod Detail |
---|
public boolean contains(Dimension d)
Dimension
true
if the input Dimension fits into this
Dimension. A Dimension of the same size is considered to "fit".
contains
in class Dimension
d
- the dimension being tested
true
if this Dimension contains dDimension.contains(org.eclipse.draw2d.geometry.Dimension)
public boolean containsProper(Dimension d)
Dimension
true
if this Dimension properly contains the one
specified. Proper containment is defined as containment using \"<\",
instead of \"<=\".
containsProper
in class Dimension
d
- the dimension being tested
true
if this Dimension properly contains the one
specifiedDimension.containsProper(org.eclipse.draw2d.geometry.Dimension)
public boolean equals(Object o)
Dimension
true
if the Object is a Dimension and its width and height
are equal to this Dimension's width and height, false
otherwise.
equals
in class Dimension
o
- the Object being tested for equality
true
if the given object is equal to this dimensionDimension.equals(java.lang.Object)
public Dimension expand(Dimension d)
Dimension
expand
in class Dimension
d
- the Dimension providing the expansion width and height
this
for convenienceDimension.expand(org.eclipse.draw2d.geometry.Dimension)
public Dimension expand(double w, double h)
Dimension
expand
in class Dimension
w
- Value by which the width should be increasedh
- Value by which the height should be increased
this
for convenienceDimension.expand(double, double)
public Dimension expand(int w, int h)
Dimension
expand
in class Dimension
w
- Value by which the width should be increasedh
- Value by which the height should be increased
this
for convenienceDimension.expand(int, int)
public Dimension getCopy()
Dimension
getCopy
in class Dimension
Dimension.getCopy()
public PrecisionDimension getPreciseCopy()
public Dimension intersect(Dimension d)
Dimension
intersect
in class Dimension
d
- the Dimension used to perform the min()
this
for convenienceDimension.intersect(org.eclipse.draw2d.geometry.Dimension)
public void performScale(double factor)
Translatable
performScale
in interface Translatable
performScale
in class Dimension
factor
- The scale factorDimension.performScale(double)
public double preciseHeight()
Dimension
double
height
preciseHeight
in class Dimension
double
heightDimension.preciseHeight()
public double preciseWidth()
Dimension
double
width
preciseWidth
in class Dimension
double
widthDimension.preciseWidth()
public Dimension scale(double widthFactor, double heightFactor)
Dimension
scale
in class Dimension
widthFactor
- the value by which the width is to be scaledheightFactor
- the value by which the height is to be scaled
this
for convenienceDimension.scale(double, double)
public Dimension setHeight(int h)
Dimension
setHeight
in class Dimension
h
- The new height
Dimension.setHeight(int)
public PrecisionDimension setPreciseHeight(double h)
h
- the new height
public PrecisionDimension setPreciseSize(double w, double h)
w
- The new widthh
- The new height
public PrecisionDimension setPreciseSize(PrecisionDimension d)
d
- The PrecisionDimension specifying the new width and height
values.
public PrecisionDimension setPreciseWidth(double w)
w
- the new width
public void setSize(Dimension d)
Dimension
setSize
in class Dimension
d
- the dimension supplying the valuesDimension.setSize(org.eclipse.draw2d.geometry.Dimension)
public Dimension setSize(int w, int h)
Dimension
setSize
in class Dimension
w
- The new widthh
- The new heightDimension.setSize(int, int)
public Dimension setWidth(int width)
Dimension
setWidth
in class Dimension
width
- The new width
Dimension.setWidth(int)
public Dimension shrink(Dimension d)
Dimension
shrink
in class Dimension
d
- The dimension whose width and height values are to be used
this
for convenienceDimension.shrink(org.eclipse.draw2d.geometry.Dimension)
public Dimension shrink(int w, int h)
Dimension
shrink
in class Dimension
w
- the value by which the width is to be reducedh
- the value by which the height is to be reduced
this
for convenienceDimension.shrink(int, int)
public Dimension shrink(double w, double h)
Dimension
shrink
in class Dimension
w
- the value by which the width is to be reducedh
- the value by which the height is to be reduced
this
for convenienceDimension.shrink(double, double)
public Dimension transpose()
Dimension
transpose
in class Dimension
this
for convenienceDimension.transpose()
public Dimension union(Dimension d)
Dimension
union
in class Dimension
d
- the Dimension to union with this Dimension
this
for convenienceDimension.union(org.eclipse.draw2d.geometry.Dimension)
public final void updateInts()
preciseWidth
and preciseHeight
field values
are not manipulated directly, but only via respective methods
offered by this class.
|
Eclipse Draw2d 3.8.0.201206011245 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |