Style Intelligence v12.0

inetsoft.report
Class TableLayout

java.lang.Object
  extended by inetsoft.report.BaseLayout
      extended by inetsoft.report.TableLayout
All Implemented Interfaces:
GroupableLayout, inetsoft.util.XMLSerializable, Serializable, Cloneable

public class TableLayout
extends BaseLayout
implements GroupableLayout

TableLayout, the data structure to manage design time table's layout, when execute table lens, table layout engine will convert the design time table layout to runtime table layout which contains normal layout, calc layout and null layout.

See Also:
Serialized Form

Nested Class Summary
static class TableLayout.RegionIndex
          Data structure to hold a region and index within the region.
static class TableLayout.TableCellBindingInfo
          CellBinding info.
 class TableLayout.VRegion
          Defines a region of cols.
 
Nested classes/interfaces inherited from class inetsoft.report.BaseLayout
BaseLayout.Region
 
Field Summary
static int CALC
          Calc table mode.
static int CROSSTAB
          Crosstab table mode.
static int DEFAULT_MODE
          Regular calc table edit mode.
static int FORMULA_MODE
          Calc table mode that shows full formula string.
static int NAME_MODE
          Calc table mode that shows cell names and groups.
static int NORMAL
          Normal table mode.
static int PLAIN
          Plain table mode.
 
Fields inherited from class inetsoft.report.BaseLayout
ncol, regions, spans
 
Constructor Summary
TableLayout()
           
 
Method Summary
 void addVRegion(TableDataPath path, BaseLayout.Region vregion)
          Add vertical region.
 Object clone()
          Make a copy of the layout.
protected  CellBinding createCellBinding()
          Create cell binding.
 boolean equals(Object obj)
          Check if equals another object.
 TableDataPath fixPathForRegion(TableDataPath path)
          Fix the table data path for region data path.
 Enumeration getAllVariables()
          Get all variables.
 List getBandInfos()
          Get all bands infomations.
 int getCalcEditMode()
          Get the calc edit mode.
 TableDataPath getCellDataPath(BaseLayout.Region region, int row, int col)
          Get cell data path for a specified region by the region and the row in the region.
 TableDataPath getCellDataPath(int row, int col)
          Get cell data path for a region.
 CellBindingInfo getCellInfo(int gr, int gc)
          Get a cell binding infomation.
 List getCellInfos(boolean all)
          Get cell binding infos.
 String[] getCellNames(boolean runtime)
          Get all cell names.
 TableDataPath getColDataPath(int col)
          Get column data path for a region.
 int getColWidth(int c)
          Get column width.
 TableDataPath getDesigntimePath(TableDataPath rpath)
          Get designtime path by runtime path.
 BaseLayout.Region getGroupRegion(int type, int level)
          Get specified level's group header/footer region.
 int getMode()
          Get mode.
 TableLayout.RegionIndex getRegionIndex(int row)
          Get region index.
 TableLayout.RegionIndex getRegionIndex(TableDataPath path)
          Get region index by table data path.
 BaseLayout.Region[] getRegions(int type)
          Get specified type of regions, such as header, detail and so on.
 TableDataPath getRowDataPath(BaseLayout.Region region, int row)
          Get row data path for a specified region and the row in the region.
 TableDataPath getRowDataPath(int row)
          Get row data path for a region.
 TableDataPath getRuntimePath(TableDataPath dpath)
          Get runtime path by design path.
 BaseLayout.Region getVRegion(int idx)
          Get specified index of vertical region.
 int getVRegionCount()
          Get vertical region count.
 BaseLayout.Region[] getVRegions()
          Get all vregions.
 BaseLayout.Region[] getVRegions(int type)
          Get vregions.
 void insertColumn(int col)
          Insert a column before the specified column.
 boolean isCalc()
          Check if the layout is an identical layout.
 boolean isCrosstab()
          Check if layout is crosstab layout.
 boolean isNormal()
          Check if layout is normal layout.
 boolean isPlain()
          Check if layout is normal layout.
 int locateCol(TableDataPath path)
          Locate col by table data path.
 BaseLayout.Region locateVRegion(TableDataPath path)
          Locate vregion by table data path.
 void parseXML(Element tag)
          Parse xml data into object.
 void removeColumn(int col)
          Remove a column.
 boolean replaceVariables(VariableTable vars)
          Replace variable.
 void setCalcEditMode(int calcEditMode)
          Set the calc edit mode.
 void setColCount(int ncol)
          Set the number of columns in the table layout.
 void setColWidth(int c, int w)
          Set column width.
 void setMode(int mode)
          Set mode.
 void setPathMapping(Map r2dpath, Map d2rpath)
          Set runtime to design time table data path mapping.
 void swapRegion(BaseLayout.Region region1, BaseLayout.Region region2)
          Swap two regions.
 void writeXML(PrintWriter writer)
          Write layout to xml format.
 
