Package org.compiere.print.layout
Class GridElement
java.lang.Object
org.compiere.print.layout.PrintElement
org.compiere.print.layout.GridElement
- All Implemented Interfaces:
ImageObserver,Serializable
- Direct Known Subclasses:
LocationElement,ParameterElement,PInstanceLogElement
Grid Element.
Simple Table with Rows/Columns, but no Headers.
Simple Table with Rows/Columns, but no Headers.
- Version:
- $Id: GridElement.java,v 1.3 2006/07/30 00:53:02 jjanke Exp $
- Author:
- Jorg Janke
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intGap between Columnsprotected intColumnsprotected int[]Column Widthprotected FontRenderContextContextprotected AttributedCharacterIterator[][]Character Iteratorprotected intGap between Rowsprotected int[]Row Heightprotected intRowsprotected TextLayout[][]The Layout DataFields inherited from class org.compiere.print.layout.PrintElement
LINK_COLOR, log, p_FieldAlignmentType, p_height, p_maxHeight, p_maxWidth, p_pageLocation, p_sizeCalculated, p_widthFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionGridElement(int rows, int cols) Grid Element Constructor Call setData to initialize content -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanLayout and Calculate Image Size.
Set p_width and p_height.voidpaint(Graphics2D g2D, int pageNo, Point2D pageStart, Properties ctx, boolean isView) Paint elementvoidCreate TextLayout from Data and calculate size.
Called from ParameterElement and Location.voidsetGap(int rowGap, int colGap) Set Row/Column gapMethods inherited from class org.compiere.print.layout.PrintElement
getAbsoluteLocation, getBounds, getCurrentPage, getDetailInfo, getDrillAcross, getDrillDown, getHeight, getHeight, getLocation, getPageCount, getPageLogic, getPrintData, getRowIndex, getWidth, imageUpdate, isTranslated, layout, setCurrentPage, setLocation, setMaxHeight, setMaxWidth, setPageLogic, setPrintData, setRowIndex, toString, translate, waitForLoad
-
Field Details
-
m_rowGap
protected int m_rowGapGap between Rows -
m_colGap
protected int m_colGapGap between Columns -
m_rows
protected int m_rowsRows -
m_cols
protected int m_colsColumns -
m_textLayout
The Layout Data -
m_iterator
Character Iterator -
m_rowHeight
protected int[] m_rowHeightRow Height -
m_colWidth
protected int[] m_colWidthColumn Width -
m_frc
Context
-
-
Constructor Details
-
GridElement
public GridElement(int rows, int cols) Grid Element Constructor Call setData to initialize content- Parameters:
rows- max rowscols- max cols
-
-
Method Details
-
setData
Create TextLayout from Data and calculate size.
Called from ParameterElement and Location.- Parameters:
row- rowcol- columnstringData- info elementfont- fontforeground- color for foreground
-
setGap
public void setGap(int rowGap, int colGap) Set Row/Column gap- Parameters:
rowGap- row gapcolGap- column gap
-
calculateSize
protected boolean calculateSize()Layout and Calculate Image Size.
Set p_width and p_height.- Specified by:
calculateSizein classPrintElement- Returns:
- true if calculated
-
paint
Paint element- Specified by:
paintin classPrintElement- Parameters:
g2D- GraphicspageStart- top left Location of pagepageNo- page number for multi page support (0 = header/footer) - ignoredctx- print contextisView- true if online view (IDs are links)
-