Package doodlepad

Class Dimension

java.lang.Object
doodlepad.Dimension

public class Dimension extends Object
A class that encapsulates width and height parameters.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Dimension(double width, double height)
    Creates a new Dimension object encapsulating width and height parameters.
    Create a DoodlePad Dimension object from a Java Dimension object.
    Create a DoodlePad Dimension object from a Java Dimension2D object.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the height of the Dimension object
    double
    Returns the width of the Dimension object
    void
    setHeight(double height)
    Sets the height of the Dimension object
    void
    setSize(double width, double height)
    Sets the width and height values of a Dimension object
    void
    Sets the width and height values of a Dimension object with a native Java Dimension object
    void
    Sets the width and height values of a Dimension object with a native Java Dimension2D object
    void
    setWidth(double width)
    Sets the width of the Dimension object

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Dimension

      public Dimension(double width, double height)
      Creates a new Dimension object encapsulating width and height parameters.
      Parameters:
      width - A width value
      height - A height value
    • Dimension

      public Dimension(Dimension d)
      Create a DoodlePad Dimension object from a Java Dimension object.
      Parameters:
      d - A native java.awt.Dimension object
    • Dimension

      public Dimension(Dimension2D d)
      Create a DoodlePad Dimension object from a Java Dimension2D object.
      Parameters:
      d - A native java.awt.geom.Dimension object
  • Method Details

    • setSize

      public void setSize(double width, double height)
      Sets the width and height values of a Dimension object
      Parameters:
      width - new width of the Dimension
      height - new height of the Dimension
    • setSize

      public void setSize(Dimension d)
      Sets the width and height values of a Dimension object with a native Java Dimension object
      Parameters:
      d - java.awt.Dimension object
    • setSize

      public void setSize(Dimension2D d)
      Sets the width and height values of a Dimension object with a native Java Dimension2D object
      Parameters:
      d - java.awt.Dimension2D object
    • getWidth

      public double getWidth()
      Returns the width of the Dimension object
      Returns:
      Dimension width
    • setWidth

      public void setWidth(double width)
      Sets the width of the Dimension object
      Parameters:
      width - of the Dimension
    • getHeight

      public double getHeight()
      Returns the height of the Dimension object
      Returns:
      Dimension height
    • setHeight

      public void setHeight(double height)
      Sets the height of the Dimension object
      Parameters:
      height - Dimension height