public class DimensionImpl extends java.lang.Object implements IAdvancedDimension
Constructor and Description |
---|
DimensionImpl(IDimension dimension) |
DimensionImpl(int width,
int height) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
IDimension |
expand(int dw,
int dh)
Expands the current dimension
|
IDimension |
getDimensionCopy() |
int |
getHeight()
Gets the height.
|
int |
getWidth()
Gets the width.
|
int |
hashCode() |
void |
scale(double amount)
Changes the current dimension
|
IDimension |
setDimension(IDimension dimension)
Sets the width and height of the dimension.
|
IDimension |
setDimension(int width,
int height)
Sets the width and height of the dimension.
|
void |
setHeight(int height)
Sets the height.
|
void |
setWidth(int width)
Sets the width.
|
java.lang.String |
toString() |
public DimensionImpl(int width, int height)
public DimensionImpl(IDimension dimension)
public int getHeight()
IDimension
getHeight
in interface IDimension
public int getWidth()
IDimension
getWidth
in interface IDimension
public void setHeight(int height)
IDimension
setHeight
in interface IDimension
height
- the new height of this dimensionpublic void setWidth(int width)
IDimension
setWidth
in interface IDimension
width
- the new width of this dimensionpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public IDimension getDimensionCopy()
getDimensionCopy
in interface IAdvancedDimension
public IDimension setDimension(int width, int height)
IAdvancedDimension
setDimension
in interface IAdvancedDimension
width
- the new width of the dimensionheight
- the new height of the dimensionpublic IDimension setDimension(IDimension dimension)
IAdvancedDimension
setDimension
in interface IAdvancedDimension
dimension
- the dimension which contains the new width and heightpublic void scale(double amount)
IAdvancedDimension
scale
in interface IAdvancedDimension
amount
- width and height of the dimension will be multiplied with this
amountpublic IDimension expand(int dw, int dh)
IAdvancedDimension
expand
in interface IAdvancedDimension
dw
- this value will be added to the widthdh
- this value will be added to the height