Package doodlepad
Class Dimension
java.lang.Object
doodlepad.Dimension
A class that encapsulates width and height parameters.
-
Constructor Summary
ConstructorsConstructorDescriptionDimension(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 TypeMethodDescriptiondoubleReturns the height of the Dimension objectdoublegetWidth()Returns the width of the Dimension objectvoidsetHeight(double height) Sets the height of the Dimension objectvoidsetSize(double width, double height) Sets the width and height values of a Dimension objectvoidSets the width and height values of a Dimension object with a native Java Dimension objectvoidSets the width and height values of a Dimension object with a native Java Dimension2D objectvoidsetWidth(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
-