Methods inherited from class inetsoft.report.BaseLayout
addRegion, addRegion, clear, convertToGlobalRow, convertToRegionRow, convertToRegionRow, debug, equals, equalsContent, findSpan, getCellBinding, getColCount, getMergedGroup, getRegion, getRegion, getRegionCount, getRegionDataPaths, getRegionPath, getRegions, getRowCount, getRowCount, getRowHeight, getSpan, getVisibleRowCount, hasCrossRegionSpan, insertRow, insertRow, locateRegion, locateRegion, locateRegionIndex, locateRow, parseRegions, parseSpan, removeEmptyRegions, removeRegion, removeRegion, removeRow, removeRow, setCellBinding, setMergedGroup, setRowHeight, setSpan, toString, writeRegions, writeSpan
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NORMAL

public static final int NORMAL
Normal table mode.

See Also:
Constant Field Values

PLAIN

public static final int PLAIN
Plain table mode.

See Also:
Constant Field Values

CROSSTAB

public static final int CROSSTAB
Crosstab table mode.

See Also:
Constant Field Values

CALC

public static final int CALC
Calc table mode.

See Also:
Constant Field Values

DEFAULT_MODE

public static final int DEFAULT_MODE
Regular calc table edit mode.

See Also:
Constant Field Values

NAME_MODE

public static final int NAME_MODE
Calc table mode that shows cell names and groups.

See Also:
Constant Field Values

FORMULA_MODE

public static final int FORMULA_MODE
Calc table mode that shows full formula string.

See Also:
Constant Field Values
Constructor Detail

TableLayout

public TableLayout()
Method Detail

getBandInfos

public List getBandInfos()
Get all bands infomations.

Specified by:
getBandInfos in interface GroupableLayout

getCellInfos

public List getCellInfos(boolean all)
Get cell binding infos.

Specified by:
getCellInfos in interface GroupableLayout
Parameters:
all, - false only return cells which on top-left of span or no span cells.

getCellInfo

public CellBindingInfo getCellInfo(int gr,
                                   int gc)
Get a cell binding infomation.

Parameters:
gr - the row in the layout.
gc - the column int the layout.

swapRegion

public void swapRegion(BaseLayout.Region region1,
                       BaseLayout.Region region2)
Swap two regions.


getRegions

public BaseLayout.Region[] getRegions(int type)
Get specified type of regions, such as header, detail and so on.


getGroupRegion

public BaseLayout.Region getGroupRegion(int type,
                                        int level)
Get specified level's group header/footer region.


getCellNames

public String[] getCellNames(boolean runtime)
Get all cell names.

Parameters:
runtime - true to include runtime cell names (names generated from cell binding if a group is defined).

getVRegions

public BaseLayout.Region[] getVRegions()
Get all vregions.


getVRegions

public BaseLayout.Region[] getVRegions(int type)
Get vregions.


getVRegionCount

public int getVRegionCount()
Get vertical region count.


getVRegion

public BaseLayout.Region getVRegion(int idx)
Get specified index of vertical region.


addVRegion

public void addVRegion(TableDataPath path,
                       BaseLayout.Region vregion)
Add vertical region.


