Style Intelligence v12.0

inetsoft.report
Class LayoutTool

java.lang.Object
  extended by inetsoft.report.LayoutTool

public class LayoutTool
extends Object

Utilities API for change table layout.


Nested Class Summary
static class LayoutTool.CrosstabOperation
          Enumeration of the binding operations on a crosstab table.
static class LayoutTool.CrosstabRegion
          Enumeration of the binding regions in a crosstab table.
static class LayoutTool.CrosstabTarget
          Data structure that encapsulates information about the drag source or drop target corresponding to a cell of a crosstab table.
static class LayoutTool.FormulaStorage
          Aggregate formula parse result storage.
 
Field Summary
static int BORDER_ALL
          Flag indicating that all borders should be drawn.
static int BORDER_BOTTOM
          Flag indicating that the bottom border should be drawn.
static int BORDER_LEFT
          Flag indicating that the left border should be drawn.
static int BORDER_RIGHT
          Flag indicating that the right border should be drawn.
static int BORDER_TOP
          Flag indicating that the top border should be drawn.
protected static Map DATEOPT
           
protected static int DETAIL
           
protected static int FOOTER
           
protected static int G_FOOTER
           
protected static int G_HEADER
           
protected static int HEADER
           
 
Constructor Summary
LayoutTool()
           
 
Method Summary
protected static void addLayoutRegion(int start, int end, TableLens lens, TableLayout layout)
          Add layout Region.
static XNode buildTree(TableLayout layout)
          Create tree node for the layout, return a root node, which contains two child nodes, one for row group, one for column group.
static boolean checkSource(inetsoft.uql.util.XSourceInfo source, TableCellBinding cell)
          Check srouce attr.
static String createAggExpression(CalcGroup[] gfields, String[] cellnames, int level, CalcAggregate afield, String var, int position, TableCellBinding cell)
          Create aggregate expression for calc.
static CalcAggregate createAggregateField(TableCellBinding cell, FormulaTable table)
          Create a AggregateField that matches the cellbinding.
protected static TableCellBinding createCellBinding(int type, int stype, String value)
          Create cell binding.
protected static TableCellBinding createCellBinding(int stype, String value)
          Create cell binding.
protected static void createCorsstabCellBinding(TableLens lens, TableLayout layout, boolean isReport)
          Create crosstab cell binding.
static String createCrossAggExpression(CalcGroup[] rgfs, String[] rnames, int ridx, CalcGroup[] cgfs, String[] cnames, int cidx, CalcAggregate afield, int perBy, boolean topn)
          Create aggregate expression.
static void createDataPathMapping(TableLayout layout, TableLens lens)
          Create data path mapping.
static String createDetailExpression(CalcGroup[] fields, String[] cellnames, DataRef field, String var)
           
static DataRef createDetailField(TableCellBinding cell, FormulaTable table)
          Create detail field match the cell.
protected static String createGroupCond(CalcGroup[] gfields, String[] cellnames, int start, int end, boolean subtopn)
          Create group condition.
protected static String createGroupCond(CalcGroup[] gfields, String[] cellnames, int start, int end, CalcGroup[] topnfields, String[] topnnames, boolean subtopn)
           
static String createGroupExpression(CalcGroup[] fields, String[] cellnames, int idx, CalcAggregate[] aggrs, String var)
          Create group expression for calc.
protected static String createGroupExpression(CalcGroup[] fields, String[] cellnames, int idx, CalcAggregate[] aggrs, String var, inetsoft.report.internal.binding.JoinInfo info, inetsoft.uql.util.XSourceInfo source, TableCellBinding cell, List list, FormulaTable table, List locs, Point point)
          Create group expression for calc.
protected static CalcGroup createGroupField(TableCellBinding gcell, FormulaTable table)
          Create a GroupField that matches the cellbinding.
protected static void fillCalcTableLens(FormulaTable table)
          Convert the table layout setting ro calc table lens.
protected static void fillCalcTableLens(FormulaTable table, VariableTable vars, boolean crossTabSupported)
           
static int findDupCount(DataRef[] fields, DataRef cfield, int lvl)
          Find a field dup times.
static int findFieldIndex(DataRef[] groups, String name)
          Find group index.
protected static boolean findSource(inetsoft.report.internal.binding.SourceAttr source, inetsoft.report.internal.binding.JoinInfo info)
          Find the source attr in common dimension infos.
static inetsoft.report.internal.binding.SourceAttr findSource(TableCellBinding cell, inetsoft.report.internal.binding.SourceAttr source)
          Find the cell binding source attr.
protected static void formatCrossSymbol(CalcGroup[] grps, CalcAggregate[] sums, TableLayout layout, TableLens lens)
          Format cross table symbol, for example, expansion, group or aggregate.
protected static int getBindingType(TableDataPath rpath, TableDataPath cpath)
          Get the cell path for crosstab cross the row path and column path.
