|
My Movies 1.0.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectAbstractTableModel
MovieTableModel
public final class MovieTableModel
Table model used by JTable, explicitly for Movie objects.
When a database operation occurs, the view is refreshed by calling
refreshView().
Note this class includes some methods which are unrelated to the needs of the superclass, but are useful in the context of this application.
| Field Summary |
|---|
| Fields inherited from class AbstractTableModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
MovieTableModel()
Constructor. |
|
| Method Summary | |
|---|---|
int |
getColumnCount()
Return the number of columns in the table. |
String |
getColumnName(int aIdx)
Return the name of a specific column. |
String |
getId(int aRow)
Returned the selected movie's id. |
Movie |
getMovie(int aRow)
Return the selected Movie. |
int |
getRowCount()
Return the number of rows in the table. |
Object |
getValueAt(int aRow,
int aCol)
Return the Object in a specific table cell. |
void |
refreshView()
Explicitly refresh the view. |
void |
sortByColumn(int aIdx)
Sort the movies. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MovieTableModel()
| Method Detail |
|---|
public void refreshView()
This style seems to be cleaner and simpler than implementing a listener on the DAO.
public String getId(int aRow)
public Movie getMovie(int aRow)
Movie.
public void sortByColumn(int aIdx)
aIdx - index of the column by which to sort.public int getColumnCount()
public int getRowCount()
public Object getValueAt(int aRow,
int aCol)
public String getColumnName(int aIdx)
getColumnName in interface TableModelgetColumnName in class AbstractTableModel
|
My Movies 1.0.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||