Package org.ka2ddo.yaac.gui
Class DigipeatAliasTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
org.ka2ddo.yaac.gui.DigipeatAliasTableModel
- All Implemented Interfaces:
Serializable
,TableModel
This class manages the list of digipeat aliases recognized by YAAC.
- Author:
- Andrew Pavlin, KA2DDO
- See Also:
-
Field Summary
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addRow()
Create an empty row in the table for the user to fill in.void
deleteRow
(int rowIndex) Delete a row from the table, taking away that particular digipeat alias definition.Class<?>
getColumnClass
(int columnIndex) Returns the Class for data in the specified column.int
Returns the number of columns in the model.getColumnName
(int column) Returns the localized name for the column.getDigipeatRecord
(String baseCallsign) Get a Digipeat alias record corresponding to the specified digipeater callsign, if such a record exists.static DigipeatAliasTableModel
Get a reference to the singleton DigipeatAliasCatalog.getRow
(int rowIndex) Get the Nth DigipeatAliasRecord in the catalog.int
Returns the number of rows in the model.getValueAt
(int rowIndex, int columnIndex) Returns the value for the cell atcolumnIndex
androwIndex
.boolean
isCellEditable
(int rowIndex, int columnIndex) Specify whether the indexed cell is editable or notvoid
setValueAt
(Object aValue, int rowIndex, int columnIndex) Sets the value for the cell atcolumnIndex
androwIndex
.Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
Method Details
-
getInstance
Get a reference to the singleton DigipeatAliasCatalog.- Returns:
- the DigipeatAliasCatalog object
-
getColumnCount
public int getColumnCount()Returns the number of columns in the model.- Returns:
- the number of columns in the model
- See Also:
-
getRowCount
public int getRowCount()Returns the number of rows in the model.- Returns:
- the number of rows in the model
- See Also:
-
getValueAt
Returns the value for the cell atcolumnIndex
androwIndex
.- Parameters:
rowIndex
- the row whose value is to be queriedcolumnIndex
- the column whose value is to be queried- Returns:
- the value Object at the specified cell
-
getColumnClass
Returns the Class for data in the specified column.- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
- Parameters:
columnIndex
- the column being queried- Returns:
- Class object for data in the column
-
getColumnName
Returns the localized name for the column.- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
- Parameters:
column
- the column being queried- Returns:
- a string containing the name of
column
-
isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex) Specify whether the indexed cell is editable or not- Specified by:
isCellEditable
in interfaceTableModel
- Overrides:
isCellEditable
in classAbstractTableModel
- Parameters:
rowIndex
- the row being queriedcolumnIndex
- the column being queried- Returns:
- all cells return boolean true for this table model
-
setValueAt
Sets the value for the cell atcolumnIndex
androwIndex
.- Specified by:
setValueAt
in interfaceTableModel
- Overrides:
setValueAt
in classAbstractTableModel
- Parameters:
aValue
- the new value Object for the specified cellrowIndex
- the row whose value is to be queriedcolumnIndex
- the column whose value is to be queried
-
addRow
public void addRow()Create an empty row in the table for the user to fill in. -
deleteRow
public void deleteRow(int rowIndex) Delete a row from the table, taking away that particular digipeat alias definition.- Parameters:
rowIndex
- zero-based int index of row to delete
-
getRow
Get the Nth DigipeatAliasRecord in the catalog.- Parameters:
rowIndex
- zero-based row index- Returns:
- DigipeatAliasRecord
-
getDigipeatRecord
Get a Digipeat alias record corresponding to the specified digipeater callsign, if such a record exists.- Parameters:
baseCallsign
- String callsign to search for- Returns:
- DigipeatAliasRecord describing the authorized alias, or null if no enabled match
-