Package org.eclipse.draw2d.geometry
Class PrecisionDimension
java.lang.Object
org.eclipse.draw2d.geometry.Dimension
org.eclipse.draw2d.geometry.PrecisionDimension
- All Implemented Interfaces:
Serializable,Cloneable,Translatable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptiondoubleDeprecated, for removal: This API element is subject to removal in a future version.doubleDeprecated, for removal: This API element is subject to removal in a future version.UsesetPreciseWidth(double)andpreciseWidth()instead. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new precision dimension.PrecisionDimension(double w, double h) Constructs a new precision dimension with the given values.Constructs a precision representation of the given dimension. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif the input Dimension fits into this Dimension.booleanReturnstrueif this Dimension properly contains the one specified.booleanReturns whether the input Object is equivalent to this Dimension.expand(double w, double h) Expands the size of this Dimension by the specified width and height.expand(int w, int h) Expands the size of this Dimension by the specified width and height.Expands the size of this Dimension by the specified amount.getCopy()Creates and returns a copy of this Dimension.Returns a precise copy of this.This Dimension is intersected with the one specified.voidperformScale(double factor) Scales this object by the scale factor.doubleReturnsdoubleheightdoubleReturnsdoublewidthscale(double widthFactor, double heightFactor) Scales the width of this Dimension by w and scales the height of this Dimension by h.setHeight(int h) Sets the height of this Rectangle to the specified one.setPreciseHeight(double h) Sets the height.setPreciseSize(double w, double h) Sets the size of this PrecisionDimension to the given width and height.Sets the size of this Dimension to the width and height of the given one.setPreciseWidth(double w) Sets the width.setSize(int w, int h) Sets the size of this dimension to the specified width and height.voidCopies the width and height values of the input Dimension to this Dimension.setWidth(int width) Sets the width of this Rectangle to the specified one.shrink(double w, double h) Reduces the width of this Dimension by w, and reduces the height of this Dimension by h.shrink(int w, int h) Reduces the width of this Dimension by w, and reduces the height of this Dimension by h.Shrinks the size of this Dimension by the width and height values of the given Dimension.Swaps the width and height of this Dimension, and returns this for convenience.Sets the width of this Dimension to the greater of this Dimension's width and d.width.final voidDeprecated, for removal: This API element is subject to removal in a future version.This method should not be accessed by clients any more (it will be made private in future releases).Methods inherited from class org.eclipse.draw2d.geometry.Dimension
equals, expand, getArea, getDifference, getExpanded, getExpanded, getExpanded, getIntersected, getNegated, getScaled, getShrinked, getShrinked, getShrinked, getTransposed, getUnioned, getUnioned, hashCode, height, isEmpty, max, min, negate, performTranslate, scale, toString, union, widthMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.draw2d.geometry.Translatable
performTranslate, performTranslate, performTranslate
-
Field Details
-
preciseHeight
Deprecated, for removal: This API element is subject to removal in a future version.UsesetPreciseHeight(double)andpreciseHeight()instead. This field will become private in the future.The height in double precision.- @noreference
- This field is not intended to be referenced by clients.
-
preciseWidth
Deprecated, for removal: This API element is subject to removal in a future version.UsesetPreciseWidth(double)andpreciseWidth()instead. This field will become private in the future.The width in double precision.- @noreference
- This field is not intended to be referenced by clients.
-
-
Constructor Details
-
PrecisionDimension
public PrecisionDimension()Constructs a new precision dimension. -
PrecisionDimension
Constructs a precision representation of the given dimension.- Parameters:
d- the reference dimension
-
PrecisionDimension
public PrecisionDimension(double w, double h) Constructs a new precision dimension with the given values.- Parameters:
w- the widthh- the height
-
-
Method Details
-
contains
Description copied from class:DimensionReturnstrueif the input Dimension fits into this Dimension. A Dimension of the same size is considered to "fit". -
containsProper
Description copied from class:DimensionReturnstrueif this Dimension properly contains the one specified. Proper containment is defined as containment using \"<\", instead of \"<=\".- Overrides:
containsProperin classDimension- Parameters:
d- the dimension being tested- Returns:
trueif this Dimension properly contains the one specified- See Also:
-
equals
Description copied from class:DimensionReturns whether the input Object is equivalent to this Dimension.trueif the Object is a Dimension and its width and height are equal to this Dimension's width and height,falseotherwise. -
expand
Description copied from class:DimensionExpands the size of this Dimension by the specified amount. -
expand
Description copied from class:DimensionExpands the size of this Dimension by the specified width and height. -
expand
Description copied from class:DimensionExpands the size of this Dimension by the specified width and height. -
getCopy
Description copied from class:DimensionCreates and returns a copy of this Dimension. -
getPreciseCopy
Returns a precise copy of this.- Returns:
- a precise copy
- Since:
- 3.7
-
intersect
Description copied from class:DimensionThis Dimension is intersected with the one specified. Intersection is performed by taking the min() of the values from each dimension. -
performScale
public void performScale(double factor) Description copied from interface:TranslatableScales this object by the scale factor.- Specified by:
performScalein interfaceTranslatable- Overrides:
performScalein classDimension- Parameters:
factor- The scale factor- See Also:
-
preciseHeight
public double preciseHeight()Description copied from class:DimensionReturnsdoubleheight- Overrides:
preciseHeightin classDimension- Returns:
doubleheight- See Also:
-
preciseWidth
public double preciseWidth()Description copied from class:DimensionReturnsdoublewidth- Overrides:
preciseWidthin classDimension- Returns:
doublewidth- See Also:
-
scale
Description copied from class:DimensionScales the width of this Dimension by w and scales the height of this Dimension by h. Returns this for convenience. -
setHeight
Description copied from class:DimensionSets the height of this Rectangle to the specified one. -
setPreciseHeight
Sets the height.- Parameters:
h- the new height- Returns:
- this for convenience
- Since:
- 3.7
-
setPreciseSize
Sets the size of this PrecisionDimension to the given width and height.- Parameters:
w- The new widthh- The new height- Returns:
- this for convenience
- Since:
- 3.7
-
setPreciseSize
Sets the size of this Dimension to the width and height of the given one.- Parameters:
d- The PrecisionDimension specifying the new width and height values.- Returns:
- This for convenience
- Since:
- 3.7
-
setPreciseWidth
Sets the width.- Parameters:
w- the new width- Returns:
- this for convenience
- Since:
- 3.7
-
setSize
Description copied from class:DimensionCopies the width and height values of the input Dimension to this Dimension. -
setSize
Description copied from class:DimensionSets the size of this dimension to the specified width and height. -
setWidth
Description copied from class:DimensionSets the width of this Rectangle to the specified one. -
shrink
Description copied from class:DimensionShrinks the size of this Dimension by the width and height values of the given Dimension. -
shrink
Description copied from class:DimensionReduces the width of this Dimension by w, and reduces the height of this Dimension by h. Returns this for convenience. -
shrink
Description copied from class:DimensionReduces the width of this Dimension by w, and reduces the height of this Dimension by h. Returns this for convenience. -
transpose
Description copied from class:DimensionSwaps the width and height of this Dimension, and returns this for convenience. Can be useful in orientation changes. -
union
Description copied from class:DimensionSets the width of this Dimension to the greater of this Dimension's width and d.width. Likewise for this Dimension's height. -
updateInts
Deprecated, for removal: This API element is subject to removal in a future version.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 ifpreciseWidthandpreciseHeightfield values are not manipulated directly, but only via respective methods offered by this class.Updates the integer fields using the precise versions.- @noreference
- This method is not intended to be referenced by clients.
-
setPreciseHeight(double)andpreciseHeight()instead.