Package org.jfree.layouting.util.geom
Class StrictDimension
- java.lang.Object
-
- org.jfree.layouting.util.geom.StrictDimension
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class StrictDimension extends java.lang.Object implements java.io.Serializable, java.lang.CloneableA dimension object that uses micro-points as units of measurement.- Author:
- Thomas Morgner
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StrictDimension()Default-Constructor.StrictDimension(long width, long height)Creates a new dimension object with the given width and height.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Creates a copy of this object.booleanequals(java.lang.Object o)Checks, whether the given object is a StrictDimension instance convering the same area as this dimension.longgetHeight()Returns the height of this dimension object.StrictDimensiongetLockedInstance()Returns a copy of this dimension which cannot be modified anymore.StrictDimensiongetUnlockedInstance()Returns a copy of this dimension which can be modified later.longgetWidth()Returns the width of this dimension object.inthashCode()Computes the hashcode for this dimension.booleanisLocked()Checks, whether this instance is locked.voidsetHeight(long height)Updates the height of this dimension object.voidsetSize(long width, long height)Sets the size of thisDimensionobject to the specified width and height.voidsetSize(StrictDimension size)voidsetWidth(long width)Updates the width of this dimension object.java.lang.StringtoString()Returns a String representation of this dimension object.
-
-
-
Method Detail
-
isLocked
public boolean isLocked()
Checks, whether this instance is locked.- Returns:
- true, if the dimension object is locked, false otherwise.
-
getLockedInstance
public StrictDimension getLockedInstance()
Returns a copy of this dimension which cannot be modified anymore.- Returns:
- a locked copy.
-
getUnlockedInstance
public StrictDimension getUnlockedInstance()
Returns a copy of this dimension which can be modified later.- Returns:
- an unlocked copy.
-
setSize
public void setSize(long width, long height)Sets the size of thisDimensionobject to the specified width and height.- Parameters:
width- the new width for theDimensionobjectheight- the new height for theDimensionobject- Throws:
java.lang.IllegalStateException- if the dimension object is locked
-
getHeight
public long getHeight()
Returns the height of this dimension object.- Returns:
- the height.
-
setHeight
public void setHeight(long height)
Updates the height of this dimension object.- Parameters:
height- the new height, given in micro-points.
-
getWidth
public long getWidth()
Returns the width of this dimension object.- Returns:
- the width.
-
setWidth
public void setWidth(long width)
Updates the width of this dimension object.- Parameters:
width- the new width, given in micro-points.
-
clone
public java.lang.Object clone()
Creates a copy of this object. This method is guaranteed to never throw a CloneNotSupportedException.- Overrides:
clonein classjava.lang.Object- Returns:
- the cloned copy.
-
toString
public java.lang.String toString()
Returns a String representation of this dimension object.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string describing the object.
-
equals
public boolean equals(java.lang.Object o)
Checks, whether the given object is a StrictDimension instance convering the same area as this dimension.- Overrides:
equalsin classjava.lang.Object- Parameters:
o- the other object.- Returns:
- true, if the other object is equal to this object, false otherwise.
-
hashCode
public int hashCode()
Computes the hashcode for this dimension.- Overrides:
hashCodein classjava.lang.Object- Returns:
- the computed hashcode.
-
setSize
public void setSize(StrictDimension size)
-
-