Package doodlepad
Class Dimension
java.lang.Object
doodlepad.Dimension
A class that encapsulates width and height parameters.
-
Constructor Summary
ConstructorDescriptionDimension
(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 TypeMethodDescriptiondouble
Returns the height of the Dimension objectdouble
getWidth()
Returns the width of the Dimension objectvoid
setHeight
(double height) Sets the height of the Dimension objectvoid
setSize
(double width, double height) Sets the width and height values of a Dimension objectvoid
Sets the width and height values of a Dimension object with a native Java Dimension objectvoid
Sets the width and height values of a Dimension object with a native Java Dimension2D objectvoid
setWidth
(double width) Sets the width of the Dimension object
-
Constructor Details
-
Dimension
public Dimension(double width, double height) Creates a new Dimension object encapsulating width and height parameters.- Parameters:
width
- A width valueheight
- A height value
-
Dimension
Create a DoodlePad Dimension object from a Java Dimension object.- Parameters:
d
- A native java.awt.Dimension object
-
Dimension
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 Dimensionheight
- new height of the Dimension
-
setSize
Sets the width and height values of a Dimension object with a native Java Dimension object- Parameters:
d
- java.awt.Dimension object
-
setSize
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
-