com.objectplanet.gui
Class Table

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended byjava.applet.Applet
                  extended bycom.objectplanet.gui.Table
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class Table
extends java.applet.Applet

This class implements a table component where objects are organized into rows and columns.

The columns can be sized by the user using the mouse. Any column can be sorted either in ascending or descending order by clicking on the column header field.

The table also has a filter bar at the bottom which can be used for searching for rows and filtering columns.

See TableEvent for a list of events generated by the table.

See here for the parameter refence and user guide.

Author:
Bjorn J. Kvande., Philipp A. Kolibaba.
See Also:
Serialized Form

Nested Class Summary
 class Table.TableThread
          This thread handles internal table stuff.
 
Nested classes inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Nested classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int ALIGN_CENTER
          Used to specify a center justified column.
static int ALIGN_LEFT
          Used to specify a left justified column.
static int ALIGN_RIGHT
          Used to specify a right justified column.
static int BOTTOM
          Used to display the filter bar at the bottom of the table.
static int COLUMN_CURRENCY
          Used to specify a currency based column (2).
static int COLUMN_DATE
          Used to specify a date based column (3).
static int COLUMN_IP
          Used to specify a ip address based columns (4).
static int COLUMN_NUMBER
          Used to specify a number based column (1).
static int COLUMN_TEXT
          Used to specify a text based column (0).
protected  java.lang.String dataURL
          The URL the data is loaded from.
protected  int[] displayList
          This array contains the indexes of the rows currently being displayed.
protected  int displayListCount
          The number of rows in the display list.
protected static int EQUAL
          Return equal type from compareRows()
protected  Filter[] filter
          The current filter setup.
protected  java.awt.Rectangle filterViewPort
          The bounds of the filter bar.
protected  java.awt.Rectangle headerViewPort
          The bounds of the header.
protected  java.awt.Rectangle hScrollbarViewPort
          The bounds of the horizontal scrollbar.
protected static int LARGER
          Return larger type from compareRows()
protected static int LESS
          Return less type from compareRows()
protected  boolean loadingData
          This flag is set to true when data is being loaded at initial startup.
protected  int loadingDataDots
          The number of dots after the loading message.
protected  java.awt.Rectangle mouseOverCellViewPort
          The bounds of the cell the mouse is currently over.
protected  double[][] numericalData
          This double array contains all data that is numeric in the table.
protected  java.awt.Rectangle rowViewPort
          The bounds of the view where the rows are displayed.
static int SELECT_MULTIPLE
          Used to set the selection mode to multiple selection.
static int SELECT_NONE
          Used to set the selection mode to no selection.
static int SELECT_SINGLE
          Used to set the selection mode to single selection.
static int SORT_ASCENDING
          Used to sort a column in ascending order.
static int SORT_DESCENDING
          Used to sort a column in descending order.
protected static int SORT_LEXICAL
          Sorts a column's data in lexical order.
protected static int SORT_NUMERICAL
          Sorts a column's data in numerical order.
static int SORT_UNSORTED
          Used to specify a column is not sorted.
protected  int[] sortedList
          This contains all the indexes of the tableData in sorted order.
protected  TableData tableData
          This object contains the rows of the table.
static int TOP
          Used to display the filter bar at the top of the table.
protected static int TOTAL_COUNT
          Used to specify the total row be the count of the rows displayed.
protected static int TOTAL_SUM
          Used to specify the total row be the sum of the values in the column.
protected  java.awt.Rectangle totalRowViewPort
          The bounds of the total row.
protected  java.awt.Rectangle vScrollbarViewPort
          The bounds of the vertical scroll bar.
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Table()
          Creates a table with one column.
Table(int columns)
          Creates a new table with the specified number of columns.
Table(TableData tableData)
          Creates a new table using the existing table data.
 
Method Summary
 void addTableListener(TableListener listener)
          Adds a table listener to receive table events when the state of the table changes.
protected  void autoRepaint()
          Calls repaint() if the automaticRepaintOn is turned on.
protected  void calculateCellInfo(int xpos, int ypos, int[] index)
          Calculates the row index, column index, and row position of the cell at the specified position.
protected  void calculateColumnViewPort(int columnIndex, java.awt.Rectangle viewport)
          Calculates the viewport for a column.
protected  void calculateFilterViewPort(java.awt.Rectangle viewport)
          Calculates the filter bar viewport.
protected  void calculateHeaderViewPort(java.awt.Rectangle viewport)
          Calculates the header viewport.
protected  void calculateHorizontalScrollbarViewPort(java.awt.Rectangle viewport)
          Calculates the horizontal scrollbar viewport and state.
protected  void calculateLabelBounds(java.lang.String label, java.awt.Rectangle cellViewport, java.awt.Rectangle labelBounds, int imageWidth, int rowIndex, int columnIndex, java.awt.FontMetrics fm)
          Calculates the bounds of a label.
protected  java.awt.Dimension calculateMultiLineLabelSize(java.lang.String label, java.awt.FontMetrics fm)
          Gets the height of a multiline label.
protected  void calculateRowViewPort(java.awt.Rectangle viewport)
          Gets the table row viewport.
protected  void calculateTotalRowViewPort(java.awt.Rectangle viewport)
          Calculates the total row viewport.
protected  void calculateVerticalScrollbarViewPort(java.awt.Rectangle viewport)
          Calculates the vertical scrollbar viewport and state.
protected  void calculateViewPorts()
          Calculates the headerViewPort, filterViewPort, totalRowViewPort, verticalScrollbarViewPort, horizontalScrollbarViewPort, and rowViewPort.
 void callJavaScript(java.lang.String javascript)
          Calls a javascript function in the applet page.
protected  int compareRows(int row_1, int row_2, int column, int order)
          This is called by sortRow() and compares two a cell in two rows.
 boolean containsRow(int row)
          Checks if the table contains the specified row.
 java.lang.String createArrayString(int[] array)
          Creates a separated string from the array.
protected static java.awt.Color createColor(java.lang.String color)
          Creates a color based on the string.
protected  java.util.Date createDate(java.lang.String dateString, int column)
          Creates a date object from the specified date string and the date pattern.
protected static java.awt.Font createFont(java.lang.String value, java.lang.String name, int type, int size)
          Creates a font based on the information in the specified string.
protected static java.lang.Long[] createLongValues(java.lang.String string)
          Convers a string parameter to an array of integer values.
protected static java.lang.String[] createStringArray(java.lang.String string, java.lang.String delimiter)
          Converts a delimited string into an array of strings.
protected  java.net.URL createURL(java.lang.String urlString)
          Creates a URL from the specified string.
 void destroy()
          Called when the applet is stopped and destroyed.
 java.awt.Frame exportData(int width, int height, char separator)
          Opens a frame with a text area containing the visible data in CSV format (or any other separator you choose).
 java.awt.Frame exportData(int width, int height, char separator, boolean header)
          Opens a frame with a text area containing the visible data in CSV format (or any other separator you choose).
 java.awt.Color getAlternateRowBackground()
          Gets the alternate background color.
 java.applet.AppletContext getAppletContext()
          Gets the applet context.
 java.lang.Object getCell(int row, int col)
          Gets a cell object.
 java.lang.String getCellLabel(int row, int column)
          Gets the label of the cell as it appears in the table including formatting and pre-and postfix labels.
protected  java.lang.String getCellLabel(int row, int column, boolean collapsed)
          Gets the label as it will appear if collapsed.
 double getCellNumber(int row, int column)
          Gets the number for a column that has specified it's data type as DATA_NUMBER.
 java.lang.Object[] getColumn(int column, int start, int count)
          Gets the row data for the specified column.
 int getColumnAlignment(int column)
          Gets the column alignment for the specified column.
 int getColumnCount()
          Returns the number of columns in the table data.
 double getColumnTotal(int column)
          Gets the total of all filtered rows for the specified column.
protected  java.lang.String getColumnTotalLabel(int column)
          Gets the total row label.
 int getColumnType(int column)
          Returns the type for the specified column
 double[] getColumnValues(int column, int start, int count)
          Gets the values of the displayed rows for the specified column.
 int getColumnWidth(int column)
          Gets the width of the specified column
 java.text.DateFormat getDateFormatter(int column)
          Gets the date formatter used for the specified column.
 int getDecimalCount(int column)
          Gets the decimal count for the specified column.
 int getDefaultSortOrder(int column)
          Gets the default sorting order for the specified column.
 int[] getDisplayedRows()
          Gets the index of the displayed (filtered) rows in the current sort order.
 java.net.URL getDocumentBase()
          Gets the document base.
 java.lang.String getExportData(char separator)
          Gets the rows and columns currently displayed in the tables scrollable view area.
 java.lang.String getExportData(char separator, boolean header)
          Gets the rows and columns currently displayed in the tables scrollable view area.
 java.awt.Image getExportFrameIcon()
          Gets the export frame icon.
 java.lang.String getFilter(int column)
          Gets the current filter for a column.
 java.awt.Color getFilterBarBackground()
          Gets the filter bar background color used when the filter field is inactive.
 java.awt.Color getFilterBarOnBackground()
          Gets the filter bar background color used when the filter field is active.
 int getFilterBarPosition()
          Gets the current position of the filter bar.
 int getFilteredRowCount()
          Returns the number of rows currently displayed (filtered) in the table.
 java.lang.String getFilterWildCard()
          Gets the current wildcard.
 int getFirstRowPosition()
          Returns the position index of the first row displayed.
 java.awt.Font getFont(java.lang.String name)
          Gets the font used for the specified table component.
 java.awt.Color getFontColor(java.lang.String name)
          Gets the font color used for the specified table component.
protected  java.lang.String getFormattedNumber(double number, int decimals, int type)
          Returns a formatted number.
 java.awt.Color getGridColor()
          Gets the row grid color.
 java.lang.String[] getHeader()
          Gets the header fields.
 java.awt.Color getHeaderBackground(int index)
          Gets the header background color.
 java.awt.Image getHeaderImage(int column)
          Gets the image used in the specified header.
 java.lang.String getHeaderLabel(int index)
          Gets the specified header field.
 java.awt.Image getImage(int column, int row)
          Gets an image used for the cell or column.
 java.lang.String getImageName(int column, int row)
          Gets the image name.
 java.lang.Thread getInitThread()
          Gets the initializer thread.
 java.awt.Insets getInsets()
          Returns the default insets of the table (3, 3, 2, 2).
 int getLastIndex()
          Returns the index of the last row in the table.
 int getLastSelectedCell()
          Returns the last selected cell/column.
 int getLastSelectedRow()
          Returns the last selected row.
 int getLastSortedColumn()
          Gets the index of the last sorted column.
 int getMaxVisibleRowCount()
          Gets the number of rows that can be visible in the current viewport.
protected  double getNumericalValue(java.lang.Object[] fields, int column, int type)
          This method is called by setRow() and returns a numerical value for a row object.
 java.lang.String getParameter(java.lang.String parameter)
          Gets the named parameter.
 java.lang.String getParameterPrefix()
          Gets the applet parameter prefix.
 java.lang.String getPostfix(int column)
          Gets the postfix of the specified column.
 java.awt.Dimension getPreferredSize()
          Gets the preferred size of the table.
 java.lang.String getPrefix(int column)
          Gets the prefix of the specified column.
 java.lang.Object[] getRow(int row)
          This method returns the fields of the specified row.
 java.awt.Color getRowBackground(int index)
          Gets the default row background color.
 int getRowCount()
          Returns the number of rows in the table data.
 java.awt.Font getRowFont(int row)
          Gets the font used for the specific row.
 java.awt.Color getRowForeground(int index)
          Gets the foreground color for the specific row.
protected  int getRowHeight(int row)
          Returns the row height for the specified row.
 int getRowIndex(int position)
          Translates a row position to the index in TableData.
 int getRowIndex(java.lang.Object key)
          Translates a row key to the index it is stored in.
 int getRowPosition(int index)
          Gets the row position of the specified row.
 int[] getSelectedRows()
          Returns the indexes of the selected rows.
 java.awt.Color getSelectionBackground()
          Gets the current background color of selected rows.
 java.awt.Color getSelectionCellBackground()
          Gets the current cell selection background color.
 java.awt.Color getSelectionForeground()
          Gets the current foreground color of selected rows.
 int getSelectionMode()
          Gets the current selection mode.
 int getSortOrder(int column)
          Gets the current sorting order for the specified column.
