com.virtuosotechnologies.lib.swing
Class FloatDimension

java.lang.Object
  extended byjava.awt.geom.Dimension2D
      extended bycom.virtuosotechnologies.lib.swing.FloatDimension
All Implemented Interfaces:
Cloneable, Serializable

public class FloatDimension
extends Dimension2D
implements Serializable

This is Dimension2D.Float.

See Also:
Serialized Form

Field Summary
 float height
          The height dimension; negative values can be used.
 float width
          The width dimension; negative values can be used.
 
Constructor Summary
FloatDimension()
          Creates an instance of FloatDimension with a width of zero and a height of zero.
FloatDimension(Dimension2D d)
          Creates an instance of Dimension whose width and height are the same as for the specified dimension.
FloatDimension(float w, float h)
          Constructs a Dimension and initializes it to the specified width and specified height.
 
Method Summary
 boolean equals(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.
 int hashCode()
          Returns the hash code for this FloatDimension.
 void setSize(double w, double h)
          Sets the size of this FloatDimension object to the specified width and height in double precision.
 String toString()
          Returns a string representation of the values of this FloatDimension object's height and width fields.
 
Methods inherited from class java.awt.geom.Dimension2D
clone, setSize
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

width

public float width
The width dimension; negative values can be used.


height

public float height
The height dimension; negative values can be used.

Constructor Detail

FloatDimension

public FloatDimension()
Creates an instance of FloatDimension with a width of zero and a height of zero.


FloatDimension

public FloatDimension(Dimension2D d)
Creates an instance of Dimension whose width and height are the same as for the specified dimension.

Parameters:
d - the specified dimension for the width and height values

FloatDimension

public FloatDimension(float w,
                      float h)
Constructs a Dimension and initializes it to the specified width and specified height.

Parameters:
w - the specified width
h - the specified height
Method Detail

getWidth

public double getWidth()
Returns the width of this dimension in double precision.

Returns:
the width of this dimension in double precision

getHeight

public double getHeight()
Returns the height of this dimension in double precision.

Returns:
the height of this dimension in double precision

setSize

public void setSize(double w,
                    double h)
Sets the size of this FloatDimension object to the specified width and height in double precision.

Parameters:
w - the new width for the FloatDimension object
h - the new height for the FloatDimension object

equals

public boolean equals(Object obj)
Checks whether two dimension objects have equal values.


hashCode

public int hashCode()
Returns the hash code for this FloatDimension.

Returns:
a hash code for this FloatDimension

toString

public String toString()
Returns a string representation of the values of this FloatDimension 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.

Returns:
a string representation of this Dimension object