Search in sources :

Example 46 with PropertyKey

use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.

the class TimeLoggingSimulation method getPathFor.

private int[] getPathFor(String path) {
    DashHierarchy hier = harness.getDashboard().getHierarchy();
    for (int a = 0; a < 3; a++) {
        PropertyKey aKey = hier.getChildKey(PropertyKey.ROOT, a);
        for (int b = 0; b < 3; b++) {
            PropertyKey bKey = hier.getChildKey(aKey, b);
            for (int c = 0; c < 3; c++) {
                PropertyKey cKey = hier.getChildKey(bKey, c);
                if (path.equals(cKey.path()))
                    return new int[] { a, b, c };
            }
        }
    }
    new Exception("no node found for path " + path).printStackTrace();
    System.exit(0);
    // unreachable
    return null;
}
Also used : DashHierarchy(net.sourceforge.processdash.hier.DashHierarchy) Point(java.awt.Point) PropertyKey(net.sourceforge.processdash.hier.PropertyKey) IOException(java.io.IOException) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Example 47 with PropertyKey

use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.

the class TimeLoggingSimulation method checkValues.

private boolean checkValues() {
    boolean foundErr = false;
    boolean loggingModelIsTiming = !getTimeLoggingModel().isPaused();
    if (loggingModelIsTiming != isTiming) {
        printErr("We disagree with the logging model on whether or not the timer is running.");
        foundErr = true;
    }
    DashHierarchy hier = harness.getDashboard().getHierarchy();
    for (int a = 0; a < 3; a++) {
        PropertyKey aKey = hier.getChildKey(PropertyKey.ROOT, a);
        for (int b = 0; b < 3; b++) {
            PropertyKey bKey = hier.getChildKey(aKey, b);
            for (int c = 0; c < 3; c++) {
                PropertyKey cKey = hier.getChildKey(bKey, c);
                if (!checkTimeData(cKey.path(), expectedTimes[a][b][c]))
                    foundErr = true;
            }
        }
    }
    if (foundErr)
        printErr("data check complete");
    return !foundErr;
}
Also used : DashHierarchy(net.sourceforge.processdash.hier.DashHierarchy) Point(java.awt.Point) PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Example 48 with PropertyKey

use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.

the class EVTask method addChildrenFromHierarchy.

/** Attempt to find children in the hierarchy, and add them to our
     *  list of children.
     * @return true if any children were found and added.
     */
protected boolean addChildrenFromHierarchy(String fullName, PropertyKey key, DataRepository data, DashHierarchy hierarchy, Listener listener) {
    boolean addedChild = false;
    if (key == null)
        // make an attempt to lookup the name in the hierarchy.
        key = hierarchy.findExistingKey(fullName);
    if (key != null) {
        int numKids = hierarchy.getNumChildren(key);
        for (int i = 0; i < numKids; i++) {
            PropertyKey child = hierarchy.getChildKey(key, i);
            children.add(new EVTask(this, taskListName, child.name(), child.path(), child, data, hierarchy, listener));
            addedChild = true;
        }
    }
    return addedChild;
}
Also used : PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Example 49 with PropertyKey

use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.

the class TaskCommenterButton method setCommentTooltipAndConflict.

// Navigate through the task hierarchy from the currentNode to the top. If any
//  conflicting comments are found, "taskInConflict" and "conflictingCommentAuthor"
//  will be set accordingly.
private void setCommentTooltipAndConflict(PropertyKey currentNode) {
    Map<String, HierarchyNote> notes = HierarchyNoteManager.getNotesForPath(context.getDataRepository(), currentNode.path());
    if (notes != null) {
        if (deepestComment == null) {
            HierarchyNote note = notes.get(HierarchyNoteManager.NOTE_KEY);
            if (note != null)
                deepestComment = note.getAsHTML() + getBylineHTML(note);
        }
        if (notes.get(HierarchyNoteManager.NOTE_CONFLICT_KEY) != null) {
            commentConflictPresent = true;
            taskInConflict = currentNode;
            conflictingCommentAuthor = notes.get(HierarchyNoteManager.NOTE_CONFLICT_KEY).getAuthor();
        }
    }
    PropertyKey parent = currentNode.getParent();
    if (parent != null)
        setCommentTooltipAndConflict(parent);
}
Also used : PropertyKey(net.sourceforge.processdash.hier.PropertyKey) HierarchyNote(net.sourceforge.processdash.hier.HierarchyNote)

Example 50 with PropertyKey

use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.

the class TaskCommenterButton method actionPerformed.

public void actionPerformed(ActionEvent e) {
    PropertyKey phaseToShow = (commentConflictPresent) ? taskInConflict : context.getCurrentPhase();
    HierarchyNoteEditorDialog.showGlobalNoteEditor(context, phaseToShow);
}
Also used : PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Aggregations

PropertyKey (net.sourceforge.processdash.hier.PropertyKey)125 DashHierarchy (net.sourceforge.processdash.hier.DashHierarchy)40 Prop (net.sourceforge.processdash.hier.Prop)16 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)10 SimpleData (net.sourceforge.processdash.data.SimpleData)7 ArrayList (java.util.ArrayList)6 Enumeration (java.util.Enumeration)6 IOException (java.io.IOException)5 Iterator (java.util.Iterator)5 StringTokenizer (java.util.StringTokenizer)5 TreePath (javax.swing.tree.TreePath)5 ListData (net.sourceforge.processdash.data.ListData)5 DefectLog (net.sourceforge.processdash.log.defects.DefectLog)5 List (java.util.List)4 ProcessDashboard (net.sourceforge.processdash.ProcessDashboard)4 HierarchyAlterer (net.sourceforge.processdash.hier.HierarchyAlterer)4 HierarchyAlterationException (net.sourceforge.processdash.hier.HierarchyAlterer.HierarchyAlterationException)4 DefectLogID (net.sourceforge.processdash.log.defects.DefectLogID)4 TinyCGIException (net.sourceforge.processdash.net.http.TinyCGIException)4 Point (java.awt.Point)3