protected  int getSortType(int column_type)
          Gets the sort type based on the column type.
 TableData getTableData()
          Gets the data of the table.
 java.lang.String getThousandsDelimiter()
          Gets the current thousands delimiter used for formatted numbers.
 java.lang.String getTooltip(java.lang.String name)
          Gets the specified tooltip label.
 java.awt.Color getTooltipBackground()
          Gets the tooltip background color.
 int getTooltipDelay(java.lang.String name)
          Gets the delay of the tootip labels.
protected  int getTotalType(int column_type)
          This method is called when calculating the total row and gets the total type for the specified column type.
 java.lang.Object getURL(int row, int column)
          Gets any URL assigned to the specified row or cell.
 java.lang.String getURLTarget(int row, int column)
          Gets the url target for the specified cell.
static java.lang.String getVersion()
          Gets the version number.
 boolean gotoRow(int index)
          Scrolls to the row with the specified index.
 boolean gotoRowPosition(int position)
          Scrolls to the specified row position.
 void init()
          This method is called by the applet container (web browser) and reads the applet parameters and the data.
 boolean isAutomaticRepaintOn()
          Checks if the automatic repaint flag is turned on.
 boolean isColumnCollapsable(int column)
          Checks if a column is set in collapsable mode.
 boolean isColumnCollapsed(int column)
          Checks if a column is collapsed.
 boolean isColumnOn(int column)
          Checks if the specified column is turned on.
 boolean isColumnStretchOn()
          Checks if column stretch is on.
 boolean isDoubleBufferingOn()
          Checks if double buffering is on.
 boolean isFilterBarOn()
          Checks if the filter bar is turned on or off.
 boolean isFilterEnabled(int index)
          Checks if the specified filter field is enabled for editing.
 boolean isFilterOn(int index)
          Checks if the specified filter field is turned on.
 boolean isGridOn()
          Checks if the row grid is on or off.
 boolean isHeaderOn()
          Checks if the header is on or off.
 boolean isLabelCacheOn()
          Checks if the label cache is turned on.
 boolean isMouseOverCellOn()
          Checks if the mouseOverCellOn flag is turned on.
 boolean isProgressiveFilterOn()
          Checks if progressive filtering is on.
 boolean isRowSelected(int index)
          Checks if the specified row is selected.
 boolean isSortingOn(int column)
          Checks if interactiv sorting is turned on for the specified column.
 boolean isTotalRowOn(int column)
          Checks if the total row is on for the specified column.
 void loadAppletParameters(java.util.Hashtable parameters)
          Loads the applet tag parameters into the parameters hashtable.
 void loadData(java.lang.String url, boolean progress)
          Loads the data into the table.
protected  java.awt.Image loadImage(java.lang.String name)
          Loads an image from the applet document base.
 void loadURLParameters(java.lang.String url, java.util.Hashtable parameters)
          Loads the parameters from the specified url.
protected  boolean matchesFilter(Filter filter, int row, int column)
          Checks for a match.
protected  boolean matchesFilter(int rowIndex)
          This method is called to check if a row matches the current filter that is set.
 void paint(java.awt.Graphics g)
          Paints the table component.
protected  void paintBorder(java.awt.Graphics g, java.awt.Rectangle viewport)
          Paints the border around the table.
protected  void paintCell(java.awt.Graphics g, java.awt.Rectangle viewport, java.lang.String label, java.awt.Rectangle labelBounds, java.awt.Image image, int rowIndex, int columnIndex)
          Paints the label and the image of a cell.
protected  void paintCellBackground(java.awt.Graphics g, java.awt.Rectangle viewport, java.lang.String label, java.awt.Rectangle labelBounds, java.awt.Image image, int rowIndex, int columnIndex)
          Paints the cell background.
protected  void paintCellForeground(java.awt.Graphics g, java.awt.Rectangle viewport, java.lang.String label, java.awt.Rectangle labelBounds, java.awt.Image image, int rowIndex, int columnIndex)
          Paints the cell foreground.
protected  void paintCellLink(java.awt.Graphics g, java.awt.Rectangle viewport, java.lang.String label, java.awt.Rectangle labelBounds, java.awt.Image image, int rowIndex, int columnIndex, boolean rowURL)
          Paints any url link below the label if configured and the column is not collapsed.
protected  void paintColumn(java.awt.Graphics g, java.awt.Rectangle viewport, int columnIndex)
          Paints a column of the table.
protected  void paintFilterBar(java.awt.Graphics g, java.awt.Rectangle viewport)
          Paints the filter bar used for searhing and filtering.
protected  void paintGrid(java.awt.Graphics g, java.awt.Rectangle viewport)
          Paints the row grid.
protected  void paintHeader(java.awt.Graphics g, java.awt.Rectangle viewport)
          Paints the table header.
protected  void paintHorizontalScrollbar(java.awt.Graphics g, java.awt.Rectangle viewport)
          Paints the horizontal scroll bar.
protected  void paintLoadingDataMessage(java.awt.Graphics g, java.awt.Rectangle viewport)
          Paints the loading data message.
protected  void paintMouseOverCell(java.awt.Graphics g, java.awt.Rectangle viewport, int rowIndex, int columnIndex)
          Paints the label and the image of a cell.
protected  void paintMultiLineLabel(java.awt.Graphics g, java.awt.Rectangle bounds, java.lang.String label, int alignment)
          Paints a multiline label in the specified bounds.
protected  void paintRowBackground(java.awt.Graphics g, java.awt.Rectangle viewport, int rowPosition)
          Paints the row background color.
protected  void paintRows(java.awt.Graphics g, java.awt.Rectangle viewport)
          Paints the rows of the table for each column.
protected  void paintRowSelection(java.awt.Graphics g, java.awt.Rectangle viewport, int rowIndex)
          Paints the row selection background color.
protected  void paintTable(java.awt.Graphics g)
          Paints the table.
protected  void paintTooltipLabel(java.awt.Graphics g, java.lang.String label, int xpos, int ypos)
          Paints a tooltip label at the specified position.
protected  void paintTotalRow(java.awt.Graphics g, java.awt.Rectangle viewport)
          Paints the total row.
protected  void paintVerticalScrollbar(java.awt.Graphics g, java.awt.Rectangle viewport)
          Paints the vertical scroll bar.
protected  void processEvent(java.awt.AWTEvent event)
          Handles the internal events of the table. lastMousePosition is set before any of the specific mouse event processing methods are called.
protected  void processHorizontalScrollbar(java.awt.event.MouseEvent event)
          Processes the horizontal scrollbar events.
protected  void processKeyFilterEdit(java.awt.event.KeyEvent event)
          Processes key type events and filter editing.
protected  void processKeyRowNavigation(java.awt.event.KeyEvent event)
          Processes key pressed events causing row navigation.
protected  void processKeys(java.awt.event.KeyEvent event)
          Processes key events.
protected  void processMouseClicked(java.awt.event.MouseEvent event)
          Processes mouse button click events.
protected  void processMouseDragged(java.awt.event.MouseEvent event)
          Processes mouse dragging events, adjusting column width or dragging scrollbar sliders.
protected  void processMouseMoved(java.awt.event.MouseEvent event)
          Changes the cursor as the mouse moves across the table.
protected  void processMousePressed(java.awt.event.MouseEvent event)
          Handles the row selections, header pushdown, filter activation, and scrollbar arrow buttons.
protected  void processMouseReleased(java.awt.event.MouseEvent event)
          Processes mouse button release events.
protected  void processNotifyListeners(TableEvent event)
          Notifies all the registered table listeners about the specified event.
protected  void processRowSelection(java.awt.event.MouseEvent event, int rowIndex, int columnIndex, int rowPosition)
          Processes the row selection events.
protected  void processVerticalScrollbar(java.awt.event.MouseEvent event)
          Processes the vertical scrollbar events.
 void removeAll()
          Removes all the rows from the table data.
 void removeRow(int row)
          Removes the specified row from the table data.
 void removeTableListener(TableListener listener)
          Removes the given table listener from the table.
protected  void render(java.awt.Graphics g)
          Renders all the elements of the table.
 void resetAllRows()
          Resets all row parameters such as fonts, foreground and background colors, cell images, URLs and URL targets
 void resetRow(int row)
          Resets parameters for the specified row.
 void selectRow(int index, boolean select)
          Selects the specified row in the table.
 void setAlternateRowBackground(java.awt.Color color, int count, int start)
          Sets alternating row backgrounds.
 void setAutomaticRepaintOn(boolean state)
          Turns on or off the automatic table repaint.
 void setCell(int row, int col, java.lang.Object value)
          Sets the value of a cell in the table.
 void setColumnAlignment(int column, int alignment)
          Sets the column alignment.
 void setColumnCollapsable(int column, boolean collapsable)
          Sets a column in collapsable mode.
 void setColumnCollapsed(int column, boolean collapsed)
          Collapses the specified column.
 void setColumnCount(int count)
          Sets the number of columns in the table.
 void setColumnOn(int column, boolean state)
          Turns a column on or off.
 void setColumnStretchOn(boolean on)
          Turns on column stretch.
 void setColumnType(int column, int type)
          Sets the columns to the specified type.
 void setColumnWidth(int column, int width)
          Sets the width of the specified column.
 void setDataParameterField(java.lang.String field, java.lang.String value)
          Sets a field in the data parameter value.
 void setDateFormatter(int column, java.text.DateFormat formatter)
          Sets the date formatter used to format date columns.
 void setDecimalCount(int column, int count)
          Sets the decimal count for the specified column.
 void setDefaultSortOrder(int column, int order)
          Sets the default sorting order for the specified column.
 void setDoubleBufferingOn(boolean state)
          Turns on or off double buffering.
 void setEnabled(boolean enabled)
          Enables or disables the component.
 void setExportFrameIcon(java.awt.Image image)
          Sets the export frame icon.
 void setFilter(int column, java.lang.String value)
          Sets the current filter for a column.
 void setFilterBarBackground(java.awt.Color color)
          Sets the filter bar background color when the filter field is inactive.
 void setFilterBarOn(boolean state)
          Turns on or off the filter bar.
 void setFilterBarOnBackground(java.awt.Color color)
          Sets the filter bar background color when the filter field is active.
 void setFilterBarPosition(int position)
          Sets the position of the filter bar.
 void setFilterEnabled(int column, boolean enabled)
          Enables or disables a filter field for filter input.
 void setFilterFields(java.lang.Object[] fields)
          Sets the current filter fields without refiltering the table.
 void setFilterOn(int column, boolean state)
          Turns on the specified filter field, and filters the data.
 void setFilterValueSeparator(int column, java.lang.String separator)
          Sets the separator to use between filter values in combination filters.
 void setFilterWildCard(java.lang.String wildcard)
          Sets the wildcard to be used when filtering data using the filter bar.
 void setFont(java.awt.Font font)
          Sets the default font to be used.
 void setFont(java.lang.String name, java.awt.Font font)
          Sets the named font.
 void setFontColor(java.lang.String name, java.awt.Color color)
          Sets the color used for the specified font.
 void setGridColor(java.awt.Color color)
          Sets the row grid color.
 void setGridOn(boolean on)
          Turns on or off the row grid.
 void setHeader(java.lang.String[] fields)
          Sets the text of the table header.
 void setHeaderBackground(int index, java.awt.Color color)
          Sets the header background color.
 void setHeaderImage(int column, java.awt.Image image)
          Sets the image for the specified header field.
 void setHeaderLabel(int index, java.lang.String label)
          Sets the specified header field.
 void setHeaderOn(boolean on)
          Turns the header on or off.
 void setImage(int column, int row, java.awt.Image image)
          Sets an image to be used in a cell or column.
 void setLabelCacheOn(boolean on)
          Turns on or off the label cache for textual columns.
 void setLocale(java.util.Locale locale)
          Sets the locale to use when formatting numbers and currency columns.
 void setMouseOverCellOn(boolean on)
          Turns on or off display of hidden cells when the mouse moves over it (off by default).
 void setParameter(java.lang.String name, java.lang.String value)
          Sets a parameter in the chart.
 void setParameterPrefix(java.lang.String prefix)
          Sets the applet parameter prefix.
 void setParameters(java.util.Hashtable parameters)
          Sets the parameters found in the specified table.
 void setParentApplet(java.applet.Applet applet)
          Sets the parent applet if this applet is used as a component in another applet.
 void setPostfix(int column, java.lang.String postfix)
          Sets the postfix of the labels in the specified column.
 void setPreferredSize(int width, int height)
          Sets the preferred size of the table.
 void setPrefix(int column, java.lang.String prefix)
          Sets the prefix of the labels in the specified column.
 void setProgressiveFilterOn(boolean on)
          Turns on progressive filtering.
 int setRow(int index, java.lang.Object[] fields)
          Sets a row in the table at the specified row index.
 int setRow(int index, java.lang.Object key, java.lang.Object[] fields)
          Sets a row in the table at the specified row index using the given key.
 void setRowBackground(int index, java.awt.Color color)
          Sets the background color of the rows.
 void setRowFont(int row, java.awt.Font font)
          Sets the font used for the specific row.
 void setRowForeground(int index, java.awt.Color color)
          Sets the row text color.
 void setSelectionBackground(java.awt.Color color)
          Sets the background color of selected rows.
 void setSelectionCellBackground(java.awt.Color color)
          Sets the cell selection background color.
 void setSelectionForeground(java.awt.Color color)
          Sets the foreground color of selected rows.
 void setSelectionMode(int mode)
          Sets the selection mode.
 void setSortingOn(int column, boolean on)
          Turns on or off interactiv sorting for the specified column.
 void setTableData(TableData tableData)
          Sets the data of the table.
 void setThousandsDelimiter(java.lang.String delimiter)
          Sets the delimiter for use in the display of numbers.
 void setTooltip(java.lang.String name, java.lang.String tooltip)
          Sets the header tooltip label.
 void setTooltipBackground(java.awt.Color color)
          Sets the tooltip background color.
 void setTooltipDelay(java.lang.String name, int ms)
          Sets the delay of the tooltip labels.
 void setTotalRowOn(int column, boolean on)
          Turns on the total for individual columns.
 void showStatus(java.lang.String status)
          Displays the status message.
 void sortColumn(int column, int order)
          Sorts a column in either ascending or descending order.
 void start()
          Called when the applet is started.
 void stop()
          Called when the applet is stopped.
 void update(java.awt.Graphics g)
          Overridden to avoid flickering.
 void updateData(boolean block)
          Updates the table's data by loading the parameters from the url specified in the data parameter.
 
