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 boolean
equals(Object obj)
Equalsdouble
getHeight(boolean orientationCorrected)
Get Height in 1/72 inchdouble
getImageableHeight(boolean orientationCorrected)
Get Image Height in 1/72 inchdouble
getImageableWidth(boolean orientationCorrected)
Get Image Width in 1/72 inchdouble
getImageableX(boolean orientationCorrected)
Get Image X in 1/72 inchdouble
getImageableY(boolean orientationCorrected)
Get Image Y in 1/72 inchInsets
getMargin(boolean orientationCorrected)
Get MarginMediaPrintableArea
getMediaPrintableArea()
Get Printable Media AreaMediaSize
getMediaSize()
Get Media SizeMediaSizeName
getMediaSizeName()
Get Media SizePageFormat
getPageFormat()
Get the Page Format for the PapaerPrintRequestAttributeSet
getPrintRequestAttributeSet()
Return Print Request Attributesdouble
getWidth(boolean orientationCorrected)
Get Width in 1/72 inchint
hashCode()
boolean
isLandscape()
Is Landscapeboolean
pageSetupDialog(PrinterJob job)
Show Dialog and Set Papervoid
setMediaPrintableArea(MediaPrintableArea area)
Get Printable Media Areavoid
setMediaSize(double x, double y, int units, boolean landscape)
Set Media Sizevoid
setMediaSize(MediaSize mediaSize, boolean landscape)
Set Media Sizevoid
setPrintRequestAttributeSet(PrintRequestAttributeSet prats)
Set Print Request AttributesString
toString()
Get String RepresentationString
toString(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 thisPaper
object's widthy
- the value to which to set thisPaper
object'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
-
-