Style Intelligence v12.0

inetsoft.report.lens
Class AttributeTableLens

java.lang.Object
  extended by inetsoft.report.lens.AbstractTableLens
      extended by inetsoft.report.lens.AttributeTableLens
All Implemented Interfaces:
StyleConstants, TableFilter, TableLens, XConstants, XTable, Serializable, Cloneable
Direct Known Subclasses:
CORBATableLens, DataSetTable, DefaultTableLens, HeaderRowTableLens, HighlightFilter, JDBCTableLens, SummaryTableLens, TextTableLens, XMLTableLens

public class AttributeTableLens
extends AbstractTableLens
implements TableFilter, Cloneable

The AttributeTableLens is a decorator table. It can be used with another table to allow users to change the attributes of the table by calling the attribute setter methods on the AttributeTableLens.

There are four levels of setting in the AttributeTableLens. An attribute can be changed at table level, in which case the attribute is applied to all cells in the table. An attribute can also be set at per row or per column level. The finest level of control allows an attribute being set at per cell level. For each attribute, there are four attribute setter methods corresponding to the four levels described above.

AttributeTableLens is the base class of most other table lens classes. Its methods can be called to change the table attributes.

See Also:
Serialized Form

Field Summary
protected  inetsoft.util.SparseIndexedMatrix alignmap
           
protected  AttributeTableLens attritable
           
protected  inetsoft.util.SparseIndexedMatrix backgroundmap
           
protected  inetsoft.util.SparseMatrix cache
           
protected  boolean check
           
protected  inetsoft.util.SparseIndexedMatrix colborderCmap
           
protected  inetsoft.util.SparseIndexedMatrix colbordermap
           
protected  inetsoft.util.SparseIndexedMatrix fontmap
           
protected  inetsoft.util.SparseIndexedMatrix foregroundmap
           
protected  inetsoft.util.SparseIndexedMatrix insetsmap
           
protected  inetsoft.util.SparseIndexedMatrix linkmap
           
protected  inetsoft.util.SparseIndexedMatrix presentermap
           
protected  inetsoft.util.SparseIndexedMatrix rowborderCmap
           
protected  inetsoft.util.SparseIndexedMatrix rowbordermap
           
protected  TableLens table
           
protected  inetsoft.util.SparseIndexedMatrix wrapmap
           
 
Fields inherited from class inetsoft.report.lens.AbstractTableLens
descriptor, isLeftAlign
 
Fields inherited from interface inetsoft.report.TableLens
BREAK_BORDER, NULL
 
Fields inherited from interface inetsoft.uql.XTable
EOT
 
Fields inherited from interface inetsoft.report.StyleConstants
ARROW_LINE_1, ARROW_LINE_2, ARROW_LINE_3, BACKGROUND_CENTER, BACKGROUND_TILED, BOX_RECTANGLE, BOX_ROUNDED_RECTANGLE, CENTER, CHART_3D_BAR, CHART_3D_BAR_3D, CHART_3D_PIE, CHART_3D_STACK_BAR, CHART_AREA, CHART_BAR, CHART_BUBBLE, CHART_CANDLE, CHART_CURVE, CHART_FILL_RADAR, CHART_GANTT, CHART_INV_BAR, CHART_INV_CURVE, CHART_INV_LINE, CHART_INV_POINT, CHART_INV_STACK_BAR, CHART_LINE, CHART_MAX_USER, CHART_PARETO, CHART_PIE, CHART_PIE_EXPLODED_ALL, CHART_PIE_EXPLODED_FIRST, CHART_PIE_EXPLODED_NONE, CHART_POINT, CHART_RADAR, CHART_RIBBON, CHART_SCATTER, CHART_SPEEDOMETER, CHART_STACK_AREA, CHART_STACK_BAR, CHART_STICK, CHART_STOCK, CHART_SURFACE, CHART_USER, CHART_VOLUME, CHART_WATERFALL, CHART_XY_LINE, CIRCLE, CROSS, CURRENCY, DASH_LINE, DASH_MASK, DEFAULT_PAGE_SIZE, DIAMOND, DOT_LINE, DOUBLE_3D_LOWERED, DOUBLE_3D_RAISED, DOUBLE_LINE, DOUBLE_MASK, FILL, FILLED_CIRCLE, FILLED_DIAMOND, FILLED_SQUARE, FILLED_TRIANGLE, FRACTION_WIDTH_MASK, H_ALIGN_MASK, H_CENTER, H_CURRENCY, H_LEFT, H_LINE, H_RIGHT, LANDSCAPE, LARGE_DASH, LEFT, LINECAP_BUTT, LINECAP_ROUND, LINECAP_SQUARE, LINEJOIN_BEVEL, LINEJOIN_MITER, LINEJOIN_ROUND, LOWERED_3D, LOWERED_MASK, LT_ANGLE, MEDIUM_DASH, MEDIUM_LINE, NIL, NO_BORDER, NONE, PAPER_10X11, PAPER_10X14, PAPER_11X17, PAPER_15X11, PAPER_9X11, PAPER_A_PLUS, PAPER_A2, PAPER_A3, PAPER_A3_EXTRA, PAPER_A3_EXTRA_TRANSVERSE, PAPER_A3_TRANSVERSE, PAPER_A4, PAPER_A4_EXTRA, PAPER_A4_PLUS, PAPER_A4_TRANSVERSE, PAPER_A4SMALL, PAPER_A5, PAPER_A5_EXTRA, PAPER_A5_TRANSVERSE, PAPER_B_PLUS, PAPER_B4, PAPER_B5, PAPER_B5_EXTRA, PAPER_B5_TRANSVERSE, PAPER_CSHEET, PAPER_DSHEET, PAPER_ENV_10, PAPER_ENV_11, PAPER_ENV_12, PAPER_ENV_14, PAPER_ENV_9, PAPER_ENV_B4, PAPER_ENV_B5, PAPER_ENV_B6, PAPER_ENV_C3, PAPER_ENV_C4, PAPER_ENV_C5, PAPER_ENV_C6, PAPER_ENV_C65, PAPER_ENV_DL, PAPER_ENV_INVITE, PAPER_ENV_ITALY, PAPER_ENV_MONARCH, PAPER_ENV_PERSONAL, PAPER_ESHEET, PAPER_EXECUTIVE, PAPER_FANFOLD_LGL_GERMAN, PAPER_FANFOLD_STD_GERMAN, PAPER_FANFOLD_US, PAPER_FOLIO, PAPER_ISO_B4, PAPER_JAPANESE_POSTCARD, PAPER_LEDGER, PAPER_LEGAL, PAPER_LEGAL_EXTRA, PAPER_LETTER, PAPER_LETTER_EXTRA, PAPER_LETTER_EXTRA_TRANSVERSE, PAPER_LETTER_PLUS, PAPER_LETTER_TRANSVERSE, PAPER_LETTERSMALL, PAPER_NOTE, PAPER_QUARTO, PAPER_STATEMENT, PAPER_TABLOID, PAPER_TABLOID_EXTRA, PATTERN_0, PATTERN_1, PATTERN_10, PATTERN_11, PATTERN_12, PATTERN_13, PATTERN_14, PATTERN_15, PATTERN_16, PATTERN_17, PATTERN_18, PATTERN_19, PATTERN_2, PATTERN_3, PATTERN_4, PATTERN_5, PATTERN_6, PATTERN_7, PATTERN_8, PATTERN_9, PATTERN_NONE, PORTRAIT, RAISED_3D, RAISED_MASK, REMAINDER, RIGHT, RIGHT_ANGLE, SOLID_MASK, SQUARE, STAR, THICK_LINE, THIN_LINE, THIN_THIN_LINE, TRAY_AUTO, TRAY_CASSETTE, TRAY_ENVELOPE, TRAY_ENVMANUAL, TRAY_FORMSOURCE, TRAY_LARGECAPACITY, TRAY_LARGEFMT, TRAY_LOWER, TRAY_MANUAL, TRAY_MIDDLE, TRAY_ONLYONE, TRAY_SMALLFMT, TRAY_TRACTOR, TRAY_UPPER, TRIANGLE, ULTRA_THIN_LINE, V_ALIGN_MASK, V_ANGLE, V_BASELINE, V_BOTTOM, V_CENTER, V_LINE, V_TOP, WIDTH_MASK, X
 
