Package 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.

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 Details

    • 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.

      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

      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

      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:
    • 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:
    • 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(Color headerColor)
      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

      void setCellBackgroundColor(Color cellColor)
      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

      void setHeaderTextColor(Color headerTextColor)
      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

      void setCellTextColor(Color cellTextColor)
      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

      void setHeaderFont(Font headerFont)
      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

      void setCellFont(Font cellFont)
      This method sets the table cell font
      Parameters:
      cellFont - table cell font
    • getCellFont

      Font getCellFont()
      This method returns table cell font
      Returns:
      cell font