Package sc.fiji.snt.seed
Class SeedTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
sc.fiji.snt.seed.SeedTableModel
- All Implemented Interfaces:
Serializable,TableModel
TableModel backed by a SeedOverlay. Seven
columns (X, Y, Z, Conf, Radius, Type, Source, plus an optional
Status column when an SNT instance is supplied so coverage
can be derived live from the active tracing).
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.
- Author:
- Tiago Ferreira
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intCoverage status (derived).static final intstatic final intstatic final intstatic final intstatic final StringCell value when a seed has a path node within tolerance.static final StringCell value when no path node lies within tolerance.static final StringCell value when there's no tracing context to compute against.Fields inherited from class javax.swing.table.AbstractTableModel
listenerList -
Constructor Summary
ConstructorsConstructorDescriptionSeedTableModel(SeedOverlay overlay) Builds a model without the Status column.SeedTableModel(SeedOverlay overlay, SNT snt) Builds a model with an optional Status column. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Unregisters the overlay listener and clears the status-cache reference.Class<?> getColumnClass(int col) intgetColumnName(int col) intgetValueAt(int row, int col) booleanisCellEditable(int row, int col) All cells are read-only.voidRecomputes the coverage cache and fires a status-column update.Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener, setValueAt
-
Field Details
-
COL_X
public static final int COL_X- See Also:
-
COL_Y
public static final int COL_Y- See Also:
-
COL_Z
public static final int COL_Z- See Also:
-
COL_CONFIDENCE
public static final int COL_CONFIDENCE- See Also:
-
COL_RADIUS
public static final int COL_RADIUS- See Also:
-
COL_TYPE
public static final int COL_TYPE- See Also:
-
COL_SOURCE
public static final int COL_SOURCE- See Also:
-
COL_STATUS
public static final int COL_STATUSCoverage status (derived). Only present when the model was built with anSNTinstance; otherwisegetColumnCount()returns 7.- See Also:
-
STATUS_COVERED
Cell value when a seed has a path node within tolerance.- See Also:
-
STATUS_UNCOVERED
Cell value when no path node lies within tolerance.- See Also:
-
STATUS_UNKNOWN
Cell value when there's no tracing context to compute against.- See Also:
-
-
Constructor Details
-
SeedTableModel
Builds a model without the Status column. -
SeedTableModel
Builds a model with an optional Status column.snt == nullsuppresses the column (matches the simpler constructor's behavior).
-
-
Method Details
-
recomputeStatuses
public void recomputeStatuses()Recomputes the coverage cache and fires a status-column update. Callers (e.g. the panel) can invoke this after tracer runs that change paths without going through the SeedOverlay listener. -
dispose
public void dispose()Unregisters the overlay listener and clears the status-cache reference. Must be called when this model is no longer used: the listener holds a strong reference back to this model, so failing to calldispose()pins the model (and its enclosing UI) for as long as the overlay lives. -
getRowCount
public int getRowCount() -
getColumnCount
public int getColumnCount() -
getColumnName
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classAbstractTableModel
-
getColumnClass
- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classAbstractTableModel
-
getValueAt
-
isCellEditable
public boolean isCellEditable(int row, int col) All cells are read-only. Edits go throughSeedPointEditDialog(opened via row double-click, canvas Alt+Click, or the panel's Edit toolbar button), which rebuilds the immutableSeedPointand applies it viaSeedOverlay.replaceAt(int, SeedPoint).- Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classAbstractTableModel
-
confidenceRangeFilter
- Returns:
- a
RowFilterthat 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'sfireTableDataChanged()firing on overlay changes) is sufficient: the panel does not need to swap the filter.
-