Package org.compiere.print
Class CPaper
java.lang.Object
java.awt.print.Paper
org.compiere.print.CPaper
- All Implemented Interfaces:
Cloneable
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 Summary
ConstructorDescriptionCPaper
(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
Modifier and TypeMethodDescriptionboolean
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 inchgetMargin
(boolean orientationCorrected) Get MarginGet Printable Media AreaGet Media SizeGet Media SizeGet the Page Format for the PapaerReturn Print Request Attributesdouble
getWidth
(boolean orientationCorrected) Get Width in 1/72 inchint
hashCode()
boolean
Is Landscapeboolean
Show Dialog and Set Papervoid
Get Printable Media Areavoid
setMediaSize
(double x, double y, int units, boolean landscape) Set Media Sizevoid
setMediaSize
(MediaSize mediaSize, boolean landscape) Set Media Sizevoid
Set Print Request AttributestoString()
Get String RepresentationtoString
(Properties ctx) Get "nice" String RepresentationMethods inherited from class java.awt.print.Paper
clone, getHeight, getImageableHeight, getImageableWidth, getImageableX, getImageableY, getWidth, setImageableArea, setSize
-
Constructor Details
-
CPaper
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 Details
-
setMediaSize
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:
-
getMediaSizeName
Get Media Size- Returns:
- media size
-
getMediaSize
Get Media Size- Returns:
- media size
-
getMediaPrintableArea
Get Printable Media Area- Returns:
- Printable Area
-
setMediaPrintableArea
Get Printable Media Area- Parameters:
area
- Printable Area
-
isLandscape
public boolean isLandscape()Is Landscape- Returns:
- true if landscape
-
pageSetupDialog
Show Dialog and Set Paper- Parameters:
job
- printer job- Returns:
- true if changed.
-
getPrintRequestAttributeSet
Return Print Request Attributes- Returns:
- PrintRequestAttributeSet
-
setPrintRequestAttributeSet
Set Print Request Attributes- Parameters:
prats
- PrintRequestAttributeSet
-
getPageFormat
Get the Page Format for the Papaer- Returns:
- Page Format
-
toString
Get String Representation -
toString
Get "nice" String Representation- Parameters:
ctx
- context- Returns:
- info
-
equals
Equals -
hashCode
public int hashCode() -
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
Get Margin- Parameters:
orientationCorrected
- correct for orientation- Returns:
- margin
-