| java.lang.Object | |
| ↳ | sofia.graphics.SizeF |
A class used elsewhere in Sofia that holds two float coordinates representing the width and height of an object.
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| public float | height | The height. | |||||||||
| public float | width | The width. | |||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
SizeF()
Creates a
SizeF with a width and height of zero. | |||||||||||
|
SizeF(float width, float height)
Creates a
SizeF with the specified width and height. | |||||||||||
|
SizeF(SizeF size)
Creates a
SizeF with values copied from the specified size. | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| boolean | equals(Object other) | ||||||||||
| boolean |
equals(float otherWidth, float otherHeight)
Gets a value indicating whether the receiver has the specified width and
height.
| ||||||||||
| int | hashCode() | ||||||||||
| float |
length()
Gets the Euclidean distance from (0, 0) to the point indicated by the
width and height of the receiver.
| ||||||||||
| void |
set(float newWidth, float newHeight)
Sets the width and height of the size.
| ||||||||||
| void |
set(SizeF size)
Sets the size's width and height to those from the specified size.
| ||||||||||
| String |
toString()
Gets a human-readable string representation of the size.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
The height.
The width.
Creates a SizeF with a width and height of zero.
Creates a SizeF with the specified width and height.
| width | the width |
|---|---|
| height | the height |
Creates a SizeF with values copied from the specified size.
| size | the size |
|---|
Gets a value indicating whether the receiver has the specified width and height.
| otherWidth | the width to compare the receiver with |
|---|---|
| otherHeight | the height to compare the receiver with |
Gets the Euclidean distance from (0, 0) to the point indicated by the width and height of the receiver.
Sets the width and height of the size.
| newWidth | the new width |
|---|---|
| newHeight | the new height |
Sets the size's width and height to those from the specified size.
| size | the size |
|---|
Gets a human-readable string representation of the size.