public class XJTable extends JTable
JTable.setAutoResizeMode(int).
 | Modifier and Type | Class and Description | 
|---|---|
| protected class  | XJTable.ColumnData | 
| protected class  | XJTable.HeaderMouseListener | 
| protected class  | XJTable.SortingModelHandles translations between an indexed data source and a permutation of 
 itself (like the translations between the rows in sorted table and the
 rows in the actual unsorted model). | 
JTable.AccessibleJTable, JTable.DropLocation, JTable.PrintModeJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description | 
|---|---|
| protected boolean | ascendingis the current sort order ascending (or descending)? | 
| protected List<XJTable.ColumnData> | columnDataA list of  XJTable.ColumnDataobjects. | 
| protected ObjectComparator | defaultComparator | 
| protected XJTable.HeaderMouseListener | headerMouseListener | 
| protected List<TableColumn> | hiddenColumnsContains the hidden columns in no particular order. | 
| protected boolean | sortableShould this table be sortable. | 
| protected int | sortedColumnThe column currently being sorted. | 
| protected XJTable.SortingModel | sortingModel | 
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 | 
|---|
| XJTable() | 
| XJTable(TableModel model) | 
| Modifier and Type | Method and Description | 
|---|---|
| protected void | calculatePreferredSize() | 
| void | changeSelection(int rowIndex,
               int columnIndex,
               boolean toggle,
               boolean extend) | 
| void | columnMarginChanged(ChangeEvent e)Overridden to fix 
 //http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4330950: | 
| void | columnMoved(TableColumnModelEvent e)Overridden to fix 
 //http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4330950: | 
| void | doLayout() | 
| Dimension | getPreferredScrollableViewportSize() | 
| Dimension | getPreferredSize() | 
| boolean | getScrollableTracksViewportHeight()Track parent viewport's size if it's larger than the current preferred 
 height of the table (causes empty tables to fill in the whole area of
 a JScrollPane). | 
| boolean | getScrollableTracksViewportWidth()Overridden to ignore requests for this table to track the width of its
 containing viewport in cases where the viewport is narrower than the
 minimum size of the table. | 
| int | getSortedColumn() | 
| int | getTableRow(int modelRow)Get the row in the table for a row in the model. | 
| void | hideColumn(int columnIndex)Hide a column. | 
| boolean | isAscending() | 
| boolean | isColumnHidden(int columnIndex)Gets the hidden state for a column | 
| boolean | isEditCellAsSoonAsFocus()Returns the state for editing a cell as soon as it gets the focus. | 
| boolean | isEnableHidingColumns()Returns the state for hiding a column. | 
| boolean | isSortable() | 
| boolean | isTabSkipUneditableCell()Returns the state for enabling tab key to skip uneditable cells. | 
| protected void | newColumns()Called when the columns have changed. | 
| int | rowAtPoint(Point point) | 
| int | rowModelToView(int modelRow)Converts a row number from the model co-ordinates system to the view's. | 
| int | rowViewToModel(int viewRow)Converts a row number from the view co-ordinates system to the model's. | 
| void | setAscending(boolean ascending) | 
| void | setComparator(int column,
             Comparator<?> comparator)Sets the custom comparator to be used for a particular column. | 
| void | setEditCellAsSoonAsFocus(boolean editCellAsSoonAsFocus)Set the possibility for a cell to be in editing mode as soon as
 it gets the focus. | 
| void | setEnableHidingColumns(boolean enableHidingColumns)Set the possibility for the user to hide/show a column by right-clicking
 on a column header. | 
| void | setModel(TableModel dataModel) | 
| void | setSortable(boolean sortable) | 
| void | setSortedColumn(int sortColumn) | 
| void | setTableHeader(JTableHeader newTableHeader) | 
| void | setTabSkipUneditableCell(boolean tabSkipUneditableCell)Set the possibility for the tab key to skip uneditable cells. | 
| void | showColumn(int columnIndex,
          int insertionIndex)Show a column. | 
