Package gnu.kawa.models
Class DDimension
- java.lang.Object
-
- java.awt.geom.Dimension2D
-
- java.awt.Dimension
-
- gnu.kawa.models.DDimension
-
- All Implemented Interfaces:
Serializable
,Cloneable
public class DDimension extends Dimension
A subclass of Dimension that uses doubles. This is compatible with code that expects a Dimension (which uses int), but can also be used where fractional lengths are needed. Avoid setting the inherited publicwidth
andheight
fields directly, as that can lead to inconsistencies.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DDimension()
DDimension(double width, double height)
DDimension(Dimension2D d)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
double
getHeight()
DDimension
getSize()
double
getWidth()
void
setHeight(double height)
void
setSize(double width, double height)
void
setSize(int width, int height)
void
setSize(Dimension d)
void
setSize(Dimension2D d)
void
setWidth(double width)
String
toString()
-
Methods inherited from class java.awt.geom.Dimension2D
clone
-
-
-
-
Constructor Detail
-
DDimension
public DDimension()
-
DDimension
public DDimension(double width, double height)
-
DDimension
public DDimension(Dimension2D d)
-
-
Method Detail
-
getSize
public DDimension getSize()
-
setWidth
public void setWidth(double width)
-
setHeight
public void setHeight(double height)
-
setSize
public void setSize(Dimension2D d)
- Overrides:
setSize
in classDimension2D
-
-