|
Compiere 3.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compiere.print.layout.LayoutEngine
public class LayoutEngine
Compiere Print Engine. All coordinates are relative to the Page. The Language setting is maintained in the format
| Field Summary | |
|---|---|
static int |
AREA_CONTENT
Content Area |
static int |
AREA_FOOTER
Footer Area |
static int |
AREA_HEADER
Header Area |
static Image |
IMAGE_FALSE
False Image |
static Dimension |
IMAGE_SIZE
Image Size |
static Image |
IMAGE_TRUE
True Image |
static boolean |
s_FASTDRAW
Draw using attributed String vs. |
| Fields inherited from interface java.awt.print.Pageable |
|---|
UNKNOWN_NUMBER_OF_PAGES |
| Fields inherited from interface java.awt.print.Printable |
|---|
NO_SUCH_PAGE, PAGE_EXISTS |
| Constructor Summary | |
|---|---|
LayoutEngine(MPrintFormat format,
PrintData data,
Query query)
Detail Constructor |
|
| Method Summary | |
|---|---|
protected void |
addX(float xOffset)
Add to X Position on current page |
protected void |
addY(int yOffset)
Add to Y Position - may cause New Page |
int |
getArea()
Get the current Print Area |
Rectangle |
getAreaBounds()
Return bounds of current Area |
DocAttributeSet |
getAttributes()
Get Document Attributes (Doc Interface) |
Color |
getColor()
Get default Color |
int |
getColumnCount()
Get the number of printed Columns |
Ctx |
getCtx()
Get PrintLayout (Report) Context |
DocFlavor |
getDocFlavor()
Get the doc flavor (Doc Interface) |
MPrintFormat |
getFormat()
Get Format Model |
HeaderFooter |
getHeaderFooter()
Get Header & Footer info |
int |
getNumberOfPages()
Get number of pages (Pageable Interface) |
Page |
getPage(int pageNo)
Get Page No |
LayoutEngine |
getPageable(boolean isCopy)
Get Print Interface (Pageable, Printable, Doc) |
PageFormat |
getPageFormat()
Get Page Format |
PageFormat |
getPageFormat(int pageIndex)
Get Page Format (Pageable Interface) |
String |
getPageInfo(int pageNo)
Get Page Info for Multi-Page tables |
String |
getPageInfoMax()
Get Max Page Info for Multi-Page tables |
int |
getPageNo()
Get current Page Number (not zero based) |
ArrayList<Page> |
getPages()
Get Pages |
CPaper |
getPaper()
Set Paper |
Point2D |
getPosition()
Get the current position on current page |
Printable |
getPrintable(int pageIndex)
Get Printable (PageableInterface) |
Object |
getPrintData()
Get Print Data (Doc Interface) |
Reader |
getReaderForText()
Obtains a reader for extracting character print data from this doc. |
InputStream |
getStreamForBytes()
Obtains an input stream for extracting byte print data from this doc. |
float |
getX()
Get X Position on current page |
float |
getXspace()
Return remaining X dimension space _ on current page in Area |
float |
getY()
Get Y Position on current page |
float |
getYspace()
Return remaining Y dimension space | on current page in Area |
boolean |
isCopy()
Print Copy |
boolean |
isXspaceFor(float width)
Remaining Space is OK for Width in Area |
boolean |
isYspaceFor(float height)
Remaining Space is OK for Height in Area |
protected void |
newLine()
Move to New Line (may cause new page) |
protected int |
newPage(boolean force,
boolean preserveXPos)
Create New Page, set position to top content |
void |
pageSetupDialog(PrinterJob job)
Show Dialog and Set Paper Optionally re-calculate layout |
int |
print(Graphics graphics,
PageFormat pageFormat,
int pageIndex)
Print Page (Printable Interface) |
protected void |
setArea(int area)
Set the current Print Area |
void |
setCopy(boolean isCopy)
Set Copy |
protected void |
setPage(int pageNo)
Set Current page to Page No |
protected void |
setPageFormat(PageFormat pf)
Set Paper from Page Format. |
void |
setPaper(CPaper paper)
Set Paper |
void |
setPaper(CPaper paper,
int headerHeight,
int footerHeight)
Set Paper Optionally re-calculate layout |
void |
setPrintData(PrintData data,
Query query,
boolean doLayout)
Set PrintData. |
void |
setPrintFormat(MPrintFormat format,
boolean doLayout)
Set Print Format Optionally re-calculate layout |
protected void |
setRelativePosition(float x,
float y)
Set Position on current page (no check) |
protected void |
setRelativePosition(Point2D p)
Set Position on current page (no check) |
protected void |
setX(float x)
Set X Position on current page |
protected void |
setY(int y)
Set Y Position on current page |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int AREA_HEADER
public static final int AREA_CONTENT
public static final int AREA_FOOTER
public static boolean s_FASTDRAW
public static Image IMAGE_TRUE
public static Image IMAGE_FALSE
public static Dimension IMAGE_SIZE
| Constructor Detail |
|---|
public LayoutEngine(MPrintFormat format,
PrintData data,
Query query)
format - Print Formatdata - Print Dataquery - query for parameter info| Method Detail |
|---|
public void setPrintFormat(MPrintFormat format,
boolean doLayout)
doLayout - if layout exists, redo itformat - print Format
public void setPrintData(PrintData data,
Query query,
boolean doLayout)
data - datadoLayout - if layout exists, redo itquery - query for parameterpublic void setPaper(CPaper paper)
paper - Paper
public void setPaper(CPaper paper,
int headerHeight,
int footerHeight)
paper - PaperheaderHeight - header heightfooterHeight - footer heightpublic void pageSetupDialog(PrinterJob job)
job - printer jobprotected void setPageFormat(PageFormat pf)
pf - Optional PageFormat - if null standard paper Portraitpublic PageFormat getPageFormat()
public CPaper getPaper()
public Ctx getCtx()
public int getColumnCount()
protected void setArea(int area)
area - see HEADER_.. constantspublic int getArea()
public Rectangle getAreaBounds()
protected int newPage(boolean force,
boolean preserveXPos)
force - if false will check if nothing printed so farpreserveXPos - preserve X Position of content area
protected void newLine()
public int getPageNo()
public Page getPage(int pageNo)
pageNo - page number (NOT zero based)
public ArrayList<Page> getPages()
public HeaderFooter getHeaderFooter()
protected void setPage(int pageNo)
pageNo - page number (NOT zero based)public String getPageInfo(int pageNo)
pageNo - page
public String getPageInfoMax()
public MPrintFormat getFormat()
public LayoutEngine getPageable(boolean isCopy)
isCopy - true if it is a document copy
protected void setRelativePosition(Point2D p)
p - point relative in area
protected void setRelativePosition(float x,
float y)
x - x position in 1/72 inchy - y position in 1/72 inchpublic Point2D getPosition()
protected void setX(float x)
x - x position in 1/72 inchprotected void addX(float xOffset)
xOffset - add offset to x position in 1/72 inchpublic float getX()
protected void setY(int y)
y - y position in 1/72 inchprotected void addY(int yOffset)
yOffset - add offset to y position in 1/72 inchpublic float getY()
public float getXspace()
public boolean isXspaceFor(float width)
width - width
public float getYspace()
public boolean isYspaceFor(float height)
height - height
public Color getColor()
public int getNumberOfPages()
getNumberOfPages in interface Pageable
public PageFormat getPageFormat(int pageIndex)
throws IndexOutOfBoundsException
getPageFormat in interface PageablepageIndex - page index
IndexOutOfBoundsException
public Printable getPrintable(int pageIndex)
throws IndexOutOfBoundsException
getPrintable in interface PageablepageIndex - page index
IndexOutOfBoundsException
public int print(Graphics graphics,
PageFormat pageFormat,
int pageIndex)
throws PrinterException
print in interface Printablegraphics - graphicspageFormat - page format (ignored)pageIndex - page index
PrinterExceptionpublic boolean isCopy()
public void setCopy(boolean isCopy)
isCopy - if true document is a copypublic DocFlavor getDocFlavor()
getDocFlavor in interface Doc
public Object getPrintData()
throws IOException
getPrintData in interface DocIOExceptionpublic DocAttributeSet getAttributes()
getAttributes in interface Doc
public Reader getReaderForText()
throws IOException
getReaderForText in interface DocIOException
public InputStream getStreamForBytes()
throws IOException
getStreamForBytes in interface DocIOException
|
Compiere 3.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||