public abstract class MonitorTable extends AbstractTableModel implements Updatable
Functionality:
ArrayList<ArrayList<MonitorCell>>) and simple implementation of TableModel.
Updatable. update(...) uses getCells(displayChannel, monitorField) to
find affected cells, computes new FormattedValue for each of them (firing table model event if
necessary), then fires CELLS_EVENT.
Listener that is notified of CELLS_EVENT or TABLE_EVENT.
JTable (rendering, mouse clicks, etc.)
| Modifier and Type | Class and Description |
|---|---|
static class |
MonitorTable.Event |
static interface |
MonitorTable.Listener |
| Modifier and Type | Field and Description |
|---|---|
protected ArrayList<ArrayList<MonitorCell>> |
cells |
protected MonitorTable.Event |
CELLS_EVENT |
static List<MonitorField> |
DEFAULT_COMPACT_FIELDS
Default list of fields to be displayed by monitoring tables in compact mode.
|
static List<MonitorField> |
DEFAULT_FIELDS
Default list of fields to be displayed by monitoring tables in full mode.
|
static MonitorFormat |
DEFAULT_FORMAT
Stateless default
MonitorFormat instance. |
protected MonitorFormat |
format |
protected boolean |
limitMaxWidth |
protected MonitorTable.Listener |
listener |
protected int |
nColumns |
protected int |
nRows |
protected MonitorTable.Event |
TABLE_EVENT |
listenerList| Modifier | Constructor and Description |
|---|---|
protected |
MonitorTable()
Empty default constructor.
|
protected |
MonitorTable(MonitorCell[][] cells)
Constructs the table with the specified content.
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Called when the table is discarded.
|
static void |
edit(Component parent,
org.lsst.ccs.bus.data.ConfigurationParameterInfo conf,
MonitorField field,
AgentChannel channel) |
protected void |
fireChangeEvent(MonitorTable.Event.Reason reason) |
protected void |
fireChangeEvent(MonitorTable.Event event) |
protected List<int[]> |
getCells(DisplayChannel item,
MonitorField field)
Returns indices of all cells whose content is affected by the specified item and field.
|
int |
getColumnCount() |
int |
getRowCount() |
JTable |
getTable() |
FormattedValue |
getValueAt(int row,
int column) |
protected JTable |
makeTable() |
void |
restore(Serializable storageBean)
Restores this table to the state described by the provided object, to the extent possible.
|
Serializable |
save()
Returns JavaBean that contains data required to restore this table to its current state.
|
void |
setFormat(MonitorFormat format)
Sets the formatter to be used by this table.
|
void |
setLimitMaxWidth(boolean limitMaxWidth)
Sets
limitMaxWidth property. |
void |
setListener(MonitorTable.Listener listener) |
boolean |
showHeader() |
protected void |
tableMouseClicked(MouseEvent evt) |
static List<MonitorField> |
trimAbsentFields(List<MonitorField> fields,
Collection<DisplayChannel> channels,
Collection<MonitorField> exclude) |
void |
update(DisplayChannel channelHandle)
Updates this component.
|
void |
update(DisplayChannel item,
List<MonitorField> fields)
Updates this component.
|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAtclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAffectedFieldspublic static final MonitorFormat DEFAULT_FORMAT
MonitorFormat instance.public static final List<MonitorField> DEFAULT_FIELDS
public static final List<MonitorField> DEFAULT_COMPACT_FIELDS
protected int nRows
protected int nColumns
protected ArrayList<ArrayList<MonitorCell>> cells
protected MonitorFormat format
protected boolean limitMaxWidth
protected MonitorTable.Listener listener
protected final MonitorTable.Event CELLS_EVENT
protected final MonitorTable.Event TABLE_EVENT
protected MonitorTable()
protected MonitorTable(MonitorCell[][] cells)
public void destroy()
public void setFormat(MonitorFormat format)
format - Formatter.public void setLimitMaxWidth(boolean limitMaxWidth)
limitMaxWidth property.limitMaxWidth - If true, the table max width will be limited to its preferred width.public int getRowCount()
getRowCount in interface TableModelpublic int getColumnCount()
getColumnCount in interface TableModelpublic FormattedValue getValueAt(int row, int column)
getValueAt in interface TableModelpublic void update(DisplayChannel item, List<MonitorField> fields)
Updatable#update(ChannelHandle).public void update(DisplayChannel channelHandle)
Updatableprotected List<int[]> getCells(DisplayChannel item, MonitorField field)
item - DisplayChannel.field - Field. If null, all cells affected by the specified item are included.public void setListener(MonitorTable.Listener listener)
protected void fireChangeEvent(MonitorTable.Event.Reason reason)
protected void fireChangeEvent(MonitorTable.Event event)
public JTable getTable()
protected JTable makeTable()
protected void tableMouseClicked(MouseEvent evt)
public boolean showHeader()
public static List<MonitorField> trimAbsentFields(List<MonitorField> fields, Collection<DisplayChannel> channels, Collection<MonitorField> exclude)
public static void edit(Component parent, org.lsst.ccs.bus.data.ConfigurationParameterInfo conf, MonitorField field, AgentChannel channel)
public Serializable save()
null, subclasses should override
if they need to support saving/restoring their state.public void restore(Serializable storageBean)
storageBean - JavaBean that contains data describing the state of this table.Copyright © 2023 LSST. All rights reserved.