Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.awt.geom

Class Dimension2D

java.lang.Object
|
+--java.awt.geom.Dimension2D

All Implemented Interfaces:

Cloneable


public abstract class Dimension2D

extends Object

implements Cloneable

This stores a dimension in 2-dimensional space - a width (along the x-axis) and height (along the y-axis). The storage is left to subclasses.

Since:Authors:

Constructor Summary

Dimension2D()

The default constructor.

Method Summary

java.lang.Objectclone()

Create a new dimension of the same run-time type with the same contents as this one.
doublegetHeight()

Get the height of this dimension.
doublegetWidth()

Get the width of this dimension.
voidsetSize(double w, double h)

Set the size of this dimension to the requested values.
voidsetSize(java.awt.geom.Dimension2D d)

Set the size of this dimension to the requested value.

Constructor Details

Dimension2D

protected Dimension2D()

The default constructor.


Method Details

clone

public Object clone()

Create a new dimension of the same run-time type with the same contents as this one.

Since:Returns:

Throws:


getHeight

public double getHeight()

Get the height of this dimension. A negative result, while legal, is undefined in meaning.

Returns:


getWidth

public double getWidth()

Get the width of this dimension. A negative result, while legal, is undefined in meaning.

Returns:


setSize

public void setSize(double w, double h)

Set the size of this dimension to the requested values. Loss of precision may occur.

Parameters:


setSize

public void setSize(java.awt.geom.Dimension2D d)

Set the size of this dimension to the requested value. Loss of precision may occur.

Parameters:

Throws: