sgtplot.util
Class Dimension2D
- java.lang.Object
-
- sgtplot.util.Dimension2D
-
public class Dimension2D extends java.lang.ObjectA class to encapsulate adoublewidth and a height.- Since:
- sgtplot 1.0
-
-
Constructor Summary
Constructors Constructor and Description Dimension2D()Dimension2D(double width, double height)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(Dimension2D d)Test for equality.doublegetHeight()Returns the height.doublegetWidth()Returns the width.voidsetSize(Dimension2D d)Set the size to match the specified size.voidsetSize(double width, double height)Set the size to the specified width and height.java.lang.StringtoString()
-
-
-
Constructor Detail
-
Dimension2D
public Dimension2D()
-
Dimension2D
public Dimension2D(double width, double height)
-
-
Method Detail
-
getWidth
public double getWidth()
Returns the width.- Returns:
- the width
-
getHeight
public double getHeight()
Returns the height.- Returns:
- the height
-
setSize
public void setSize(double width, double height)Set the size to the specified width and height. This method is included for completeness, to parallel the getSize method ofComponent.- Parameters:
width- the new widthheight- the new height
-
setSize
public void setSize(Dimension2D d)
Set the size to match the specified size. This method is included for completeness, to parallel the getSize method ofComponent.- Parameters:
d- the new size
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(Dimension2D d)
Test for equality. Both width and height must be equal to be true.
-
-
DMelt 3.0 © DataMelt by jWork.ORG