Class SeedTableModel

All Implemented Interfaces:
Serializable, TableModel

public class SeedTableModel extends AbstractTableModel
TableModel backed by a SeedOverlay. Seven columns: X, Y, Z, Conf, Radius, Type, Source.

All cells are read-only: to relocate a seed, change confidence/radius/type, or relabel its provenance, open the SeedPointEditDialog (single mode via double-click on a row or Alt+Click on the canvas; bulk mode via the panel's Edit toolbar button).

The model remains a 1:1 view of the overlay (one row per seed). Confidence- range filtering is exposed as a RowFilter via confidenceRangeFilter(), which the panel installs on the table's TableRowSorter; out-of-range rows are hidden by the sorter (not removed from the model), so view↔model row conversions continue to work transparently for selection sync.

Coverage against the active tracing (whether a seed already has a nearby traced path node) is not tracked here: it is a point-in-time snapshot, not a live table column, and is computed on demand by the panel's "Select by Coverage" action, which selects the matching seeds directly on the overlay.

Author:
Tiago Ferreira
See Also:
  • Field Details

  • Constructor Details

    • SeedTableModel

      public SeedTableModel(SeedOverlay overlay)
  • Method Details

    • dispose

      public void dispose()
      Unregisters the overlay listener. Must be called when this model is no longer used: the listener holds a strong reference back to this model, so failing to call dispose() pins the model (and its enclosing UI) for as long as the overlay lives.
    • getRowCount

      public int getRowCount()
    • getColumnCount

      public int getColumnCount()
    • getColumnName

      public String getColumnName(int col)
      Specified by:
      getColumnName in interface TableModel
      Overrides:
      getColumnName in class AbstractTableModel
    • getColumnClass

      public Class<?> getColumnClass(int col)
      Specified by:
      getColumnClass in interface TableModel
      Overrides:
      getColumnClass in class AbstractTableModel
    • getValueAt

      public Object getValueAt(int row, int col)
    • isCellEditable

      public boolean isCellEditable(int row, int col)
      All cells are read-only. Edits go through SeedPointEditDialog (opened via row double-click, canvas Alt+Click, or the panel's Edit toolbar button), which rebuilds the immutable SeedPoint and applies it via SeedOverlay.replaceAt(int, SeedPoint).
      Specified by:
      isCellEditable in interface TableModel
      Overrides:
      isCellEditable in class AbstractTableModel
    • confidenceRangeFilter

      public RowFilter<SeedTableModel,Integer> confidenceRangeFilter()
      Returns:
      a RowFilter that includes a row iff its seed's confidence falls within the overlay's current [lowConfidence, highConfidence] window. The filter reads the bounds live, so re-evaluating it after a range change (e.g., via the model's fireTableDataChanged() firing on overlay changes) is sufficient: the panel does not need to swap the filter.