use of net.sourceforge.processdash.ev.EVTask in project processdash by dtuma.
the class TaskScheduleDialog method highlightErrors.
protected void highlightErrors(Map errors) {
if (errors == null || errors.size() == 0)
return;
Iterator i = errors.values().iterator();
while (i.hasNext()) {
EVTask t = (EVTask) i.next();
treeTable.getTree().makeVisible(new TreePath(t.getPath()));
}
}
use of net.sourceforge.processdash.ev.EVTask in project processdash by dtuma.
the class TaskScheduleDialog method selectNodesAndDescendants.
private void selectNodesAndDescendants(List<EVTask> selectedTasks) {
int[] newSelection = new int[] { Integer.MAX_VALUE, -1 };
for (EVTask task : selectedTasks) getRowRangeForTaskAndDescendants(task, newSelection);
if (newSelection[1] > -1) {
treeTable.clearSelection();
treeTable.getSelectionModel().addSelectionInterval(newSelection[0], newSelection[1]);
}
}
use of net.sourceforge.processdash.ev.EVTask in project processdash by dtuma.
the class TaskScheduleDialog method selectedTaskPos.
protected int selectedTaskPos(TreePath selPath, TreeModel model) {
if (selPath == null)
return -1;
int pathLen = selPath.getPathCount();
// only adjust children of the root node.
if (pathLen != 2)
return -1;
EVTask selectedTask = (EVTask) selPath.getPathComponent(pathLen - 1);
EVTask parentNode = (EVTask) selPath.getPathComponent(pathLen - 2);
return model.getIndexOfChild(parentNode, selectedTask);
}
use of net.sourceforge.processdash.ev.EVTask in project processdash by dtuma.
the class TaskScheduleDialog method showFilteredHTML.
public void showFilteredHTML() {
TreePath selectionPath = treeTable.getTree().getSelectionPath();
if (selectionPath == null)
return;
if (!saveOrCancel(true))
return;
// If the user has selected a node in the tree that has no siblings,
// we can move up a generation and start the filtering there.
EVTask task = (EVTask) selectionPath.getLastPathComponent();
EVTask parent = task.getParent();
while (parent != null && parent.getNumChildren() == 1) {
task = parent;
parent = task.getParent();
}
// main task list. We can just display the regular, unfiltered chart.
if (parent == null) {
showReport(taskListName, getUserFilter());
return;
}
// node and launch the report.
if (isMergedView()) {
String option = EVReportSettings.MERGED_PATH_FILTER_PARAM + "=" + HTMLUtils.urlEncode(getMergedPathFilterParam(task));
showReport(taskListName, option, getUserFilter(), REPORT_URL);
return;
}
// find the root of the task list containing the selected node.
EVTask root = task;
String subPath = null;
while (root != null && root.getFlag() == null) {
subPath = root.getName() + (subPath == null ? "" : "/" + subPath);
root = root.getParent();
}
EVTaskList subSchedule = findTaskListWithRoot(model, root);
if (subSchedule == null)
return;
String option;
if (task == root) {
// The selected node happens to be the root of some subschedule. No
// filtering is needed; just display the chart for that schedule.
option = null;
} else {
// if the task isn't the schedule root, send subpath to the report
option = EVReportSettings.PATH_FILTER_PARAM + "=" + HTMLUtils.urlEncode(subPath);
}
showReport(subSchedule.getTaskListName(), option, null, REPORT_URL);
}
use of net.sourceforge.processdash.ev.EVTask in project processdash by dtuma.
the class TaskScheduleDialog method setSelectedTasksFlatView.
private void setSelectedTasksFlatView(List<EVTask> tasks) {
treeTable.clearSelection();
for (EVTask task : tasks) if (task != model.getRoot())
addTaskToFlatViewSelection(task);
scrollToRow(treeTable.getSelectionModel().getMaxSelectionIndex());
scrollToRow(treeTable.getSelectionModel().getMinSelectionIndex());
}
Aggregations