wt.clients.csm.widgets
Class CSMResultsTable

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bywt.clients.csm.widgets.CSMResultsTable
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Serializable

public class CSMResultsTable
extends JPanel

A Panel that has a table with scroll bars

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  Color bgColor
           
protected  CSMResultsTableCellRenderer cellRenderer
           
protected  Vector colNames
           
(package private)  boolean columnSelected
           
protected  CSMResultsTableSelectionListenerManager csmResultsTableSelectionListenerManager
           
(package private)  int defaultColumnWidth
           
protected  Color gridColor
           
protected  TableCellRenderer headerRenderer
           
(package private)  MouseListener listener
           
protected  Vector maxColumnWidth
           
protected  String ms
           
(package private)  boolean rowSelected
           
protected  JScrollPane scrollPane
           
static int SELECTION
           
protected  JTable table
           
protected  CSMResultsTableModel tableModel
           
 
Fields inherited from class javax.swing.JPanel
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
 
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
CSMResultsTable()
          Construct a JCSMTable
CSMResultsTable(Vector data, Vector columnNames)
          Construct a JCSMTable
 
Method Summary
 void addCSMResultsTableSelectionListener(CSMResultsTableSelectionEventListener obj)
           
 void addMouseListener(MouseListener listener)
           
 void clearTable()
           
 void clearTableData()
          Clears the table (Removes all the entries)
protected  CSMResultsTableModel createModel()
           
protected  CSMResultsTableModel createModel(Vector data, Vector columnNames)
           
 void fireSelectionChangedEvent(CSMResultsTableSelectionEvent obj)
           
 Object getCellComponent(int row, int col)
          Get the cell component
 int getColumnCount()
          Return the column count
 int[] getColWidths()
           
protected  int getHeaderRowHeight()
          return the header row height
 String getMeasurementSystem()
           
 int getRankingColumn()
           
 Color getRowColor(int row)
           
 int getRowCount()
          Return the row count
 int[] getRowHeights()
          Get the row heights
 int getSelectedColumn()
          Get the selected column
 int[] getSelectedColumns()
          Get the selected columns Get an array of indices of the selected columns
 int getSelectedRow()
          Get the selectedRow
 int[] getSelectedRows()
          Get the selected Rows
 void removeCSMResultsTableSelectionListener(CSMResultsTableSelectionEventListener obj)
           
 void removeMouseListener(MouseListener listener)
           
 void setAutoResizeMode(int mode)
          Set the auto resize mode
 void setColor(Hashtable colorTable)
           
 void setColumnNames(Vector columnNames)
           
 void setColumnSelectionInterval(int index0, int index1)
           
 void setColumnWidth()
           
 void setColumnWidth(int width)
          Set the column width
 void setColumnWidth(int columnNo, int width)
          Set the column width for a specified column
protected  void setComponents()
          Set the components
 void setHeaderBackground(Color color)
          Set the header background color
 void setHeaderFont(Font font)
          Set the headerFont
 void setHeaderForeground(Color color)
          Set the header foreground color
protected  void setHeaderRenderer(TableCellRenderer headerRenderer)
           
 void setMaxColumnWidth(Vector v)
           
 void setMeasurementSystem(String ms)
           
 void setRankingColumn(int i)
           
 void setRowColor(int row, Color color)
           
 void setRowHeight(int height)
          Set the row height
 void setRowSelectionInterval(int index0, int index1)
           
protected  void setTable()
          Set the table
 void setTableBackground(Color color)
          Set the table background
 void setTableData(Vector data)
          Set the data for the table
 void setTableIntercellSpacing(Dimension d)
          Set the table cell spacing
 void setTableSize(Dimension dimension)
          Set the table size
private  void setTheColors()
           
 void stopCellEditing()
           
 void validateTable()
          Validate the table
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, 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

SELECTION

public static final int SELECTION
See Also:
Constant Field Values

tableModel

protected CSMResultsTableModel tableModel

table

protected JTable table

scrollPane

protected JScrollPane scrollPane

bgColor

protected Color bgColor

gridColor

protected Color gridColor

headerRenderer

protected TableCellRenderer headerRenderer

cellRenderer

protected CSMResultsTableCellRenderer cellRenderer

ms

protected String ms

colNames

protected Vector colNames

maxColumnWidth

protected Vector maxColumnWidth

defaultColumnWidth

int defaultColumnWidth

rowSelected

boolean rowSelected

