*/
public Object getValueAt(Object node, int column) {
Object res = null;
if (!(node instanceof TaskNode))
return null;
TaskNode tn = (TaskNode) node;
Task t = (Task) tn.getUserObject();
// if(tn.getParent()!=null){
switch (column) {
case 0:
if (((Task) tn.getUserObject()).isProjectTask()) {
res = new ImageIcon(getClass().getResource(
"/icons/mproject.gif"));
} else if (!tn.isLeaf())
res = new ImageIcon(getClass().getResource("/icons/mtask.gif"));
else if (t.isMilestone())
res = new ImageIcon(getClass()
.getResource("/icons/meeting.gif"));
else
res = new ImageIcon(getClass().getResource("/icons/tasks2.png"));
break;
case 1:
Task task = (Task) tn.getUserObject();
String path = (task.getPriority() == 0 ? "/icons/task1.gif" : task
.getPriority() == 1 ? "/icons/task.gif"
: "/icons/task2.gif");
res = new ImageIcon(getClass().getResource(path));
break;
case 2: // info
TaskInfo info = t.getTaskInfo();
if (info != null) {
if (info instanceof Delay) {
int type = ((Delay) info).getType();
if (type == Delay.NORMAL)
res = new ImageIcon(getClass().getResource(
"/icons/alert1_16.gif"));
else if (type == Delay.CRITICAL)
res = new ImageIcon(getClass().getResource(
"/icons/alert2_16.gif"));
}
}
break;
case 3:
res = tn.getName();
break;
case 4:
res = tn.getStart();
break;
case 5:
res = tn.getEnd();
break;
case 6:
res = new Integer(tn.getDuration());
break;
case 7:
res = new Integer(tn.getCompletionPercentage());
break;
case 8: {
ResourceAssignment[] tAssign = t.getAssignments();
StringBuffer sb = new StringBuffer();
int nb = 0;