JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.page
Class JCUnit.Margins

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

public static class JCUnit.Margins
extends Object
implements Cloneable

Stores the sizes of the margins around a figure or area. Margin widths are stored as double-precision numbers along with the units of measurement in which they are specified.


Field Summary
 double bottom
          The widths of the bottom margin in the given units.
 double left
          The widths of the left margin in the given units.
 double right
          The widths of the right margin in the given units.
 double top
          The widths of the top margin in the given units.
 com.klg.jclass.page.JCUnit units
          JCUnit object representing the units of linear measurement.
 
Constructor Summary
JCUnit.Margins()
          Creates a set of zero margins using the current units.
JCUnit.Margins(double top, double bottom, double left, double right)
          Creates the margins for a region given the distances in current units.
JCUnit.Margins(com.klg.jclass.page.JCUnit units)
          Creates a set of zero margins using the specified units.
JCUnit.Margins(com.klg.jclass.page.JCUnit units, double top, double bottom, double left, double right)
          Creates the margins for a region given the distances and the units.
 
Method Summary
 void assign(JCUnit.Margins newValue)
          Sets these margins equal to the given ones.
 Object clone()
          Creates a clone of this Margins.
 boolean equals(Object obj)
          Compares another Object to this Margins.
 JCUnit.Measure getBottom()
          Returns the bottom margin width as a measure.
 JCUnit.Measure getLeft()
          Returns the left margin width as a measure.
 JCUnit.Measure getRight()
          Returns the right margin width as a measure.
 JCUnit.Measure getTop()
          Returns the top margin width as a measure.
 int hashCode()
          Creates a hash that generates the same value depending on the property values.
 void setBottom(JCUnit.Measure newBottom)
          Sets the bottom margin width given a measure.
 void setLeft(JCUnit.Measure newLeft)
          Sets the left margin width given a measure.
 void setRight(JCUnit.Measure newRight)
          Sets the right margin width given a measure.
 void setTop(JCUnit.Measure newTop)
          Sets the top margin width given a measure.
 String toString()
          Returns the margin positions and units as a String.
 
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.


top

public double top
The widths of the top margin in the given units.


bottom

public double bottom
The widths of the bottom margin in the given units.


left

public double left
The widths of the left margin in the given units.


right

public double right
The widths of the right margin in the given units.

Constructor Detail

JCUnit.Margins

public JCUnit.Margins()
Creates a set of zero margins using the current units.


JCUnit.Margins

public JCUnit.Margins(com.klg.jclass.page.JCUnit units)
Creates a set of zero margins using the specified units.

Parameters:
units - the units the margin distances are measured in

JCUnit.Margins

public JCUnit.Margins(double top,
                      double bottom,
                      double left,
                      double right)
Creates the margins for a region given the distances in current units.

Parameters:
top - the width of the top margin
bottom - the width of the bottom margin
left - the width of the left margin
right - the width of the right margin

JCUnit.Margins

public JCUnit.Margins(com.klg.jclass.page.JCUnit units,
                      double top,
                      double bottom,
                      double left,
                      double right)
Creates the margins for a region given the distances and the units.

Parameters:
units - the units the margin distances are measured in
top - the width of the top margin
bottom - the width of the bottom margin
left - the width of the left margin
right - the width of the right margin
Method Detail

clone

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

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

getTop

public JCUnit.Measure getTop()
Returns the top margin width as a measure.

Returns:
the width of the top margin in the units used by these Margins

setTop

public void setTop(JCUnit.Measure newTop)
Sets the top margin width given a measure.

Parameters:
newTop - the width to set for the top margin

getBottom

public JCUnit.Measure getBottom()
Returns the bottom margin width as a measure.

Returns:
the width of the bottom margin in the units used by these Margins

setBottom

public void setBottom(JCUnit.Measure newBottom)
Sets the bottom margin width given a measure.

Parameters:
newBottom - the width to set for the bottom margin

getLeft

public JCUnit.Measure getLeft()
Returns the left margin width as a measure.

Returns:
the width of the left margin in the units used by these Margins

setLeft

public void setLeft(JCUnit.Measure newLeft)
Sets the left margin width given a measure.

Parameters:
newLeft - the width to set for the left margin

getRight

public JCUnit.Measure getRight()
Returns the right margin width as a measure.

Returns:
the width of the right margin in the units used by these Margins

setRight

public void setRight(JCUnit.Measure newRight)
Sets the right margin width given a measure.

Parameters:
newRight - the width to set for the right margin

assign

public void assign(JCUnit.Margins newValue)
Sets these margins equal to the given ones.

Parameters:
newValue - the values to assign to these margins

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 another Object to this Margins.

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

toString

public String toString()
Returns the margin positions and units as a String.

Overrides:
toString in class Object
Returns:
margin positions and units

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