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.
 
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).
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.
static int SORT_UNSORTED
          Used to specify a column is not sorted.
static int TOP
          Used to display the filter bar at the top of the table.
 
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.
 void callJavaScript(java.lang.String javascript)
          Calls a javascript function in the applet page.
 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.
 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.
 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.
 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.
 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.
 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.
 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.
 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.
 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.
 void loadURLParameters(java.lang.String url, java.util.Hashtable parameters)
          Loads the parameters from the specified url.
 void paint(java.awt.Graphics g)
          Paints the table component.
 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.
 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, 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, preferredSize, print, printComponents, remove, remove, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, 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
equals, 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

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_UNSORTED

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

See Also:
Constant Field Values

TOP

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

See Also:
Constant Field Values
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.

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

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.

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)

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.

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.

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

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.

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 no