Package org.cesilko.rachota.gui
Class RegularTasksTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
org.cesilko.rachota.gui.RegularTasksTableModel
- All Implemented Interfaces:
Serializable
,TableModel
Table model for regular tasks in settings dialog.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final boolean
Ascending sorting order.private static final boolean
Descending sorting order.private Vector
Vector of regular tasks.private int
Currently selected sorting column.private boolean
Currently selected sorting order.static final int
Identification of task description column.static final int
Identification of task priority column.static final int
Identification of task frequency column.Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
Constructor Summary
ConstructorsConstructorDescriptionRegularTasksTableModel
(Vector regularTasks) Creates new table model for regular tasks in settings dialog. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns number of columns in the table i.e.getColumnName
(int column) Returns name of column by given column number.int
Returns number of rows (regular tasks) in the table.getValueAt
(int row, int column) Returns value of cell located in given row and column.sortTable
(int column) Sorts table according to given column and known order.Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
-
Field Details
-
TASK_PRIORITY
public static final int TASK_PRIORITYIdentification of task priority column.- See Also:
-
TASK_DESCRIPTION
public static final int TASK_DESCRIPTIONIdentification of task description column.- See Also:
-
TASK_REGULAR
public static final int TASK_REGULARIdentification of task frequency column.- See Also:
-
regularTasks
Vector of regular tasks. -
sortedColumn
private int sortedColumnCurrently selected sorting column. -
sortingOrder
private boolean sortingOrderCurrently selected sorting order. -
ASCENDING
private static final boolean ASCENDINGAscending sorting order.- See Also:
-
DESCENDING
private static final boolean DESCENDINGDescending sorting order.- See Also:
-
-
Constructor Details
-
RegularTasksTableModel
Creates new table model for regular tasks in settings dialog.- Parameters:
regularTasks
- Set of currently planned regular tasks.
-
-
Method Details
-
sortTable
Sorts table according to given column and known order.- Parameters:
column
- Column that will be used for sorting.- Returns:
- Vector of sorted regular tasks.
-
getColumnCount
public int getColumnCount()Returns number of columns in the table i.e. 3.- Returns:
- Always 3 since table has three columns.
-
getRowCount
public int getRowCount()Returns number of rows (regular tasks) in the table.- Returns:
- Number of rows in the table i.e. number of regular tasks.
-
getValueAt
Returns value of cell located in given row and column.- Parameters:
row
- Number of row.column
- Number of column.- Returns:
- Value of cell at specified location.
-
getColumnName
Returns name of column by given column number.- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
- Parameters:
column
- Number of column.- Returns:
- Name of column by given column number.
-