|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jdesktop.swingx.treetable.AbstractTreeTableModel
org.chorem.jtimer.ui.treetable.ProjectsAndTasksModel
public class ProjectsAndTasksModel
Cette classe gere l'affichage d'une liste de project dans l'arbre/table Cela permet au programme principal de manipuler la liste et d'oublier la gestion de l'arbre... Le modele de cet arbre utilise directement des TimerTask au lieu des TreeTableNode qui ne servent a rien et qui complique tout. Par contre, les tâches étant les mêmes instances que celle manipulées par le programme, il doit mettre en cache certains infos pour un rafraichissement correct:
| Field Summary | |
|---|---|
protected List<String> |
columnIdentifiers
Tree column identifiers. |
protected TimerDataManager |
dataManager
Data. |
static int |
OPERATION_ADD
Add node operation. |
static int |
OPERATION_DELETE
Delete Node operation. |
static int |
OPERATION_MODIFY
Modify node operation. |
protected ProjectsAndTasksTable |
projectsAndTaskTable
Tree managed by this model. |
protected boolean |
showClosedTask
Show closed task property. |
protected Map<Object,List<TimerTask>> |
subTasksCache
|
protected Map<TimerTask,String> |
taskNameCache
|
| Fields inherited from class org.jdesktop.swingx.treetable.AbstractTreeTableModel |
|---|
modelSupport, root |
| Constructor Summary | |
|---|---|
ProjectsAndTasksModel(ProjectsAndTasksTable projectsAndTaskTable,
TimerCore core,
List<String> columnIdentifiers)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addProject(TimerProject project)
Add project event. |
void |
addTask(TimerTask task)
Add task event. |
void |
changeClosedState(TimerTask task)
Change task state. |
void |
dataLoaded(Collection<TimerProject> projects)
All data loaded. |
void |
deleteProject(TimerProject project)
Delete project. |
void |
deleteTask(TimerTask task)
Delete task. |
Object |
getChild(Object parent,
int index)
|
int |
getChildCount(Object parent)
|
int |
getColumnCount()
|
String |
getColumnName(int column)
|
protected List<TimerTask> |
getFiteredSubListFor(Object parent)
Recupere la sous liste: data.getProjectsList() si parent = root getSubTasks() sinon (cache results). |
protected List<TimerTask> |
getFiteredSubListFor(Object parent,
boolean noCache)
Recupere la sous liste: data.getProjectsList() si parent = root getSubTasks() sinon. |
int |
getIndexOfChild(Object parent,
Object child)
|
Object |
getValueAt(Object object,
int column)
|
boolean |
isCellEditable(Object object,
int column)
|
boolean |
isLeaf(Object node)
|
void |
modifyProject(TimerProject project)
Modify project. |
void |
modifyTask(TimerTask task)
Modify task. |
void |
moveTask(TimerTask task)
Post move task. |
protected void |
notifyTaskChanged(TimerTask task,
int operation)
Notification de changement de donnees. |
void |
postMergeTasks(TimerTask destinationTask,
List<TimerTask> otherTasks)
Post merge task. |
void |
preMergeTasks(TimerTask destinationTask,
List<TimerTask> otherTasks)
Pre merge task. |
void |
preMoveTask(TimerTask task)
Pre move task. |
void |
setAnnotation(TimerTask task,
Date date,
String annotation)
Add annotation. |
void |
setShowClosed(boolean showClosedTask)
Change closed task property. |
void |
setTaskTime(TimerTask task,
Date date,
Long time)
Set task time. |
void |
startTask(TimerTask task)
Start task. |
void |
stopTask(TimerTask task)
Stop task. |
protected boolean |
updateChildren(TimerTask task,
TreePath path,
int operation)
Recursively try to update node. |
| Methods inherited from class org.jdesktop.swingx.treetable.AbstractTreeTableModel |
|---|
addTreeModelListener, getColumnClass, getHierarchicalColumn, getRoot, getTreeModelListeners, removeTreeModelListener, setValueAt, valueForPathChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int OPERATION_ADD
public static final int OPERATION_MODIFY
public static final int OPERATION_DELETE
protected ProjectsAndTasksTable projectsAndTaskTable
protected TimerDataManager dataManager
protected List<String> columnIdentifiers
protected boolean showClosedTask
protected Map<TimerTask,String> taskNameCache
protected Map<Object,List<TimerTask>> subTasksCache
| Constructor Detail |
|---|
public ProjectsAndTasksModel(ProjectsAndTasksTable projectsAndTaskTable,
TimerCore core,
List<String> columnIdentifiers)
projectsAndTaskTable - tablecore - timer corecolumnIdentifiers - column identifiers| Method Detail |
|---|
public int getColumnCount()
getColumnCount in interface org.jdesktop.swingx.treetable.TreeTableModelpublic String getColumnName(int column)
getColumnName in interface org.jdesktop.swingx.treetable.TreeTableModelgetColumnName in class org.jdesktop.swingx.treetable.AbstractTreeTableModel
public Object getValueAt(Object object,
int column)
getValueAt in interface org.jdesktop.swingx.treetable.TreeTableModel
public boolean isCellEditable(Object object,
int column)
isCellEditable in interface org.jdesktop.swingx.treetable.TreeTableModelisCellEditable in class org.jdesktop.swingx.treetable.AbstractTreeTableModel
public Object getChild(Object parent,
int index)
getChild in interface TreeModelpublic int getChildCount(Object parent)
getChildCount in interface TreeModelprotected List<TimerTask> getFiteredSubListFor(Object parent)
parent - parent to task sublist
protected List<TimerTask> getFiteredSubListFor(Object parent,
boolean noCache)
parent - parent to task sublistnoCache - disable use of cached result and result caching
public int getIndexOfChild(Object parent,
Object child)
getIndexOfChild in interface TreeModelpublic boolean isLeaf(Object node)
isLeaf in interface TreeModelisLeaf in class org.jdesktop.swingx.treetable.AbstractTreeTableModel
protected void notifyTaskChanged(TimerTask task,
int operation)
task - task to updateoperation - operation
protected boolean updateChildren(TimerTask task,
TreePath path,
int operation)
task - the task to updatepath - current pathoperation - operation (add, modify, delete)
public void addProject(TimerProject project)
DataEventListener
addProject in interface DataEventListenerproject - project to addpublic void addTask(TimerTask task)
DataEventListener
addTask in interface DataEventListenertask - task to addpublic void dataLoaded(Collection<TimerProject> projects)
DataEventListener
dataLoaded in interface DataEventListenerprojects - projects collectionpublic void deleteProject(TimerProject project)
DataEventListener
deleteProject in interface DataEventListenerproject - deleted projectpublic void deleteTask(TimerTask task)
DataEventListener
deleteTask in interface DataEventListenertask - deleted taskpublic void modifyProject(TimerProject project)
DataEventListener
modifyProject in interface DataEventListenerproject - modified projectpublic void modifyTask(TimerTask task)
DataEventListener
modifyTask in interface DataEventListenertask - modified task
public void setAnnotation(TimerTask task,
Date date,
String annotation)
DataEventListener
setAnnotation in interface DataEventListenertask - task where annotation is changeddate - dateannotation - new annotation value
public void setTaskTime(TimerTask task,
Date date,
Long time)
DataEventListener
setTaskTime in interface DataEventListenertask - task where time is changeddate - datetime - task timepublic void changeClosedState(TimerTask task)
DataEventListener
changeClosedState in interface DataEventListenertask - taskpublic void startTask(TimerTask task)
DataEventListener
startTask in interface DataEventListenertask - started taskpublic void stopTask(TimerTask task)
DataEventListener
stopTask in interface DataEventListenertask - stoped taskpublic void setShowClosed(boolean showClosedTask)
showClosedTask - closed task propertypublic void moveTask(TimerTask task)
DataEventListener
moveTask in interface DataEventListenertask - taskpublic void preMoveTask(TimerTask task)
DataEventListener
preMoveTask in interface DataEventListenertask - task
public void postMergeTasks(TimerTask destinationTask,
List<TimerTask> otherTasks)
DataEventListener
postMergeTasks in interface DataEventListenerdestinationTask - task where all other task will be mergedotherTasks - other tasks to merge
public void preMergeTasks(TimerTask destinationTask,
List<TimerTask> otherTasks)
DataEventListener
preMergeTasks in interface DataEventListenerdestinationTask - task where all other task will be mergedotherTasks - other tasks to merge
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||