Constructor and Description |
---|
RelativeDimension()
Creates a relative dimension without constraint.
|
RelativeDimension(float widthPercent,
float heightPercent)
Creates a relative dimension with constraints.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(Rectangle contentBounds,
Rectangle sizeHint)
Applies the dimension to the given size.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
void |
setHeightProportion(float heightPercent)
Sets the height proportion.
|
void |
setSizeProportions(float widthPercent,
float heightPercent)
Sets the width and height proportions.
|
void |
setWidthProportion(float widthPercent)
Sets the width proportion.
|
public RelativeDimension()
public RelativeDimension(float widthPercent, float heightPercent)
widthPercent
- the width proportion to set.heightPercent
- the height proportion to set.public void setWidthProportion(float widthPercent)
widthPercent
- the width proportion to set.public void setHeightProportion(float heightPercent)
heightPercent
- the height proportion to set.public void setSizeProportions(float widthPercent, float heightPercent)
widthPercent
- the width proportion to set.heightPercent
- the height proportion to set.public void apply(Rectangle contentBounds, Rectangle sizeHint)
Dimension
The content bounds is updated.
public boolean equals(@Nullable java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object