arlut.csd.JTable
Class gridTable

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--arlut.csd.JTable.baseTable
                          |
                          +--arlut.csd.JTable.gridTable
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class gridTable
extends baseTable

gridTable is a specialized baseTable, supporting an x,y access model

See Also:
baseTable, Serialized Form

Field Summary
(package private) static boolean debug
           
 
Fields inherited from class arlut.csd.JTable.baseTable
bounding_rect, canvas, colPos, cols, hbar, hbar_visible, headerAttrib, headerMenu, hHeadLineColor, hHeadLineThickness, horizLines, hRowLineColor, hRowLineThickness, hVertFill, in, menu, menuCol, menuRow, origTotalWidth, row_baseline, row_height, rows, rowsToShow, scalefact, selectedRow, tableAttrib, vbar, vbar_visible, vertFill, vertLines, vHeadLineColor, vLineThickness, vRowLineColor
 
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
gridTable(int[] colWidths, java.lang.String[] headers, javax.swing.JPopupMenu menu)
          Constructor with default fonts, justification, and behavior
gridTable(arlut.csd.JTable.tableAttr headerAttrib, arlut.csd.JTable.tableAttr tableAttrib, arlut.csd.JTable.tableAttr[] colAttribs, int[] colWidths, java.awt.Color vHeadLineColor, java.awt.Color vRowLineColor, java.awt.Color hHeadLineColor, java.awt.Color hRowLineColor, java.lang.String[] headers, boolean horizLines, boolean vertLines, boolean vertFill, boolean hVertFill, javax.swing.JPopupMenu menu, javax.swing.JPopupMenu headerMenu)
          This is the base constructor for gridTable, which allows all aspects of the gridTable's appearance and behavior to be customized.
 
Method Summary
 arlut.csd.JTable.tableAttr getCellAttr(int x, int y)
          Gets the tableAttr of a cell in the table.
 java.lang.String getCellText(int x, int y)
          Gets the contents of a cell in the table.
 void setCellAttr(int x, int y, arlut.csd.JTable.tableAttr attr, boolean repaint)
          Sets the tableAttr of a cell in the table.
 void setCellBackColor(int x, int y, java.awt.Color color, boolean repaint)
          Sets the background color of a cell A color of (Color) null will cause baseTable to revert to using the background selected for the column (if defined) or the background for the table.
 void setCellColor(int x, int y, java.awt.Color color, boolean repaint)
          Sets the foreground color of a cell A color of (Color) null will cause baseTable to revert to using the foreground selected for the column (if defined) or the foreground for the table.
 void setCellFont(int x, int y, java.awt.Font font, boolean repaint)
          Sets the font of a cell in the table.
 void setCellJust(int x, int y, int just, boolean repaint)
          Sets the justification of a cell in the table.
 void setCellText(int x, int y, java.lang.String cellText, boolean repaint)
          Sets the contents of a cell in the table.
 
Methods inherited from class arlut.csd.JTable.baseTable
actionPerformed, addRow, adjustmentValueChanged, adjustScrollbars, calcCols, calcFonts, calcVSize, clearCells, clickInCell, clickInCell, deleteColumn, deleteRow, displayRegionFirstLine, doubleClickInCell, getCell, getCellAttr, getCellText, getRowCount, getTableHeaders, getWrappedCellText, getWrappedCellText, optimizeCols, reCalcRowPos, refreshTable, reinitialize, reinitialize, reShape, scrollRowTo, selectCell, selectCol, selectRow, setBounds, setCellAttr, setCellBackColor, setCellColor, setCellFont, setCellJust, setCellText, setColAttr, setColBackColor, setColColor, setColFont, setColJust, setHeadAttr, setHeadBackColor, setHeadColor, setHeadFont, setRows, setRowsVisible, setTableAttr, setTableBackColor, setTableColor, setTableFont, setTableJust, testCellSelected, testColSelected, testRowSelected, unSelectAll, unSelectCell, unSelectCol, unSelectRow
 
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, getAccessibleContext, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, 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, updateUI
 
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, addMouseListener, 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, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, 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

debug

static final boolean debug
See Also:
Constant Field Values
Constructor Detail

gridTable

public gridTable(arlut.csd.JTable.tableAttr headerAttrib,
                 arlut.csd.JTable.tableAttr tableAttrib,
                 arlut.csd.JTable.tableAttr[] colAttribs,
                 int[] colWidths,
                 java.awt.Color vHeadLineColor,
                 java.awt.Color vRowLineColor,
                 java.awt.Color hHeadLineColor,
                 java.awt.Color hRowLineColor,
                 java.lang.String[] headers,
                 boolean horizLines,
                 boolean vertLines,
                 boolean vertFill,
                 boolean hVertFill,
                 javax.swing.JPopupMenu menu,
                 javax.swing.JPopupMenu headerMenu)