Methods inherited from class java.applet.Applet
getAccessibleContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getImage, getImage, getLocale, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getListeners, getMaximumSize, getMinimumSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALIGN_CENTER

public static final int ALIGN_CENTER
Used to specify a center justified column.

See Also:
Constant Field Values

ALIGN_LEFT

public static final int ALIGN_LEFT
Used to specify a left justified column.

See Also:
Constant Field Values

ALIGN_RIGHT

public static final int ALIGN_RIGHT
Used to specify a right justified column.

See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
Used to display the filter bar at the bottom of the table.

See Also:
Constant Field Values

COLUMN_CURRENCY

public static final int COLUMN_CURRENCY
Used to specify a currency based column (2).

See Also:
Constant Field Values

COLUMN_DATE

public static final int COLUMN_DATE
Used to specify a date based column (3).

See Also:
Constant Field Values

COLUMN_IP

public static final int COLUMN_IP
Used to specify a ip address based columns (4).

See Also:
Constant Field Values

COLUMN_NUMBER

public static final int COLUMN_NUMBER
Used to specify a number based column (1).

See Also:
Constant Field Values

COLUMN_TEXT

public static final int COLUMN_TEXT
Used to specify a text based column (0).

See Also:
Constant Field Values

dataURL

protected java.lang.String dataURL
The URL the data is loaded from.


displayList

protected int[] displayList
This array contains the indexes of the rows currently being displayed. They are displayed in the order found in this list. The sortedList is used when building this list, by going through the index values of the sorted list and see if the row with the index matches the current filter. The filtered list is then always sorted and filtered.


displayListCount

protected int displayListCount
The number of rows in the display list. Be very careful this number is correct if you ever change it, otherwise you may end up with tons of IndexOutOfBoundsExceptions as the rendering of the rows is highly dependent on this counter and the content of the displayList.


EQUAL

protected static final int EQUAL
Return equal type from compareRows()

See Also:
Constant Field Values

filter

protected Filter[] filter
The current filter setup.


filterViewPort

protected java.awt.Rectangle filterViewPort
The bounds of the filter bar.


headerViewPort

protected java.awt.Rectangle headerViewPort
The bounds of the header.


hScrollbarViewPort

protected java.awt.Rectangle hScrollbarViewPort
The bounds of the horizontal scrollbar.


LARGER

protected static final int LARGER
Return larger type from compareRows()

See Also:
Constant Field Values

LESS

protected static final int LESS
Return less type from compareRows()

See Also:
Constant Field Values

loadingData

protected boolean loadingData
This flag is set to true when data is being loaded at initial startup.


loadingDataDots

protected int loadingDataDots
The number of dots after the loading message. This can be adjusted when loading data, and repaint() will paint the message with the dots.


mouseOverCellViewPort

protected java.awt.Rectangle mouseOverCellViewPort
The bounds of the cell the mouse is currently over.


numericalData

protected double[][] numericalData
This double array contains all data that is numeric in the table. This is in addition of the textual representation in the tableData object, and is used to speed up sorting of data.


rowViewPort

protected java.awt.Rectangle rowViewPort
The bounds of the view where the rows are displayed.


SELECT_MULTIPLE

public static final int SELECT_MULTIPLE
Used to set the selection mode to multiple selection.

See Also:
Constant Field Values

SELECT_NONE

public static final int SELECT_NONE
Used to set the selection mode to no selection.

See Also:
Constant Field Values

SELECT_SINGLE

public static final int SELECT_SINGLE
Used to set the selection mode to single selection.

See Also:
Constant Field Values

SORT_ASCENDING

public static final int SORT_ASCENDING
Used to sort a column in ascending order.

See Also:
Constant Field Values

SORT_DESCENDING

public static final int SORT_DESCENDING
Used to sort a column in descending order.

See Also:
Constant Field Values

SORT_LEXICAL

protected static final int SORT_LEXICAL
Sorts a column's data in lexical order. The data in a column can either be sorted in lexical order (alphabetically) or numerically. The sortRow() method calls getSortOrder(columnType) and subclasse can override this method and return the correct sort order when adding new column types.

See Also:
getSortOrder(int), Constant Field Values

SORT_NUMERICAL

protected static final int SORT_NUMERICAL
Sorts a column's data in numerical order. The data in a column can either be sorted in lexical order (alphabetically) or numerically. The sortRow() method calls getSortOrder(columnType) and subclasse can override this method and return the correct sort order when adding new column types.

See Also:
getSortOrder(int), Constant Field Values

SORT_UNSORTED

public static final int SORT_UNSORTED
Used to specify a column is not sorted.

See Also:
Constant Field Values

sortedList

protected int[] sortedList
This contains all the indexes of the tableData in sorted order. The sort order depends on which column was last sorted.


tableData

protected TableData tableData
This object contains the rows of the table. The table data can be shared among several table components with different sortings and filters at the same time.


TOP

public static final int TOP
Used to display the filter bar at the top of the table.

See Also:
Constant Field Values

TOTAL_COUNT

protected static final int TOTAL_COUNT
Used to specify the total row be the count of the rows displayed. The method getTotalType(columnType) is called when calculating the totals for a row. By default it returns TOTAL_COUNT for COLUMN_TEXT, COLUMN_DATE, and COLUMN_IP. Override the getTotalType() method for subclasses that adds new column types.

See Also:
Constant Field Values

TOTAL_SUM

protected static final int TOTAL_SUM
Used to specify the total row be the sum of the values in the column. The method getTotalType(columnType) is called when calculating the totals for a row. By default it returns TOTAL_SUM for COLUMN_NUMBER and COLUMN_CURRENCY. Override the getTotalType() method for subclasses that adds new column types.

See Also:
Constant Field Values

totalRowViewPort

protected java.awt.Rectangle totalRowViewPort
The bounds of the total row.


vScrollbarViewPort

protected java.awt.Rectangle vScrollbarViewPort
The bounds of the vertical scroll bar.

Constructor Detail

Table

public Table()
Creates a table with one column.


Table

public Table(int columns)
Creates a new table with the specified number of columns.

Parameters:
columns - The number of columns to use for the table.

Table

public Table(TableData tableData)
Creates a new table using the existing table data. This enables you to have two table components sharing the same data.

Parameters:
tableData - The table data to use.
Throws:
java.lang.IllegalArgumentException - if the table data is null.
Method Detail

addTableListener

public void addTableListener(TableListener listener)
Adds a table listener to receive table events when the state of the table changes. The listener will receive events when a table row or cell is selected, deselected, or double-clicked. The table event will contain the row selected, or the cell selected (a seperate event is sent for each of them), the row index, and the column index.

NOTE: At a row DESELECTION both the columnIndex and the rowIndex will be unknown (-1). However, you will get the correct deselected row object.

Parameters:
listener - The table listener.

autoRepaint

protected void autoRepaint()
Calls repaint() if the automaticRepaintOn is turned on.


calculateCellInfo

protected void calculateCellInfo(int xpos,
                                 int ypos,
                                 int[] index)
Calculates the row index, column index, and row position of the cell at the specified position. If the index array is 5 elements, the 4th and 5th element will contain the y position and height of the cell.

Depends on: calculateRowViewPort().
Called by: processMouseMoved(), processMousePressed(), processMouseClicked().

Parameters:
xpos - The x-position.
ypos - The y-position.
index - A 3 or 5-element array.
Throws:
java.lang.IllegalArgumentException - If the index is invalid.

calculateColumnViewPort

protected void calculateColumnViewPort(int columnIndex,
                                       java.awt.Rectangle viewport)
Calculates the viewport for a column. This is the viewport where the column is actually painted and takes into effect the scroll offset.
Called by: paintRows().
Depends on: calculateRowViewPort().

Parameters:
columnIndex - The index of the column.
viewport - The rectangle where the column's viewport is set.

calculateFilterViewPort

protected void calculateFilterViewPort(java.awt.Rectangle viewport)
Calculates the filter bar viewport.
Called by: calculateViewPorts().
Depends on: calculateHorizontalScrollbarViewPort().

Parameters:
viewport - The rectangle to set the viewport in.

calculateHeaderViewPort

protected void calculateHeaderViewPort(java.awt.Rectangle viewport)
Calculates the header viewport.

Called by: calculateViewPorts().
Calls: calculateMultiLineLabelSize().

Parameters:
viewport - The rectangle to set the viewport in.

calculateHorizontalScrollbarViewPort

protected void calculateHorizontalScrollbarViewPort(java.awt.Rectangle viewport)
Calculates the horizontal scrollbar viewport and state.
Called by: calculateViewPorts().
Depends on: calculateVerticalScrollbarViewPort().

Parameters:
viewport - The rectangle where the viewport info will be set.

calculateLabelBounds

protected void calculateLabelBounds(java.lang.String label,
                                    java.awt.Rectangle cellViewport,
                                    java.awt.Rectangle labelBounds,
                                    int imageWidth,
                                    int rowIndex,
                                    int columnIndex,
                                    java.awt.FontMetrics fm)
Calculates the bounds of a label.
Called by: paintColumn(), paintTotalRow(), and paintFilterBar().

Parameters:
label - The label to position.
cellViewport - The viewport of the cell.
labelBounds - The label position and size (y is base of label).
imageWidth - The image width.
rowIndex - The index of the row.
columnIndex - The index of the colum.
fm - The font metrics used for the label.

calculateMultiLineLabelSize

protected java.awt.Dimension calculateMultiLineLabelSize(java.lang.String label,
                                                         java.awt.FontMetrics fm)
Gets the height of a multiline label.
Called by: calculateHeaderViewPort(), paintTooltipLabel(), processMousePressed().

