net.sf.paperclips
Class Margins

java.lang.Object
  extended by net.sf.paperclips.Margins

public class Margins
extends java.lang.Object

Instances of this class represent the page margins to follow when processing a print job.


Field Summary
 int bottom
          The bottom margin.
 int left
          The left margin.
 int right
          The right margin.
 int top
          The top margin.
 
Constructor Summary
Margins()
          Constructs a Margins with all sides set to 1" margins.
Margins(int margins)
          Constructs a Margins with all sides set to the argument.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
 Margins rotate()
          Returns a Margins that is the result of rotating this Margins counter-clockwise 90 degrees.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

top

public int top
The top margin.


left

public int left
The left margin.


right

public int right
The right margin.


bottom

public int bottom
The bottom margin.

Constructor Detail

Margins

public Margins()
Constructs a Margins with all sides set to 1" margins.


Margins

public Margins(int margins)
Constructs a Margins with all sides set to the argument.

Parameters:
margins - the page margins, expressed in points. 72 points = 1".
Method Detail

rotate

public Margins rotate()
Returns a Margins that is the result of rotating this Margins counter-clockwise 90 degrees. A job which is rotated 90 degrees (e.g. for landscape printing) needs to have its margins rotated to match. This is a convenience method for that purpose.

Returns:
a Margins that is the result of rotating this Margins counter-clockwise 90 degrees.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object