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;
}
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);
}
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;
}
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);
}
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;
}
Aggregations