columnSelected

boolean columnSelected

listener

MouseListener listener

csmResultsTableSelectionListenerManager

protected CSMResultsTableSelectionListenerManager csmResultsTableSelectionListenerManager
Constructor Detail

CSMResultsTable

public CSMResultsTable()
Construct a JCSMTable


CSMResultsTable

public CSMResultsTable(Vector data,
                       Vector columnNames)
Construct a JCSMTable

Parameters:
data - - vector of (columns) vector of (rows)data
columnNames - - vector columnNames
Method Detail

createModel

protected CSMResultsTableModel createModel()

createModel

protected CSMResultsTableModel createModel(Vector data,
                                           Vector columnNames)

setColumnNames

public void setColumnNames(Vector columnNames)

setRankingColumn

public void setRankingColumn(int i)

getRankingColumn

public int getRankingColumn()

setTheColors

private void setTheColors()

setHeaderRenderer

protected void setHeaderRenderer(TableCellRenderer headerRenderer)

setTableData

public void setTableData(Vector data)
Set the data for the table


stopCellEditing

public void stopCellEditing()

clearTableData

public void clearTableData()
Clears the table (Removes all the entries)


clearTable

public void clearTable()

validateTable

public void validateTable()
Validate the table


getRowCount

public int getRowCount()
Return the row count

Returns:
the no of rows

getColumnCount

public int getColumnCount()
Return the column count

Returns:
the no of columns

getSelectedRow

public int getSelectedRow()
Get the selectedRow

Returns:
the index of the selected row

getSelectedRows

public int[] getSelectedRows()
Get the selected Rows

Returns:
an array of indices of the selected rows

getSelectedColumn

public int getSelectedColumn()
Get the selected column

Returns:
the index of the selected column

getSelectedColumns

public int[] getSelectedColumns()
Get the selected columns Get an array of indices of the selected columns


getCellComponent

public Object getCellComponent(int row,
                               int col)
Get the cell component


setColor

public void setColor(Hashtable colorTable)

setRowColor

public void setRowColor(int row,
                        Color color)

getRowColor

public Color getRowColor(int row)

setTableBackground

public void setTableBackground(Color color)
Set the table background

Parameters:
color -

setHeaderForeground

public void setHeaderForeground(Color color)
Set the header foreground color


setHeaderBackground

public void setHeaderBackground(Color color)
Set the header background color


setHeaderFont

public void setHeaderFont(Font font)
Set the headerFont


setColumnWidth

public void setColumnWidth()

setColumnWidth

public void setColumnWidth(int width)
Set the column width

Parameters:
width -

setColumnWidth

public void setColumnWidth(int columnNo,
                           int width)
Set the column width for a specified column

Parameters:
width -

setRowHeight

public void setRowHeight(int height)
Set the row height

Parameters:
height - of the row

setAutoResizeMode

public void setAutoResizeMode(int mode)
Set the auto resize mode

Parameters:
mode - (JTables AutoResize modes)

getColWidths

public int[] getColWidths()

getRowHeights

public int[] getRowHeights()
Get the row heights

Returns:
an array of row heights

getHeaderRowHeight

protected int getHeaderRowHeight()
return the header row height

Returns:
header row height

setTableIntercellSpacing

public void setTableIntercellSpacing(Dimension d)
Set the table cell spacing


setTableSize

public void setTableSize(Dimension dimension)
Set the table size

Parameters:
dimension -

addCSMResultsTableSelectionListener

public void addCSMResultsTableSelectionListener(CSMResultsTableSelectionEventListener obj)

removeCSMResultsTableSelectionListener

public void removeCSMResultsTableSelectionListener(CSMResultsTableSelectionEventListener obj)

fireSelectionChangedEvent

public void fireSelectionChangedEvent(CSMResultsTableSelectionEvent obj)

addMouseListener

public void addMouseListener(MouseListener listener)

removeMouseListener

public void removeMouseListener(MouseListener listener)

setComponents

protected void setComponents()
Set the components


setTable

protected void setTable()
Set the table


setMaxColumnWidth

public void setMaxColumnWidth(Vector v)

setMeasurementSystem

public void setMeasurementSystem(String ms)

getMeasurementSystem

public String getMeasurementSystem()

setRowSelectionInterval

public void setRowSelectionInterval(int index0,
                                    int index1)

setColumnSelectionInterval

public void setColumnSelectionInterval(int index0,
                                       int index1)