protected static int getBType(BaseLayout.Region region)
          Get table cell binding structure type.
static CalcAggregate[] getCalcAggregateFields(FormulaTable table)
          Get all Aggregate fields from a calc table
static inetsoft.report.internal.binding.JoinInfo getCommonDimension(TableCellBinding cell, inetsoft.report.internal.binding.SourceAttr source)
           
protected static String getExpressionVar(TableCellBinding cell, inetsoft.uql.util.XSourceInfo source)
           
protected static String getInterval(inetsoft.report.internal.binding.OrderInfo info)
          Get interval option.
static int getRowCount(BaseLayout.Region[] regions)
          Count regions row count.
static int getRowCount(BaseLayout.Region[] regions, boolean ignoreInvisible)
          Count regions row count.
protected static List getTableCellBindings(FormulaTable table, int btype)
          Get all Detail fields from a calc table
static List getTableCellBindings(TableLayout layout, int btype)
          Get all Detail fields from a calc table
static String guessPreferName(DataRef[] fields, DataRef cfield, int lvl)
          Guess a preferred name.
static boolean hasScriptBinding(TableLayout layout)
          Check if the layout contains script binding.
protected static boolean isDate(CalcGroup group)
          Check is date group.
static boolean isSimpleNamedGroup(inetsoft.uql.util.XNamedGroupInfo info)
          Create named group mapping array spec for mapList().
protected static LayoutTool.FormulaStorage parseFormula(CalcAggregate afield)
          Parse formula expression.
static LayoutTool.FormulaStorage parseFormula(String formula)
           
protected static String trimFormula(CalcAggregate agg)
          Get the aggregate name without formula.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATEOPT

protected static Map DATEOPT

HEADER

protected static final int HEADER
See Also:
Constant Field Values

G_HEADER

protected static final int G_HEADER
See Also:
Constant Field Values

DETAIL

protected static final int DETAIL
See Also:
Constant Field Values

G_FOOTER

protected static final int G_FOOTER
See Also:
Constant Field Values

FOOTER

protected static final int FOOTER
See Also:
Constant Field Values

BORDER_TOP

public static final int BORDER_TOP
Flag indicating that the top border should be drawn.

See Also:
Constant Field Values

BORDER_BOTTOM

public static final int BORDER_BOTTOM
Flag indicating that the bottom border should be drawn.

See Also:
Constant Field Values

BORDER_LEFT

public static final int BORDER_LEFT
Flag indicating that the left border should be drawn.

See Also:
Constant Field Values

BORDER_RIGHT

public static final int BORDER_RIGHT
Flag indicating that the right border should be drawn.

See Also:
Constant Field Values

BORDER_ALL

public static final int BORDER_ALL
Flag indicating that all borders should be drawn.

See Also:
Constant Field Values
Constructor Detail

LayoutTool

public LayoutTool()
Method Detail

hasScriptBinding

public static boolean hasScriptBinding(TableLayout layout)
Check if the layout contains script binding.


createDataPathMapping

public static void createDataPathMapping(TableLayout layout,
                                         TableLens lens)
Create data path mapping.


createGroupExpression

public static String createGroupExpression(CalcGroup[] fields,
                                           String[] cellnames,
                                           int idx,
                                           CalcAggregate[] aggrs,
                                           String var)
Create group expression for calc.


isSimpleNamedGroup

public static boolean isSimpleNamedGroup(inetsoft.uql.util.XNamedGroupInfo info)
Create named group mapping array spec for mapList().


getRowCount

public static int getRowCount(BaseLayout.Region[] regions)
Count regions row count.


getRowCount

public static int getRowCount(BaseLayout.Region[] regions,
                              boolean ignoreInvisible)
Count regions row count.


findSource

public static inetsoft.report.internal.binding.SourceAttr findSource(TableCellBinding cell,
                                                                     inetsoft.report.internal.binding.SourceAttr source)
Find the cell binding source attr.


checkSource

public static boolean checkSource(inetsoft.uql.util.XSourceInfo source,
                                  TableCellBinding cell)
Check srouce attr.


getCommonDimension

public static inetsoft.report.internal.binding.JoinInfo getCommonDimension(TableCellBinding cell,
                                                                           inetsoft.report.internal.binding.SourceAttr source)

createCrossAggExpression

public static String createCrossAggExpression(CalcGroup[] rgfs,
                                              String[] rnames,
                                              int ridx,
                                              CalcGroup[] cgfs,
                                              String[] cnames,
                                              int cidx,
                                              CalcAggregate afield,
                                              int perBy,
                                              boolean topn)
Create aggregate expression.


formatCrossSymbol

protected static void formatCrossSymbol(CalcGroup[] grps,
                                        CalcAggregate[] sums,
                                        TableLayout layout,
                                        TableLens lens)
