java.awt.geom
abstract public class: Dimension2D [javadoc |
source]
java.lang.Object
java.awt.geom.Dimension2D
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
Dimension, DimensionUIResource
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: |
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. |
| Methods from java.lang.Object: |
|---|
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from java.awt.geom.Dimension2D Detail: |
public Object clone() {
try {
return super.clone();
} catch (CloneNotSupportedException e) {
// this shouldn't happen, since we are Cloneable
throw new InternalError();
}
}
Creates a new object of the same class as this object. |
abstract public double getHeight()
Returns the height of this Dimension in double
precision. |
abstract public double getWidth()
Returns the width of this Dimension in double
precision. |
public void setSize(Dimension2D d) {
setSize(d.getWidth(), d.getHeight());
}
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. |
abstract public 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 . |