Parameters:
label - The label to be painted.
fm - The font metrics used to paint the label with.
Returns:
The width and height of the label in pixels.

calculateRowViewPort

protected void calculateRowViewPort(java.awt.Rectangle viewport)
Gets the table row viewport. This is the viewport seen in the table, and does not take into effect the scroll offset.
Called by: paintTable().
Depends on: calculateHeaderViewPort(), calculateTotalRowViewPort(), calculateHorizontalScrollbarViewPort(), calculateVerticalScrollbarViewPort(), and calculateFilterViewPort().

Parameters:
viewport - The rectangle to set the viewport in.

calculateTotalRowViewPort

protected void calculateTotalRowViewPort(java.awt.Rectangle viewport)
Calculates the total row viewport.
Called by: calculateViewPorts().
Depends on: calculateHorizontalScrollbarViewPort().

Parameters:
viewport - The rectangle to set the viewport in.

calculateVerticalScrollbarViewPort

protected void calculateVerticalScrollbarViewPort(java.awt.Rectangle viewport)
Calculates the vertical scrollbar viewport and state.
Called by: calculateViewPorts().

Parameters:
viewport - The rectangle where the viewport info will be set.

calculateViewPorts

protected void calculateViewPorts()
Calculates the headerViewPort, filterViewPort, totalRowViewPort, verticalScrollbarViewPort, horizontalScrollbarViewPort, and rowViewPort.

Called by: paintTable().
Calls: calculateHeaderViewPort(), calculateVerticalScrollbarViewPort(), calculateFilterViewPort(), calculateTotalRowViewPort(), calculateHorizontalScrollbarViewPort(), and calculateRowViewPort().


callJavaScript

public void callJavaScript(java.lang.String javascript)
                    throws java.lang.reflect.InvocationTargetException
Calls a javascript function in the applet page.

Parameters:
javascript - The javascript URL.
Throws:
java.lang.reflect.InvocationTargetException - If the call fails in any way (it contains the actual exception).

compareRows

protected int compareRows(int row_1,
                          int row_2,
                          int column,
                          int order)
This is called by sortRow() and compares two a cell in two rows. The method getSortType() is called with the specific column type to check if the fields should be compared lexically (COLUMN_TEXT) or numerically (all others, since they are stored as numbers). You can override getSortType() in subclasses if you add new column types. Empty fields will always be put last.

Parameters:
row_1 - The index of the first row to compare.
row_2 - The index of the row to compare with.
column - The column index to compare in the two rows, -1 for row index.
order - The sort order (SORT_ASCENDING or SORT_DESCENDING).
Returns:
LESS, EQUAL, or LARGER.

containsRow

public boolean containsRow(int row)
Checks if the table contains the specified row.

Parameters:
row - The row index.
Returns:
True if the table contains the row, false otherwise.

createArrayString

public java.lang.String createArrayString(int[] array)
Creates a separated string from the array. This method is useful when you want to create arrays using javascript, since javasript can not use java arrays directly.

In javascript you can use it like this:

selected = document.Table.getSelectedRows();
selected = document.Table1.createArrayString(selected);
array = selected.split(',');
for (i = 0; i < array.length; i++) {
   index = array[i];
   //....
}

Parameters:
array - The array to convert.
Returns:
A comma separated string of numbers.

createColor

