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

public class GridElement extends PrintElement
Grid Element.
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 Details

    • m_rowGap

      protected int m_rowGap
      Gap between Rows
    • m_colGap

      protected int m_colGap
      Gap between Columns
    • m_rows

      protected int m_rows
      Rows
    • m_cols

      protected int m_cols
      Columns
    • m_textLayout

      protected TextLayout[][] m_textLayout
      The Layout Data
    • m_iterator

      protected AttributedCharacterIterator[][] m_iterator
      Character Iterator
    • m_rowHeight

      protected int[] m_rowHeight
      Row Height
    • m_colWidth

      protected int[] m_colWidth
      Column Width
    • m_frc

      protected FontRenderContext m_frc
      Context
  • Constructor Details

    • GridElement

      public GridElement(int rows, int cols)
      Grid Element Constructor Call setData to initialize content
      Parameters:
      rows - max rows
      cols - max cols
  • Method Details

    • setData

      public void setData(int row, int col, String stringData, Font font, Paint foreground)
      Create TextLayout from Data and calculate size.
      Called from ParameterElement and Location.
      Parameters:
      row - row
      col - column
      stringData - info element
      font - font
      foreground - color for foreground
    • setGap

      public void setGap(int rowGap, int colGap)
      Set Row/Column gap
      Parameters:
      rowGap - row gap
      colGap - column gap
    • calculateSize

      protected boolean calculateSize()
      Layout and Calculate Image Size.
      Set p_width and p_height.
      Specified by:
      calculateSize in class PrintElement
      Returns:
      true if calculated
    • paint

      public void paint(Graphics2D g2D, int pageNo, Point2D pageStart, Properties ctx, boolean isView)
      Paint element
      Specified by:
      paint in class PrintElement
      Parameters:
      g2D - Graphics
      pageStart - top left Location of page
      pageNo - page number for multi page support (0 = header/footer) - ignored
      ctx - print context
      isView - true if online view (IDs are links)