This is the base constructor for gridTable, which allows all aspects of the gridTable's appearance and behavior to be customized.

Parameters:
headerAttrib - attribute set for the column headers
tableAttrib - default attribute set for the body of the table
colAttribs - per column attribute sets
colWidths - array of initial column widths
vHeadLineColor - color of vertical lines in the column headers, if any
vRowLineColor - color of vertical lines in the table body, if any
hHeadLineColor - color of horizontal lines in the column headers, if any
headers - array of column header titles, must be same size as colWidths
horizLines - true if horizontal lines should be shown between rows in report table
vertLines - true if vertical lines should be shown between columns in report table
vertFill - true if table should expand vertically to fill size of baseTable
hVertFill - true if horizontal lines should be drawn in the vertical fill region (only applies if vertFill and horizLines are true)

gridTable

public gridTable(int[] colWidths,
                 java.lang.String[] headers,
                 javax.swing.JPopupMenu menu)
Constructor with default fonts, justification, and behavior

Parameters:
colWidths - array of initial column widths
headers - array of column header titles, must be same size as colWidths
Method Detail

setCellText

public final void setCellText(int x,
                              int y,
                              java.lang.String cellText,
                              boolean repaint)
Sets the contents of a cell in the table.

Parameters:
x - column of the cell to change [0..#cols - 1]
y - row of the cell to change [0..#rows - 1]
cellText - the text to place into cell
repaint - true if the table should be redrawn after changing cell

getCellText

public final java.lang.String getCellText(int x,
                                          int y)
Gets the contents of a cell in the table.

Overrides:
getCellText in class baseTable
Parameters:
x - column of the cell to retrieve [0..#cols - 1]
y - row of the cell to retrieve [0..#rows - 1]

setCellAttr

public final void setCellAttr(int x,
                              int y,
                              arlut.csd.JTable.tableAttr attr,
                              boolean repaint)
Sets the tableAttr of a cell in the table.

Parameters:
x - column of the cell to change [0..#cols - 1]
y - row of the cell to change [0..#rows - 1]
attr - the tableAttr to assign to cell
repaint - true if the table should be redrawn after changing cell

getCellAttr

public final arlut.csd.JTable.tableAttr getCellAttr(int x,
                                                    int y)
Gets the tableAttr of a cell in the table.

Parameters:
x - column of the cell to retrieve tableAttr from [0..#cols - 1]
y - row of the cell to retrieve tableAttr from [0..#rows - 1]

setCellFont

public final void setCellFont(int x,
                              int y,
                              java.awt.Font font,
                              boolean repaint)
Sets the font of a cell in the table. A font of (Font) null will cause baseTable to revert to using the table or column's default font for this cell.

Parameters:
x - column of the cell to change [0..#cols - 1]
y - row of the cell to change [0..#rows - 1]
font - the Font to assign to cell, may be null to use default
repaint - true if the table should be redrawn after changing cell

setCellJust

public final void setCellJust(int x,
                              int y,
                              int just,
                              boolean repaint)
Sets the justification of a cell in the table. Use tableAttr.JUST_INHERIT to have this cell use default justification

Parameters:
x - column of the cell to change [0..#cols - 1]
y - row of the cell to change [0..#rows - 1]
just - the justification to assign to cell
repaint - true if the table should be redrawn after changing cell
See Also:
tableAttr

setCellColor

public final void setCellColor(int x,
                               int y,
                               java.awt.Color color,
                               boolean repaint)
Sets the foreground color of a cell A color of (Color) null will cause baseTable to revert to using the foreground selected for the column (if defined) or the foreground for the table.

Parameters:
x - column of the cell to change [0..#cols - 1]
y - row of the cell to change [0..#rows - 1]
color - the Color to assign to cell
repaint - true if the table should be redrawn after changing cell

setCellBackColor

public final void setCellBackColor(int x,
                                   int y,
                                   java.awt.Color color,
                                   boolean repaint)
Sets the background color of a cell A color of (Color) null will cause baseTable to revert to using the background selected for the column (if defined) or the background for the table.

Parameters:
x - column of the cell to change [0..#cols - 1]
y - row of the cell to change [0..#rows - 1]
color - the Color to assign to cell
repaint - true if the table should be redrawn after changing cell