Fields inherited from interface inetsoft.uql.XConstants
AM_PM_DATE_GROUP, AM_PM_OF_DAY_DATE_GROUP, AVERAGE_FORMULA, CALC_FORMULA, COLUMN, CONCAT_FORMULA, CONDITION_EMPTY_STRING, CONDITION_NULL_STRING, CONDITION_NULL_VALUE, CONDITION_REAL_NULL, CORRELATION_FORMULA, COUNT_FORMULA, COVARIANCE_FORMULA, CURRENCY_FORMAT, CURRENT_REP_CHANGED, CURRENT_REP_WILL_CHANGE, DATE_FORMAT, DAY_DATE_GROUP, DAY_OF_MONTH_DATE_GROUP, DAY_OF_WEEK_DATE_GROUP, DAY_OF_YEAR_DATE_GROUP, DECIMAL_FORMAT, DISTINCTCOUNT_FORMULA, FIRST_FORMULA, FULL_JOIN, GREATER_EQUAL_JOIN, GREATER_JOIN, GROUP_OTHERS, HOUR_DATE_GROUP, HOUR_OF_DAY_DATE_GROUP, INNER_JOIN, JOIN, LAST_FORMULA, LEAVE_OTHERS, LEFT_JOIN, LESS_EQUAL_JOIN, LESS_JOIN, MAX_FORMULA, MEDIAN_FORMULA, MESSAGE_FORMAT, MILLISECOND_DATE_GROUP, MIN_FORMULA, MINUTE_DATE_GROUP, MODE_FORMULA, MONTH_DATE_GROUP, MONTH_OF_YEAR_DATE_GROUP, NONE_DATE_GROUP, NONE_FORMULA, NOT_EQUAL_JOIN, NTHLARGEST_FORMULA, NTHMOSTFREQUENT_FORMULA, NTHSMALLEST_FORMULA, PARAM_PREFIX, PART_DATE_GROUP, PERCENT_FORMAT, PERCENTAGE_BY_COL, PERCENTAGE_BY_ROW, PERCENTAGE_NONE, PERCENTAGE_OF_COL_GRANDTOTAL, PERCENTAGE_OF_COL_GROUP, PERCENTAGE_OF_GRANDTOTAL, PERCENTAGE_OF_GROUP, PERCENTAGE_OF_ROW_GRANDTOTAL, PERCENTAGE_OF_ROW_GROUP, POPULATIONSTANDARDDEVIATION_FORMULA, POPULATIONVARIANCE_FORMULA, PRODUCT_FORMULA, PTHPERCENTILE_FORMULA, QUARTER_DATE_GROUP, QUARTER_OF_YEAR_DATE_GROUP, RIGHT_JOIN, SECOND_DATE_GROUP, SET_FORMULA, SORT_ASC, SORT_DESC, SORT_NONE, SORT_ORIGINAL, SORT_SPECIFIC, SORT_VALUE_ASC, SORT_VALUE_DESC, STANDARDDEVIATION_FORMULA, SUB_QUERY_PARAM, SUM_FORMULA, SUMSQ_FORMULA, SUMWT_FORMULA, VARIANCE_FORMULA, WEEK_DATE_GROUP, WEEK_OF_MONTH_DATE_GROUP, WEEK_OF_YEAR_DATE_GROUP, WEIGHTEDAVERAGE_FORMULA, YEAR_DATE_GROUP
 
