public class PDimension
extends java.awt.geom.Dimension2D
This class represents a dimension similar to java.awt.geom.Dimension2D.Dimension but ensures that width and height are stored using floating point values.
| Constructor and Description |
|---|
PDimension(float w,
float h)
Creates a new instance of a PDimension.
|
PDimension(int w,
int h)
Creates a new instance of a PDimension.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getHeight()
Gets the height of the dimension object.
|
double |
getWidth()
Gets the width of the dimension object.
|
void |
set(float w,
float h)
Sets the width and height of the dimension.
|
void |
set(int w,
int h)
Sets the width and height of the dimension.
|
void |
setSize(double width,
double height) |
java.awt.Dimension |
toDimension()
Converts this object to a java.awt.geom.Dimension2D.Dimension.
|
java.lang.String |
toString()
String representation of this object.
|
public PDimension(float w,
float h)
w - width of new dimension.h - height of new dimension.public PDimension(int w,
int h)
w - width of new dimension.h - height of new dimension.public void set(float w,
float h)
w - new width value.h - new height value.public void set(int w,
int h)
w - new width value.h - new height value.public double getWidth()
getWidth in class java.awt.geom.Dimension2Dpublic double getHeight()
getHeight in class java.awt.geom.Dimension2Dpublic java.awt.Dimension toDimension()
public java.lang.String toString()
toString in class java.lang.Objectpublic void setSize(double width,
double height)
setSize in class java.awt.geom.Dimension2D