att.grappa
Class GrappaSize

java.lang.Object
  extended by java.awt.geom.Dimension2D
      extended by att.grappa.GrappaSize
All Implemented Interfaces:
java.lang.Cloneable

public class GrappaSize
extends java.awt.geom.Dimension2D

This class extends java.awt.geom.Dimension2D and provides built-in string-to-Dimension2D and Dimension2D-to-string conversions suitable for Grappa.

Version:
1.2, 21 Aug 2005; Copyright 1996 - 2005 by AT&T Corp.
Author:
John Mocenigo, Research @ AT&T Labs

Field Summary
 double height
          The height of the Dimension.
 double width
          The width of the Dimension.
 
Constructor Summary
GrappaSize()
          Constructs and initializes a GrappaSize with coordinates (0, 0).
GrappaSize(double width, double height)
          Constructs and initializes a GrappaSize with the specified coordinates.
GrappaSize(java.lang.String dimenString)
          Constructs and initializes a GrappaSize with the coordinates derived from the specified String representation.
 
Method Summary
 double getHeight()
          Returns the height.
 double getWidth()
          Returns the width.
 void setSize(java.awt.geom.Dimension2D d)
          Sets the width and height.
 void setSize(double width, double height)
          Sets the width and height.
 java.lang.String toAttributeString()
          Provides a string representation of this object consistent with Grappa attributes.
 java.lang.String toFormattedString(java.lang.String format)
          Provides a formatted string representation of this object.
 java.lang.String toString()
          Provides a generic string representation of this object.
 
Methods inherited from class java.awt.geom.Dimension2D
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

width

public double width
The width of the Dimension.


height

public double height
The height of the Dimension.

Constructor Detail

GrappaSize

public GrappaSize()
Constructs and initializes a GrappaSize with coordinates (0, 0).


GrappaSize

public GrappaSize(double width,
                  double height)
Constructs and initializes a GrappaSize with the specified coordinates.

Parameters:
width, height - the coordinates to which to set the newly constructed GrappaSize

GrappaSize

public GrappaSize(java.lang.String dimenString)
Constructs and initializes a GrappaSize with the coordinates derived from the specified String representation. The String format should be: "width,height"

Parameters:
dimenString - String representing the dimensions to which to set the newly constructed GrappaSize
Method Detail

getWidth

public double getWidth()
Returns the width.

Specified by:
getWidth in class java.awt.geom.Dimension2D

getHeight

public double getHeight()
Returns the height.

Specified by:
getHeight in class java.awt.geom.Dimension2D

setSize

public void setSize(java.awt.geom.Dimension2D d)
Sets the width and height.

Overrides:
setSize in class java.awt.geom.Dimension2D

setSize

public void setSize(double width,
                    double height)
Sets the width and height.

Specified by:
setSize in class java.awt.geom.Dimension2D

toAttributeString

public java.lang.String toAttributeString()
Provides a string representation of this object consistent with Grappa attributes.

Returns:
attribute-suitable string representation of this GrappaSize.

toFormattedString

public java.lang.String toFormattedString(java.lang.String format)
Provides a formatted string representation of this object.

Parameters:
format - the format used to build the string (%p is the base directive suitable for a GrappaSize).
Returns:
a string representation of this GrappaSize.

toString

public java.lang.String toString()
Provides a generic string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
a generic string representation of this GrappaSize.