Search in sources :

Example 76 with PropertyKey

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

the class MockActiveTaskModel method setNextPhase.

public boolean setNextPhase() {
    PropertyKey parent = node.getParent();
    PropertyKey nextNode = null;
    for (int i = hierarchy.getNumChildren(parent); i-- > 0; ) {
        PropertyKey childKey = hierarchy.getChildKey(parent, i);
        if (node.equals(childKey))
            return setNode(nextNode);
        else
            nextNode = childKey;
    }
    return false;
}
Also used : PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Example 77 with PropertyKey

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

the class TaskListAltererMessageHandler method findProjectWithID.

private String findProjectWithID(PropertyKey parent, String projectID) {
    for (int i = ctx.getHierarchy().getNumChildren(parent); i-- > 0; ) {
        PropertyKey node = ctx.getHierarchy().getChildKey(parent, i);
        // check to see if THIS node is the project we're looking for.
        String path = node.path();
        if (pathMatchesProjectID(path, projectID))
            return path;
        // Otherwise, recurse into children to look for the project.
        String childResult = findProjectWithID(node, projectID);
        if (childResult != null)
            return childResult;
    }
    // the project was not found in this portion of the tree.
    return null;
}
Also used : PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Example 78 with PropertyKey

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

the class MigrationToolTeam method getDataFileName.

private String getDataFileName(DashboardContext ctx, String path) {
    DashHierarchy hier = ctx.getHierarchy();
    PropertyKey key = hier.findExistingKey(path);
    if (key == null) {
        logger.severe("No property key found for '" + path + "'");
        return null;
    }
    Prop p = hier.pget(key);
    if (p == null) {
        logger.severe("No prop found for '" + path + "'");
        return null;
    }
    String dataFileName = p.getDataFile();
    if (dataFileName == null) {
        logger.severe("No datafile associated with '" + path + "'");
        return null;
    }
    return dataFileName;
}
Also used : Prop(net.sourceforge.processdash.hier.Prop) DashHierarchy(net.sourceforge.processdash.hier.DashHierarchy) PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Example 79 with PropertyKey

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

the class HierarchySynchronizer method getTotalPlanTimeForIndivNode.

private double getTotalPlanTimeForIndivNode(PropertyKey node) {
    double result = 0;
    // add time logged directly to the node, if it exists.
    SimpleData d = getData(node.path(), EST_TIME_DATA_NAME);
    result += getDoubleData(d);
    // if the node is not a PSP task and has children, add their time too.
    if (!isPSPTask(node)) {
        for (int i = hierarchy.getNumChildren(node); i-- > 0; ) {
            PropertyKey child = hierarchy.getChildKey(node, i);
            result += getTotalPlanTimeForIndivNode(child);
        }
    }
    return result;
}
Also used : SimpleData(net.sourceforge.processdash.data.SimpleData) PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Example 80 with PropertyKey

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

the class ConvertTeamProjectMCF method findProject.

/**
     * Locates the enclosing team project, and sets the values of the
     * {@link #projectRoot} and {@link #processID} fields accordingly. If there
     * is no enclosing team project, both will be set to null.
     */
private void findProject() throws MigrationException {
    DashHierarchy hierarchy = getPSPProperties();
    PropertyKey key = hierarchy.findExistingKey(getPrefix());
    while (key != null) {
        String templateID = hierarchy.getID(key);
        if (templateID != null && templateID.endsWith(MASTER_ROOT)) {
            throw new MigrationException("notSupportedMaster");
        }
        String teamTemplateID = getTeamPID(templateID);
        if (teamTemplateID != null) {
            projectRoot = key.path();
            processID = teamTemplateID;
            return;
        }
        key = key.getParent();
    }
    throw new MigrationException("notTeamProject");
}
Also used : DashHierarchy(net.sourceforge.processdash.hier.DashHierarchy) 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