Constructor Summary
AttributeTableLens()
          The setTable() method must be called before this table can be used.
AttributeTableLens(TableLens table)
          Create an attribute table with the specified table as the base table.
 
Method Summary
 Object clone()
          Make a copy of this table.
 void cloneAttributes(AttributeTableLens attr)
          Make copy of the attributes to a new attribute table lens.
 boolean containsLink()
          Check if contains hyperlink definitation.
 void dispose()
          Dispose the table to clear up temporary resources.
 int findColumn(String header)
          Find the column with the specified header.
protected  Object format(int r, int c, Object obj)
          Format or add presenter to an object.
 int getAlignment(int r, int c)
          Return the alignment for the row.
 Color getBackground(int r, int c)
          Return the background color for the specified row.
 int getBaseColIndex(int col)
          Get the base table column index corresponding to the filtered table.
 int getBaseRowIndex(int row)
          Get the base table row index corresponding to the filtered table.
 Format getCellFormat(int row, int col)
          Get the format defined in this table lens.
 Format getCellFormat(int row, int col, boolean cellOnly)
          Get the format defined in this table lens.
 int getColBorder(int r, int c)
          Return the style for right border of the specified row.
 Color getColBorderColor(int r, int c)
          Return the color for drawing the column border lines.
 int getColCount()
          Return the number of columns in the table.
 Object getColHeader(int col)
          Get column header.
 Class getColType(int col)
          Get the current column content type.
 String getColumnIdentifier(int col)
          Get the column identifier of a column.
 int getColWidth(int col)
          Get the current column width setting.
 Object getData(int r, int c)
          Return the data at the specified cell.
 TableDataDescriptor getDescriptor()
          Get internal table data descriptor which contains table structural infos.
 Font getFont(int r, int c)
          Return the per row font.
 Color getForeground(int r, int c)
          Return the foreground color for the specified row.
 Format getFormat(int col)
          Get the format associated with the column.
 Format getFormat(int row, int col)
          Get the format for the specified cell.
 Format getFormat(int row, int col, boolean cellOnly)
          Get the format for the specified cell.
 int getHeaderColCount()
          Return the number of columns on the left of the table to be treated as header columns.
 int getHeaderRowCount()
          Return the number of rows on the top of the table to be treated as header rows.
 Hyperlink.Ref getHyperlink(int r, int c)
          Get hyperlink of a table cell.
 Insets getInsets(int r, int c)
          Return the cell gap space.
 Object getObject(int r, int c)
          Return the value at the specified cell.
 Object getObject0(int r, int c)
          Return the value at the specified cell.
 Presenter getPresenter(int col)
          Get the presenter for the specified column.
 Presenter getPresenter(int row, int col)
          Get the presenter for the specified cell.
 Presenter getPresenter(String header)
          Get the presenter for the specified column.
 int getRowBorder(int r, int c)
          Return the style for bottom border of the specified cell.
 Color getRowBorderColor(int r, int c)
          Return the color for drawing the row border lines.
 int getRowCount()
          Return the number of rows in the table.
 Format getRowFormat(int row)
          Get the format associated with a row.
 int getRowHeight(int row)
          Get the current row heights setting.
 Dimension getSpan(int r, int c)
          Return the spanning setting for the cell.
 TableLens getTable()
          Get the base table lens.
 int getTrailerColCount()
          Return the number of columns on the right of the table to be treated as tail columns.
 int getTrailerRowCount()
          Return the number of rows on the bottom of the table to be treated as tail rows.
 void invalidate()
          Invalidate the table filter forcely, and the table filter will perform filtering calculation to validate itself.
 boolean isColSuppressIfDuplicate(int c)
          Return the per col suppress if duplicate.
 boolean isColSuppressIfZero(int c)
          Return the per col suppress if zero.
 boolean isLineWrap(int r, int c)
          Return the per cell line wrap mode.
 boolean isSuppressIfDuplicate(int r, int c)
          Return the per cell suppress if duplicate mode.
 boolean isSuppressIfZero(int r, int c)
          Return the per cell suppress if zero mode.
 boolean moreRows(int row)
          Check if there are more rows.
 void removeAllSpans()
          Remove all span setting.
 void setAlignment(int align)
          Set the table level cell alignment.
 void setAlignment(int r, int c, int align)
          Set the cell alignment.
 void setBackground(int r, int c, Color color)
          Set the background color for the specified cell.
 void setColAlignment(int c, int align)
          Set the col cell alignment.
 void setColAutoSize(boolean auto)
          If autosize is enabled, the base table column width is ignored.
 void setColBackground(int c, Color color)
          Set the background color for the specified col.
 void setColBorder(int style)
          Set the table level column border.
 void setColBorder(int c, int style)
          Set the style of the column border.
 void setColBorder(int r, int c, int style)
          Set the style of the column border.
 void setColBorderColor(Color color)
          Set the table level column border color.
 void setColBorderColor(int c, Color color)
          Set the color for the column border.
 void setColBorderColor(int r, int c, Color color)
          Set the color for the column border.
 void setColCount(int cols)
          Set the number of columns.
 void setColFont(int c, Font font)
          Set the font for the col.
 void setColForeground(int c, Color color)
          Set the foreground color for the specified col.
 void setColHeader(int col, Object hdr)
          Set the table column header.
 void setColInsets(int c, Insets insets)
          Set the cell insets for the col.
 void setColLineWrap(int c, boolean wrap)
          Set the line wrap for the col.
 void setColSuppressIfDuplicate(int c, boolean dup)
          Set the line wrap for the col.
 void setColSuppressIfZero(int c, boolean zero)
          Set the line wrap for the col.
 void setColWidth(int col, int width)
          Set the width of the column in pixels.
 void setData(int r, int c, Object val)
          Return the data at the specified cell.
 void setFont(Font font)
          Set the default font for the table.
 void setFont(int r, int c, Font font)
          Set the font for the cell.
 void setForeground(int r, int c, Color color)
          Set the foreground color for the specified cell.
 void setFormat(int col, Format p)
          Set the format for the specified column.
 void setFormat(int r, int c, Format format)
          Set the format for the specified cell.
 void setFormat(String header, Format p)
          Set the format for the specified column.
 void setHeaderColCount(int headerCol)
          Set the number of header columns.
 void setHeaderRowCount(int headerRow)
          Set the number of header rows.
 void setHyperlink(int r, int c, Hyperlink.Ref link)
          Set the hyperlink for the specified cell.
 void setInsets(Insets insets)
          Set the table level cell padding.
 void setInsets(int r, int c, Insets insets)
          Set the cell insets for the cell.
 void setLineWrap(boolean wrap)
          Set the table line wrap setting.
 void setLineWrap(int r, int c, boolean wrap)
          Set the line wrap for the cell.
 void setObject(int r, int c, Object val)
          Set a cell value.
 void setPresenter(int r, int c, Presenter presenter)
          Set the presenter for the specified cell.
 void setPresenter(int col, Presenter p)
          Set the presenter for the specified column.
 void setPresenter(String header, Presenter p)
          Set the presenter for the specified column.
 void setRowAlignment(int r, int align)
          Set the row cell alignment.
 void setRowAutoSize(boolean auto)
          If autosize is enabled, the base table row height is ignored.
 void setRowBackground(int r, Color color)
          Set the background color for the specified row.
 void setRowBorder(int style)
          Set the table level row border.
 void setRowBorder(int r, int style)
          Set the style of the row border.
 void setRowBorder(int r, int c, int style)
          Set the style of the row border.
 void setRowBorderColor(Color color)
          Set the table level row border color.
 void setRowBorderColor(int r, Color color)
          Set the color for the row border.
 void setRowBorderColor(int r, int c, Color color)
          Set the color for the row border at the specified cell.
 void setRowCount(int rows)
          Set the number of rows.
 void setRowFont(int r, Font font)
          Set the font for the row.
 void setRowForeground(int r, Color color)
          Set the foreground color for the specified row.
 void setRowFormat(int row, Format p)
          Set the format for the specified column.
 void setRowHeight(int h)
          Set the row height of the table.
 void setRowHeight(int r, int h)
          Set the row height of a row in the table.
 void setRowInsets(int r, Insets insets)
          Set the cell insets for the row.
 void setRowLineWrap(int r, boolean wrap)
          Set the line wrap for the row.
 void setRowPresenter(int row, Presenter p)
          Set the presenter for the specified row.
 void setSpan(int r, int c, Dimension span)
          Set the span dimension of a cell.
 void setTable(TableLens table)
          Set the base table to be used with the attribute table table.
 void setTrailerColCount(int tailCol)
          Set the number of tail columns.
 void setTrailerRowCount(int tailRow)
          Set the number of tail rows.
 
