Methods Summary |
---|
public boolean | equals(java.lang.Object obj)Compares this Dimension object with the specified object.
if (obj == this) {
return true;
}
if (obj instanceof Dimension) {
Dimension d = (Dimension)obj;
return (d.width == width && d.height == height);
}
return false;
|
public double | getHeight()Gets the height of the Dimension.
return height;
|
public java.awt.Dimension | getSize()Gets the size of the Dimension.
return new Dimension(width, height);
|
public double | getWidth()Gets the width of the Dimension.
return width;
|
public int | hashCode()Returns the hash code of the Dimension.
HashCode hash = new HashCode();
hash.append(width);
hash.append(height);
return hash.hashCode();
|
public void | setSize(int width, int height)Sets the size of this Dimension object with the specified width and
height.
this.width = width;
this.height = height;
|
public void | setSize(java.awt.Dimension d)Sets the size of this Dimension object by copying the data from the
specified Dimension object.
setSize(d.width, d.height);
|
public void | setSize(double width, double height)Sets the size of this Dimension object with the specified double width
and height.
setSize((int)Math.ceil(width), (int)Math.ceil(height));
|
public java.lang.String | toString()Returns the String associated to this Dimension object.
// The output format based on 1.5 release behaviour. It could be
// obtained in the following way
// System.out.println(new Dimension().toString())
return getClass().getName() + "[width=" + width + ",height=" + height + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|