Package org.jfree.ui
Class FloatDimension
- java.lang.Object
-
- java.awt.geom.Dimension2D
-
- org.jfree.ui.FloatDimension
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class FloatDimension extends java.awt.geom.Dimension2D implements java.io.Serializable
A dimension object specified usingfloatvalues.- Author:
- Thomas Morgner
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FloatDimension()Creates a new dimension object with width and height set to zero.FloatDimension(float width, float height)Creates a new dimension.FloatDimension(FloatDimension fd)Creates a new dimension that is a copy of another dimension.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Creates and returns a copy of this object.booleanequals(java.lang.Object o)Tests this object for equality with another object.doublegetHeight()Returns the height.doublegetWidth()Returns the width.inthashCode()Returns a hash code.voidsetHeight(double height)Sets the height.voidsetSize(double width, double height)Sets the size of thisDimensionobject to the specified width and height.voidsetWidth(double width)Sets the width.java.lang.StringtoString()Returns a string representation of the object.
-
-
-
Constructor Detail
-
FloatDimension
public FloatDimension()
Creates a new dimension object with width and height set to zero.
-
FloatDimension
public FloatDimension(FloatDimension fd)
Creates a new dimension that is a copy of another dimension.- Parameters:
fd- the dimension to copy.
-
FloatDimension
public FloatDimension(float width, float height)
Creates a new dimension.- Parameters:
width- the width.height- the height.
-
-
Method Detail
-
getWidth
public double getWidth()
Returns the width.- Specified by:
getWidthin classjava.awt.geom.Dimension2D- Returns:
- the width.
-
getHeight
public double getHeight()
Returns the height.- Specified by:
getHeightin classjava.awt.geom.Dimension2D- Returns:
- the height.
-
setWidth
public void setWidth(double width)
Sets the width.- Parameters:
width- the width.
-
setHeight
public void setHeight(double height)
Sets the height.- Parameters:
height- the height.
-
setSize
public void setSize(double width, double height)
Sets the size of thisDimensionobject to the specified width and height. This method is included for completeness, to parallel thegetSizemethod ofComponent.- Specified by:
setSizein classjava.awt.geom.Dimension2D- Parameters:
width- the new width for theDimensionobjectheight- the new height for theDimensionobject
-
clone
public java.lang.Object clone()
Creates and returns a copy of this object.- Overrides:
clonein classjava.awt.geom.Dimension2D- Returns:
- a clone of this instance.
- See Also:
Cloneable
-
toString
public java.lang.String toString()
Returns a string representation of the object. In general, thetoStringmethod returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of the object.
-
equals
public boolean equals(java.lang.Object o)
Tests this object for equality with another object.- Overrides:
equalsin classjava.lang.Object- Parameters:
o- the other object.- Returns:
trueorfalse.
-
hashCode
public int hashCode()
Returns a hash code.- Overrides:
hashCodein classjava.lang.Object- Returns:
- A hash code.
-
-