EspressReport 6.6

quadbase.util
Interface ITable


public interface ITable

This table feature allows users to optionally display the data used to plot the chart. If there are too many data points in the chart, the table will skip some data points, depending on how much space is available and the position of the table.

The most efficient way to set the table properties is to call setVisible(true) after all other ITable methods. This reduces the number of canvas resizing, and thus the performance is better.

Scatter, Bubble, and Surface chart does not support table

A handle to an object that implements this interface can be obtained by calling the gethTable method defined in QbChart.

eg. QbChart chart = new QbChart(...);
ITable table = chart.gethTable();

See Also:
QbChart

Method Summary
 java.awt.Color getCellBackgroundColor()
          This method returns the table cell background color
 java.awt.Font getCellFont()
          This method returns table cell font
 java.awt.Color getCellTextColor()
          This method returns the table cell text color
 int getColumnCount()
          This method counts number of columns
 int getColumnWidth(int columnIndex)
          This method returns the width of the column
 short getContentTitleAlignment()
          This method gets content title alignment
 short getContentValueAlignment()
          This method gets content value alignment
 java.awt.Color getHeaderBackgroundColor()
          This method returns the table header background color
 java.awt.Font getHeaderFont()
          This method returns the table header font
 java.awt.Color getHeaderTextColor()
          This method returns the table header text color
 short getHeaderTitleAlignment()
          This method gets header title alignment
 short getHeaderValueAlignment()
          This method gets header value alignment
 int getRelativePosition()
          This method returns the relative position of the table to the chart
 short getSecondaryTitleAlignment()
          This method gets secondary title alignment
 short getSecondaryValueAlignment()
          This method gets secondary value alignment
 int getTableHeight()
          This method returns the hight of the table
 java.awt.Point getTablePosition()
          This method returns the current table position in pixels
 int getTableWidth()
          This method returns the width of the table
 boolean getTranspose()
          This method returns whether the position of column header and the position of row header is interchanged.
 boolean hasTabPanel()
          This method returns whether there is tab panel for data series
 boolean isSecondaryDataShownInPrimaryTab()
          This method returns whether the secondary data is shown in primary tab
 boolean isTableDrawn()
          Deprecated. The table is always drawn when it is set to visible.
 boolean isVisible()
          This method returns whether the table is visible or not
 void moveTable(int x, int y)
          This method moves the table to a location
 void refreshTable()
          Deprecated. The table is refreshed when the chart is refreshed. Programmers should not call this method.
 void setCellBackgroundColor(java.awt.Color cellColor)
          This method sets the table cell background color
 void setCellFont(java.awt.Font cellFont)
          This method sets the table cell font
 void setCellTextColor(java.awt.Color cellTextColor)
          This method sets the table cell text color
 void setColumnWidth(int columnIndex, int width)
          This method set the width of the column
 void setContentTitleAlignment(short alignment)
          This method sets content title alignment
 void setContentValueAlignment(short alignment)
          This method sets content value alignment
 void setHeaderBackgroundColor(java.awt.Color headerColor)
          This method sets the table header background color
 void setHeaderFont(java.awt.Font headerFont)
          This method sets the table header font
 void setHeaderTextColor(java.awt.Color headerTextColor)
          This method sets the table header text color
 void setHeaderTitleAlignment(short alignment)
          This method sets header title alignment
 void setHeaderValueAlignment(short alignment)
          This method sets header value alignment
 void setPosition(Position position)
          This method sets the table position.
 void setRelativePosition(int direction)
          This method sets the table position to either below or on the right hand side of the chart.
 void setSecondaryDataShownInPrimaryTab(boolean showData)
          This method sets whether the secondary data is shown in primary tab
 void setSecondaryTitleAlignment(short alignment)
          This method sets secondary title alignment
 void setSecondaryValueAlignment(short alignment)
          This method sets secondary value alignment
 void setTableDrawn(boolean drawn)
          Deprecated. The table is always drawn when it is set to visible
 void setTableWidth(int width)
          This method set the width of the table
 void setTranspose(boolean doTranspose)
          This method sets whether the position of column header and the position of the row header is interchanged
 void setVisible(boolean state)
          This method sets whether to display the table.
 void update()
          Deprecated. The table is updated after each method call. Programmers should not call this method.
 

