Class PrintJob


  • public class PrintJob
    extends java.lang.Object
    Instances of this class represent a prepared print job.
    Author:
    Matthew Hall
    • Constructor Summary

      Constructors 
      Constructor Description
      PrintJob​(java.lang.String name, Print document)
      Constructs a PrintJob for the given document.
    • Constructor Detail

      • PrintJob

        public PrintJob​(java.lang.String name,
                        Print document)
        Constructs a PrintJob for the given document.
        Parameters:
        name - the name of the print job, which will appear in the print queue of the operating system.
        document - the document to be printed.
    • Method Detail

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

        public java.lang.String getName()
        Returns the name of the print job.
        Returns:
        the name of the print job.
      • getDocument

        public Print getDocument()
        Returns the document to be printed.
        Returns:
        the document to be printed.
      • getOrientation

        public int getOrientation()
        Returns the page orientation.
        Returns:
        the page orientation.
      • getMargins

        public Margins getMargins()
        Returns the page margins, expressed in points. 72 points = 1".
        Returns:
        the page margins, expressed in points. 72 points = 1".
      • setMargins

        public PrintJob setMargins​(Margins margins)
        Sets the page margins.
        Parameters:
        margins - the new page margins.
        Returns:
        this PrintJob (for chaining method calls)
      • setMargins

        public PrintJob setMargins​(int margins)
        Sets the top, left, right, and bottom margins to the argument.
        Parameters:
        margins - the margins, in points. 72 points = 1 inch.
        Returns:
        this PrintJob (for chaining method calls)