Methods inherited from class inetsoft.report.lens.AbstractTableLens
addChangeListener, containsDrill, containsFormat, findColumnByIdentifier, fireChangeEvent, getBoolean, getByte, getDefaultFormat, getDouble, getFloat, getInt, getLong, getShort, getXDrillInfo, isNull, isPrimitive, removeChangeListener, setColumnIdentifier, setLeftAlign, setLocal
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface inetsoft.report.TableLens
addChangeListener, containsDrill, containsFormat, getDefaultFormat, getXDrillInfo, removeChangeListener
 
Methods inherited from interface inetsoft.uql.XTable
getBoolean, getByte, getDouble, getFloat, getInt, getLong, getShort, isNull, isPrimitive, setColumnIdentifier
 

Field Detail

table

protected TableLens table

attritable

protected AttributeTableLens attritable

cache

protected inetsoft.util.SparseMatrix cache

check

protected boolean check

colbordermap

protected inetsoft.util.SparseIndexedMatrix colbordermap

rowbordermap

protected inetsoft.util.SparseIndexedMatrix rowbordermap

rowborderCmap

protected inetsoft.util.SparseIndexedMatrix rowborderCmap

colborderCmap

protected inetsoft.util.SparseIndexedMatrix colborderCmap

foregroundmap

protected inetsoft.util.SparseIndexedMatrix foregroundmap

backgroundmap

protected inetsoft.util.SparseIndexedMatrix backgroundmap

alignmap

protected inetsoft.util.SparseIndexedMatrix alignmap

wrapmap

protected inetsoft.util.SparseIndexedMatrix wrapmap

insetsmap

protected inetsoft.util.SparseIndexedMatrix insetsmap

presentermap

protected inetsoft.util.SparseIndexedMatrix presentermap