Method Detail

update

@Deprecated
void update()
Deprecated. The table is updated after each method call. Programmers should not call this method.

This method updates the table, paint chart at the same time


setVisible

void setVisible(boolean state)
This method sets whether to display the table. If the state is changed, the size of the canvas is automatically adjusted in order to get the table displayed probably.

If the relative position is QbChart.DOWN, the table height is added to the canvas height when the state is changed from false to true. Similarly, If the relative position is QbChart.RIGHT, the table width is added to the canvas width. The additional space is taken out from the canvas when the state is change from true to false.

The most efficient way to set the table properties is to call setVisible(true) after all other ITable methods. This reduces the number of canvas resizing, and thus improves the performance.

You also need to draw the chart in the background first before setting the table's visibility to be true. You can draw the chart in the background. You can draw the chart in the background using the following lines of code :

        QbChart chart = new QbChart(..........);
        Frame f = new Frame();
        f.addNotify();
        chart.draw(f.getGraphics(), f, width, height);  // where width and height are in pixels
        chart.gethTable().setVisible(true);
        f.removeNotify();
 

Parameters:
state - The state
See Also:
setRelativePosition(int)

isVisible

boolean isVisible()
This method returns whether the table is visible or not

Returns:
The state of the table

setPosition

void setPosition(Position position)
This method sets the table position. Note that x and y values in the position object should be between 0 and 1

Parameters:
position - Position of the table

moveTable

void moveTable(int x,
               int y)
This method moves the table to a location

Parameters:
x - x coordinate in pixels
y - y coordinate in pixels

refreshTable

@Deprecated
void refreshTable()
Deprecated. The table is refreshed when the chart is refreshed. Programmers should not call this method.

This method refreshes the table


setTranspose

void setTranspose(boolean doTranspose)
This method sets whether the position of column header and the position of the row header is interchanged

Parameters:
doTranspose - The new state

getTranspose

boolean getTranspose()
This method returns whether the position of column header and the position of row header is interchanged.

Returns:
The state of the table.

setSecondaryDataShownInPrimaryTab

void setSecondaryDataShownInPrimaryTab(boolean showData)
This method sets whether the secondary data is shown in primary tab

Parameters:
showData - The new state

isSecondaryDataShownInPrimaryTab

boolean isSecondaryDataShownInPrimaryTab()
This method returns whether the secondary data is shown in primary tab

Returns:
The state of the table.

setHeaderTitleAlignment

void setHeaderTitleAlignment(short alignment)
This method sets header title alignment

Parameters:
alignment - , either QbChart.LEFTALIGNMENT, QbChart.CENTERALIGNMENT or QbChart.RIGHTALIGNMENT

getHeaderTitleAlignment

short getHeaderTitleAlignment()
This method gets header title alignment


setHeaderValueAlignment

void setHeaderValueAlignment(short alignment)
This method sets header value alignment

Parameters:
alignment - either QbChart.LEFTALIGNMENT, QbChart.CENTERALIGNMENT or QbChart.RIGHTALIGNMENT

getHeaderValueAlignment

short getHeaderValueAlignment()
This method gets header value alignment


setContentTitleAlignment

void setContentTitleAlignment(short alignment)
This method sets content title alignment

Parameters:
alignment - , wither QbChart.LEFTALIGNMENT, QbChart.CENTERALIGNMENT or QbChart.RIGHTALIGNMENT

getContentTitleAlignment

short getContentTitleAlignment()
This method gets content title alignment


setContentValueAlignment

void setContentValueAlignment(short alignment)
This method sets content value alignment

Parameters:
alignment - , either QbChart.LEFTALIGNMENT, QbChart.CENTERALIGNMENT or QbChart.RIGHTALIGNMENT

getContentValueAlignment

short getContentValueAlignment()
This method gets content value alignment


setSecondaryTitleAlignment

void setSecondaryTitleAlignment(short alignment)
This method sets secondary title alignment

