Package org.compiere.print
Class CPaper
- java.lang.Object
-
- java.awt.print.Paper
-
- org.compiere.print.CPaper
-
-
Constructor Summary
Constructors Constructor Description CPaper(boolean landscape)Constructor.CPaper(double x, double y, int units, boolean landscape, double left, double top, double right, double bottom)Get Media SizeCPaper(PageFormat pf)Constructor.CPaper(MediaSize mediaSize, boolean landscape, double left, double top, double right, double bottom)Detail Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)EqualsdoublegetHeight(boolean orientationCorrected)Get Height in 1/72 inchdoublegetImageableHeight(boolean orientationCorrected)Get Image Height in 1/72 inchdoublegetImageableWidth(boolean orientationCorrected)Get Image Width in 1/72 inchdoublegetImageableX(boolean orientationCorrected)Get Image X in 1/72 inchdoublegetImageableY(boolean orientationCorrected)Get Image Y in 1/72 inchInsetsgetMargin(boolean orientationCorrected)Get MarginMediaPrintableAreagetMediaPrintableArea()Get Printable Media AreaMediaSizegetMediaSize()Get Media SizeMediaSizeNamegetMediaSizeName()Get Media SizePageFormatgetPageFormat()Get the Page Format for the PapaerPrintRequestAttributeSetgetPrintRequestAttributeSet()Return Print Request AttributesdoublegetWidth(boolean orientationCorrected)Get Width in 1/72 inchinthashCode()booleanisLandscape()Is LandscapebooleanpageSetupDialog(PrinterJob job)Show Dialog and Set PapervoidsetMediaPrintableArea(MediaPrintableArea area)Get Printable Media AreavoidsetMediaSize(double x, double y, int units, boolean landscape)Set Media SizevoidsetMediaSize(MediaSize mediaSize, boolean landscape)Set Media SizevoidsetPrintRequestAttributeSet(PrintRequestAttributeSet prats)Set Print Request AttributesStringtoString()Get String RepresentationStringtoString(Properties ctx)Get "nice" String Representation-
Methods inherited from class java.awt.print.Paper
clone, getHeight, getImageableHeight, getImageableWidth, getImageableX, getImageableY, getWidth, setImageableArea, setSize
-
-
-
-
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 sizeleft- x in 1/72 inchtop- y in 1/72 inchright- right x in 1/72bottom- bottom y in 1/72landscape- 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 sizelandscape- 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 thisPaperobject's widthy- the value to which to set thisPaperobject's heightunits- 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
-
toString
public String toString(Properties ctx)
Get "nice" String Representation- Parameters:
ctx- context- Returns:
- info
-
equals
public boolean equals(Object obj)
Equals
-
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
-
-