Interface ITable
table.setVisible(true) should be called before setting other table properties, such as setCellFont or setColumnWidth. If transposition is required, table.setVisible(true) should be called after table.setTranspose(true).
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:
-
Method Summary
Modifier and TypeMethodDescriptionThis method returns the table cell background colorThis method returns table cell fontThis method returns the table cell text colorintThis method counts number of columnsintgetColumnWidth(int columnIndex) This method returns the width of the columnshortThis method gets content title alignmentshortThis method gets content value alignmentThis method returns the table header background colorThis method returns the table header fontThis method returns the table header text colorshortThis method gets header title alignmentshortThis method gets header value alignmentintThis method returns the relative position of the table to the chartshortThis method gets secondary title alignmentshortThis method gets secondary value alignmentintThis method returns the hight of the tableThis method returns the current table position in pixelsintThis method returns the width of the tablebooleanThis method returns whether the position of column header and the position of row header is interchanged.booleanThis method returns whether there is tab panel for data seriesbooleanThis method returns whether the secondary data is shown in primary tabbooleanDeprecated.The table is always drawn when it is set to visible.booleanThis method returns whether the table is visible or notvoidmoveTable(int x, int y) This method moves the table to a locationvoidDeprecated.The table is refreshed when the chart is refreshed.voidsetCellBackgroundColor(Color cellColor) This method sets the table cell background colorvoidsetCellFont(Font cellFont) This method sets the table cell fontvoidsetCellTextColor(Color cellTextColor) This method sets the table cell text colorvoidsetColumnWidth(int columnIndex, int width) This method set the width of the columnvoidsetContentTitleAlignment(short alignment) This method sets content title alignmentvoidsetContentValueAlignment(short alignment) This method sets content value alignmentvoidsetHeaderBackgroundColor(Color headerColor) This method sets the table header background colorvoidsetHeaderFont(Font headerFont) This method sets the table header fontvoidsetHeaderTextColor(Color headerTextColor) This method sets the table header text colorvoidsetHeaderTitleAlignment(short alignment) This method sets header title alignmentvoidsetHeaderValueAlignment(short alignment) This method sets header value alignmentvoidsetPosition(Position position) This method sets the table position.voidsetRelativePosition(int direction) This method sets the table position to either below or on the right hand side of the chart.voidsetSecondaryDataShownInPrimaryTab(boolean showData) This method sets whether the secondary data is shown in primary tabvoidsetSecondaryTitleAlignment(short alignment) This method sets secondary title alignmentvoidsetSecondaryValueAlignment(short alignment) This method sets secondary value alignmentvoidsetTableDrawn(boolean drawn) Deprecated.The table is always drawn when it is set to visiblevoidsetTableWidth(int width) This method set the width of the tablevoidsetTranspose(boolean doTranspose) This method sets whether the position of column header and the position of the row header is interchangedvoidsetVisible(boolean state) This method sets whether to display the table.voidupdate()Deprecated.The table is updated after each method call.
-
Method Details
-
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.
table.setVisible(true) should be called before setting other table properties, such as setCellFont or setColumnWidth. If transposition is required, table.setVisible(true) should be called after table.setTranspose(true).
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:
-
isVisible
boolean isVisible()This method returns whether the table is visible or not- Returns:
- The state of the table
-
setPosition
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 pixelsy- y coordinate in pixels
-
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
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 0width- The width in pixels
-
getTableHeight
int getTableHeight()This method returns the hight of the table- Returns:
- The height in pixels
-
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:
-
setTableDrawn
Deprecated.The table is always drawn when it is set to visibleThis method sets table to be undrawn, clear the table structure- Parameters:
drawn- The new state- See Also:
-
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
This method sets the table header background color- Parameters:
headerColor- table header background color
-
getHeaderBackgroundColor
Color getHeaderBackgroundColor()This method returns the table header background color- Returns:
- header background color
-
setCellBackgroundColor
This method sets the table cell background color- Parameters:
cellColor- table cell background color
-
getCellBackgroundColor
Color getCellBackgroundColor()This method returns the table cell background color- Returns:
- cell background color
-
setHeaderTextColor
This method sets the table header text color- Parameters:
headerTextColor- table header text color
-
getHeaderTextColor
Color getHeaderTextColor()This method returns the table header text color- Returns:
- header text color
-
setCellTextColor
This method sets the table cell text color- Parameters:
cellTextColor- table cell text color
-
getCellTextColor
Color getCellTextColor()This method returns the table cell text color- Returns:
- cell text color
-
setHeaderFont
This method sets the table header font- Parameters:
headerFont- table header font
-
getHeaderFont
Font getHeaderFont()This method returns the table header font- Returns:
- header font
-
setCellFont
This method sets the table cell font- Parameters:
cellFont- table cell font
-
getCellFont
Font getCellFont()This method returns table cell font- Returns:
- cell font
-