Parameters:
alignment - , either QbChart.LEFTALIGNMENT, QbChart.CENTERALIGNMENT or QbChart.RIGHTALIGNMENT

getSecondaryTitleAlignment

short getSecondaryTitleAlignment()
This method gets secondary title alignment


setSecondaryValueAlignment

void setSecondaryValueAlignment(short alignment)
This method sets secondary value alignment

Parameters:
alignment - , either QbChart.LEFTALIGNMENT, QbChart.CENTERALIGNMENT or QbChart.RIGHTALIGNMENT

getSecondaryValueAlignment

short getSecondaryValueAlignment()
This method gets secondary value alignment


setRelativePosition

void setRelativePosition(int direction)
This method sets the table position to either below or on the right hand side of the chart.

Parameters:
direction - The relative position, either QbChart.DOWN or QbChart.RIGHT

getRelativePosition

int getRelativePosition()
This method returns the relative position of the table to the chart

Returns:
The relative position, either QbChart.DOWN or QbChart.RIGHT

getTablePosition

java.awt.Point getTablePosition()
This method returns the current table position in pixels

Returns:
The position in pixels

getColumnCount

int getColumnCount()
This method counts number of columns

Returns:
number of columns

getTableWidth

int getTableWidth()
This method returns the width of the table

Returns:
The width in pixels

setTableWidth

void setTableWidth(int width)
This method set the width of the table

Parameters:
width - The width in pixels

getColumnWidth

int getColumnWidth(int columnIndex)
This method returns the width of the column

Parameters:
columnIndex - The index of the column, beginning with 0
Returns:
The width in pixels

setColumnWidth

void setColumnWidth(int columnIndex,
                    int width)
This method set the width of the column

Parameters:
columnIndex - The index of the column, beginning with 0
width - The width in pixels

getTableHeight

int getTableHeight()
This method returns the hight of the table

Returns:
The height in pixels

isTableDrawn

@Deprecated
boolean isTableDrawn()
Deprecated. The table is always drawn when it is set to visible.

This method returns whether the table has been drawn

Returns:
The state
See Also:
isVisible()

setTableDrawn

@Deprecated
void setTableDrawn(boolean drawn)
Deprecated. The table is always drawn when it is set to visible

This method sets table to be undrawn, clear the table structure

Parameters:
drawn - The new state
See Also:
setVisible(boolean)

hasTabPanel

boolean hasTabPanel()
This method returns whether there is tab panel for data series

Returns:
true if there is tab panel, else return false

setHeaderBackgroundColor

void setHeaderBackgroundColor(java.awt.Color headerColor)
This method sets the table header background color

Parameters:
headerColor - table header background color

getHeaderBackgroundColor

java.awt.Color getHeaderBackgroundColor()
This method returns the table header background color

Returns:
header background color

setCellBackgroundColor

void setCellBackgroundColor(java.awt.Color cellColor)
This method sets the table cell background color

Parameters:
cellColor - table cell background color

getCellBackgroundColor

java.awt.Color getCellBackgroundColor()
This method returns the table cell background color

Returns:
cell background color

setHeaderTextColor

void setHeaderTextColor(java.awt.Color headerTextColor)
This method sets the table header text color

Parameters:
headerTextColor - table header text color

getHeaderTextColor

java.awt.Color getHeaderTextColor()
This method returns the table header text color

Returns:
header text color

setCellTextColor

void setCellTextColor(java.awt.Color cellTextColor)
This method sets the table cell text color

Parameters:
cellTextColor - table cell text color

getCellTextColor

java.awt.Color getCellTextColor()
This method returns the table cell text color

Returns:
cell text color

setHeaderFont

void setHeaderFont(java.awt.Font headerFont)
This method sets the table header font

Parameters:
headerFont - table header font

getHeaderFont

java.awt.Font getHeaderFont()
This method returns the table header font

Returns:
header font

setCellFont

void setCellFont(java.awt.Font cellFont)
This method sets the table cell font

Parameters:
cellFont - table cell font

getCellFont

java.awt.Font getCellFont()
This method returns table cell font

Returns:
cell font

EspressReport 6.6