Format cross table symbol, for example, expansion, group or aggregate.


addLayoutRegion

protected static void addLayoutRegion(int start,
                                      int end,
                                      TableLens lens,
                                      TableLayout layout)
Add layout Region.


createCorsstabCellBinding

protected static void createCorsstabCellBinding(TableLens lens,
                                                TableLayout layout,
                                                boolean isReport)
Create crosstab cell binding.


findFieldIndex

public static int findFieldIndex(DataRef[] groups,
                                 String name)
Find group index.


guessPreferName

public static String guessPreferName(DataRef[] fields,
                                     DataRef cfield,
                                     int lvl)
Guess a preferred name.


findDupCount

public static int findDupCount(DataRef[] fields,
                               DataRef cfield,
                               int lvl)
Find a field dup times.


findSource

protected static boolean findSource(inetsoft.report.internal.binding.SourceAttr source,
                                    inetsoft.report.internal.binding.JoinInfo info)
Find the source attr in common dimension infos.


getTableCellBindings

public static List getTableCellBindings(TableLayout layout,
                                        int btype)
Get all Detail fields from a calc table

Parameters:
btype - the TableCellBinding type to filter by

getTableCellBindings

protected static List getTableCellBindings(FormulaTable table,
                                           int btype)
Get all Detail fields from a calc table

Parameters:
btype - the TableCellBinding type to filter by

createDetailField

public static DataRef createDetailField(TableCellBinding cell,
                                        FormulaTable table)
Create detail field match the cell.


createAggregateField

public static CalcAggregate createAggregateField(TableCellBinding cell,
                                                 FormulaTable table)
Create a AggregateField that matches the cellbinding.


fillCalcTableLens

protected static void fillCalcTableLens(FormulaTable table)
Convert the table layout setting ro calc table lens.


fillCalcTableLens

protected static void fillCalcTableLens(FormulaTable table,
                                        VariableTable vars,
                                        boolean crossTabSupported)

buildTree

public static XNode buildTree(TableLayout layout)
Create tree node for the layout, return a root node, which contains two child nodes, one for row group, one for column group.


createAggExpression

public static String createAggExpression(CalcGroup[] gfields,
                                         String[] cellnames,
                                         int level,
                                         CalcAggregate afield,
                                         String var,
                                         int position,
                                         TableCellBinding cell)
Create aggregate expression for calc.


getBindingType

protected static int getBindingType(TableDataPath rpath,
                                    TableDataPath cpath)
Get the cell path for crosstab cross the row path and column path.


createCellBinding

protected static TableCellBinding createCellBinding(int stype,
                                                    String value)
Create cell binding.


createCellBinding

protected static TableCellBinding createCellBinding(int type,
                                                    int stype,
                                                    String value)
Create cell binding.


parseFormula

protected static LayoutTool.FormulaStorage parseFormula(CalcAggregate afield)
Parse formula expression.


parseFormula

public static LayoutTool.FormulaStorage parseFormula(String formula)

getInterval

protected static String getInterval(inetsoft.report.internal.binding.OrderInfo info)
Get interval option.


createGroupCond

protected static String createGroupCond(CalcGroup[] gfields,
                                        String[] cellnames,
                                        int start,
                                        int end,
                                        boolean subtopn)
Create group condition.


createGroupCond

protected static String createGroupCond(CalcGroup[] gfields,
                                        String[] cellnames,
                                        int start,
                                        int end,
                                        CalcGroup[] topnfields,
                                        String[] topnnames,
                                        boolean subtopn)

createGroupExpression

protected static String createGroupExpression(CalcGroup[] fields,
                                              String[] cellnames,
                                              int idx,
                                              CalcAggregate[] aggrs,
                                              String var,
                                              inetsoft.report.internal.binding.JoinInfo info,
                                              inetsoft.uql.util.XSourceInfo source,
                                              TableCellBinding cell,
                                              List list,
                                              FormulaTable table,
                                              List locs,
                                              Point point)
Create group expression for calc.


isDate

protected static boolean isDate(CalcGroup group)
Check is date group.


getExpressionVar

protected static String getExpressionVar(TableCellBinding cell,
                                         inetsoft.uql.util.XSourceInfo source)

getBType

protected static int getBType(BaseLayout.Region region)
Get table cell binding structure type.


createDetailExpression

public static String createDetailExpression(CalcGroup[] fields,
                                            String[] cellnames,
                                            DataRef field,
                                            String var)

createGroupField

protected static CalcGroup createGroupField(TableCellBinding gcell,
                                            FormulaTable table)
Create a GroupField that matches the cellbinding.


getCalcAggregateFields

public static CalcAggregate[] getCalcAggregateFields(FormulaTable table)
Get all Aggregate fields from a calc table


trimFormula

protected static String trimFormula(CalcAggregate agg)
Get the aggregate name without formula.


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