|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
net.shredzone.ifish.gui
Class NaviDbTableModel
java.lang.Objectnet.shredzone.ifish.db.NaviDb
net.shredzone.ifish.gui.NaviDbTableModel
- All Implemented Interfaces:
- TableModel
public class NaviDbTableModel
- extends NaviDb
- implements TableModel
- extends NaviDb
This is an extension of the NaviDb class to make it usable in JTables.
- Version:
- $Id: NaviDbTableModel.java 291 2009-04-28 21:29:27Z shred $
| Field Summary | |
|---|---|
protected List<Entry> |
lSequence
|
| Fields inherited from class net.shredzone.ifish.db.NaviDb |
|---|
sEntries |
| Constructor Summary | |
|---|---|
NaviDbTableModel()
Create a new, empty NaviDbTableModel. |
|
NaviDbTableModel(File file,
String charset)
Create a database and fill it with a database file. |
|
| Method Summary | |
|---|---|
void |
addEntry(Entry entry)
Add an entry to the database. |
void |
addTableModelListener(TableModelListener l)
Add a TableModelListener. |
protected void |
fireTableModelEvent(int row)
Fire a model event. |
Class<?> |
getColumnClass(int columnIndex)
Get the class that represents the column. |
int |
getColumnCount()
Get the number of columns |
String |
getColumnName(int columnIndex)
Get the column title. |
Entry |
getEntryAt(int rowIndex)
Get the entry of a certain row. |
int |
getRowCount()
Get the number of rows. |
Object |
getValueAt(int rowIndex,
int columnIndex)
Get the value of a certain cell. |
boolean |
isCellEditable(int rowIndex,
int columnIndex)
Check if a cell is editable. |
void |
removeEntry(Entry entry)
Remove an entry from the database. |
void |
removeTableModelListener(TableModelListener l)
Remove a TableModelListener. |
void |
setValueAt(Object aValue,
int rowIndex,
int columnIndex)
Change the value of a cell. |
| Methods inherited from class net.shredzone.ifish.db.NaviDb |
|---|
exportFile, exportFile, getAddCounter, getCreationDate, getEntry, getEntry, getRemoveCounter, getUpdateCounter, importFile, importFile, iterator, knowsFile, modifiedFile, resetCounters, size |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
lSequence
protected final List<Entry> lSequence
| Constructor Detail |
|---|
NaviDbTableModel
public NaviDbTableModel()
- Create a new, empty NaviDbTableModel.
NaviDbTableModel
public NaviDbTableModel(File file, String charset) throws IOException, DatabaseException, UnsupportedEncodingException
- Create a database and fill it with a database file.
- Parameters:
file- Database file to be readcharset- Desired Charset- Throws:
IOException- File was erraneous or could not be readDatabaseException- An error occured during database creationUnsupportedEncodingException- Charset not known
| Method Detail |
|---|
getRowCount
public int getRowCount()
- Get the number of rows.
- Specified by:
getRowCountin interfaceTableModel
- Returns:
- Number of Rows (entries)
getColumnCount
public int getColumnCount()
- Get the number of columns
- Specified by:
getColumnCountin interfaceTableModel
- Returns:
- Number of Columns
getColumnName
public String getColumnName(int columnIndex)
- Get the column title.
- Specified by:
getColumnNamein interfaceTableModel
- Parameters:
columnIndex- Addressed column- Returns:
- It's title
getColumnClass
public Class<?> getColumnClass(int columnIndex)
- Get the class that represents the column.
- Specified by:
getColumnClassin interfaceTableModel
- Parameters:
columnIndex- Addressed column- Returns:
- The representing class
isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex)
- Check if a cell is editable. Will always return false.
- Specified by:
isCellEditablein interfaceTableModel
- Parameters:
rowIndex- Addressed RowcolumnIndex- Addressed Column- Returns:
- true: editable, false: immutable
getValueAt
public Object getValueAt(int rowIndex, int columnIndex)
- Get the value of a certain cell.
- Specified by:
getValueAtin interfaceTableModel
- Parameters:
rowIndex- Addressed RowcolumnIndex- Addressed Column- Returns:
- Value of this cell
getEntryAt
public Entry getEntryAt(int rowIndex)
- Get the entry of a certain row.
- Parameters:
rowIndex- Addressed Row- Returns:
- Entry
setValueAt
public void setValueAt(Object aValue, int rowIndex, int columnIndex)
- Change the value of a cell. This is unsupported.
- Specified by:
setValueAtin interfaceTableModel
- Parameters:
aValue- New valuerowIndex- Addressed RowcolumnIndex- Addressed Column
addTableModelListener
public void addTableModelListener(TableModelListener l)
- Add a TableModelListener.
- Specified by:
addTableModelListenerin interfaceTableModel
- Parameters:
l- TableModelListener to add.
removeTableModelListener
public void removeTableModelListener(TableModelListener l)
- Remove a TableModelListener. If it was not added, nothing will happen.
- Specified by:
removeTableModelListenerin interfaceTableModel
- Parameters:
l- TableModelListener to be removed.
fireTableModelEvent
protected void fireTableModelEvent(int row)
- Fire a model event.
- Parameters:
row- Affected row
addEntry
public void addEntry(Entry entry) throws DatabaseException
- Add an entry to the database.
- Parameters:
entry- Entry to be added- Throws:
DatabaseException
removeEntry
public void removeEntry(Entry entry)
- Remove an entry from the database. If the entry does not exist,
nothing will happen.
- Overrides:
removeEntryin classNaviDb
- Parameters:
entry- Entry to be removed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright © 2007-2011 shredzone.org. All Rights Reserved.
