Class Margins

java.lang.Object
org.eclipse.nebula.paperclips.core.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

    Fields 
    Modifier and Type Field Description
    int bottom
    The bottom margin.
    int left
    The left margin.
    int right
    The right margin.
    int top
    The top margin.
  • Constructor Summary

    Constructors 
    Constructor Description
    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

    Modifier and Type Method Description
    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 Details

    • 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 Details

    • 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 Details

    • 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