protected static java.awt.Color createColor(java.lang.String color)
Creates a color based on the string. The string can either be the name of a java defined color, a comma seperated RGB string (255,255,255), or a 6-digit hex-string (#af10cd).

Returns:
The color object, or null if string is invalid.

createDate

protected java.util.Date createDate(java.lang.String dateString,
                                    int column)
Creates a date object from the specified date string and the date pattern.

Parameters:
dateString - The date string to parse.
column - The column index (used for the date parser).
Returns:
The date, or null if it could not be created.
Throws:
java.lang.IllegalArgumentException - If the date could not be created.

createFont

protected static java.awt.Font createFont(java.lang.String value,
                                          java.lang.String name,
                                          int type,
                                          int size)
Creates a font based on the information in the specified string.

Parameters:
value - The font string value.
name - The name of the default font.
type - The default type (Font.PLAIN, Font.BOLD, Font.ITALIC).
size - The default size.

createLongValues

protected static java.lang.Long[] createLongValues(java.lang.String string)
Convers a string parameter to an array of integer values.

Parameters:
string - The array of string numbers.
Returns:
An array with the values, or null if not found.

createStringArray

protected static java.lang.String[] createStringArray(java.lang.String string,
                                                      java.lang.String delimiter)
Converts a delimited string into an array of strings. Only one character field delimiters are supported in this version.

Parameters:
string - The string parameter to return the values from.
delimiter - The delimiter used for the fields (default is comma)
Returns:
An array containing String objects.

createURL

protected java.net.URL createURL(java.lang.String urlString)
Creates a URL from the specified string. If the table is used within another applet, the parent applet must be set correctly for this to work.

Parameters:
urlString - The url string.
Returns:
The URL created, or null if invalid or empty.
See Also:
setParentApplet(java.applet.Applet)

destroy

public void destroy()
Called when the applet is stopped and destroyed.


exportData

public java.awt.Frame exportData(int width,
                                 int height,
                                 char separator)
Opens a frame with a text area containing the visible data in CSV format (or any other separator you choose). A text area is added as the only component in the frame.

Parameters:
width - The width of the window.
height - The height of the window.
separator - The character used to separate the fields.
Returns:
The frame that contains the export data.

exportData

public java.awt.Frame exportData(int width,
                                 int height,
                                 char separator,
                                 boolean header)
Opens a frame with a text area containing the visible data in CSV format (or any other separator you choose). A text area is added as the only component in the frame.

Parameters:
width - The width of the window.
height - The height of the window.
separator - The character used to separate the fields.
header - True if the header should be included.
Returns:
The frame that contains the export data.

getAlternateRowBackground

public java.awt.Color getAlternateRowBackground()
Gets the alternate background color.

Returns:
The color used, or null if no alternate row background is used.

getAppletContext

public java.applet.AppletContext getAppletContext()
Gets the applet context. If the the table is used in another component and the parent applet has been set, the parent applets context is gotten.

Returns:
The applet context, null if no context is found.

getCell

public java.lang.Object getCell(int row,
                                int col)
Gets a cell object. This can be a string, Data, or a byte[] array (IP).

Parameters:
row - The index of the row.
col - The index of the column.
Returns:
The value as a string or null if no value found.
See Also:
setCell(int, int, java.lang.Object)

getCellLabel

public java.lang.String getCellLabel(int row,
                                     int column)
Gets the label of the cell as it appears in the table including formatting and pre-and postfix labels. All other column types than TEXT, DATE, and IP, will call the getFormattedNumber() method.
Called by:
Calls: getCellLabel(row, column, collapsed).

Parameters:
row - The index of the row, -3 is filter bar.
column - The index of the column (0-based).
Returns:
The value as a string or null if no value found.
See Also:
getCell(int, int)

getCellLabel

protected java.lang.String getCellLabel(int row,
                                        int column,
                                        boolean collapsed)
Gets the label as it will appear if collapsed.
Called by: getCellLabel(row, column)
Calls: getFormattedNumber().

Parameters:
row - The index of the row, -3 is filter bar.
column - The index of the column (0-based).
collapsed - Return .. if the column is collapsed.
Returns:
The value as a string or null if no value found.

getCellNumber

public double getCellNumber(int row,
                            int column)
Gets the number for a column that has specified it's data type as DATA_NUMBER. For all other column, Double.NaN is returned.

Parameters:
row - The index of the row.
column - The index of the column (0-based).
Returns:
The value or Double.NaN.
See Also:
getCellLabel(int, int)

getColumn

public java.lang.Object[] getColumn(int column,
                                    int start,
                                    int count)
Gets the row data for the specified column. The data is sorted and filtered the same way as displayed in the table.

Parameters:
column - The index of the column.
start - The index of the start row (position).
count - The number of rows to get, -1 is all.
Returns:
An array containing the entries, or null if nohing was found.

getColumnAlignment

public int getColumnAlignment(int column)
Gets the column alignment for the specified column.

Parameters:
column - The index of the column.
Returns:
ALIGN_LEFT, ALIGN_CENTER, or ALIGN_RIGHT.
See Also:
setColumnAlignment(int, int)

getColumnCount

public int getColumnCount()
Returns the number of columns in the table data.


getColumnTotal

public double getColumnTotal(int column)
Gets the total of all filtered rows for the specified column. If the column is numeric, the total is the sum of all the numerical values of the displayed rows. Otherwise, the total is the number of displayed rows.

Parameters:
column - The index of the column
Returns:
The total sum or rows displayed, or 0 if column is invalid.

getColumnTotalLabel

protected java.lang.String getColumnTotalLabel(int column)
Gets the total row label. This is the label that is displayed in the total row, including formatting and total row state.

Calls: getFormattedNumber(getColumnTotal(column)..)
Called by: paintTotalRow().

Parameters:
column - The column of the row.
Returns:
The label displayed in the total row.

getColumnType

public int getColumnType(int column)
Returns the type for the specified column

Parameters:
column - The index of the column
Returns:
COLUMN_TEXT, COLUMN_NUMBER, COLUMN_CURRENCY, COLUMN_DATE, and COLUMN_IP.
See Also:
setColumnType(int, int)

getColumnValues

public double[] getColumnValues(int column,
                                int start,
                                int count)
Gets the values of the displayed rows for the specified column.

Parameters:
column - The index of the column
start - The index of the start row position.
count - The number of rows to get, -1 for all displayed rows.
Returns:
A double array with the values, or null if nothing was found.

getColumnWidth

public int getColumnWidth(int column)
Gets the width of the specified column

Parameters:
column - The index of the column
Returns:
The width in pixels.
See Also:
setColumnWidth(int, int)

getDateFormatter

public java.text.DateFormat getDateFormatter(int column)
Gets the date formatter used for the specified column.

Parameters:
column - The index of the column (-1 for default formatter).
Returns:
The date formatter used.

getDecimalCount

public int getDecimalCount(int column)
Gets the decimal count for the specified column.

Parameters:
column - The index of the column.

getDefaultSortOrder

public int getDefaultSortOrder(int column)
Gets the default sorting order for the specified column.

Returns:
SORT_ASCENDING or SORT_DESCENDING.

getDisplayedRows

public int[] getDisplayedRows()
Gets the index of the displayed (filtered) rows in the current sort order.


getDocumentBase

public java.net.URL getDocumentBase()
Gets the document base.


getExportData

public java.lang.String getExportData(char separator)
Gets the rows and columns currently displayed in the tables scrollable view area. Columns that are turned off, less than 5 pixels wide, or collapsed are not included. Numerical columns return the numerical value without any prefix or postfix labels.

Parameters:
separator - The separator used to separate the fields (, by default).
Returns:
A string with each field separated by the separator and row by \n.

getExportData

public java.lang.String getExportData(char separator,
                                      boolean header)
Gets the rows and columns currently displayed in the tables scrollable view area. Columns that are turned off, less than 5 pixels wide, or collapsed are not included. Numerical columns return the numerical value without any prefix or postfix labels.

Parameters:
separator - The separator used to separate the fields (, by default).
header - True if the header should be included.
Returns:
A string with each field separated by the separator and row by \n.

getExportFrameIcon

public java.awt.Image getExportFrameIcon()
Gets the export frame icon.

Returns:
The image used for the icon, or null if none is specified.

getFilter

public java.lang.String getFilter(int column)
Gets the current filter for a column.

Parameters:
column - The column index.
Returns:
The filter value, or null if no filter is set.

getFilterBarBackground

public java.awt.Color getFilterBarBackground()
Gets the filter bar background color used when the filter field is inactive.

See Also:
setFilterBarBackground(java.awt.Color)

getFilterBarOnBackground

public java.awt.Color getFilterBarOnBackground()
Gets the filter bar background color used when the filter field is active.

See Also:
setFilterBarBackground(java.awt.Color)

getFilterBarPosition

public int getFilterBarPosition()
Gets the current position of the filter bar.

Returns:
TOP or BOTTOM.
See Also:
setFilterBarPosition(int)

getFilteredRowCount

public int getFilteredRowCount()
Returns the number of rows currently displayed (filtered) in the table. The number of rows in the table can be different from the table data since the rows can be filtered out.

See Also:
getRowCount()

getFilterWildCard

public java.lang.String getFilterWildCard()
Gets the current wildcard.

See Also:
setFilterWildCard(java.lang.String)

getFirstRowPosition

public int getFirstRowPosition()
Returns the position index of the first row displayed. Use getRowIndex(int position) to get the row index.


getFont

public java.awt.Font getFont(java.lang.String name)
Gets the font used for the specified table component. The different font names are headerFont, rowFont, totalRowFont, filterBarFont.

Parameters:
name - The name of the table font.
Returns:
The font used, or null if default font is used.

getFontColor

public java.awt.Color getFontColor(java.lang.String name)
Gets the font color used for the specified table component. The different font color names are headerFontColor, totalRowFontColor, filterBarFontColor.

Parameters:
name - The name of the table font color.
Returns:
The color used, or null if default color is used.

getFormattedNumber

protected java.lang.String getFormattedNumber(double number,
                                              int decimals,
                                              int type)
Returns a formatted number. Override this method if you need special formatting of certain column types.

Called by: getColumnTotalLabel(), getCellLabel().

Parameters:
number - The number to format.
decimals - The number of decimals.
type - The column type (COLUMN_NUMBER, COLUMN_CURRENCY).
Returns:
The formatted number as a string or null if number if Double.NaN.

getGridColor

public java.awt.Color getGridColor()
Gets the row grid color.


getHeader

public java.lang.String[] getHeader()
Gets the header fields.

Returns:
The header as a string array.

getHeaderBackground

public java.awt.Color getHeaderBackground(int index)
Gets the header background color.

Parameters:
index - The index of the header field.
Returns:
The color used.

getHeaderImage

public java.awt.Image getHeaderImage(int column)
Gets the image used in the specified header.

Parameters:
column - The column index.
Returns:
The image used, or null if no image is used.

getHeaderLabel

public java.lang.String getHeaderLabel(int index)
Gets the specified header field.

Parameters:
index - The index of the header field.
Returns:
The field label or null if no label is specified.

getImage

public java.awt.Image getImage(int column,
                               int row)
Gets an image used for the cell or column.

Parameters:
column - The index of the column.
row - The index of the row (-1 for all the rows in this column).
Returns:
The image or null for no image is used.

getImageName

public java.lang.String getImageName(int column,
                                     int row)
Gets the image name.

Parameters:
column - The index of the column.
row - The index of the row (-1 for all the rows in this column).
Returns:
The name of the image, or null if no image is present.

getInitThread

public java.lang.Thread getInitThread()
Gets the initializer thread. If loadingMessageOn or updateWhileLoadingURLData is set, the init() method starts a thread that loads the data. Get this thread and join it when it ends if you need to do something after it is done.

Returns:
The init thread if it's running, null otherwise.

getInsets

public java.awt.Insets getInsets()
Returns the default insets of the table (3, 3, 2, 2).


getLastIndex

public int getLastIndex()
Returns the index of the last row in the table. This might be different than the row count, since the rows can be inserted out of sequence and non consequtively.

See Also:
getRowCount()

getLastSelectedCell

public int getLastSelectedCell()
Returns the last selected cell/column.

Returns:
The index of the last selected cell, -1 if no row is selected.

getLastSelectedRow

public int getLastSelectedRow()
Returns the last selected row.

Returns:
The index of the last selected row, -1 if no row is selected.

getLastSortedColumn

public int getLastSortedColumn()
Gets the index of the last sorted column.

Returns:
The index (0-based) or -1 if no column has been sorted yet.

getMaxVisibleRowCount

public int getMaxVisibleRowCount()
Gets the number of rows that can be visible in the current viewport.

Returns:
The number of visible rows (always 0 or higher).

getNumericalValue

protected double getNumericalValue(java.lang.Object[] fields,
                                   int column,
                                   int type)
                            throws java.lang.IllegalArgumentException
This method is called by setRow() and returns a numerical value for a row object. By default, numerical values are returned for columns of type COLUMN_NUMBER, COLUMN_CURRENCY, COLUMN_IP, and COLUMN_DATE. This is done to speed up searching, sorting, and filtering of columns and to save space by not storing the label, but instead using the value. For number and currency column types, the fields[column] value is set to null, so the label is removed. If you want to add your own column types, just override this method if you want a numerical value be stored.

Called by: setRow().

Parameters:
fields - The fields of the row.
column - The index of the column.
type - The column type.
Returns:
The numerical value to store, return Double.NaN if no value is calculated.
Throws:
java.lang.IllegalArgumentException - If the value from the field could not be created.

getParameter

public java.lang.String getParameter(java.lang.String parameter)
Gets the named parameter. If the applet parameter prefix is set, the applet tries to read the parameter named prefix+name.

Parameters:
parameter - The parameter name.
Returns:
The parameter value, or null if not found.

getParameterPrefix

public java.lang.String getParameterPrefix()
Gets the applet parameter prefix.

Returns:
The prefix set, or null if no prefix is set.

getPostfix

public java.lang.String getPostfix(int column)
Gets the postfix of the specified column.

Parameters:
column - The column to get the postfix for.

getPreferredSize

public java.awt.Dimension getPreferredSize()
Gets the preferred size of the table.


getPrefix

public java.lang.String getPrefix(int column)
Gets the prefix of the specified column.

Parameters:
column - The column to get the prefix for.

getRow

public java.lang.Object[] getRow(int row)
This method returns the fields of the specified row. The entries in the array returned will hold the labels for textual columns, Date objects for date columns, byte[] arrays for IP columns, and labels for numerical columns. The array returned is a copy of the actual row stored, and any modifications you do to the array and it's references will not take any effect. However, if you do any modifications to it's referred elements the changes will be applied. If you want to modify the references of the row array, you need to call getTableData().getRow(index).

Parameters:
row - The row index.
Returns:
An array of strings or null if no row was found.
See Also:
setRow(int, Object[])

getRowBackground

public java.awt.Color getRowBackground(int index)
Gets the default row background color.

Parameters:
index - The index of the row, -1 for the default color.

getRowCount

public int getRowCount()
Returns the number of rows in the table data.

See Also:
getFilteredRowCount(), getLastIndex()

getRowFont

public java.awt.Font getRowFont(int row)
Gets the font used for the specific row.

Parameters:
row - The index of the row.
Returns:
The font used, or null if no font is defined for the specified row.

getRowForeground

public java.awt.Color getRowForeground(int index)
Gets the foreground color for the specific row. If there is no color set for the specified row, the default row foreground color is returned.

Parameters:
index - The index of the row.

getRowHeight

protected int getRowHeight(int row)
Returns the row height for the specified row.

Parameters:
row - The row index.
Returns:
The height in pixels.

getRowIndex

public int getRowIndex(int position)
Translates a row position to the index in TableData.

Parameters:
position - Position of the row.
Returns:
The index of the row, or -1 if there was no row at the position.

getRowIndex

public int getRowIndex(java.lang.Object key)
Translates a row key to the index it is stored in.

Parameters:
key - The key of the row.
Returns:
The index of the row, or -1 if not found.

getRowPosition

public int getRowPosition(int index)
Gets the row position of the specified row. Use getRowIndex(int position) to get the index of the row position.

Parameters:
index - The row index to find position of.
Returns:
The position, or -1 if the row is not displayed.

getSelectedRows

public int[] getSelectedRows()
Returns the indexes of the selected rows.

Returns:
An array of the row indexes, or empty array if none are selected.

getSelectionBackground

public java.awt.Color getSelectionBackground()
Gets the current background color of selected rows.


getSelectionCellBackground

public java.awt.Color getSelectionCellBackground()
Gets the current cell selection background color.


getSelectionForeground

public java.awt.Color getSelectionForeground()
Gets the current foreground color of selected rows.


getSelectionMode

public int getSelectionMode()
Gets the current selection mode.

Returns:
SELECT_NODE, SELECT_SINGLE, or SELECT_MULTIPLE.
See Also:
setSelectionMode(int)

getSortOrder

public int getSortOrder(int column)
Gets the current sorting order for the specified column.

Returns:
SORT_ASCENDING, SORT_DESCENDING, or SORT_UNSORTED if not sorted.

getSortType

protected int getSortType(int column_type)
Gets the sort type based on the column type. The sort can either be lexical or numerical, with lexical being the default if the column type is unknown. Override this if you add new column types.

Parameters:
column_type - The column type.
Returns:
SORT_LEXICAL or SORT_NUMERICAL.

getTableData

public TableData getTableData()
Gets the data of the table.


getThousandsDelimiter

public java.lang.String getThousandsDelimiter()
Gets the current thousands delimiter used for formatted numbers.

Returns:
The current delimiter, or null if the Locale is used.

getTooltip

public java.lang.String getTooltip(java.lang.String name)
Gets the specified tooltip label. Supported tooltip labels are tooltipHeader_N, tooltipFilter, and tooltipFilter_N.

Parameters:
name - The name of the tooltip label.
Returns:
The tooltip label or null if no label is defined.

getTooltipBackground

public java.awt.Color getTooltipBackground()
Gets the tooltip background color.

Returns:
The color used, or null if default is used.

getTooltipDelay

public int getTooltipDelay(java.lang.String name)
Gets the delay of the tootip labels. Supported tooltip labels are tooltipDelay, tooltipDelayHeader, and tooltipDelayFilter.

Parameters:
name - The name of the tooltip label(s) to get the delay for.
Returns:
The delay in milliseconds.

getTotalType

protected int getTotalType(int column_type)
This method is called when calculating the total row and gets the total type for the specified column type. The total type is either sum for COLUMN_NUMBER or COLUMN_CURRENCY or count for all other types. Override this method if you add new column types you wish to calculate a sum for.

Parameters:
column_type - The column type.
Returns:
TOTAL_COUNT or TOTAL_SUM.

getURL

public java.lang.Object getURL(int row,
                               int column)
Gets any URL assigned to the specified row or cell. The returned value is either a valid URL or a string, in which case it is a javascript function. The url is only applicable for applets, and the url is set using the setParameter("url_N_M", "url") method call, where N is the row, and M is the column.

Parameters:
row - The index of the row.
column - The index of the column, -1 for entire row.
Returns:
The URL for row and/or column, or null if none is assigned.

getURLTarget

public java.lang.String getURLTarget(int row,
                                     int column)
Gets the url target for the specified cell. The url is only applicable for applets, and the url is set using the setParameter("urlTarget_N_M", "target") method call, where N is the row, and M is the column.

Parameters:
row - The index of the row (0-based).
column - The index of the column (0-based).

getVersion

public static java.lang.String getVersion()
Gets the version number.


gotoRow

public boolean gotoRow(int index)
Scrolls to the row with the specified index. This is not the position.

Parameters:
index - The row index to scroll to.
Returns:
True if the table has to scroll to display the new row.

gotoRowPosition

public boolean gotoRowPosition(int position)
Scrolls to the specified row position.

Parameters:
position - The row position to scroll to (0-based).
Returns:
True if the table has to scroll to display the new row.

init

public void init()
This method is called by the applet container (web browser) and reads the applet parameters and the data.


isAutomaticRepaintOn

public boolean isAutomaticRepaintOn()
Checks if the automatic repaint flag is turned on.

Returns:
True for on, false for off.
See Also:
setAutomaticRepaintOn(boolean)

isColumnCollapsable

public boolean isColumnCollapsable(int column)
Checks if a column is set in collapsable mode.

Parameters:
column - The column index.
Returns:
True if collapsable, false otherwise.

isColumnCollapsed

public boolean isColumnCollapsed(int column)
Checks if a column is collapsed.

Parameters:
column - The index of the column to collapse.
Returns:
True if collapsed, false otherwise.

isColumnOn

public boolean isColumnOn(int column)
Checks if the specified column is turned on.

Parameters:
column - The index of the column to check.
Returns:
True for on, false for off.
See Also:
setColumnOn(int, boolean)

isColumnStretchOn

public boolean isColumnStretchOn()
Checks if column stretch is on.

Returns:
True if on, false if off.
See Also:
setColumnStretchOn(boolean)

isDoubleBufferingOn

public boolean isDoubleBufferingOn()
Checks if double buffering is on.

Returns:
True for on, false for off.

isFilterBarOn

public boolean isFilterBarOn()
Checks if the filter bar is turned on or off.

Returns:
True for on, false for off.
See Also:
setFilterBarOn(boolean)

isFilterEnabled

public boolean isFilterEnabled(int index)
Checks if the specified filter field is enabled for editing.

Parameters:
index - The column index to check for, -1 for any column.
Returns:
True if enabled, false if disabled.

isFilterOn

public boolean isFilterOn(int index)
Checks if the specified filter field is turned on.

Parameters:
index - The column index to check for, -1 for any column.
Returns:
True if on, false if off.

isGridOn

public boolean isGridOn()
Checks if the row grid is on or off.

Returns:
True for on, false for off.

isHeaderOn

public boolean isHeaderOn()
Checks if the header is on or off.

Returns:
True if on, false if off.

isLabelCacheOn

public boolean isLabelCacheOn()
Checks if the label cache is turned on.


isMouseOverCellOn

public boolean isMouseOverCellOn()
Checks if the mouseOverCellOn flag is turned on.

Returns:
True for on, false for off (default).
See Also:
setMouseOverCellOn(boolean)

isProgressiveFilterOn

public boolean isProgressiveFilterOn()
Checks if progressive filtering is on.

Returns:
True of on, false if off.
See Also:
setProgressiveFilterOn(boolean)

isRowSelected

public boolean isRowSelected(int index)
Checks if the specified row is selected.

Parameters:
index - The index of the row.
Returns:
True if selected, false if not.

isSortingOn

public boolean isSortingOn(int column)
Checks if interactiv sorting is turned on for the specified column.

Parameters:
column - The index of the column.
Returns:
True for on, false for off.
See Also:
setSortingOn(int, boolean)

isTotalRowOn

public boolean isTotalRowOn(int column)
Checks if the total row is on for the specified column.

Parameters:
column - The column to check for.
Returns:
True for on, false for off.

loadAppletParameters

public void loadAppletParameters(java.util.Hashtable parameters)
Loads the applet tag parameters into the parameters hashtable. You can then call setParameters() to set these parameters.

Parameters:
parameters - The parameters are placed into this hashtable.

loadData

public void loadData(java.lang.String url,
                     boolean progress)
              throws java.io.IOException
Loads the data into the table.

Parameters:
url - The URL to load the data from.
progress - Display a "loading data..." progress while loading the data.
Throws:
java.io.IOException

loadImage

protected java.awt.Image loadImage(java.lang.String name)
Loads an image from the applet document base.

Parameters:
name - The path/file name of the image.
Returns:
The image, or null if not found.

loadURLParameters

public void loadURLParameters(java.lang.String url,
                              java.util.Hashtable parameters)
                       throws java.io.IOException
Loads the parameters from the specified url. You can call setParameters(parameters) after they are loaded. If the parameters is set to null, the table is updated while the data is loaded.

Parameters:
url - The url to load the data from.
parameters - Read the parameters into this hashtable.
Throws:
java.io.IOException - If something went wrong with the data reading.

matchesFilter

protected boolean matchesFilter(Filter filter,
                                int row,
                                int column)
Checks for a match.

Parameters:
filter - The filter to check for.
row - The index of the current row to test for.
column - The column index.
Returns:
True for match, false for mismatch.

matchesFilter

protected boolean matchesFilter(int rowIndex)
This method is called to check if a row matches the current filter that is set. This is called when the filter is set or modified, and when a new row is added. The rowIndex is the index of the row being checked, and is used to speed up matching of numerical columns. Override this method if you add new column types and you need special matching rules.

Parameters:
rowIndex - The index of the row.

paint

public final void paint(java.awt.Graphics g)
Paints the table component. Methods called: render().

Parameters:
g - The graphics object used to paint with.

paintBorder

protected void paintBorder(java.awt.Graphics g,
                           java.awt.Rectangle viewport)
Paints the border around the table.
Called by: paintTable().

Parameters:
g - The graphics object used to paint with.
viewport - The viewport of the entire table.

paintCell

protected void paintCell(java.awt.Graphics g,
                         java.awt.Rectangle viewport,
                         java.lang.String label,
                         java.awt.Rectangle labelBounds,
                         java.awt.Image image,
                         int rowIndex,
                         int columnIndex)
Paints the label and the image of a cell. The clip of the graphics object is not set before this method is called.
Called by: paintColumn(), paintTotalRow(), paintFilterBar()
Calls: paintCellBackground(), paintCellForeground().

Parameters:
g - The graphics object used to paint with.
viewport - The viewport of the cell.
label - The label to paint.
labelBounds - The bounds of the label.
image - The image of the cell (optional).
rowIndex - The index of the row the cell is in (-1 if not known).
columnIndex - The index of the column the cell is in.

paintCellBackground

protected void paintCellBackground(java.awt.Graphics g,
                                   java.awt.Rectangle viewport,
                                   java.lang.String label,
                                   java.awt.Rectangle labelBounds,
                                   java.awt.Image image,
                                   int rowIndex,
                                   int columnIndex)
Paints the cell background. Override this if you want another background.
Called by: paintCell()

Parameters:
g - The graphics object used to paint with.
viewport - The viewport of the cell.
label - The label to paint.
labelBounds - The bounds of the label.
image - The image of the cell (optional).
rowIndex - The index of the row the cell is in (-1 if not known).
columnIndex - The index of the column the cell is in.

paintCellForeground

protected void paintCellForeground(java.awt.Graphics g,
                                   java.awt.Rectangle viewport,
                                   java.lang.String label,
                                   java.awt.Rectangle labelBounds,
                                   java.awt.Image image,
                                   int rowIndex,
                                   int columnIndex)
Paints the cell foreground.
Called by: paintCell()

Parameters:
g - The graphics object used to paint with.
viewport - The viewport of the cell.
label - The label to paint.
labelBounds - The bounds of the label.
image - The image of the cell (optional).
rowIndex - The index of the row the cell is in (-1 if not known).
columnIndex - The index of the column the cell is in.

paintCellLink

protected void paintCellLink(java.awt.Graphics g,
                             java.awt.Rectangle viewport,
                             java.lang.String label,
                             java.awt.Rectangle labelBounds,
                             java.awt.Image image,
                             int rowIndex,
                             int columnIndex,
                             boolean rowURL)
Paints any url link below the label if configured and the column is not collapsed.
Called by: paintCell()

Parameters:
g - The graphics object used to paint with.
viewport - The viewport of the cell.
label - The label to paint.
labelBounds - The bounds of the label.
image - The image of the cell (optional).
rowIndex - The index of the row the cell is in (-1 if not known).
columnIndex - The index of the column the cell is in.
rowURL - Set to true if the entire row has the URL, the link should cover the cell.

paintColumn

protected void paintColumn(java.awt.Graphics g,
                           java.awt.Rectangle viewport,
                           int columnIndex)
Paints a column of the table.
Called by: paintRows().
Calls: getCellLabel(), calculateLabelBounds(), paintCell().

Parameters:
g - The graphics object used to paint with.
viewport - The viewport where this column is painted.
columnIndex - The index of the column being painted.

paintFilterBar

protected void paintFilterBar(java.awt.Graphics g,
                              java.awt.Rectangle viewport)
Paints the filter bar used for searhing and filtering. The filter bar is either painted at the bottom of the table below all the rows and the total row, or at the top of the table just below the header.
Called by: paintTable().
Calls: calculateLabelBounds(), paintCell().

Parameters:
g - The graphics object used to paint with.
viewport - The viewport where the filter bar is painted.

paintGrid

protected void paintGrid(java.awt.Graphics g,
                         java.awt.Rectangle viewport)
Paints the row grid.
Called by: paintTable().
Calls: calculateColumnViewPort().

Parameters:
g - The graphics context used to paint with.
viewport - The viewport where the rows are painted.

paintHeader

protected void paintHeader(java.awt.Graphics g,
                           java.awt.Rectangle viewport)
Paints the table header.
Called by: paintTable().
Calls: paintMultiLineLabel().

Parameters:
g - The graphics context used to paint with.
viewport - The viewport where the header is painted.

paintHorizontalScrollbar

protected void paintHorizontalScrollbar(java.awt.Graphics g,
                                        java.awt.Rectangle viewport)
Paints the horizontal scroll bar.
Called by: paintTable().

Parameters:
g - The graphics object used to paint with.
viewport - The scrollbars viewport.

paintLoadingDataMessage

protected void paintLoadingDataMessage(java.awt.Graphics g,
                                       java.awt.Rectangle viewport)
Paints the loading data message. Override this method if you want this method painted otherwise.
Called by: render().
Calls: paintBorder().

Parameters:
g - The graphics object used to paint with.
viewport - The entire tables viewport.

paintMouseOverCell

protected void paintMouseOverCell(java.awt.Graphics g,
                                  java.awt.Rectangle viewport,
                                  int rowIndex,
                                  int columnIndex)
Paints the label and the image of a cell. The clip of the graphics object is not set before this method is called.
Called by: paintColumn(), paintTotalRow(), paintFilterBar()

Parameters:
g - The graphics object used to paint with.
viewport - The viewport of the cell.
rowIndex - The index of the row the cell is in (-1 if not known).
columnIndex - The index of the column the cell is in.

paintMultiLineLabel

protected void paintMultiLineLabel(java.awt.Graphics g,
                                   java.awt.Rectangle bounds,
                                   java.lang.String label,
                                   int alignment)
Paints a multiline label in the specified bounds. Each line is delimited with the character \n.
Called by: paintHeader().

Parameters:
g - The graphics object to paint with.
bounds - The bounds to paint within.
label - The label to be painted.
alignment - The horizontal alignment of the label (ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT).

paintRowBackground

protected void paintRowBackground(java.awt.Graphics g,
                                  java.awt.Rectangle viewport,
                                  int rowPosition)
Paints the row background color.
Called by: paintRows().

Parameters:
g - The graphics object used to paint with.
viewport - The viewport where the rows are painted in.
rowPosition - The position index of the row.

paintRows

protected void paintRows(java.awt.Graphics g,
                         java.awt.Rectangle viewport)
Paints the rows of the table for each column. Columns outside the viewport will not be painted.
Called by: paintTable().
Calls: paintRowBackground(), paintRowSelection(), calculateColumnViewPort(), paintColumn().

Parameters:
g - The graphics object used to paint with.
viewport - The viewport where the rows are painted in.

paintRowSelection

protected void paintRowSelection(java.awt.Graphics g,
                                 java.awt.Rectangle viewport,
                                 int rowIndex)
Paints the row selection background color.
Called by: paintRows().

Parameters:
g - The graphics object used to paint with.
viewport - The viewport where the rows are painted in.
rowIndex - The index of the row.

paintTable

protected void paintTable(java.awt.Graphics g)
Paints the table.
Called by: render().
Calls: calculateViewPorts(), calculateTotals(), paintRows(), paintGrid(), paintHeader(), paintTotalRow(), paintFilterbar(), paintVerticalScrollbar(), paintHorizontalScrollbar(), paintBorder(), and paintTooltipLabel().

Parameters:
g - The graphics object used to paint with.

paintTooltipLabel

protected void paintTooltipLabel(java.awt.Graphics g,
                                 java.lang.String label,
                                 int xpos,
                                 int ypos)
Paints a tooltip label at the specified position.
Called by: paintTable().
Calls: calculateMultiLineLabelSize(), paintMultiLineLabel().

Parameters:
g - The graphics object used to paint with.
label - The tooltip label to be painted.
xpos - The x position of the label.
ypos - The y position of the label.

paintTotalRow

protected void paintTotalRow(java.awt.Graphics g,
                             java.awt.Rectangle viewport)
Paints the total row.
Called by: paintTable().
Calls: getColumnTotalLabel(), calculateLabelBounds(), paintCell().

Parameters:
g - The graphics object used to paint with.
viewport - The viewport where the total row is painted.

paintVerticalScrollbar

protected void paintVerticalScrollbar(java.awt.Graphics g,
                                      java.awt.Rectangle viewport)
Paints the vertical scroll bar.
Called by: paintTable().

Parameters:
g - The graphics object used to paint with.
viewport - The scrollbars viewport.

processEvent

protected void processEvent(java.awt.AWTEvent event)
Handles the internal events of the table. lastMousePosition is set before any of the specific mouse event processing methods are called.
Called by: The Java VM.
Calls: processMouseMoved(), processMousePressed(), processMouseDragged(), processMouseReleased(), processMouseClicked(), and processKeys().

Parameters:
event - The AWT event to process.

processHorizontalScrollbar

protected void processHorizontalScrollbar(java.awt.event.MouseEvent event)
Processes the horizontal scrollbar events.
Called by: processMousePressed() and processMouseDragged().

Parameters:
event - The mouse clicked or dragged event.

processKeyFilterEdit

protected void processKeyFilterEdit(java.awt.event.KeyEvent event)
Processes key type events and filter editing.
Called by: processKeys().
Calls: setFilter(), selectRow().

Parameters:
event - The key pressed or key typed event.

processKeyRowNavigation

protected void processKeyRowNavigation(java.awt.event.KeyEvent event)
Processes key pressed events causing row navigation.
Called by: processKeys().
Calls: selectRow(), setFilterFields().

Parameters:
event - The key pressed event.

processKeys

protected void processKeys(java.awt.event.KeyEvent event)
Processes key events. Row and cell navigation, data update, and filter editing is handled by this method.
Called by: processEvent().
Calls: processKeyRowNavigation() and processKeyFilterEdit().

Parameters:
event - The key event.

processMouseClicked

protected void processMouseClicked(java.awt.event.MouseEvent event)
Processes mouse button click events. A click event happens if the mouse pointer has not been moved between the push and release events. This method causes column sorting, column collapsing, and URL opening.
Called by: processEvent().
Calls: setColumnCollapsed(), sortColumn(), showDocument(), callJavaScript().

Parameters:
event - The mouse event.

processMouseDragged

protected void processMouseDragged(java.awt.event.MouseEvent event)
Processes mouse dragging events, adjusting column width or dragging scrollbar sliders.
Called by: processEvent().
Calls: processVerticalScrollbar(), and processHorizontalScrollbar().

Parameters:
event - The mouse dragged event.

processMouseMoved

protected void processMouseMoved(java.awt.event.MouseEvent event)
Changes the cursor as the mouse moves across the table. If the mouse is over a header field it changes to a hand, if over a field seperator it changes to a horizontal resize-cursor, if over a filter field it changes to a text edit cursor. If the mouse is over a URL, the url is written to the browsers status field. It also displays tooltip labels.
Called by: processEvent().
Calls: calculateCellInfo(), repaint().

Parameters:
event - The mouse move event.

processMousePressed

protected void processMousePressed(java.awt.event.MouseEvent event)
Handles the row selections, header pushdown, filter activation, and scrollbar arrow buttons.
Called by: processEvent().
Calls: calculateCellInfo(), processVerticalScrollbar(), processHorizontalScrollbar(), processRowSelection(), repaint().

Parameters:
event - The mouse press event.

processMouseReleased

protected void processMouseReleased(java.awt.event.MouseEvent event)
Processes mouse button release events. Released pushed-down header fields and scroller buttons, and stops scroller threads.
Called by: processEvent().
Calls: repaint().

Parameters:
event - The mouse event.

processNotifyListeners

protected void processNotifyListeners(TableEvent event)
Notifies all the registered table listeners about the specified event. Overload this method if you want to do something before anyone gets the event after you must call super.processNotifyListeners(event).

Parameters:
event - The table event to be sent.

processRowSelection

protected void processRowSelection(java.awt.event.MouseEvent event,
                                   int rowIndex,
                                   int columnIndex,
                                   int rowPosition)
Processes the row selection events. The row clicked will be selected or deselected depending on the current state of the row. Selection, deselection, and double-click events will be notified the listeners. Cells or rows with URLS are processed in processMouseReleased().
Called by: processMousePressed().
Calls: selectRow(), setFilterFields().

Parameters:
event - The event.
rowIndex - The index of the selected row.
columnIndex - The index of the selected column.
rowPosition - The position index of the selected row.

processVerticalScrollbar

protected void processVerticalScrollbar(java.awt.event.MouseEvent event)
Processes the vertical scrollbar events.
Called by: processMousePressed() and processMouseDragged().

Parameters:
event - The mouse clicked or dragged event.

removeAll

public void removeAll()
Removes all the rows from the table data.


removeRow

public void removeRow(int row)
Removes the specified row from the table data.

Parameters:
row - The index of the row.

removeTableListener

public void removeTableListener(TableListener listener)
Removes the given table listener from the table.

Parameters:
listener - The table listener to remove.
See Also:
addTableListener(com.objectplanet.gui.TableListener)

render

protected void render(java.awt.Graphics g)
Renders all the elements of the table.
Calls: paintLoadingDataMessage(), paintTable().

Parameters:
g - The graphics context used to paint the table on.

resetAllRows

public void resetAllRows()
Resets all row parameters such as fonts, foreground and background colors, cell images, URLs and URL targets


resetRow

public void resetRow(int row)
Resets parameters for the specified row.

Parameters:
row - Index of the row.

selectRow

public void selectRow(int index,
                      boolean select)
Selects the specified row in the table. No event is generated. A selected row will appear highlighted.

Parameters:
index - The index of the row to select, -1 for all rows.
select - True for select, false for deselect.

setAlternateRowBackground

public void setAlternateRowBackground(java.awt.Color color,
                                      int count,
                                      int start)
Sets alternating row backgrounds. The colors set by setRowBackground(index, color) follows the rows when they are sorted. This method alternates the rows and the colors does not follow the sorting or filtering. Set the color to null for no alternating.

Parameters:
color - The color to use for the background.
count - The number of sequential rows to alternate the background.
start - The position of the row where the alternation should start.

setAutomaticRepaintOn

public void setAutomaticRepaintOn(boolean state)
Turns on or off the automatic table repaint. If automatic table repaint is turned on, the table will be automatically repainted if the data changes or any table attributes change. If it is turned off, the repaint() method must be called explisitly to repaint the table. It is turned on by default.

Parameters:
state - True for on (detaul), false for off.

setCell

public void setCell(int row,
                    int col,
                    java.lang.Object value)
Sets the value of a cell in the table.

Parameters:
row - The index of the row to set the cell in.
col - The column to set the cell in.
value - The value to set for the cell.
Throws:
java.lang.IllegalArgumentException - If the column is incorrect.
java.lang.ClassCastException - If the value is not a String.

setColumnAlignment

public void setColumnAlignment(int column,
                               int alignment)
Sets the column alignment.

Parameters:
column - The index of the column.
alignment - ALIGN_LEFT, ALIGN_CENTER, or ALIGN_RIGHT.
Throws:
java.lang.IllegalArgumentException - if the column or alignment is invalid.

setColumnCollapsable

public void setColumnCollapsable(int column,
                                 boolean collapsable)
Sets a column in collapsable mode. If a column is collapsable a left arrow will be displayed at the right edge of the header field, and if the user clicks this arrow, the column will collaps to about 10 pixels. A collapsed column will not appear on data exports.

Parameters:
column - The column index, -1 for all columns.
collapsable - True if collapsable, false otherwise.
Throws:
java.lang.IllegalArgumentException - if the column index is invalid.

setColumnCollapsed

public void setColumnCollapsed(int column,
                               boolean collapsed)
Collapses the specified column. A part of the column will still be displayed, with an arrow to uncollapse the column again (user clicks the arrow). The cells in the collapsed column will display ... only.

Parameters:
column - The index of the column to collapse.
collapsed - True for collapsed, false otherwise.
Throws:
java.lang.IllegalArgumentException - if the column index is invalid.

setColumnCount

public void setColumnCount(int count)
Sets the number of columns in the table.

Parameters:
count - The number of columns to set.

setColumnOn

public void setColumnOn(int column,
                        boolean state)
Turns a column on or off. If the column is off, it will not be displayed, however the indexes of the columns will still be the same. So if column 2 is turned off, the visible columns will have indexes 0,1,3,4,5, and so on. All columns are turned on by default.

Parameters:
column - The index of the column to turn off.
state - True for on, false for off.
Throws:
java.lang.IllegalArgumentException - if the column index is invalid.

setColumnStretchOn

public void setColumnStretchOn(boolean on)
Turns on column stretch. If this is turned on, the columns will stretch so they occupy the whole table width.

Parameters:
on - True for on, false for off.

setColumnType

public void setColumnType(int column,
                          int type)
Sets the columns to the specified type. The column type will affect the column sorting. Text columns are sorted lexically, while number columns are sorted numerically. If the type is currency, the correct currency symbol will be added as a prefix or a postfix.

Parameters:
column - The column index.
type - COLUMN_TEXT, COLUMN_NUMBER, COLUMN_CURRENCY, COLUMN_DATE, or COLUMN_IP.
Throws:
java.lang.IllegalArgumentException - if the column index.

setColumnWidth

public void setColumnWidth(int column,
                           int width)
Sets the width of the specified column. Set the width to -1 to adjust to the widest label currently visible in the column.

Parameters:
column - The index of the column.
width - The width in number of pixels, -1 for widest label.

setDataParameterField

public void setDataParameterField(java.lang.String field,
                                  java.lang.String value)
Sets a field in the data parameter value. If the field does not exist from before it is added, if it exists already, it's value is replaced with the new one.

Parameters:
field - The name of the field.
value - The value of the field, null to remove it.

setDateFormatter

public void setDateFormatter(int column,
                             java.text.DateFormat formatter)
Sets the date formatter used to format date columns.

Parameters:
column - The index of the column (-1 for default formatter).
formatter - The date formatter to be used, null to remove.

setDecimalCount

public void setDecimalCount(int column,
                            int count)
Sets the decimal count for the specified column. The column has to be of type COLUMN_NUMBER or COLUMN_CURRENCY.

Parameters:
column - The index of the column.
count - The decimal count.
Throws:
java.lang.IllegalArgumentException - if the column is invalid.

setDefaultSortOrder

public void setDefaultSortOrder(int column,
                                int order)
Sets the default sorting order for the specified column. This affects the sorting order the first time you sort an unsorted column. The default sorting order is ascending. For numerical type columns, you might want to set the default sorting order to descending.

Parameters:
column - The index of the column.
order - SORT_ASCENDING or SORT_DESCENDING.

setDoubleBufferingOn

public void setDoubleBufferingOn(boolean state)
Turns on or off double buffering. If double buffering is turned off, flickering might occur. Turn this off is you use some other type of double buffering/non-flickering techniques.

Parameters:
state - True for on, false for off. Default is on.

setEnabled

public void setEnabled(boolean enabled)
Enables or disables the component.

Parameters:
enabled - True for enabled, false for disabled.

setExportFrameIcon

public void setExportFrameIcon(java.awt.Image image)
Sets the export frame icon.

Parameters:
image - The image to use for the icon, null for default.

setFilter

public void setFilter(int column,
                      java.lang.String value)
Sets the current filter for a column. If a filter is set for two columns, only rows matching fields in both column will be displayed. To clear the filter for a column, specify a null value for it. The filter operators that can be used are *, <, >, <=, >=, <>.

Parameters:
column - The index of the column to filter.
value - The value to use for a filter, null to clear filter.
Throws:
java.lang.IllegalArgumentException - if the column index is invalid.
See Also:
setFilterBarOn(boolean), setFilterEnabled(int, boolean), setFilterOn(int, boolean)

setFilterBarBackground

public void setFilterBarBackground(java.awt.Color color)
Sets the filter bar background color when the filter field is inactive.

Parameters:
color - The color to use, null for the default color.
See Also:
setFilterBarOnBackground(java.awt.Color)

setFilterBarOn

public void setFilterBarOn(boolean state)
Turns on or off the filter bar. The filter bar is off by default.

Parameters:
state - True for on, false for off.
See Also:
setFilter(int, java.lang.String)

setFilterBarOnBackground

public void setFilterBarOnBackground(java.awt.Color color)
Sets the filter bar background color when the filter field is active.

Parameters:
color - The color to use, null for the default color.
See Also:
setFilterBarBackground(java.awt.Color)

setFilterBarPosition

public void setFilterBarPosition(int position)
Sets the position of the filter bar. The filter bar can be at the bottom (default) or at the top below the header.

Parameters:
position - TOP or BOTTOM.

setFilterEnabled

public void setFilterEnabled(int column,
                             boolean enabled)
Enables or disables a filter field for filter input.

Parameters:
column - The column index -1 for all columns.
enabled - True for enabled (default), false for disabled.
Throws:
java.lang.IllegalArgumentException - For invalid column index.

setFilterFields

public void setFilterFields(java.lang.Object[] fields)
Sets the current filter fields without refiltering the table.

Parameters:
fields - The value of the filter fields.

setFilterOn

public void setFilterOn(int column,
                        boolean state)
Turns on the specified filter field, and filters the data.

Parameters:
column - The column to turn the filter on for, -1 for all.
state - The status of the filter, true for on, false for off.
Throws:
java.lang.IllegalArgumentException - if the column index is invalid.

setFilterValueSeparator

public void setFilterValueSeparator(int column,
                                    java.lang.String separator)
Sets the separator to use between filter values in combination filters. The default separator is space. If two (or more) filter values (expressions) are typed into the filter field, rows matching both (or all) filters will be displayed. Not expressions (!= and !*) does not work with combination filters.

Parameters:
column - The column index.
separator - The separator to use, null or empty for default.
Throws:
java.lang.IllegalArgumentException - If the column index is invalid.

setFilterWildCard

public void setFilterWildCard(java.lang.String wildcard)
Sets the wildcard to be used when filtering data using the filter bar. The default filter wildcard is * and can be used before and after a string. If the wildcard is set to null, any row containing a label beginning with the typed filter string matches.

Parameters:
wildcard - The wildcard to use.

setFont

public void setFont(java.awt.Font font)
Sets the default font to be used.

Parameters:
font - The font to use, null for the default default font.

setFont

public void setFont(java.lang.String name,
                    java.awt.Font font)
Sets the named font. The fonts that can be set are headerFont, rowFont, totalRowFont, filterBarFont, and tooltipFont.

Parameters:
name - The name of the font to be set.
font - The font to use, or null if default font is to be used.

setFontColor

public void setFontColor(java.lang.String name,
                         java.awt.Color color)
Sets the color used for the specified font. The font colors that can be set are headerFontColor, totalRowFontColor, filterBarFontColor, and filterBarOnFontColor.

Parameters:
name - The name of the font to be set.
color - The color to use, or null if default color is to be used.

setGridColor

public void setGridColor(java.awt.Color color)
Sets the row grid color.

Parameters:
color - The color to use, null for the default color.

setGridOn

public void setGridOn(boolean on)
Turns on or off the row grid. It is off by default.

Parameters:
on - True for on, false for off.

setHeader

public void setHeader(java.lang.String[] fields)
Sets the text of the table header.

Parameters:
fields - An array of strings.

setHeaderBackground

public void setHeaderBackground(int index,
                                java.awt.Color color)
Sets the header background color.

Parameters:
index - The index of the header field.
color - The color to be used, null for the default color.

setHeaderImage

public void setHeaderImage(int column,
                           java.awt.Image image)
Sets the image for the specified header field.

Parameters:
column - The column index (0-based).
image - The image to add to the header.

setHeaderLabel

public void setHeaderLabel(int index,
                           java.lang.String label)
Sets the specified header field.

Parameters:
index - The index of the header field.
label - The label to set for the field.

setHeaderOn

public void setHeaderOn(boolean on)
Turns the header on or off. The header is on by default.

Parameters:
on - True for on, false for off.

setImage

public void setImage(int column,
                     int row,
                     java.awt.Image image)
Sets an image to be used in a cell or column. The image is always to the left of the label.

Parameters:
column - The index of the column.
row - The index of the row (-1 for all the rows in this column).
image - The image to be used, null for no image.

setLabelCacheOn

public void setLabelCacheOn(boolean on)
Turns on or off the label cache for textual columns. This will save memory space if you have many repeating labels in your cells. The label cache is static and is shared across all instances of the table component within the same java VM.

Parameters:
on - True for on, false for off.

setLocale

public void setLocale(java.util.Locale locale)
Sets the locale to use when formatting numbers and currency columns. Default locale used is the one set in the clients PC. To format dates use the setDateFormatter() method.

Parameters:
locale - The locale to use, null for default locale.
See Also:
setDateFormatter(int, java.text.DateFormat)

setMouseOverCellOn

public void setMouseOverCellOn(boolean on)
Turns on or off display of hidden cells when the mouse moves over it (off by default).

Parameters:
on - True for on, false for off.

setParameter

public void setParameter(java.lang.String name,
                         java.lang.String value)
Sets a parameter in the chart.

Parameters:
name - The name of the parameter.
value - The value of the parameter as a string.

setParameterPrefix

public void setParameterPrefix(java.lang.String prefix)
Sets the applet parameter prefix. This prefix is used if this table applet is used as a component within another applet and wants to read applet parameters. The applet parameters for this table applet must then be prefixed with this prefix.

Parameters:
prefix - The prefix to use.
See Also:
setParentApplet(java.applet.Applet)

setParameters

public void setParameters(java.util.Hashtable parameters)
Sets the parameters found in the specified table. The parameters are keyed by their parameter name.

Parameters:
parameters - The parameter pairs (name, value).

setParentApplet

public void setParentApplet(java.applet.Applet applet)
Sets the parent applet if this applet is used as a component in another applet. This way you can call the init() method of the applet and read the applet parameters. Set the parent applet before init() is called.

Parameters:
applet - The parent applet.
See Also:
setParameterPrefix(java.lang.String)

setPostfix

public void setPostfix(int column,
                       java.lang.String postfix)
Sets the postfix of the labels in the specified column.

Parameters:
column - The index of the column.
postfix - The postfix, null for no postfix.

setPreferredSize

public void setPreferredSize(int width,
                             int height)
Sets the preferred size of the table.

Parameters:
width - The width of the table.
height - The height of the table.

setPrefix

public void setPrefix(int column,
                      java.lang.String prefix)
Sets the prefix of the labels in the specified column.

Parameters:
column - The index of the column.
prefix - The prefix, null for no prefix.

setProgressiveFilterOn

public void setProgressiveFilterOn(boolean on)
Turns on progressive filtering. If this is turned on, the table will be filtered as the user types in the filter key.

Parameters:
on - True for on, false for off.
See Also:
setFilterBarOn(boolean), setFilterOn(int, boolean), setFilter(int, java.lang.String)

setRow

public int setRow(int index,
                  java.lang.Object[] fields)
Sets a row in the table at the specified row index. To add a row at the end, specify -1 as the row index. If the row index is larger than the number of rows currently in the table, the row is added at the specified index and empty rows are inserted in between. If a row exists in the specified row index from before, the old row will be replaced.

Parameters:
index - The index of the row. -1 adds the row at the end.
fields - A string array containing the row labels.
Returns:
The index of the row where it was set.
See Also:
setRow(int, Object, Object[])

setRow

public int setRow(int index,
                  java.lang.Object key,
                  java.lang.Object[] fields)
Sets a row in the table at the specified row index using the given key. The row can be retrieved using this key at a later time. To add a row at the end, specify -1 as the row index. If the row index is larger than the number of rows currently in the table, the row is added at the specified index and empty rows are inserted in between. If a row exists in the specified row index from before, the old row will be replaced. The row will only be added as a viewable row if it matches the current filter. It will be added to the data in any case.
Calls: TableData.setRow(), setNumericalFieldValue(), matchesFilter().

Parameters:
index - The index of the row. -1 adds the row at the end.
key - The key of the row.
fields - The text for each field of the row.
Returns:
The index of the row where it was set.
See Also:
setRow(int, Object[])

setRowBackground

public void setRowBackground(int index,
                             java.awt.Color color)
Sets the background color of the rows.

Parameters:
index - The index of the row, -1 for the default color.
color - The color to set.

setRowFont

public void setRowFont(int row,
                       java.awt.Font font)
Sets the font used for the specific row. Use setFont("rowFont", font) to set the default row font.

Parameters:
row - The index of the row.
font - The font to use, null for the default font.

setRowForeground

public void setRowForeground(int index,
                             java.awt.Color color)
Sets the row text color.

Parameters:
index - The index of the row, -1 for the default color.
color - The color to set.

setSelectionBackground

public void setSelectionBackground(java.awt.Color color)
Sets the background color of selected rows.

Parameters:
color - The color to use, null for the default color.

setSelectionCellBackground

public void setSelectionCellBackground(java.awt.Color color)
Sets the cell selection background color.

Parameters:
color - The color to use, null for default.

setSelectionForeground

public void setSelectionForeground(java.awt.Color color)
Sets the foreground color of selected rows.

Parameters:
color - The color to use, null for the default color.

setSelectionMode

public void setSelectionMode(int mode)
Sets the selection mode. The default is SELECT_NONE. If the selection mode is set to SELECT_SINGLE only one row at a time can be selected. If the selection mode is set to SELECT_MULTIPLE multiple rows can be selected and deselected.

Parameters:
mode - SELECT_NONE, SELECT_SINGLE, SELECT_MULTIPLE.
Throws:
java.lang.IllegalArgumentException - if the selection mode is invalid.

setSortingOn

public void setSortingOn(int column,
                         boolean on)
Turns on or off interactiv sorting for the specified column. If interactive sorting is on, the user can sort a column by clicking the header field for that column. Sorting is on by default.

Parameters:
column - The index of the column (0-based).
on - True for on, false for off.

setTableData

public void setTableData(TableData tableData)
Sets the data of the table. By using this, two or more tables can share the same data.

Parameters:
tableData - The data to use.
Throws:
java.lang.IllegalArgumentException - if the data is invalid.

setThousandsDelimiter

public void setThousandsDelimiter(java.lang.String delimiter)
Sets the delimiter for use in the display of numbers. By default, the delimiter is not set, so the delimiter for the default Locale is used instead.

Parameters:
delimiter - The delimiter character to set or true for default, or false for no thousands grouping.

setTooltip

public void setTooltip(java.lang.String name,
                       java.lang.String tooltip)
Sets the header tooltip label. Supported labels are tooltipHeader_N, tooltipFilter, and tooltipFilter_N where N is the column index (0-based). Using an empty or null tooltip removes the tooltip label.

Parameters:
name - The name of the tooltip label.
tooltip - The tooltip label, use \n for line breaks.

setTooltipBackground

public void setTooltipBackground(java.awt.Color color)
Sets the tooltip background color.

Parameters:
color - The color to use, null for default color.

setTooltipDelay

public void setTooltipDelay(java.lang.String name,
                            int ms)
Sets the delay of the tooltip labels. The default delay is 1500 milliseconds. Use -1 to clear the delay (and use default) for the named tooltip. Supported tooltips are tooltipDelay, tooltipDelayHeader, and tooltipDelayFilter.

Parameters:
name - The name of the tooltip label(s) to set the delay for.
ms - The delay in milliseconds.

setTotalRowOn

public void setTotalRowOn(int column,
                          boolean on)
Turns on the total for individual columns.

Parameters:
column - The column to set total on for, -1 for all.
on - True for on, false for off.

showStatus

public void showStatus(java.lang.String status)
Displays the status message.

Parameters:
status - The status message to show.

sortColumn

public void sortColumn(int column,
                       int order)
Sorts a column in either ascending or descending order. Rows with null values will always be put last, regarding the sorting order.

Parameters:
column - The index of the column to sort, -1 sorts by the row index.
order - SORT_ASCENDING or SORT_DESCENDING.
Throws:
java.lang.IllegalArgumentException - If the sort order is invalid.

start

public void start()
Called when the applet is started.


stop

public void stop()
Called when the applet is stopped.


update

public void update(java.awt.Graphics g)
Overridden to avoid flickering.


updateData

public void updateData(boolean block)
Updates the table's data by loading the parameters from the url specified in the data parameter. The data parameters is either set through the applet parameter or through table.setParameter("data", "url"). A DATA_LOADED event is sent when the new data has been loaded. This method returns immediatly if the block parameter is set to false and updates the data in a separate thread. If the block parameter is set to true, the method blocks until the data has been loaded.

Parameters:
block - True if this method should block until the data is updated.