public class rowTable extends baseTable implements java.awt.event.ActionListener
rowTable is a specialized baseTable, supporting a per-row access model based on a hashtable.
javax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
(package private) rowSelectCallback |
callback |
(package private) java.util.Vector<rowHandle> |
crossref |
(package private) static boolean |
debug |
static java.lang.String |
delColStr |
(package private) javax.swing.JMenuItem |
DeleteColMI |
(package private) java.util.Hashtable<java.lang.Object,rowHandle> |
index |
private int |
lastSortColumn |
private boolean |
lastSortForward |
static java.lang.String |
menuTitle |
private int |
olderSortColumn |
private boolean |
olderSortForward |
static java.lang.String |
optColWidStr |
(package private) javax.swing.JMenuItem |
OptimizeMI |
(package private) javax.swing.JMenuItem |
RevSortByMI |
static java.lang.String |
revSortByStr |
(package private) javax.swing.JPopupMenu |
rowMenu |
(package private) java.lang.Object |
rowSelectedKey
The hash key for the selected row, or null if no row is
selected.
|
(package private) javax.swing.JMenuItem |
SortByMI |
static java.lang.String |
sortByStr |
(package private) static TranslationService |
ts
TranslationService object for handling string localization in the
Ganymede client.
|
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, vRowLineColoraccessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
rowTable(int[] colWidths,
java.lang.String[] headers,
rowSelectCallback callback,
boolean horizLines,
javax.swing.JPopupMenu menu,
boolean allowDeleteColumn)
Constructor with default fonts, justification, and behavior
|
rowTable(int[] colWidths,
java.lang.String[] headers,
rowSelectCallback callback,
javax.swing.JPopupMenu menu,
boolean allowDeleteColumn)
Constructor with default fonts, justification, and behavior
|
rowTable(tableAttr headerAttrib,
tableAttr tableAttrib,
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,
rowSelectCallback callback,
javax.swing.JPopupMenu menu,
boolean allowDeleteColumn)
This is the base constructor for rowTable, which allows
all aspects of the rowTable's appearance and behavior
to be customized.
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Method used to handle the popup menu
|
void |
clearCells()
Erases all the cells in the table and removes any per-cell
attribute sets.
|
void |
clickInCell(int x,
int y,
boolean rightButton)
Hook for subclasses to implement selection logic
|
boolean |
containsKey(java.lang.Object key)
Returns true if a key is already in use in the table
|
void |
deleteRow(java.lang.Object key,
boolean repaint)
Deletes a row.
|
void |
doubleClickInCell(int x,
int y)
Hook for subclasses to implement selection logic
|
private rowHandle |
findRow(int y) |
tableCell |
getCell(java.lang.Object key,
int col)
Gets a cell based on hashkey
|
tableAttr |
getCellAttr(java.lang.Object key,
int col)
Gets the tableAttr of a cell in the table.
|
java.lang.String |
getCellText(java.lang.Object key,
int col)
Gets the contents of a cell in the table.
|
java.lang.Object |
getSelectedRow() |
java.lang.String |
getSortPref()
Gets the sort preferences for this rowTable as a String
encoding suitable for storage in a Java Prefrences object.
|
java.util.Enumeration |
keys()
Return an enumeration of the keys in the table
|
void |
newRow(java.lang.Object key)
Creates a new row, adds it to the hashtable
|
void |
resort(boolean repaint)
Sort by the last two sort columns and sort orders, if set.
|
void |
resort(int column,
boolean forward,
boolean repaint)
Do a sort by column and forward direction.
|
void |
selectRow(java.lang.Object key,
boolean refreshTable)
This method unselects any rows currently selected that do not
match key and selects the row that does match key (if any).
|
void |
setCellAttr(java.lang.Object key,
int col,
tableAttr attr,
boolean repaint)
Sets the tableAttr of a cell in the table.
|
void |
setCellBackColor(java.lang.Object key,
int col,
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(java.lang.Object key,
int col,
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(java.lang.Object key,
int col,
java.awt.Font font,
boolean repaint)
Sets the font of a cell in the table.
|
void |
setCellJust(java.lang.Object key,
int col,
int just,
boolean repaint)
Sets the justification of a cell in the table.
|
void |
setCellText(java.lang.Object key,
int col,
java.lang.String cellText,
boolean repaint)
Sets the contents of a cell in the table.
|
void |
setCellText(java.lang.Object key,
int col,
java.lang.String cellText,
java.lang.Object data,
boolean repaint)
Sets the contents of a cell in the table.
|
void |
setSortPref(java.lang.String sortPref)
Sets the sort preferences for this rowTable from a String
encoding suitable for storage in a Java Prefrences object.
|
void |
unSelectAll()
Unselect all cells.. override of a baseTable method.
|
void |
unSelectRow()
This method unselects the currently selected row.
|
addRow, adjustmentValueChanged, adjustScrollbars, calcCols, calcFonts, calcVSize, clickInCell, deleteColumn, deleteRow, displayRegionFirstLine, dispose, getCell, getCellAttr, getCellText, getCellText, getColCount, getRowCount, getTableHeaders, getWrappedCellText, getWrappedCellText, mouseWheelMoved, 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, unSelectCell, unSelectCol, unSelectRowaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUIadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclestatic final boolean debug
static final TranslationService ts
public static final java.lang.String menuTitle
public static final java.lang.String sortByStr
public static final java.lang.String revSortByStr
public static final java.lang.String delColStr
public static final java.lang.String optColWidStr
java.util.Hashtable<java.lang.Object,rowHandle> index
java.util.Vector<rowHandle> crossref
rowSelectCallback callback
javax.swing.JPopupMenu rowMenu
javax.swing.JMenuItem SortByMI
javax.swing.JMenuItem RevSortByMI
javax.swing.JMenuItem DeleteColMI
javax.swing.JMenuItem OptimizeMI
private int lastSortColumn
private boolean lastSortForward
private int olderSortColumn
private boolean olderSortForward
java.lang.Object rowSelectedKey
The hash key for the selected row, or null if no row is selected.
public rowTable(tableAttr headerAttrib, tableAttr tableAttrib, 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, rowSelectCallback callback, javax.swing.JPopupMenu menu, boolean allowDeleteColumn)
headerAttrib - attribute set for the column headerstableAttrib - default attribute set for the body of the tablecolAttribs - per column attribute setscolWidths - array of initial column widthsvHeadLineColor - color of vertical lines in the column headers, if anyvRowLineColor - color of vertical lines in the table body, if anyhHeadLineColor - color of horizontal lines in the column headers, if anyhRowLineColor - color of vertical lines in the table body, if anyheaders - array of column header titles, must be same size as colWidthshorizLines - true if horizontal lines should be shown between rows in report tablevertLines - true if vertical lines should be shown between columns in report tablevertFill - true if table should expand vertically to fill size of baseTablehVertFill - true if horizontal lines should be drawn in the vertical fill region
(only applies if vertFill and horizLines are true)callback - reference to an object that implements the rowSelectCallback interfacemenu - reference to a popup menu to be associated with rows in this tableallowDeleteColumn - if true, a 'Delete This Column' menu item will be added
to the per-column popup menupublic rowTable(int[] colWidths,
java.lang.String[] headers,
rowSelectCallback callback,
boolean horizLines,
javax.swing.JPopupMenu menu,
boolean allowDeleteColumn)
colWidths - array of initial column widthsheaders - array of column header titles, must be same size as colWidthscallback - reference to an object that implements the rowSelectCallback interfacehorizLines - draw horizontal lines between rows?menu - reference to a popup menu to be associated with rows in this tablepublic rowTable(int[] colWidths,
java.lang.String[] headers,
rowSelectCallback callback,
javax.swing.JPopupMenu menu,
boolean allowDeleteColumn)
colWidths - array of initial column widthsheaders - array of column header titles, must be same size as colWidthscallback - reference to an object that implements the rowSelectCallback interfacemenu - reference to a popup menu to be associated with rows in this tablepublic void clickInCell(int x,
int y,
boolean rightButton)
clickInCell in class baseTablex - col of cell clicked iny - row of cell clicked inrightButton - if true, the cell click was with the right buttonpublic void doubleClickInCell(int x,
int y)
doubleClickInCell in class baseTablex - col of cell double clicked iny - row of cell double clicked inpublic void unSelectAll()
unSelectAll in class baseTablepublic java.lang.Object getSelectedRow()
public void selectRow(java.lang.Object key,
boolean refreshTable)
key - The key to the row to be selectedpublic void unSelectRow()
public void clearCells()
clearCells in class baseTablepublic void newRow(java.lang.Object key)
key - A hashtable key to be used to refer to this row in the futurepublic void deleteRow(java.lang.Object key,
boolean repaint)
key - A hashtable key for the row to deleterepaint - true if the table should be redrawn after the row is deletedpublic tableCell getCell(java.lang.Object key, int col)
key - A hashtable key for the row of the cellcol - Column number, range 0..# of columns - 1public final void setCellText(java.lang.Object key,
int col,
java.lang.String cellText,
boolean repaint)
key - key to the row of the cell to be changedcol - column of the cell to be changedcellText - the text to place into cellrepaint - true if the table should be redrawn after changing cellpublic final void setCellText(java.lang.Object key,
int col,
java.lang.String cellText,
java.lang.Object data,
boolean repaint)
key - key to the row of the cell to be changedcol - column of the cell to be changedcellText - the text to place into celldata - A piece of data to be held with this cell, will be used for sortingrepaint - true if the table should be redrawn after changing cellpublic final java.lang.String getCellText(java.lang.Object key,
int col)
key - key to the row of the cellcol - column of the cellpublic final void setCellAttr(java.lang.Object key,
int col,
tableAttr attr,
boolean repaint)
key - key to the row of the cell to be changedcol - column of the cell to be changedattr - the tableAttr to assign to cellrepaint - true if the table should be redrawn after changing cellpublic final tableAttr getCellAttr(java.lang.Object key, int col)
key - key to the row of the cellcol - column of the cellpublic final void setCellFont(java.lang.Object key,
int col,
java.awt.Font font,
boolean repaint)
key - key to the row of the cellcol - column of the cellfont - the Font to assign to cell, may be null to use defaultrepaint - true if the table should be redrawn after changing cellpublic final void setCellJust(java.lang.Object key,
int col,
int just,
boolean repaint)
key - key to the row of the cellcol - column of the celljust - the justification to assign to cellrepaint - true if the table should be redrawn after changing celltableAttrpublic final void setCellColor(java.lang.Object key,
int col,
java.awt.Color color,
boolean repaint)
key - key to the row of the cellcol - column of the cellcolor - the Color to assign to cellrepaint - true if the table should be redrawn after changing cellpublic final void setCellBackColor(java.lang.Object key,
int col,
java.awt.Color color,
boolean repaint)
key - key to the row of the cellcol - column of the cellcolor - the Color to assign to cellrepaint - true if the table should be redrawn after changing cellpublic boolean containsKey(java.lang.Object key)
key - key to look for in the tablepublic java.util.Enumeration keys()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListeneractionPerformed in class baseTablepublic void setSortPref(java.lang.String sortPref)
Sets the sort preferences for this rowTable from a String encoding suitable for storage in a Java Prefrences object.
public java.lang.String getSortPref()
Gets the sort preferences for this rowTable as a String encoding suitable for storage in a Java Prefrences object.
public void resort(boolean repaint)
Sort by the last two sort columns and sort orders, if set.
public void resort(int column,
boolean forward,
boolean repaint)
Do a sort by column and forward direction.
private rowHandle findRow(int y)