linkmap

protected inetsoft.util.SparseIndexedMatrix linkmap

fontmap

protected inetsoft.util.SparseIndexedMatrix fontmap
Constructor Detail

AttributeTableLens

public AttributeTableLens()
The setTable() method must be called before this table can be used.


AttributeTableLens

public AttributeTableLens(TableLens table)
Create an attribute table with the specified table as the base table.

Parameters:
table - base table.
Method Detail

getBaseRowIndex

public int getBaseRowIndex(int row)
Get the base table row index corresponding to the filtered table. If the row does not exist in the base table, it returns -1.

Specified by:
getBaseRowIndex in interface TableFilter
Parameters:
row - row index in the filtered table.
Returns:
corresponding row index in the base table.

getBaseColIndex

public int getBaseColIndex(int col)
Get the base table column index corresponding to the filtered table. If the column does not exist in the base table, it returns -1.

Specified by:
getBaseColIndex in interface TableFilter
Parameters:
col - column index in the filtered table.
Returns:
corresponding column index in the bast table.

setTable

public void setTable(TableLens table)
Set the base table to be used with the attribute table table.

Specified by:
setTable in interface TableFilter
Parameters:
table - base table.

getTable

public TableLens getTable()
Get the base table lens.

Specified by:
getTable in interface TableFilter
Returns:
base table.

getDescriptor

public TableDataDescriptor getDescriptor()
Get internal table data descriptor which contains table structural infos.

Specified by:
getDescriptor in interface TableLens
Specified by:
getDescriptor in interface XTable
Overrides:
getDescriptor in class AbstractTableLens
Returns:
table data descriptor.

invalidate

public void invalidate()
Invalidate the table filter forcely, and the table filter will perform filtering calculation to validate itself.

Specified by:
invalidate in interface TableFilter

setColHeader

public void setColHeader(int col,
                         Object hdr)
Set the table column header.

Parameters:
col - column index.
hdr - column header value.

getColHeader

public Object getColHeader(int col)
Get column header.

Parameters:
col - column index.
Returns:
column header or null if column header is not set.

moreRows

public boolean moreRows(int row)
Check if there are more rows. The row index is the row that will be accessed. This method must block until the row is available, or return false if the row does not exist in the table. This method is used to iterate through the table, and allow partial table to be accessed in report processing.

Specified by:
moreRows in interface XTable
Overrides:
moreRows in class AbstractTableLens
Parameters:
row - row number.
Returns:
true if the row exists, or false if no more rows.

getRowCount

public int getRowCount()
Return the number of rows in the table. The number of rows includes the header rows.

Specified by:
getRowCount in interface XTable
Returns:
number of rows in table.

setRowCount

public void setRowCount(int rows)
Set the number of rows.

Parameters:
rows - number of rows.

getColCount

public int getColCount()
Return the number of columns in the table. The number of columns includes the header columns.

Specified by:
getColCount in interface XTable
Returns:
number of columns in table.

setColCount

public void setColCount(int cols)
Set the number of columns.

Parameters:
cols - number of columns.

getColType

public Class getColType(int col)
Get the current column content type.

Specified by:
getColType in interface XTable
Overrides:
getColType in class AbstractTableLens
Parameters:
col - column number.
Returns:
column type.

getData

public Object getData(int r,
                      int c)
Return the data at the specified cell.

Parameters:
r - row number.
c - column number.
Returns:
the data at the specified cell.

setData

public void setData(int r,
                    int c,
                    Object val)
Return the data at the specified cell.

Parameters:
r - row number.
c - column number.
val - cell value.

getObject

public Object getObject(int r,
                        int c)
Return the value at the specified cell.

Specified by:
getObject in interface XTable
Parameters:
r - row number.
c - column number.
Returns:
the value at the location.

setObject

public void setObject(int r,
                      int c,
                      Object val)
Set a cell value.

Specified by:
setObject in interface XTable
Overrides:
setObject in class AbstractTableLens
Parameters:
r - row index.
c - column index.
val - cell value.

getObject0

public Object getObject0(int r,
                         int c)
Return the value at the specified cell.

Parameters:
r - row number.
c - column number.
Returns:
the value at the location.

format

protected Object format(int r,
                        int c,
                        Object obj)
Format or add presenter to an object.


getHeaderRowCount

public int getHeaderRowCount()
Return the number of rows on the top of the table to be treated as header rows.

Specified by:
getHeaderRowCount in interface XTable
Overrides:
getHeaderRowCount in class AbstractTableLens
Returns:
number of header rows.

setHeaderRowCount

public void setHeaderRowCount(int headerRow)
Set the number of header rows.

Parameters:
headerRow - number of header rows.

getHeaderColCount

public int getHeaderColCount()
Return the number of columns on the left of the table to be treated as header columns.

Specified by:
getHeaderColCount in interface XTable
Overrides:
getHeaderColCount in class AbstractTableLens

setHeaderColCount

public void setHeaderColCount(int headerCol)
Set the number of header columns.

Parameters:
headerCol - number of header columns.

getTrailerRowCount

public int getTrailerRowCount()
Return the number of rows on the bottom of the table to be treated as tail rows.

Specified by:
getTrailerRowCount in interface XTable
Overrides:
getTrailerRowCount in class AbstractTableLens
Returns:
number of tail rows.

setTrailerRowCount

public void setTrailerRowCount(int tailRow)
Set the number of tail rows.

Parameters:
tailRow - number of tail rows.

getTrailerColCount

public int getTrailerColCount()
Return the number of columns on the right of the table to be treated as tail columns.

