org.jhotdraw.geom
Class Dimension2DDouble
- java.lang.Object
-
- java.awt.geom.Dimension2D
-
- org.jhotdraw.geom.Dimension2DDouble
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
public class Dimension2DDouble extends java.awt.geom.Dimension2D implements java.io.SerializableDimension2DDouble.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description doubleheightThe height dimension; negative values can be used.doublewidthThe width dimension; negative values can be used.
-
Constructor Summary
Constructors Constructor and Description Dimension2DDouble()Creates an instance ofDimension2DDoublewith a width of zero and a height of zero.Dimension2DDouble(Dimension2DDouble d)Creates an instance ofDimension2DDoublewhose width and height are the same as for the specified dimension.Dimension2DDouble(double width, double height)Constructs aDimension2DDoubleand initializes it to the specified width and specified height.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object obj)Checks whether two dimension objects have equal values.doublegetHeight()Returns the height of this dimension in double precision.Dimension2DDoublegetSize()Gets the size of thisDimension2DDoubleobject.doublegetWidth()Returns the width of this dimension in double precision.inthashCode()Returns the hash code for thisDimension2DDouble.voidsetSize(Dimension2DDouble d)Sets the size of thisDimension2DDoubleobject to the specified size.voidsetSize(double width, double height)Sets the size of thisDimension2DDoubleobject to the specified width and height in double precision.java.lang.StringtoString()Returns a string representation of the values of thisDimension2DDoubleobject'sheightandwidthfields.
-
-
-
Field Detail
-
width
public double width
The width dimension; negative values can be used.- See Also:
getSize(),setSize(double, double)
-
height
public double height
The height dimension; negative values can be used.- See Also:
getSize(),setSize(double, double)
-
-
Constructor Detail
-
Dimension2DDouble
public Dimension2DDouble()
Creates an instance ofDimension2DDoublewith a width of zero and a height of zero.
-
Dimension2DDouble
public Dimension2DDouble(Dimension2DDouble d)
Creates an instance ofDimension2DDoublewhose width and height are the same as for the specified dimension.- Parameters:
d- the specified dimension for thewidthandheightvalues
-
Dimension2DDouble
public Dimension2DDouble(double width, double height)Constructs aDimension2DDoubleand initializes it to the specified width and specified height.- Parameters:
width- the specified widthheight- the specified height
-
-
Method Detail
-
getWidth
public double getWidth()
Returns the width of this dimension in double precision.- Specified by:
getWidthin classjava.awt.geom.Dimension2D- Returns:
- the width of this dimension in double precision
-
getHeight
public double getHeight()
Returns the height of this dimension in double precision.- Specified by:
getHeightin classjava.awt.geom.Dimension2D- Returns:
- the height of this dimension in double precision
-
setSize
public void setSize(double width, double height)Sets the size of thisDimension2DDoubleobject to the specified width and height in double precision. Note that ifwidthorheightare larger thanInteger.MAX_VALUE, they will be reset toInteger.MAX_VALUE.- Specified by:
setSizein classjava.awt.geom.Dimension2D- Parameters:
width- the new width for theDimension2DDoubleobjectheight- the new height for theDimension2DDoubleobject
-
getSize
public Dimension2DDouble getSize()
Gets the size of thisDimension2DDoubleobject. This method is included for completeness, to parallel thegetSizemethod defined byComponent.- Returns:
- the size of this dimension, a new instance of
Dimension2DDoublewith the same width and height - Since:
- JDK1.1
- See Also:
setSize(double, double),Component.getSize()
-
setSize
public void setSize(Dimension2DDouble d)
Sets the size of thisDimension2DDoubleobject to the specified size. This method is included for completeness, to parallel thesetSizemethod defined byComponent.- Parameters:
d- the new size for thisDimension2DDoubleobject- Since:
- JDK1.1
- See Also:
getSize(),Component.setSize(int, int)
-
equals
public boolean equals(java.lang.Object obj)
Checks whether two dimension objects have equal values.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
Returns the hash code for thisDimension2DDouble.- Overrides:
hashCodein classjava.lang.Object- Returns:
- a hash code for this
Dimension2DDouble
-
toString
public java.lang.String toString()
Returns a string representation of the values of thisDimension2DDoubleobject'sheightandwidthfields. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not benull.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of this
Dimension2DDoubleobject
-
-
DataMelt 3.0 © DataMelt by jWork.ORG