Top Description Constructors Methods
java.awt.geom

public abstract Class Dimension2D

extends Object
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable
Known Direct Subclasses
java.awt.Dimension

The Dimension2D class is to encapsulate a width and a height dimension.

This class is only the abstract superclass for all objects that store a 2D dimension. The actual storage representation of the sizes is left to the subclass.

Author
Jim Graham
Since
1.2

Constructor Summary

AccessConstructor and Description
protected
Dimension2D()

This is an abstract class that cannot be instantiated directly.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

a clone of this instance.
clone
()

Overrides java.lang.Object.clone.

Creates a new object of the same class as this object.
public abstract double

Returns:

the height of this Dimension.
getHeight
()

Returns the height of this Dimension in double precision.

public abstract double

Returns:

the width of this Dimension.
getWidth
()

Returns the width of this Dimension in double precision.

public abstract void
setSize(double
the new width for the Dimension object
width
,
double
the new height for the Dimension object
height
)

Sets the size of this Dimension object to the specified width and height.

public void
setSize(Dimension2D
the new size for the Dimension2D object
d
)

Sets the size of this Dimension2D object to match the specified size.

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Dimension2Dback to summary
protected Dimension2D()

This is an abstract class that cannot be instantiated directly. Type-specific implementation subclasses are available for instantiation and provide a number of formats for storing the information necessary to satisfy the various accessor methods below.

Since
1.2
See Also
java.awt.Dimension

Method Detail

cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Creates a new object of the same class as this object.

Returns:Object

a clone of this instance.

Exceptions
OutOfMemoryError:
if there is not enough memory.
Since
1.2
See Also
java.lang.Cloneable
getHeightback to summary
public abstract double getHeight()

Returns the height of this Dimension in double precision.

Returns:double

the height of this Dimension.

Since
1.2
getWidthback to summary
public abstract double getWidth()

Returns the width of this Dimension in double precision.

Returns:double

the width of this Dimension.

Since
1.2
setSizeback to summary
public abstract void setSize(double width, double height)

Sets the size of this Dimension object to the specified width and height. This method is included for completeness, to parallel the getSize method of java.awt.Component.

Parameters
width:double

the new width for the Dimension object

height:double

the new height for the Dimension object

Since
1.2
setSizeback to summary
public void setSize(Dimension2D d)

Sets the size of this Dimension2D object to match the specified size. This method is included for completeness, to parallel the getSize method of Component.

Parameters
d:Dimension2D

the new size for the Dimension2D object

Since
1.2