setPathMapping

public void setPathMapping(Map r2dpath,
                           Map d2rpath)
Set runtime to design time table data path mapping.

Parameters:
r2dpath - runtime to designtime path mapping.
d2rpath - designtime to runtime path mapping.

getRuntimePath

public TableDataPath getRuntimePath(TableDataPath dpath)
Get runtime path by design path.

Parameters:
dpath - the designtime path.

getDesigntimePath

public TableDataPath getDesigntimePath(TableDataPath rpath)
Get designtime path by runtime path.

Parameters:
rpath - the runtime path.

setMode

public void setMode(int mode)
Set mode.


getMode

public int getMode()
Get mode.


isCalc

public boolean isCalc()
Check if the layout is an identical layout.


isCrosstab

public boolean isCrosstab()
Check if layout is crosstab layout.


isNormal

public boolean isNormal()
Check if layout is normal layout.


isPlain

public boolean isPlain()
Check if layout is normal layout.


getCalcEditMode

public int getCalcEditMode()
Get the calc edit mode.


setCalcEditMode

public void setCalcEditMode(int calcEditMode)
Set the calc edit mode.


getColWidth

public int getColWidth(int c)
Get column width.


setColWidth

public void setColWidth(int c,
                        int w)
Set column width.


locateCol

public int locateCol(TableDataPath path)
Locate col by table data path.


locateVRegion

public BaseLayout.Region locateVRegion(TableDataPath path)
Locate vregion by table data path.


getRegionIndex

public TableLayout.RegionIndex getRegionIndex(TableDataPath path)
Get region index by table data path.


getRegionIndex

public TableLayout.RegionIndex getRegionIndex(int row)
Get region index.

Parameters:
row - the global row index in table layout.

getRowDataPath

public TableDataPath getRowDataPath(int row)
Get row data path for a region.

Parameters:
row - the global row index in table layout.

getRowDataPath

public TableDataPath getRowDataPath(BaseLayout.Region region,
                                    int row)
Get row data path for a specified region and the row in the region.


getColDataPath

public TableDataPath getColDataPath(int col)
Get column data path for a region.

Parameters:
col - the global column index in table layout.

getCellDataPath

public TableDataPath getCellDataPath(int row,
                                     int col)
Get cell data path for a region.

Parameters:
row - the global row index in table layout.
col - the global column index in table layout.

getCellDataPath

public TableDataPath getCellDataPath(BaseLayout.Region region,
                                     int row,
                                     int col)
Get cell data path for a specified region by the region and the row in the region.


setColCount

public void setColCount(int ncol)
Set the number of columns in the table layout.

Overrides:
setColCount in class BaseLayout

insertColumn

public void insertColumn(int col)
Insert a column before the specified column.

Overrides:
insertColumn in class BaseLayout
Parameters:
col - column index in the layout.

removeColumn

public void removeColumn(int col)
Remove a column.

Overrides:
removeColumn in class BaseLayout
Parameters:
col - column index in the layout.

writeXML

public void writeXML(PrintWriter writer)
Write layout to xml format.

Specified by:
writeXML in interface inetsoft.util.XMLSerializable

parseXML

public void parseXML(Element tag)
              throws Exception
Parse xml data into object.

Specified by:
parseXML in interface inetsoft.util.XMLSerializable
Throws:
Exception

clone

public Object clone()
Make a copy of the layout.

Overrides:
clone in class BaseLayout

equals

public boolean equals(Object obj)
Check if equals another object.

Overrides:
equals in class BaseLayout
Returns:
ture if equals, false otherwise

fixPathForRegion

public TableDataPath fixPathForRegion(TableDataPath path)
Fix the table data path for region data path.

Specified by:
fixPathForRegion in class BaseLayout

replaceVariables

public boolean replaceVariables(VariableTable vars)
Replace variable.


getAllVariables

public Enumeration getAllVariables()
Get all variables.


createCellBinding

protected CellBinding createCellBinding()
Create cell binding.

Overrides:
createCellBinding in class BaseLayout

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