Specified by:
getTrailerColCount in interface XTable
Overrides:
getTrailerColCount in class AbstractTableLens

setTrailerColCount

public void setTrailerColCount(int tailCol)
Set the number of tail columns.

Parameters:
tailCol - number of tail columns.

getRowHeight

public int getRowHeight(int row)
Get the current row heights setting. The meaning of row heights depends on the table layout policy setting. If the row height is to be calculated by the ReportSheet based on the content, return -1.

Specified by:
getRowHeight in interface TableLens
Overrides:
getRowHeight in class AbstractTableLens
Returns:
row height.

setRowAutoSize

public void setRowAutoSize(boolean auto)
If autosize is enabled, the base table row height is ignored. The ReportSheet will calculate the height base on the row contents.

Parameters:
auto - true to enable autosize.

setRowHeight

public void setRowHeight(int h)
Set the row height of the table. All rows are set to the same height. If the height is 0, row height is reset and RowAutoSize property controls how the row height is calculated.

Parameters:
h - minimum row height.

setRowHeight

public void setRowHeight(int r,
                         int h)
Set the row height of a row in the table.

Parameters:
r - row number.
h - minimum row height.

getColWidth

public int getColWidth(int col)
Get the current column width setting. The meaning of column widths depends on the table layout policy setting. If the column width is to be calculated by the ReportSheet based on the content, return -1.

Specified by:
getColWidth in interface TableLens
Overrides:
getColWidth in class AbstractTableLens
Returns:
column width.

setColAutoSize

public void setColAutoSize(boolean auto)
If autosize is enabled, the base table column width is ignored. The ReportSheet will calculate the width base on the column contents.

Parameters:
auto - true to enable autosize.

setColWidth

public void setColWidth(int col,
                        int width)
Set the width of the column in pixels. This overrides auto size setting for the column width. The StyleConstants.REMAINDER can be passed in as the width. For the meaning of the constant, refer to the documentation on the TableLens.getColWidth() method.

Parameters:
col - column index.
width - column width.

getRowBorderColor

public Color getRowBorderColor(int r,
                               int c)
Return the color for drawing the row border lines.

Specified by:
getRowBorderColor in interface TableLens
Overrides:
getRowBorderColor in class AbstractTableLens
Parameters:
r - row number.
c - column number.
Returns:
ruling color.

setRowBorderColor

public void setRowBorderColor(Color color)
Set the table level row border color.

Parameters:
color - row border color.

setRowBorderColor

public void setRowBorderColor(int r,
                              Color color)
Set the color for the row border.

Parameters:
r - row number.
color - border color.

setRowBorderColor

public void setRowBorderColor(int r,
                              int c,
                              Color color)
Set the color for the row border at the specified cell. This overrides the border color setting on the entire row.

Parameters:
r - row number.
c - column number.
color - border color.

getColBorderColor

public Color getColBorderColor(int r,
                               int c)
Return the color for drawing the column border lines.

Specified by:
getColBorderColor in interface TableLens
Overrides:
getColBorderColor in class AbstractTableLens
Parameters:
r - row number.
c - column number.
Returns:
ruling color.

setColBorderColor

public void setColBorderColor(Color color)
Set the table level column border color.

Parameters:
color - column border color.

setColBorderColor

public void setColBorderColor(int c,
                              Color color)
Set the color for the column border.

Parameters:
c - column number.
color - border color.

setColBorderColor

public void setColBorderColor(int r,
                              int c,
                              Color color)
Set the color for the column border.

Parameters:
r - row number.
c - column number.
color - border color.

getRowBorder

public int getRowBorder(int r,
                        int c)
Return the style for bottom border of the specified cell. The flag must be one of the style options defined in the StyleConstants class. If the row number is -1, it's checking the outside ruling on the top.

Specified by:
getRowBorder in interface TableLens
Overrides:
getRowBorder in class AbstractTableLens
Parameters:
r - row number.
c - column number.
Returns:
ruling flag.

setRowBorder

public void setRowBorder(int style)
Set the table level row border.

Parameters:
style - row border style.

setRowBorder

public void setRowBorder(int r,
                         int style)
Set the style of the row border.

Parameters:
r - row number.
style - border style.

setRowBorder

public void setRowBorder(int r,
                         int c,
                         int style)
Set the style of the row border.

Parameters:
r - row number.
style - border style.

getColBorder

public int getColBorder(int r,
                        int c)
Return the style for right border of the specified row. The flag must be one of the style options defined in the StyleConstants class. If the column number is -1, it's checking the outside ruling on the left.

Specified by:
getColBorder in interface TableLens
Overrides:
getColBorder in class AbstractTableLens
Parameters:
r - row number.
c - column number.
Returns:
ruling flag.

setColBorder

public void setColBorder(int style)
Set the table level column border.

Parameters:
style - column border style.

setColBorder

public void setColBorder(int c,
                         int style)
Set the style of the column border.

Parameters:
c - column number.
style - border style.

setColBorder

public void setColBorder(int r,
                         int c,
                         int style)
Set the style of the column border.

Parameters:
r - row number.
c - column number.
style - border style.

getInsets

public Insets getInsets(int r,
                        int c)
Return the cell gap space.

Specified by:
getInsets in interface TableLens
Overrides:
getInsets in class AbstractTableLens
Parameters:
r - row number.
c - col number.
Returns:
cell gap space.

setInsets

public void setInsets(Insets insets)
Set the table level cell padding.

Parameters:
insets - cell padding.

setInsets

public void setInsets(int r,
                      int c,
                      Insets insets)
Set the cell insets for the cell.

