Search in sources :

Example 1 with EVTask

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()));
    }
}
Also used : TreePath(javax.swing.tree.TreePath) EVTask(net.sourceforge.processdash.ev.EVTask) Iterator(java.util.Iterator)

Example 2 with EVTask

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]);
    }
}
Also used : EVTask(net.sourceforge.processdash.ev.EVTask)

Example 3 with EVTask

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);
}
Also used : EVTask(net.sourceforge.processdash.ev.EVTask) Point(java.awt.Point)

Example 4 with EVTask

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);
}
Also used : TreePath(javax.swing.tree.TreePath) EVTask(net.sourceforge.processdash.ev.EVTask) EVTaskList(net.sourceforge.processdash.ev.EVTaskList)

Example 5 with EVTask

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());
}
Also used : EVTask(net.sourceforge.processdash.ev.EVTask)

Aggregations

EVTask (net.sourceforge.processdash.ev.EVTask)24 TreePath (javax.swing.tree.TreePath)12 EVTaskList (net.sourceforge.processdash.ev.EVTaskList)8 Point (java.awt.Point)6 ArrayList (java.util.ArrayList)6 Iterator (java.util.Iterator)4 LinkedList (java.util.LinkedList)3 List (java.util.List)3 MilestoneList (net.sourceforge.processdash.ev.MilestoneList)3 Date (java.util.Date)2 HashMap (java.util.HashMap)2 EVTaskDependency (net.sourceforge.processdash.ev.EVTaskDependency)2 Component (java.awt.Component)1 Collection (java.util.Collection)1 EventObject (java.util.EventObject)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 JLabel (javax.swing.JLabel)1 JTree (javax.swing.JTree)1