Class FVTable

All Implemented Interfaces:
MouseListener, MouseMotionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, CellEditorListener, ListSelectionListener, RowSorterListener, TableColumnModelListener, TableModelListener, Scrollable

public class FVTable extends GTable implements MouseMotionListener, MouseListener
The table that backs the FileViewer window. It is responsible for displaying Chunk instances.
See Also:
  • Constructor Details

  • Method Details

    • prepareRenderer

      public Component prepareRenderer(TableCellRenderer renderer, int row, int column)
      Adjusts the column widths to be at least as wide as the widest cell. This is required for horizontal scrolling to work properly.
      Overrides:
      prepareRenderer in class JTable
    • setShiftDown

      public void setShiftDown(boolean isDown)
      Sets the status of the shift key.
      Parameters:
      isDown -
    • setMouseDragging

      public void setMouseDragging(boolean isMouseDragging)
    • addRow

      public void addRow(String row)
      Adds the given row to the table.
      Parameters:
      row -
    • addRows

      public void addRows(List<String> rows)
      Adds the list of rows to the table.
      Parameters:
      rows -
    • restoreSelection

      public void restoreSelection()
      Set any previously selected table rows to a selected state. This should be called any time a chunk is read into the table. Note: This is critically important when the user has selected a row, then scrolled such that the selected row is in a chunk that has been swapped out and is no longer in the table. When that chunk is scrolled back into view, this will restore the selection. Note2: If there is a range of selected values and the table is somewhere in the middle of that range, just select the entire table.
    • clear

      public void clear()
      Removes all rows from the table model.
    • incrementAndAddSelection

      public void incrementAndAddSelection(int rows)
      Increments the selection by the given number of rows, but doesn't affect any previously selected rows. This is typically called when selecting while dragging.
      Parameters:
      rows -
    • incrementSelection

      public void incrementSelection(int rows)
      Moves the table selection down by the number of rows specified, ensuring that selection does not go beyond the bounds of the file.
      Parameters:
      rows -
    • decrementAndAddSelection

      public void decrementAndAddSelection(int rows)
      Decrements the selection by the number of rows given, and adds the new rows to the selection.
      Parameters:
      rows -
    • decrementSelection

      public void decrementSelection(int rows)
      Moves the table selection up by the number of rows specified, ensuring that selection does not go beyond the beginning of the file.
      Parameters:
      rows -
    • valueChanged

      public void valueChanged(ListSelectionEvent e)
      Invoked when a new row has been selected in the table. Update our chunk model to reflect as much.
      Specified by:
      valueChanged in interface ListSelectionListener
      Overrides:
      valueChanged in class JTable
      Parameters:
      e -
    • mouseDragged

      public void mouseDragged(MouseEvent e)
      Specified by:
      mouseDragged in interface MouseMotionListener
    • mouseMoved

      public void mouseMoved(MouseEvent e)
      Specified by:
      mouseMoved in interface MouseMotionListener
    • mouseClicked

      public void mouseClicked(MouseEvent e)
      Specified by:
      mouseClicked in interface MouseListener
    • mousePressed

      public void mousePressed(MouseEvent e)
      Specified by:
      mousePressed in interface MouseListener
    • mouseReleased

      public void mouseReleased(MouseEvent e)
      Specified by:
      mouseReleased in interface MouseListener
    • mouseEntered

      public void mouseEntered(MouseEvent e)
      Specified by:
      mouseEntered in interface MouseListener
    • mouseExited

      public void mouseExited(MouseEvent e)
      Specified by:
      mouseExited in interface MouseListener