(tree, value, selected, expanded, leaf, row, hasFocus);
String errorStr = null;
// find the EVTask for the indicated row
TreePath path = tree.getPathForRow(row);
EVTask node = null;
if (path != null)
node = (EVTask) path.getLastPathComponent();
// in flat mode, display the full name of the node rather
// than the terminal name
if (node != null && tree.getModel() == flatModel)
setText((String) flatModel.getValueAt(node,
EVTaskList.TASK_COLUMN));
// retrieve the error string for this node
if (node != null && model != null)
errorStr = ((EVTaskList) model).getErrorStringAt
(node, EVTaskList.TASK_COLUMN);
// display the error string if needed
if (result instanceof JComponent)
((JComponent) result).setToolTipText(errorStr);
if (errorStr != null)
result.setForeground(errorStr.startsWith(" ")
? Color.orange : Color.red);
Font f = getFont(errorStr != null, false, result);
if (f != null) result.setFont(f);
// give pruned nodes a special appearance
if (node != null && node.isUserPruned()) {
result.setForeground(PHANTOM_COLOR);
if (errorStr == null && result instanceof JComponent)
((JComponent) result).setToolTipText
(resources.getString("Task.Removed_Tooltip"));
if (result instanceof JLabel)
((JLabel) result).setIcon(getPrunedIcon(expanded, leaf));
// give chronologically pruned nodes a special appearance
} else if (node != null && node.isChronologicallyPruned()) {
result.setForeground(SEPIA);
if (errorStr == null && result instanceof JComponent) {
((JComponent) result).setToolTipText
(resources.getString
("Task.Previously_Completed_Tooltip"));
result.setFont(getFont(false, true, result));
}
if (result instanceof JLabel)
((JLabel) result).setIcon(getChronIcon(expanded, leaf));
// give cut nodes a special appearance
} else if (row > 0 && cutList.get(row)) {
if (result instanceof JLabel)
((JLabel) result).setIcon(getCutLeafIcon());
if (errorStr == null && result instanceof JComponent) {
((JComponent) result).setToolTipText
(resources.getString("Task.Copied_Tooltip"));
result.setForeground(Color.BLUE);
}
// use strikethrough for completed (but otherwise normal) tasks
} else if (node != null && node.getPercentComplete() > 0.99999
&& errorStr == null) {
result.setFont(getFont(false, true, result));
}
return result;