acm.graphics
Class GDimension

java.lang.Object
  extended by acm.graphics.GDimension

public class GDimension
extends Object
implements Serializable

This class is a double-precision version of the Dimension class in java.awt.


Constructor Summary
GDimension()
Constructs a new dimension object with zero values for width and height.
GDimension(Dimension size)
Constructs a new GDimension object from an AWT Dimension.
GDimension(double width, double height)
Constructs a new dimension object with the specified components.
GDimension(GDimension size)
Constructs a new GDimension object from an existing one.
 
Method Summary
 double getHeight()
Returns the height of this GDimension.
 GDimension getSize()
Returns a new GDimension object equal to this one.
 double getWidth()
Returns the width of this GDimension.
 void setSize(double width, double height)
Sets the components of the dimension object from the specified parameters.
 void setSize(GDimension size)
Sets the width and height of one GDimension object equal to that of another.
 Dimension toDimension()
Converts this GDimension to the nearest integer-based Dimension.
 

Constructor Detail

public GDimension()

Constructs a new dimension object with zero values for width and height.

 
Usage: dim = new GDimension(); 
 


public GDimension(Dimension size)

Constructs a new GDimension object from an AWT Dimension.

 
Usage: dim = new GDimension(size); 
Parameter: 
size  An AWT Dimension object specifying the size
 


public GDimension(double width, double height)

Constructs a new dimension object with the specified components.

 
Usage: dim = new GDimension(width, height); 
Parameters: 
width  The width of the dimension object
height  The height of the dimension object
 


public GDimension(GDimension size)

Constructs a new GDimension object from an existing one.

 
Usage: dim = new GDimension(size); 
Parameter: 
size  An existing GDimension object specifying the size
 

Method Detail

public double getHeight()

Returns the height of this GDimension.

 
Usage: height = dim.getHeight(); 
Returns: The height of this GDimension
 


public GDimension getSize()

Returns a new GDimension object equal to this one.

 
Usage: size = dim.getSize(); 
Returns: A new GDimension object with the same size
 


public double getWidth()

Returns the width of this GDimension.

 
Usage: width = dim.getWidth(); 
Returns: The width of this GDimension
 


public void setSize(double width, double height)

Sets the components of the dimension object from the specified parameters.

 
Usage: dim.setSize(width, height); 
Parameters: 
width  The new width of the dimension object
height  The new height of the dimension object
 


public void setSize(GDimension size)

Sets the width and height of one GDimension object equal to that of another.

 
Usage: dim.setSize(size); 
Parameter: 
size  A GDimension object specifying the new size
 


public Dimension toDimension()

Converts this GDimension to the nearest integer-based Dimension.

 
Usage: size = dim.toDimension(); 
Returns: The closest integer-based Dimension object