| void | tableChanged(TableModelEvent e)Overridden for efficiency reasons (provides a better calculation of the 
 dirty region). | 
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, clearSelection, columnAdded, columnAtPoint, columnRemoved, columnSelectionChanged, configureEnclosingScrollPane, convertColumnIndexToModel, convertColumnIndexToView, convertRowIndexToModel, convertRowIndexToView, createDefaultColumnModel, createDefaultColumnsFromModel, createDefaultDataModel, createDefaultEditors, createDefaultRenderers, createDefaultSelectionModel, createDefaultTableHeader, createScrollPaneForTable, editCellAt, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoCreateRowSorter, getAutoResizeMode, getCellEditor, getCellEditor, getCellRect, getCellRenderer, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getDropLocation, getDropMode, getEditingColumn, getEditingRow, getEditorComponent, getFillsViewportHeight, getGridColor, getIntercellSpacing, getModel, getPrintable, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getRowSorter, getScrollableBlockIncrement, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getToolTipText, getUI, getUIClassID, getUpdateSelectionOnSort, getValueAt, initializeLocalVars, isCellEditable, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, prepareRenderer, print, print, print, print, print, processKeyBinding, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, resizeAndRepaint, selectAll, setAutoCreateColumnsFromModel, setAutoCreateRowSorter, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setDropMode, setEditingColumn, setEditingRow, setFillsViewportHeight, setGridColor, setIntercellSpacing, setPreferredScrollableViewportSize, setRowHeight, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setRowSorter, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setUI, setUpdateSelectionOnSort, setValueAt, sizeColumnsToFit, sizeColumnsToFit, sorterChanged, 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, 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, processMouseEvent, 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, setEnabled, 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, transferFocusUpCycleprotected XJTable.SortingModel sortingModel
protected ObjectComparator defaultComparator
protected int sortedColumn
protected boolean ascending
protected boolean sortable
protected List<XJTable.ColumnData> columnData
XJTable.ColumnData objects.protected XJTable.HeaderMouseListener headerMouseListener
protected List<TableColumn> hiddenColumns
public XJTable()
public XJTable(TableModel model)
public void setModel(TableModel dataModel)
protected void newColumns()
public void setTableHeader(JTableHeader newTableHeader)
setTableHeader in class JTablepublic Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize in interface ScrollablegetPreferredScrollableViewportSize in class JTableprotected void calculatePreferredSize()
public Dimension getPreferredSize()
getPreferredSize in class JComponentpublic boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth in interface ScrollablegetScrollableTracksViewportWidth in class JTablepublic boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight in interface ScrollablegetScrollableTracksViewportHeight in class JTablepublic int rowModelToView(int modelRow)
modelRow - the row number in the modelrowViewToModel(int)public boolean isAscending()
public boolean isColumnHidden(int columnIndex)
columnIndex - index of the column in the table modelpublic void hideColumn(int columnIndex)
columnIndex - index of the column in the table modelpublic void showColumn(int columnIndex,
                       int insertionIndex)
columnIndex - index of the column in the table modelinsertionIndex - index of the view where the colum will be insertedpublic void setAscending(boolean ascending)
ascending - The ascending to set. True by default.public int rowViewToModel(int viewRow)
viewRow - the row number in the view.rowModelToView(int)public void setEnableHidingColumns(boolean enableHidingColumns)
enableHidingColumns - true if and only if the columns can be hidden.public boolean isEnableHidingColumns()
public boolean isEditCellAsSoonAsFocus()
public void setEditCellAsSoonAsFocus(boolean editCellAsSoonAsFocus)
editCellAsSoonAsFocus - true if and only if a cell get in editing
 mode when it receives the focus.public boolean isTabSkipUneditableCell()
public void setTabSkipUneditableCell(boolean tabSkipUneditableCell)
tabSkipUneditableCell - true if and only if the tab key skip
 uneditable cells.public void setComparator(int column,
                          Comparator<?> comparator)
column - the column index.comparator - the comparator to be used.public boolean isSortable()
public void setSortable(boolean sortable)
sortable - The sortable to set. True by default.public int getSortedColumn()
public void setSortedColumn(int sortColumn)
sortColumn - The sortColumn to set. None (-1) by default.public int getTableRow(int modelRow)
modelRow - row in the modelpublic void changeSelection(int rowIndex,
                            int columnIndex,
                            boolean toggle,
                            boolean extend)
changeSelection in class JTablepublic int rowAtPoint(Point point)
rowAtPoint in class JTablepublic void tableChanged(TableModelEvent e)
tableChanged in interface TableModelListenertableChanged in class JTablepublic void columnMoved(TableColumnModelEvent e)
columnMoved in interface TableColumnModelListenercolumnMoved in class JTablepublic void columnMarginChanged(ChangeEvent e)
columnMarginChanged in interface TableColumnModelListenercolumnMarginChanged in class JTableCopyright © 2024 GATE. All rights reserved.