Parameters:
r - row number.
c - column number.
insets - cell insets.

setRowInsets

public void setRowInsets(int r,
                         Insets insets)
Set the cell insets for the row.

Parameters:
r - row number.
insets - cell insets.

setColInsets

public void setColInsets(int c,
                         Insets insets)
Set the cell insets for the col.

Parameters:
c - col number.
insets - cell insets.

getSpan

public Dimension getSpan(int r,
                         int c)
Return the spanning setting for the cell. If the specified cell is not a spanning cell, it returns null. Otherwise it returns a Dimension object with Dimension.width equals to the number of columns and Dimension.height equals to the number of rows of the spanning cell.

Specified by:
getSpan in interface TableLens
Overrides:
getSpan in class AbstractTableLens
Parameters:
r - row number.
c - column number.
Returns:
span cell dimension.

setSpan

public void setSpan(int r,
                    int c,
                    Dimension span)
Set the span dimension of a cell.

Parameters:
r - row number.
c - column number.
span - span dimension.

removeAllSpans

public void removeAllSpans()
Remove all span setting.


getAlignment

public int getAlignment(int r,
                        int c)
Return the alignment for the row.

Specified by:
getAlignment in interface TableLens
Overrides:
getAlignment in class AbstractTableLens
Parameters:
r - row number.
c - col number.
Returns:
cell alignment.

setAlignment

public void setAlignment(int align)
Set the table level cell alignment.

Parameters:
align - alignment.

setAlignment

public void setAlignment(int r,
                         int c,
                         int align)
Set the cell alignment.

Parameters:
r - row number.
c - column number.
align - alignment flagn, pass -1 to clear the setting.

setRowAlignment

public void setRowAlignment(int r,
                            int align)
Set the row cell alignment.

Parameters:
r - row number.
align - alignment flag, pass -1 to clear the setting.

setColAlignment

public void setColAlignment(int c,
                            int align)
Set the col cell alignment.

Parameters:
c - col number.
align - alignment flag, pass -1 to clear the setting.

getFont

public Font getFont(int r,
                    int c)
Return the per row font. Return null to use default font.

Specified by:
getFont in interface TableLens
Overrides:
getFont in class AbstractTableLens
Parameters:
r - row number.
c - column number.
Returns:
font for the specified row.

setFont

public void setFont(int r,
                    int c,
                    Font font)
Set the font for the cell.

Parameters:
r - row number.
c - column number.
font - row font.

setFont

public void setFont(Font font)
Set the default font for the table.

Parameters:
font - table font.

setRowFont

public void setRowFont(int r,
                       Font font)
Set the font for the row.

Parameters:
r - row number.
font - row font.

setColFont

public void setColFont(int c,
                       Font font)
Set the font for the col.

Parameters:
c - col number.
font - col font.

isLineWrap

public boolean isLineWrap(int r,
                          int c)
Return the per cell line wrap mode. If the line wrap mode is true, lines are wrapped when the text can not fit on one line. Otherwise the wrapping is never done and any overflow text will be truncated.

Specified by:
isLineWrap in interface TableLens
Overrides:
isLineWrap in class AbstractTableLens
Parameters:
r - row number.
c - column number.
Returns:
true if line wrapping should be done.

setLineWrap

public void setLineWrap(boolean wrap)
Set the table line wrap setting.

Parameters:
wrap - true to allow lines to wrap.

setLineWrap

public void setLineWrap(int r,
                        int c,
                        boolean wrap)
Set the line wrap for the cell.

Parameters:
r - row number.
c - column number.
wrap - row wrap.

setRowLineWrap

public void setRowLineWrap(int r,
                           boolean wrap)
Set the line wrap for the row.

Parameters:
r - row number.
wrap - row wrap.

setColLineWrap

public void setColLineWrap(int c,
                           boolean wrap)
Set the line wrap for the col.

Parameters:
c - col number.
wrap - col wrap.

setColSuppressIfZero

public void setColSuppressIfZero(int c,
                                 boolean zero)
Set the line wrap for the col.

Parameters:
c - col number.
zero - col suppress if zero.

isColSuppressIfZero

public boolean isColSuppressIfZero(int c)
Return the per col suppress if zero.

Parameters:
c - column number.
Returns:
true if col suppress if zero.

isSuppressIfZero

public boolean isSuppressIfZero(int r,
                                int c)
Return the per cell suppress if zero mode.

Parameters:
r - row number
c - column number
Returns:
true when suppress if zero should be done

setColSuppressIfDuplicate

public void setColSuppressIfDuplicate(int c,
                                      boolean dup)
Set the line wrap for the col.

Parameters:
c - col number.
dup - col suppress if duplicate.

isColSuppressIfDuplicate

public boolean isColSuppressIfDuplicate(int c)
Return the per col suppress if duplicate.

Parameters:
c - column number.
Returns:
true if col suppress if duplicate.

isSuppressIfDuplicate

public boolean isSuppressIfDuplicate(int r,
                                     int c)
Return the per cell suppress if duplicate mode.

Parameters:
r - row number
c - column number
Returns:
true when suppress if duplicate should be done

getForeground

public Color getForeground(int r,
                           int c)
Return the foreground color for the specified row. Return null to use default color.

Specified by:
getForeground in interface TableLens
Overrides:
getForeground in class AbstractTableLens
Parameters:
r - row number.
c - col number.
Returns:
foreground color for the specified row.

setForeground

public void setForeground(int r,
                          int c,
                          Color color)
Set the foreground color for the specified cell.

Parameters:
r - row number.
c - column number.
color - foreground color.

