public class DayTableModel
extends javax.swing.table.AbstractTableModel
Modifier and Type | Field and Description |
---|---|
static int |
TASK_DESCRIPTION
Identification of description column.
|
static int |
TASK_DURATION
Identification of duration column.
|
static int |
TASK_KEYWORD
Identification of keyword column.
|
static int |
TASK_NONE
Identification of no column.
|
static int |
TASK_NOTIFICATION
Identification of notification column.
|
static int |
TASK_PRIORITY
Identification of priority column.
|
static int |
TASK_PRIVATE
Identification of keyword column.
|
static int |
TASK_REGULAR
Identification of regular tasks column.
|
static int |
TASK_STATE
Identification of state column.
|
Constructor and Description |
---|
DayTableModel(Day day)
Creates a new instance of DayTableModel.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
getAllColumnNames()
Returns all translated column names.
|
int |
getAllColumnsCount()
Returns how many columns are available in total.
|
java.lang.Class |
getColumnClass(int column)
Returns class that should be used to render all values in given column.
|
int |
getColumnCount()
Returns how many columns are currently selected and should be displayed.
|
int |
getColumnID(int column)
Returns absolute column number identified by given visible column number
i.e.
|
java.lang.String |
getColumnName(int column)
Returns translated name of column identified by given visible column
number.
|
int |
getRow(Task task)
Returns number of row occupied by given task.
|
int |
getRowCount()
Returns how many rows should be displayed depending on visibility of finished tasks.
|
int |
getSortedColumn()
Returns column that is currently sorted.
|
java.lang.String |
getSortedOrder()
Returns sorting order that is currently used.
|
Task |
getTask(int row)
Returns task located at given row depending on whether finished tasks
are displayed or not.
|
java.lang.Object |
getValueAt(int row,
int column)
Returns cell value located by given row and column.
|
boolean |
isSelectedColumn(int columnID)
Finds out if given column is visible i.e.
|
void |
resortRows()
Manually invokes resorting of all rows.
|
void |
setDay(Day day)
Sets day to be represented by this model.
|
void |
setSelectedColumn(int columnID,
boolean state)
Sets visibility for given column.
|
void |
setSortedColumn(int column,
boolean changeOrder)
Changes sorting order (ascending <-> descending) for given column.
|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
public static final int TASK_PRIORITY
public static final int TASK_DESCRIPTION
public static final int TASK_DURATION
public static final int TASK_STATE
public static final int TASK_REGULAR
public static final int TASK_NOTIFICATION
public static final int TASK_KEYWORD
public static final int TASK_PRIVATE
public static final int TASK_NONE
public DayTableModel(Day day)
day
- Day that this table model represents.public void setDay(Day day)
day
- Day that this table model represents.public int getColumnCount()
public java.lang.String[] getAllColumnNames()
public int getRowCount()
public java.lang.Class getColumnClass(int column)
getColumnClass
in interface javax.swing.table.TableModel
getColumnClass
in class javax.swing.table.AbstractTableModel
column
- Column whose class should be returned.public java.lang.Object getValueAt(int row, int column)
row
- Row number to locate the interested cell.column
- Column number to locate the interested cell.public java.lang.String getColumnName(int column)
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
column
- Visible column number whose name will be returned.public int getColumnID(int column)
column
- Visible column number whose absolute column number will be calculated.public boolean isSelectedColumn(int columnID)
columnID
- Absolute column number to be checked for visibility.public void setSelectedColumn(int columnID, boolean state)
columnID
- Absolute column number to be set.state
- True if column should be visible or false otherwise.public int getAllColumnsCount()
public void setSortedColumn(int column, boolean changeOrder)
column
- Visible column number.changeOrder
- True if sorting order should be changed.public void resortRows()
public Task getTask(int row)
row
- Number of row whose task should be returned.public int getRow(Task task)
task
- Task whose row number should be returned.public int getSortedColumn()
public java.lang.String getSortedOrder()