Class CPaper

  • All Implemented Interfaces:
    Cloneable

    public class CPaper
    extends Paper
    Adempiere Paper Change log:
    • 2009-02-10 - armen - [ 2580531 ] Custom Paper Support - https://sourceforge.net/p/adempiere/feature-requests/655/
    Version:
    $Id: CPaper.java,v 1.2 2006/07/30 00:53:02 jjanke Exp $
    Author:
    Jorg Janke
    • Constructor Detail

      • CPaper

        public CPaper​(PageFormat pf)
        Constructor. Derive Paper from PageForamt
        Parameters:
        pf - PageFormat
      • CPaper

        public CPaper​(boolean landscape)
        Constructor. Get Media Size from Default Language
        Parameters:
        landscape - true if landscape, false if portrait
      • CPaper

        public CPaper​(MediaSize mediaSize,
                      boolean landscape,
                      double left,
                      double top,
                      double right,
                      double bottom)
        Detail Constructor
        Parameters:
        mediaSize - media size
        left - x in 1/72 inch
        top - y in 1/72 inch
        right - right x in 1/72
        bottom - bottom y in 1/72
        landscape - true if landscape, false if portrait
      • CPaper

        public CPaper​(double x,
                      double y,
                      int units,
                      boolean landscape,
                      double left,
                      double top,
                      double right,
                      double bottom)
        Get Media Size
    • Method Detail

      • setMediaSize

        public void setMediaSize​(MediaSize mediaSize,
                                 boolean landscape)
        Set Media Size
        Parameters:
        mediaSize - media size
        landscape - true if landscape, false if portrait
      • setMediaSize

        public void setMediaSize​(double x,
                                 double y,
                                 int units,
                                 boolean landscape)
        Set Media Size
        Parameters:
        x - the value to which to set this Paper object's width
        y - the value to which to set this Paper object's height
        units - number of microns (see Size2DSyntax.INCH, Size2DSyntax.MM)
        landscape - true if it's landscape format
        See Also:
        Paper.setSize(double, double)
      • getMediaSizeName

        public MediaSizeName getMediaSizeName()
        Get Media Size
        Returns:
        media size
      • getMediaSize

        public MediaSize getMediaSize()
        Get Media Size
        Returns:
        media size
      • getMediaPrintableArea

        public MediaPrintableArea getMediaPrintableArea()
        Get Printable Media Area
        Returns:
        Printable Area
      • setMediaPrintableArea

        public void setMediaPrintableArea​(MediaPrintableArea area)
        Get Printable Media Area
        Parameters:
        area - Printable Area
      • isLandscape

        public boolean isLandscape()
        Is Landscape
        Returns:
        true if landscape
      • pageSetupDialog

        public boolean pageSetupDialog​(PrinterJob job)
        Show Dialog and Set Paper
        Parameters:
        job - printer job
        Returns:
        true if changed.
      • getPrintRequestAttributeSet

        public PrintRequestAttributeSet getPrintRequestAttributeSet()
        Return Print Request Attributes
        Returns:
        PrintRequestAttributeSet
      • setPrintRequestAttributeSet

        public void setPrintRequestAttributeSet​(PrintRequestAttributeSet prats)
        Set Print Request Attributes
        Parameters:
        prats - PrintRequestAttributeSet
      • getPageFormat

        public PageFormat getPageFormat()
        Get the Page Format for the Papaer
        Returns:
        Page Format
      • toString

        public String toString()
        Get String Representation
        Overrides:
        toString in class Object
        Returns:
        info
      • toString

        public String toString​(Properties ctx)
        Get "nice" String Representation
        Parameters:
        ctx - context
        Returns:
        info
      • equals

        public boolean equals​(Object obj)
        Equals
        Overrides:
        equals in class Object
        Parameters:
        obj - compare
        Returns:
        true if equal
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getWidth

        public double getWidth​(boolean orientationCorrected)
        Get Width in 1/72 inch
        Parameters:
        orientationCorrected - correct for orientation
        Returns:
        width
      • getHeight

        public double getHeight​(boolean orientationCorrected)
        Get Height in 1/72 inch
        Parameters:
        orientationCorrected - correct for orientation
        Returns:
        height
      • getImageableY

        public double getImageableY​(boolean orientationCorrected)
        Get Image Y in 1/72 inch
        Parameters:
        orientationCorrected - correct for orientation
        Returns:
        imagable Y
      • getImageableX

        public double getImageableX​(boolean orientationCorrected)
        Get Image X in 1/72 inch
        Parameters:
        orientationCorrected - correct for orientation
        Returns:
        imagable X
      • getImageableHeight

        public double getImageableHeight​(boolean orientationCorrected)
        Get Image Height in 1/72 inch
        Parameters:
        orientationCorrected - correct for orientation
        Returns:
        imagable height
      • getImageableWidth

        public double getImageableWidth​(boolean orientationCorrected)
        Get Image Width in 1/72 inch
        Parameters:
        orientationCorrected - correct for orientation
        Returns:
        imagable width
      • getMargin

        public Insets getMargin​(boolean orientationCorrected)
        Get Margin
        Parameters:
        orientationCorrected - correct for orientation
        Returns:
        margin