setRowForeground

public void setRowForeground(int r,
                             Color color)
Set the foreground color for the specified row.

Parameters:
r - row number.
color - foreground color.

setColForeground

public void setColForeground(int c,
                             Color color)
Set the foreground color for the specified col.

Parameters:
c - col number.
color - foreground color.

getBackground

public Color getBackground(int r,
                           int c)
Return the background color for the specified row. Return null to use default color.

Specified by:
getBackground in interface TableLens
Overrides:
getBackground in class AbstractTableLens
Parameters:
r - row number.
c - col number.
Returns:
background color for the specified row.

setBackground

public void setBackground(int r,
                          int c,
                          Color color)
Set the background color for the specified cell.

Parameters:
r - row number.
c - column number.
color - background color.

setRowBackground

public void setRowBackground(int r,
                             Color color)
Set the background color for the specified row.

Parameters:
r - row number.
color - background color.

setColBackground

public void setColBackground(int c,
                             Color color)
Set the background color for the specified col.

Parameters:
c - col number.
color - background color.

getPresenter

public Presenter getPresenter(int row,
                              int col)
Get the presenter for the specified cell.

Parameters:
row - row number
col - column number.
Returns:
presenter for this cell.

getPresenter

public Presenter getPresenter(int col)
Get the presenter for the specified column.

Parameters:
col - column cell presenter.
Returns:
presenter for this column.

getPresenter

public Presenter getPresenter(String header)
Get the presenter for the specified column.

Parameters:
header - name of the cell presenter.
Returns:
presenter for this column.

setPresenter

public void setPresenter(String header,
                         Presenter p)
Set the presenter for the specified column. The column is identified by the header. If the header does not exist in the table, a NoSuchElementException is thrown.

Parameters:
header - column header.
p - presenter.

setPresenter

public void setPresenter(int r,
                         int c,
                         Presenter presenter)
Set the presenter for the specified cell.

Parameters:
r - row number.
c - column number.
presenter - cell presenter.

setPresenter

public void setPresenter(int col,
                         Presenter p)
Set the presenter for the specified column. The Presenter is used by all cells in the column for printing.

Parameters:
col - column number.
p - presenter.

setRowPresenter

public void setRowPresenter(int row,
                            Presenter p)
Set the presenter for the specified row. The Presenter is used by all cells in the row for printing. This override the presenter setting for the columns.

Parameters:
row - row number.
p - presenter.

getFormat

public Format getFormat(int row,
                        int col)
Get the format for the specified cell.

Parameters:
row - row number.
col - column number.
Returns:
column format.

getFormat

public Format getFormat(int row,
                        int col,
                        boolean cellOnly)
Get the format for the specified cell.

Parameters:
row - row number.
col - column number.
Returns:
column format.

getCellFormat

public Format getCellFormat(int row,
                            int col)
Get the format defined in this table lens.


getCellFormat

public Format getCellFormat(int row,
                            int col,
                            boolean cellOnly)
Get the format defined in this table lens.


getFormat

public Format getFormat(int col)
Get the format associated with the column.

Parameters:
col - column number.
Returns:
column format.

getRowFormat

public Format getRowFormat(int row)
Get the format associated with a row.

Parameters:
row - row index.
Returns:
row format.

setFormat

public void setFormat(int r,
                      int c,
                      Format format)
Set the format for the specified cell.

Parameters:
r - row number.
c - column number.
format - cell format.

setFormat

public void setFormat(String header,
                      Format p)
Set the format for the specified column. The column is identified by the header. If the header does not exist in the table, a NoSuchElementException is thrown. call is quitely ignored.

Parameters:
header - column header.
p - format.

setFormat

public void setFormat(int col,
                      Format p)
Set the format for the specified column. The format is used to convert the cell objects to their string representation for printing.

Parameters:
col - column number.
p - format.

setRowFormat

public void setRowFormat(int row,
                         Format p)
Set the format for the specified column. The format is used to convert the cell objects to their string representation for printing.

Parameters:
row - row number.
p - format.

findColumn

public int findColumn(String header)
Find the column with the specified header.

Returns:
column index or -1 if not found.

setHyperlink

public void setHyperlink(int r,
                         int c,
                         Hyperlink.Ref link)
Set the hyperlink for the specified cell.

Parameters:
r - row number.
c - column number.
link - the specified hyperlink.

containsLink

public boolean containsLink()
Check if contains hyperlink definitation.


getHyperlink

public Hyperlink.Ref getHyperlink(int r,
                                  int c)
Get hyperlink of a table cell.

Parameters:
r - the specified row
c - the specified col

clone

public Object clone()
Make a copy of this table. The table data is shared and the attributes are not copied. This only works to make a copy of the data and share the data to avoid keeping data in two places. If any attributes are changed, they are lost and need to be applied on the new copy.

Overrides:
clone in class AbstractTableLens
Returns:
the cloned AbstractTableLens if successful, null otherwise

cloneAttributes

public void cloneAttributes(AttributeTableLens attr)
Make copy of the attributes to a new attribute table lens.


dispose

public void dispose()
Dispose the table to clear up temporary resources.

Specified by:
dispose in interface XTable
Overrides:
dispose in class AbstractTableLens

getColumnIdentifier

public String getColumnIdentifier(int col)
Get the column identifier of a column.

Specified by:
getColumnIdentifier in interface XTable
Overrides:
getColumnIdentifier in class AbstractTableLens
Parameters:
col - the specified column index.
Returns:
the column indentifier of the column. The identifier might be different from the column name, for it may contain more locating information than the column name.

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.