Search in sources :

Example 11 with WBSNode

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

the class WBSExcelWriter method writeDataForNodes.

private int writeDataForNodes(HSSFSheet sheet, int rowNum, WBSNode node, TableColumnModel columns) {
    HSSFRow row = sheet.createRow(rowNum);
    writeCellForNodeName(node, row);
    writeCellsForNodeData(row, node, columns);
    WBSNode[] children = wbs.getChildren(node);
    if (children.length == 0)
        return rowNum;
    int childRowPos = rowNum;
    for (WBSNode child : children) {
        if (!child.isHidden())
            childRowPos = writeDataForNodes(sheet, childRowPos + 1, child, columns);
    }
    sheet.groupRow(rowNum + 1, childRowPos);
    if (!node.isExpanded())
        sheet.setRowGroupCollapsed(rowNum + 1, true);
    return childRowPos;
}
Also used : HSSFRow(org.apache.poi.hssf.usermodel.HSSFRow) WBSNode(teamdash.wbs.WBSNode)

Example 12 with WBSNode

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

the class PlanTimeWatcher method calcDiscrepancies.

private List<String> calcDiscrepancies() {
    if (restrictTo == null)
        return null;
    List<String> result = null;
    WBSNode rootNode = dataModel.getWBSModel().getRoot();
    if (rootNode.getAttribute(WBSSynchronizer.SYNC_IN_PROGRESS_ATTR) != null)
        return null;
    for (int i = teamMemberColumns.size(); i-- > 0; ) {
        int oneColumn = teamMemberColumns.get(i);
        String oneAttr = teamMemberAttrs[i];
        String oneDiscrepancy = calcDiscrepancyFor(rootNode, oneColumn, oneAttr);
        if (oneDiscrepancy != null) {
            if (result == null)
                result = new ArrayList<String>();
            result.add(oneDiscrepancy);
        }
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) WBSNode(teamdash.wbs.WBSNode)

Example 13 with WBSNode

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

the class TeamTimeColumn method applyWorkflowRoleEdits.

private void applyWorkflowRoleEdits(AssignedToEditList edits, WBSNode node) {
    // scan the list of edits, looking for role-related changes.
    for (Iterator i = edits.iterator(); i.hasNext(); ) {
        Change change = (Change) i.next();
        String origInitials = change.origInitials;
        boolean isRoleAssignment = false;
        if (origInitials != null && origInitials.startsWith(ROLE_BEG)) {
            if (change.isDelete()) {
                deleteRole(node, origInitials);
            } else if (change.isInitialsChange()) {
                isRoleAssignment = true;
                deleteRole(node, origInitials);
            }
        }
        if (!isRoleAssignment)
            i.remove();
    }
    // no role assignments were found, we're done.
    if (edits.isEmpty())
        return;
    // find the parent node which bounds this workflow instantiation.
    while (true) {
        WBSNode parent = wbsModel.getParent(node);
        if (parent == null || parent.getAttribute(WorkflowModel.WORKFLOW_SOURCE_IDS_ATTR) == null)
            break;
        else
            node = parent;
    }
    // store these new role assignments on the parent node
    storeRoleAssignments(edits, node);
    // tell the decendants of that parent to apply these role assignments.
    for (WBSNode child : wbsModel.getDescendants(node)) {
        LeafTaskData leafTaskData = getLeafTaskData(child);
        if (leafTaskData != null)
            leafTaskData.applyWorkflowRoleAssignments(edits);
    }
}
Also used : Iterator(java.util.Iterator) Change(net.sourceforge.processdash.ui.lib.autocomplete.AssignedToEditList.Change) WBSNode(teamdash.wbs.WBSNode)

Example 14 with WBSNode

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

the class ProjectChangeListFactory method buildChangesForEditedNode.

private void buildChangesForEditedNode(TreeNodeChange<Integer, WBSNodeContent> tnc, Map<Integer, ProjectWbsNodeChange> nodeChanges, Map<Integer, ProjectWbsTimeChange> timeChanges) {
    Integer nodeID = tnc.getNodeID();
    if (nodeID < 0)
        // don't look for edits on the root node.
        return;
    WBSNodeContent base = diff.getBaseRoot().findNode(nodeID).getContent();
    WBSNodeContent mod = tnc.getNode().getContent();
    Set<String> attrNames = new HashSet<String>(base.keySet());
    attrNames.addAll(mod.keySet());
    boolean sawTimeChange = false;
    for (String attr : attrNames) {
        String baseVal = base.get(attr);
        String modVal = mod.get(attr);
        if (baseVal != null && baseVal.equals(modVal)) {
        // no change in this attribute value
        } else if (NODE_NAME.equals(attr)) {
            Object changeType = new ProjectWbsNodeChange.Renamed(baseVal);
            addNodeChange(tnc, nodeChanges, wbsB, changeType);
        } else if (indivTimeAttrs.contains(attr) || TeamTimeColumn.TEAM_TIME_ATTR.equals(attr)) {
            sawTimeChange = true;
        }
    }
    if (sawTimeChange) {
        WBSNode node = wbsB.getNodeMap().get(nodeID);
        timeChanges.put(nodeID, new ProjectWbsTimeChange(node, base, mod, indivTimeAttrs, teamMemberNames, author, timestamp));
    }
}
Also used : WBSNodeContent(teamdash.wbs.AbstractWBSModelMerger.WBSNodeContent) WBSNode(teamdash.wbs.WBSNode) HashSet(java.util.HashSet)

Example 15 with WBSNode

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

the class ProjectChangeListFactory method addNodeMove.

private void addNodeMove(TreeNodeChange<Integer, WBSNodeContent> tnc, Map<Integer, ProjectWbsNodeChange> nodeChanges) {
    Integer nodeID = tnc.getNodeID();
    WBSNode node = wbsA.getNodeMap().get(nodeID);
    WBSNode oldParent = wbsA.getParent(node);
    Object changeType = new ProjectWbsNodeChange.Moved(oldParent);
    addNodeChange(tnc, nodeChanges, wbsB, changeType);
}
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