Package org.ka2ddo.yaac.gui
Class BlacklistTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
org.ka2ddo.yaac.gui.BlacklistTableModel
- All Implemented Interfaces:
Serializable
,TableModel
This class makes the list of digipeater blacklisted callsigns visible as an editable
table view by implementing a Swing TableModel.
- Author:
- Andrew Pavlin, KA2DDO
- See Also:
-
Field Summary
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addToBlacklist
(String callsign) Add a callsign to the blacklist.Class<?>
getColumnClass
(int columnIndex) Get the Class of values in the specified column.int
Get the number of columns in the table model.getColumnName
(int column) Get the localizd name for the column header.static Digipeater.BlacklistMask
getElementAt
(int index) Returns the value at the specified index.int
Returns the length of the list.getValueAt
(int rowIndex, int columnIndex) Obtain the value of a particular cell in the table.boolean
isCellEditable
(int rowIndex, int columnIndex) Indicate whether the specified cell is editable.void
removeFromBlacklist
(String callsign) Remove a callsign from the blacklist.void
setValueAt
(Object aValue, int rowIndex, int columnIndex) Set the value of an editable table cell.Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
Constructor Details
-
BlacklistTableModel
public BlacklistTableModel()Create a BlacklistTableModel.
-
-
Method Details
-
getElementAt
Returns the value at the specified index.- Parameters:
index
- the requested index- Returns:
- the value at
index
-
getRowCount
public int getRowCount()Returns the length of the list.- Returns:
- the length of the list
-
getColumnCount
public int getColumnCount()Get the number of columns in the table model.- Returns:
- column count
-
getValueAt
Obtain the value of a particular cell in the table.- Parameters:
rowIndex
- zero-based row index of the cellcolumnIndex
- zero-based column index of the cell- Returns:
- the value of the cell
-
getColumnName
Get the localizd name for the column header.- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
- Parameters:
column
- zero-based column index- Returns:
- String title of the column
-
getColumnClass
Get the Class of values in the specified column.- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
- Parameters:
columnIndex
- zero-based column index- Returns:
- Class of data values from cells in the column
-
isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex) Indicate whether the specified cell is editable.- Specified by:
isCellEditable
in interfaceTableModel
- Overrides:
isCellEditable
in classAbstractTableModel
- Parameters:
rowIndex
- zero-based row index of the cellcolumnIndex
- zero-based column index of the cell- Returns:
- boolean true if cell is editable
-
setValueAt
Set the value of an editable table cell.- Specified by:
setValueAt
in interfaceTableModel
- Overrides:
setValueAt
in classAbstractTableModel
- Parameters:
aValue
- new value for the cellrowIndex
- zero-based row index of the cellcolumnIndex
- zero-based column index of the cell
-
addToBlacklist
Add a callsign to the blacklist.- Parameters:
callsign
- String of callsign
-
removeFromBlacklist
Remove a callsign from the blacklist.- Parameters:
callsign
- String of callsign
-