public class G9Table extends JTable
JTable.AccessibleJTable, JTable.DropLocation, JTable.PrintModeJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
String |
myStupidId
The id
|
AUTO_RESIZE_ALL_COLUMNS, AUTO_RESIZE_LAST_COLUMN, AUTO_RESIZE_NEXT_COLUMN, AUTO_RESIZE_OFF, AUTO_RESIZE_SUBSEQUENT_COLUMNS, autoCreateColumnsFromModel, autoResizeMode, cellEditor, cellSelectionEnabled, columnModel, dataModel, defaultEditorsByColumnClass, defaultRenderersByColumnClass, editingColumn, editingRow, editorComp, gridColor, preferredViewportSize, rowHeight, rowMargin, rowSelectionAllowed, selectionBackground, selectionForeground, selectionModel, showHorizontalLines, showVerticalLines, tableHeaderlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
G9Table(AbstractTableModel m,
String id,
Listblock listblock)
Creates a new G9Table instance
|
| Modifier and Type | Method and Description |
|---|---|
void |
addG9SelectionListener(G9SelectionListener listener)
Adds a selection listener to the list of listeners that will be notified
each time the selected row has changed.
|
void |
addVetoableSelectionListener(G9VetoableSelectionListener listener)
Adds a vetoable selection listener to the list of vetoable selection
listeners.
|
void |
changeSelection(int rowIndex,
int columnIndex,
boolean toggle,
boolean extend)
Updates the selection models of the table, depending on the state of the
two flags:
toggle and extend. |
boolean |
editCellAt(int row,
int column) |
void |
fireG9SelectedEvent(int oldRow,
int newRow)
Notifies all registered listeners that the selected row has changed
|
protected boolean |
fireVetoableSelectionEvent(int oldRow,
int newRow)
Fires a vetoable selection event, notifying all registered listeners that
the selected row is about to change
|
TableCellEditor |
getCellEditor(int row,
int column) |
TableCellRenderer |
getCellRenderer(int row,
int column) |
Color |
getChangedForgroundColor() |
Listblock |
getListblock() |
CellRenderOverride |
getRenderOverride()
Returns the cell render override (if any) that is used to override cell
renders
|
boolean |
getScrollableTracksViewportWidth() |
TableCellRenderer |
getTextRenderer(int alignment)
Returns a renderer with the specified text alignment
|
void |
hideColumn(int columnIndex)
Internal use.
|
boolean |
isBlocked()
Internal use.
|
boolean |
isCellEditable(int row,
int col) |
boolean |
processDoubleClickMouseEvent(MouseEvent e)
Internal use only! Invoked from DialogBlocker when a double click event
occurs, and gives this table a crack at the event.
|
protected boolean |
processKeyBinding(KeyStroke ks,
KeyEvent e,
int condition,
boolean pressed) |
protected void |
processMouseEvent(MouseEvent e)
Process mouse events only if table is enabled and not blocked.
|
void |
registerCellRenderOverride(CellRenderOverride renderOverride)
Register the cell render override to use when rendering cells.
|
static void |
setBestFitColumnWidths(JTable table)
Sets the size of the columns of the given JTable to an appropriate size
based on the size of the column headings and the contents of the column.
|
static void |
setBestFitColumnWidths(JTable table,
int columnnumber)
Sets the size of a given column in the JTable to an appropriate size
based on the size of the column headings and the contents of the column.
|
void |
setBlocked(boolean isBlocked)
Internal use.
|
void |
setChangedLineColor(Color changedColor)
Internal use.
|
void |
setDefaultLineColor(Color defaultColor) |
void |
setEditableCol(int col)
Sets a column to be editable.
|
void |
setEnabled(boolean enable)
In addition to itself, all the table cells and the table header are
enabled or disabled according to
enable. |
void |
setScrollPaneInUse(JScrollPane scrollPane)
Internal use! The scrollPane is used to caluculate the width of the
table.
|
void |
showColumn(int columnIndex)
Internal use! Shows the specified coulmn.
|
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, clearSelection, columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, configureEnclosingScrollPane, convertColumnIndexToModel, convertColumnIndexToView, convertRowIndexToModel, convertRowIndexToView, createDefaultColumnModel, createDefaultColumnsFromModel, createDefaultDataModel, createDefaultEditors, createDefaultRenderers, createDefaultSelectionModel, createDefaultTableHeader, createScrollPaneForTable, doLayout, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoCreateRowSorter, getAutoResizeMode, getCellEditor, getCellRect, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getDropLocation, getDropMode, getEditingColumn, getEditingRow, getEditorComponent, getFillsViewportHeight, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getPrintable, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getRowSorter, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getToolTipText, getUI, getUIClassID, getUpdateSelectionOnSort, getValueAt, initializeLocalVars, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, prepareRenderer, print, print, print, print, print, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, resizeAndRepaint, rowAtPoint, selectAll, setAutoCreateColumnsFromModel, setAutoCreateRowSorter, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setDropMode, setEditingColumn, setEditingRow, setFillsViewportHeight, setGridColor, setIntercellSpacing, setModel, setPreferredScrollableViewportSize, setRowHeight, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setRowSorter, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setUI, setUpdateSelectionOnSort, setValueAt, sizeColumnsToFit, sizeColumnsToFit, sorterChanged, tableChanged, unconfigureEnclosingScrollPane, updateUI, valueChangedaddAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, 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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, 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, 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, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic String myStupidId
public G9Table(AbstractTableModel m, String id, Listblock listblock)
m - the table modelid - the idlistblock - (missing javadoc)public Listblock getListblock()
public void registerCellRenderOverride(CellRenderOverride renderOverride)
renderOverride - the cell render overridepublic CellRenderOverride getRenderOverride()
null if no such override
is registered.registerCellRenderOverride(CellRenderOverride)public boolean isBlocked()
isBlocked == true will not process any mouse events.public void setBlocked(boolean isBlocked)
isBlocked == true will not process any mouse events.isBlocked - the value of the isBlocked property to set.public boolean processDoubleClickMouseEvent(MouseEvent e)
e - the mouse event.true if this table is processing the event.public void setEditableCol(int col)
col - the index of the column that is editable.public boolean isCellEditable(int row,
int col)
isCellEditable in class JTablepublic static void setBestFitColumnWidths(JTable table)
table - The JTable to set the size of the columns.public static void setBestFitColumnWidths(JTable table, int columnnumber)
table - The JTable to set the size of the column.columnnumber - The column to adjust.public TableCellRenderer getCellRenderer(int row, int column)
getCellRenderer in class JTablepublic TableCellEditor getCellEditor(int row, int column)
getCellEditor in class JTablepublic boolean editCellAt(int row,
int column)
editCellAt in class JTableprotected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed)
processKeyBinding in class JTableprotected void processMouseEvent(MouseEvent e)
processMouseEvent in class JComponentComponent.processMouseEvent(java.awt.event.MouseEvent)public void setEnabled(boolean enable)
enable.setEnabled in class JComponentJComponent.setEnabled(boolean)public void changeSelection(int rowIndex,
int columnIndex,
boolean toggle,
boolean extend)
toggle and extend. All changes to
the selection that are the result of keyboard or mouse events received by
the UI are channeled through this method so that the behavior may be
overridden by a subclass.
This implementation uses the following conventions:
toggle: false, extend:
false. Clear the previous selection and ensure the new cell is
selected.
toggle: false, extend:
true. Extend the previous selection to include the specified
cell.
toggle: true, extend:
false. If the specified cell is selected, deselect it. If it is
not selected, select it.
toggle: true, extend:
true. Leave the selection state as it is, but move the anchor
index to the specified location.
changeSelection in class JTablerowIndex - affects the selection at rowcolumnIndex - affects the selection at columntoggle - see description aboveextend - if true, extend the current selectionpublic void addVetoableSelectionListener(G9VetoableSelectionListener listener)
listener - the listener to addprotected boolean fireVetoableSelectionEvent(int oldRow,
int newRow)
oldRow - the currently selected rownewRow - the row that will become selected if the selection event is
not vetoed.true if the selection event is vetoed.public void addG9SelectionListener(G9SelectionListener listener)
listener - the listener to addpublic void fireG9SelectedEvent(int oldRow,
int newRow)
oldRow - the row that was selected prior to the changenewRow - the row that is selcted.public TableCellRenderer getTextRenderer(int alignment)
alignment - the alignmentpublic boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth in interface ScrollablegetScrollableTracksViewportWidth in class JTablepublic void hideColumn(int columnIndex)
columnIndex - the index of the column to hide.public void showColumn(int columnIndex)
columnIndex - the index of the column to show.public void setScrollPaneInUse(JScrollPane scrollPane)
scrollPane - the scroll pane in which this table lies.public void setChangedLineColor(Color changedColor)
changedColor - the changedColor to setpublic Color getChangedForgroundColor()
public void setDefaultLineColor(Color defaultColor)
defaultColor - the defaultColor to setCopyright © 2006–2017 Esito AS. All rights reserved.