JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.page
Class JCUnit.Dimension

java.lang.Object
  |
  +--com.klg.jclass.page.JCUnit.Dimension
All Implemented Interfaces:
Cloneable
Enclosing class:
JCUnit

public static class JCUnit.Dimension
extends Object
implements Cloneable

Dimension is similar in concept to java.awt.Dimension, but the values are stored as double-precision numbers and the units of measurement are recorded as well.


Field Summary
 double height
          The magnitude of the height being represented.
 com.klg.jclass.page.JCUnit units
          JCUnit object representing the units of linear measurement.
 double width
          The magnitude of the width being represented.
 
Constructor Summary
JCUnit.Dimension()
          Creates zero dimensions based on the current units.
JCUnit.Dimension(double width, double height)
          Creates width and height dimensions measured in the current units.
JCUnit.Dimension(com.klg.jclass.page.JCUnit units)
          Creates zero dimensions based on the given units.
JCUnit.Dimension(com.klg.jclass.page.JCUnit units, double width, double height)
          Creates width and height dimensions measured in the given units.
 
Method Summary
 void assign(JCUnit.Dimension newValue)
          Sets this dimension equal to the given one.
 Object clone()
          Creates a clone of this Dimension.
 boolean equals(Object obj)
          Compares an Object to this Dimension.
 JCUnit.Measure getHeight()
          Returns the height of the dimension as a measure.
 JCUnit.Measure getWidth()
          Returns the width of the dimension as a measure.
 int hashCode()
          Creates a hash that generates the same value depending on the property values.
 double heightInt()
          Gets the height defined by the object in internal units.
 void setHeight(JCUnit.Measure newHeight)
          Sets the height of the dimension from a measure.
 void setWidth(JCUnit.Measure newWidth)
          Sets the width of the dimension from a measure.
 String toString()
          Returns the dimension values and units as a String.
 double widthInt()
          Gets the width defined by the object in internal units.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

units

public com.klg.jclass.page.JCUnit units
JCUnit object representing the units of linear measurement.


width

public double width
The magnitude of the width being represented.


height

public double height
The magnitude of the height being represented.

Constructor Detail

JCUnit.Dimension

public JCUnit.Dimension()
Creates zero dimensions based on the current units.


JCUnit.Dimension

public JCUnit.Dimension(com.klg.jclass.page.JCUnit units)
Creates zero dimensions based on the given units.

Parameters:
units - the units to apply to the new dimensions

JCUnit.Dimension

public JCUnit.Dimension(double width,
                        double height)
Creates width and height dimensions measured in the current units.

Parameters:
width - the magnitude of the horizontal dimension in current units
height - the magnitude of the vertical dimension in current units

JCUnit.Dimension

public JCUnit.Dimension(com.klg.jclass.page.JCUnit units,
                        double width,
                        double height)
Creates width and height dimensions measured in the given units.

Parameters:
units - the units to apply to the new dimensions
width - the magnitude of the horizontal dimension in units
height - the magnitude of the vertical dimension in units
Method Detail

clone

public Object clone()
Creates a clone of this Dimension.

Overrides:
clone in class Object
Returns:
a new Dimension, which is a clone

getWidth

public JCUnit.Measure getWidth()
Returns the width of the dimension as a measure.

Returns:
the width in the units used by the Dimension

setWidth

public void setWidth(JCUnit.Measure newWidth)
Sets the width of the dimension from a measure.

Parameters:
newWidth - the measure giving the Dimension's new width

widthInt

public double widthInt()
Gets the width defined by the object in internal units.

Returns:
the width converted to internal units

getHeight

public JCUnit.Measure getHeight()
Returns the height of the dimension as a measure.

Returns:
the height in the units used by the Dimension

setHeight

public void setHeight(JCUnit.Measure newHeight)
Sets the height of the dimension from a measure.

Parameters:
newHeight - the measure giving the Dimension's new height

heightInt

public double heightInt()
Gets the height defined by the object in internal units.

Returns:
the height converted to internal units

assign

public void assign(JCUnit.Dimension newValue)
Sets this dimension equal to the given one.

Parameters:
newValue - the value to assign to this dimension

hashCode

public int hashCode()
Creates a hash that generates the same value depending on the property values.

Overrides:
hashCode in class Object
Returns:

equals

public boolean equals(Object obj)
Compares an Object to this Dimension.

Overrides:
equals in class Object
Parameters:
obj - an Object to compare for equality with this Dimension
Returns:
true if both objects are Dimensions and the two Dimensions are identical (independent of units)

toString

public String toString()
Returns the dimension values and units as a String.

Overrides:
toString in class Object
Returns:
dimension values

Copyright © 2004 Quest Software Inc..
All rights reserved.