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 SummaryFieldsModifier 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 SummaryConstructorsConstructorDescriptionConstructs 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 SummaryModifier 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.Dimensionequals, 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.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.draw2d.geometry.TranslatableperformTranslate, performTranslate, performTranslate
- 
Field Details- 
preciseHeightDeprecated, 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.
 
- 
preciseWidthDeprecated, 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- 
PrecisionDimensionpublic PrecisionDimension()Constructs a new precision dimension.
- 
PrecisionDimensionConstructs a precision representation of the given dimension.- Parameters:
- d- the reference dimension
 
- 
PrecisionDimensionpublic PrecisionDimension(double w, double h) Constructs a new precision dimension with the given values.- Parameters:
- w- the width
- h- the height
 
 
- 
- 
Method Details- 
containsDescription copied from class:DimensionReturnstrueif the input Dimension fits into this Dimension. A Dimension of the same size is considered to "fit".
- 
containsProperDescription copied from class:DimensionReturnstrueif this Dimension properly contains the one specified. Proper containment is defined as containment using \"<\", instead of \"<=\".- Overrides:
- containsProperin class- Dimension
- Parameters:
- d- the dimension being tested
- Returns:
- trueif this Dimension properly contains the one specified
- See Also:
 
- 
equalsDescription 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.
- 
expandDescription copied from class:DimensionExpands the size of this Dimension by the specified amount.
- 
expandDescription copied from class:DimensionExpands the size of this Dimension by the specified width and height.
- 
expandDescription copied from class:DimensionExpands the size of this Dimension by the specified width and height.
- 
getCopyDescription copied from class:DimensionCreates and returns a copy of this Dimension.
- 
getPreciseCopyReturns a precise copy of this.- Returns:
- a precise copy
- Since:
- 3.7
 
- 
intersectDescription copied from class:DimensionThis Dimension is intersected with the one specified. Intersection is performed by taking the min() of the values from each dimension.
- 
performScalepublic void performScale(double factor) Description copied from interface:TranslatableScales this object by the scale factor.- Specified by:
- performScalein interface- Translatable
- Overrides:
- performScalein class- Dimension
- Parameters:
- factor- The scale factor
- See Also:
 
- 
preciseHeightpublic double preciseHeight()Description copied from class:DimensionReturnsdoubleheight- Overrides:
- preciseHeightin class- Dimension
- Returns:
- doubleheight
- See Also:
 
- 
preciseWidthpublic double preciseWidth()Description copied from class:DimensionReturnsdoublewidth- Overrides:
- preciseWidthin class- Dimension
- Returns:
- doublewidth
- See Also:
 
- 
scaleDescription copied from class:DimensionScales the width of this Dimension by w and scales the height of this Dimension by h. Returns this for convenience.
- 
setHeightDescription copied from class:DimensionSets the height of this Rectangle to the specified one.
- 
setPreciseHeightSets the height.- Parameters:
- h- the new height
- Returns:
- this for convenience
- Since:
- 3.7
 
- 
setPreciseSizeSets the size of this PrecisionDimension to the given width and height.- Parameters:
- w- The new width
- h- The new height
- Returns:
- this for convenience
- Since:
- 3.7
 
- 
setPreciseSizeSets 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
 
- 
setPreciseWidthSets the width.- Parameters:
- w- the new width
- Returns:
- this for convenience
- Since:
- 3.7
 
- 
setSizeDescription copied from class:DimensionCopies the width and height values of the input Dimension to this Dimension.
- 
setSizeDescription copied from class:DimensionSets the size of this dimension to the specified width and height.
- 
setWidthDescription copied from class:DimensionSets the width of this Rectangle to the specified one.
- 
shrinkDescription copied from class:DimensionShrinks the size of this Dimension by the width and height values of the given Dimension.
- 
shrinkDescription copied from class:DimensionReduces the width of this Dimension by w, and reduces the height of this Dimension by h. Returns this for convenience.
- 
shrinkDescription copied from class:DimensionReduces the width of this Dimension by w, and reduces the height of this Dimension by h. Returns this for convenience.
- 
transposeDescription copied from class:DimensionSwaps the width and height of this Dimension, and returns this for convenience. Can be useful in orientation changes.
- 
unionDescription 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.
- 
updateIntsDeprecated, 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.