|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.awt.geom.Dimension2D
|
+--edu.umd.cs.jazz.util.Dimension2DFloat
The Dimension class encapsulates the width and
height of a component (in float precision) in a single object.
Normally the values of width
and height are non-negative integers.
The constructors that allow you to create a dimension do
not prevent you from setting a negative value for these properties.
If the value of width or height is
negative, the behavior of some methods defined by other objects is
undefined.
This is modified from java.awt.Dimension
| Field Summary | |
float |
height
The height dimension. |
float |
width
The width dimension. |
| Constructor Summary | |
Dimension2DFloat()
Creates an instance of Dimension2DFloat with a width
of zero and a height of zero. |
|
Dimension2DFloat(java.awt.geom.Dimension2D d)
Creates an instance of Dimension2DFloat whose width
and height are the same as for the specified dimension. |
|
Dimension2DFloat(float width,
float height)
Constructs a Dimension and initializes it to the specified width and specified height. |
|
| Method Summary | |
boolean |
equals(java.lang.Object obj)
Checks whether two dimension objects have equal values. |
double |
getHeight()
Returns the height of this dimension in double precision. |
double |
getWidth()
Returns the width of this dimension in double precision. |
void |
setSize(java.awt.geom.Dimension2D d)
Set the size of this Dimension object to the specified size. |
void |
setSize(double width,
double height)
Set the size of this Dimension object to the specified width and height in double precision. |
void |
setSize(float width,
float height)
Set the size of this Dimension object
to the specified width and height. |
java.lang.String |
toString()
Returns a string representation of the values of this Dimension object's height and
width fields. |
| Methods inherited from class java.awt.geom.Dimension2D |
clone |
| Methods inherited from class java.lang.Object |
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public float width
setSize(float, float)public float height
setSize(float, float)| Constructor Detail |
public Dimension2DFloat()
Dimension2DFloat with a width
of zero and a height of zero.public Dimension2DFloat(java.awt.geom.Dimension2D d)
Dimension2DFloat whose width
and height are the same as for the specified dimension.d - the specified dimension for the
width and
height values.
public Dimension2DFloat(float width,
float height)
width - the specified width dimensionheight - the specified height dimension| Method Detail |
public double getWidth()
public double getHeight()
public void setSize(double width,
double height)
width - the new width for the Dimension objectheight - the new height for the Dimension objectpublic void setSize(java.awt.geom.Dimension2D d)
Dimension object to the specified size.
This method is included for completeness, to parallel the
setSize method defined by Component.d - the new size for this Dimension object.Dimension.getSize(),
Component.setSize(int, int)
public void setSize(float width,
float height)
Dimension object
to the specified width and height.
This method is included for completeness, to parallel the
setSize method defined by Component.width - the new width for this Dimension object.height - the new height for this Dimension object.Dimension.getSize(),
Component.setSize(int, int)public boolean equals(java.lang.Object obj)
public java.lang.String toString()
Dimension object's height and
width fields. This method is intended to be used only
for debugging purposes, and the content and format of the returned
string may vary between implementations. The returned string may be
empty but may not be null.Dimension
object.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||