Search in sources :

Example 1 with WBSNode

use of teamdash.wbs.WBSNode in project processdash by dtuma.

the class AncestorSelectionColumn method recalc.

private boolean recalc(WBSNode node) {
    boolean isChecked = node.getAttribute(explicitAttrName) != null;
    for (WBSNode child : wbsModel.getChildren(node)) if (recalc(child))
        isChecked = true;
    node.setAttribute(calculatedAttrName, isChecked ? "t" : null);
    if (isChecked && MAKE_ANCESTORS_EXPLICIT)
        node.setAttribute(explicitAttrName, "t");
    return isChecked;
}
Also used : WBSNode(teamdash.wbs.WBSNode)

Example 2 with WBSNode

use of teamdash.wbs.WBSNode in project processdash by dtuma.

the class MilestoneColorColumn method getFirstUnusedColor.

private String getFirstUnusedColor() {
    HashSet usedColors = new HashSet();
    for (WBSNode node : milestones.getMilestones()) usedColors.add(node.getAttribute(VALUE_ATTR));
    for (int j = 0; j < DEFAULT_COLORS.length; j++) {
        if (!usedColors.contains(DEFAULT_COLORS[j]))
            return DEFAULT_COLORS[j];
    }
    Random r = new Random();
    Color c = new Color(r.nextInt());
    return ColorCellEditor.encodeColor(c);
}
Also used : Random(java.util.Random) Color(java.awt.Color) WBSNode(teamdash.wbs.WBSNode) HashSet(java.util.HashSet)

Example 3 with WBSNode

use of teamdash.wbs.WBSNode in project processdash by dtuma.

the class TeamMemberTimeColumn method recalc.

@Override
protected double recalc(WBSNode node) {
    node.removeAttribute(assignWithZeroInheritedAttr);
    double result = super.recalc(node);
    if (result > 0) {
        node.removeAttribute(assignWithZeroAttr);
    } else {
        WBSNode parent = wbsModel.getParent(node);
        if (parent != null && isAssignedWithZero(node))
            parent.setAttribute(assignWithZeroInheritedAttr, "t");
    }
    return result;
}
Also used : WBSNode(teamdash.wbs.WBSNode)

Example 4 with WBSNode

use of teamdash.wbs.WBSNode in project processdash by dtuma.

the class TeamTimeColumn method changeInitials.

public static void changeInitials(WBSModel wbsModel, Map<String, String> initialsToChange) {
    AssignedToEditList initialsChanges = new AssignedToEditList();
    for (Entry<String, String> e : initialsToChange.entrySet()) {
        Change change = new Change();
        change.origInitials = e.getKey();
        change.newInitials = e.getValue();
        initialsChanges.add(change);
    }
    updateRoleAssignments(initialsChanges, wbsModel.getRoot());
    for (WBSNode node : wbsModel.getDescendants(wbsModel.getRoot())) updateRoleAssignments(initialsChanges, node);
}
Also used : Change(net.sourceforge.processdash.ui.lib.autocomplete.AssignedToEditList.Change) AssignedToEditList(net.sourceforge.processdash.ui.lib.autocomplete.AssignedToEditList) WBSNode(teamdash.wbs.WBSNode)

Example 5 with WBSNode

use of teamdash.wbs.WBSNode in project processdash by dtuma.

the class TeamTimeColumn method sumUpChildValues.

@Override
protected double sumUpChildValues(WBSNode parent, WBSNode[] children, int numToInclude) {
    // perform standard logic to recalc children and sum up total time
    double result = super.sumUpChildValues(parent, children, numToInclude);
    // sum up filtered time from child to parent
    double filteredTime = 0;
    if (matchesFilter != null) {
        for (int i = 0; i < numToInclude; i++) {
            WBSNode child = children[i];
            if (shouldFilterFromCalculations(child) == false)
                filteredTime += getFilteredAmount(child);
        }
    }
    parent.setNumericAttribute(FILTERED_TIME_ATTR, filteredTime);
    return result;
}
Also used : WBSNode(teamdash.wbs.WBSNode)

Aggregations

WBSNode (teamdash.wbs.WBSNode)40 ArrayList (java.util.ArrayList)6 HashMap (java.util.HashMap)3 HashSet (java.util.HashSet)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 Change (net.sourceforge.processdash.ui.lib.autocomplete.AssignedToEditList.Change)2 WBSNodeContent (teamdash.wbs.AbstractWBSModelMerger.WBSNodeContent)2 DataTableModel (teamdash.wbs.DataTableModel)2 NumericDataValue (teamdash.wbs.NumericDataValue)2 Color (java.awt.Color)1 Date (java.util.Date)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Random (java.util.Random)1 Matcher (java.util.regex.Matcher)1 AssignedToEditList (net.sourceforge.processdash.ui.lib.autocomplete.AssignedToEditList)1 HSSFRow (org.apache.poi.hssf.usermodel.HSSFRow)1 BlameCaretPos (teamdash.hist.BlameCaretPos)1 BlameModelData (teamdash.hist.BlameModelData)1 BlameNodeData (teamdash.hist.BlameNodeData)1