Class ExactTable

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, CellEditorListener, ListSelectionListener, RowSorterListener, TableColumnModelListener, TableModelListener, Scrollable
Direct Known Subclasses:
CacheSectionPanel.ClassSwitchTable, ClassSwitchSectionPanel.ClassSwitchTable, NumberOfCustomersPanel.PopulationVectorTable, PAResultsWindow.ValuesTable, ReferenceStationPanel.STTable, ResultsTable, SimulationPanel.PreloadingTable

public class ExactTable extends JTable
a table with some improvements:
  • has a click-aware header
  • has a click-aware row header
  • "more rows" and "more columns" warning icons
  • clipboard transfer of cell values (support depends on the underlying data model) - CTRL+C, CTRL+X, CTRL+V
  • can clear selected cells - DELETE
See Also:
  • Field Details

    • rowHeader

      protected RowHeader rowHeader
    • rowHeaderWidth

      protected int rowHeaderWidth
    • selectAllButton

      protected JButton selectAllButton
    • moreColumnsLabel

      protected JLabel moreColumnsLabel
    • moreRowsLabel

      protected JLabel moreRowsLabel
    • displaysScrollLabels

      protected boolean displaysScrollLabels
    • selectAllEnabled

      protected boolean selectAllEnabled
    • batchEditingEnabled

      protected boolean batchEditingEnabled
    • selectionListener

      protected TableSelectionListener selectionListener
    • mouseHandler

      protected ExactTable.MouseHandler mouseHandler
    • mouseMenuEnabled

      protected boolean mouseMenuEnabled
    • clipboard

      protected Clipboard clipboard
    • selectAllTooltip

      protected String selectAllTooltip
    • moreColumnsTooltip

      protected String moreColumnsTooltip
    • moreRowsTooltip

      protected String moreRowsTooltip
    • selectAction

      protected AbstractAction selectAction
    • CUT_ACTION

      public AbstractAction CUT_ACTION
    • COPY_ACTION

      public AbstractAction COPY_ACTION
    • PASTE_ACTION

      public AbstractAction PASTE_ACTION
    • CLEAR_ACTION

      public AbstractAction CLEAR_ACTION
  • Constructor Details

  • Method Details

    • installKeyboard

      protected void installKeyboard()
    • installKeyboardAction

      protected void installKeyboardAction(Action a)
    • installKeyboardAction

      protected void installKeyboardAction(InputMap im, ActionMap am, Action a)
    • installMouse

      protected void installMouse()
    • makeMouseMenu

      protected JPopupMenu makeMouseMenu()
    • tableChanged

      public void tableChanged(TableModelEvent e)
      Overridden to make sure column sizes are maintained
      Specified by:
      tableChanged in interface TableModelListener
      Overrides:
      tableChanged in class JTable
    • setRowSelectionAllowed

      public void setRowSelectionAllowed(boolean allowed)
      Overrides:
      setRowSelectionAllowed in class JTable
    • setColumnSelectionAllowed

      public void setColumnSelectionAllowed(boolean allowed)
      Overrides:
      setColumnSelectionAllowed in class JTable
    • setSelectAllStatus

      public void setSelectAllStatus(boolean allowed)
    • createDefaultTableHeader

      protected JTableHeader createDefaultTableHeader()
      Overridden to return our nifty header
      Overrides:
      createDefaultTableHeader in class JTable
    • configureEnclosingScrollPane

      protected void configureEnclosingScrollPane()
      duplicated to avoid repeating the same checks multiple times
      Overrides:
      configureEnclosingScrollPane in class JTable
    • unconfigureEnclosingScrollPane

      protected void unconfigureEnclosingScrollPane()
      Overrides:
      unconfigureEnclosingScrollPane in class JTable
    • stopEditing

      public void stopEditing()
      Make sure we're not editing a cell. NOTE: requires the editor to honor stopCellEditing() or cancelCellEditing() calls.
    • setSelectedCell

      public void setSelectedCell(int row, int col)
      selects a cell
    • selectAll

      public void selectAll()
      Overridden to stop editing
      Overrides:
      selectAll in class JTable
    • updateActions

      protected void updateActions()
      Updates the state of the actions. called whenever the selection state of the table changes.
    • updateStructure

      public void updateStructure()
    • update

      public void update()
    • updateRow

      public void updateRow(int row)
    • updateRows

      public void updateRows(int firstRow, int lastRow)
    • getRowHeaderWidth

      public int getRowHeaderWidth()
    • setRowHeaderWidth

      public void setRowHeaderWidth(int rowHeaderWidth)
    • getSelectAllTooltip

      public String getSelectAllTooltip()
    • setSelectAllTooltip

      public void setSelectAllTooltip(String selectAllTooltip)
    • getMoreRowsTooltip

      public String getMoreRowsTooltip()
    • setMoreRowsTooltip

      public void setMoreRowsTooltip(String moreRowsTooltip)
    • getMoreColumnsTooltip

      public String getMoreColumnsTooltip()
    • setMoreColumnsTooltip

      public void setMoreColumnsTooltip(String moreColumnsTooltip)
    • displaysScrollLabels

      public boolean displaysScrollLabels()
    • setDisplaysScrollLabels

      public void setDisplaysScrollLabels(boolean displaysScrollLabels)
    • getScrollableUnitIncrement

      public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
      Try to keep the viewport aligned on column boundaries in the direction of interest
      Specified by:
      getScrollableUnitIncrement in interface Scrollable
      Overrides:
      getScrollableUnitIncrement in class JTable
    • getScrollableBlockIncrement

      public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
      Specified by:
      getScrollableBlockIncrement in interface Scrollable
      Overrides:
      getScrollableBlockIncrement in class JTable
    • isBatchEditingEnabled

      public boolean isBatchEditingEnabled()
    • setBatchEditingEnabled

      public void setBatchEditingEnabled(boolean batchEditingEnabled)
    • isMouseMenuEnabled

      public boolean isMouseMenuEnabled()
    • setMouseMenuEnabled

      public void setMouseMenuEnabled(boolean mouseMenuEnabled)
    • copyCells

      public void copyCells()
    • clearCells

      public void clearCells()
    • pasteCells

      public void pasteCells()
    • canPaste

      public boolean canPaste()