public interface ITable
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();
QbChart
Modifier and Type | Method and Description |
---|---|
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.
|
@Deprecated void update()
void setVisible(boolean state)
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();
state
- The statesetRelativePosition(int)
boolean isVisible()
void setPosition(Position position)
position
- Position of the tablevoid moveTable(int x, int y)
x
- x coordinate in pixelsy
- y coordinate in pixels@Deprecated void refreshTable()
void setTranspose(boolean doTranspose)
doTranspose
- The new stateboolean getTranspose()
void setSecondaryDataShownInPrimaryTab(boolean showData)
showData
- The new stateboolean isSecondaryDataShownInPrimaryTab()
void setHeaderTitleAlignment(short alignment)
alignment
- , either QbChart.LEFTALIGNMENT, QbChart.CENTERALIGNMENT or QbChart.RIGHTALIGNMENTshort getHeaderTitleAlignment()
void setHeaderValueAlignment(short alignment)
alignment
- either QbChart.LEFTALIGNMENT, QbChart.CENTERALIGNMENT or QbChart.RIGHTALIGNMENTshort getHeaderValueAlignment()
void setContentTitleAlignment(short alignment)
alignment
- , wither QbChart.LEFTALIGNMENT, QbChart.CENTERALIGNMENT or QbChart.RIGHTALIGNMENTshort getContentTitleAlignment()
void setContentValueAlignment(short alignment)
alignment
- , either QbChart.LEFTALIGNMENT, QbChart.CENTERALIGNMENT or QbChart.RIGHTALIGNMENTshort getContentValueAlignment()
void setSecondaryTitleAlignment(short alignment)
alignment
- , either QbChart.LEFTALIGNMENT, QbChart.CENTERALIGNMENT or QbChart.RIGHTALIGNMENTshort getSecondaryTitleAlignment()
void setSecondaryValueAlignment(short alignment)
alignment
- , either QbChart.LEFTALIGNMENT, QbChart.CENTERALIGNMENT or QbChart.RIGHTALIGNMENTshort getSecondaryValueAlignment()
void setRelativePosition(int direction)
direction
- The relative position, either QbChart.DOWN or QbChart.RIGHTint getRelativePosition()
java.awt.Point getTablePosition()
int getColumnCount()
int getTableWidth()
void setTableWidth(int width)
width
- The width in pixelsint getColumnWidth(int columnIndex)
columnIndex
- The index of the column, beginning with 0void setColumnWidth(int columnIndex, int width)
columnIndex
- The index of the column, beginning with 0width
- The width in pixelsint getTableHeight()
@Deprecated boolean isTableDrawn()
isVisible()
@Deprecated void setTableDrawn(boolean drawn)
drawn
- The new statesetVisible(boolean)
boolean hasTabPanel()
void setHeaderBackgroundColor(java.awt.Color headerColor)
headerColor
- table header background colorjava.awt.Color getHeaderBackgroundColor()
void setCellBackgroundColor(java.awt.Color cellColor)
cellColor
- table cell background colorjava.awt.Color getCellBackgroundColor()
void setHeaderTextColor(java.awt.Color headerTextColor)
headerTextColor
- table header text colorjava.awt.Color getHeaderTextColor()
void setCellTextColor(java.awt.Color cellTextColor)
cellTextColor
- table cell text colorjava.awt.Color getCellTextColor()
void setHeaderFont(java.awt.Font headerFont)
headerFont
- table header fontjava.awt.Font getHeaderFont()
void setCellFont(java.awt.Font cellFont)
cellFont
- table cell fontjava.awt.Font getCellFont()