Search in sources :

Example 31 with WBSNode

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

the class WorkflowMappingAlterer method applyChanges.

private void applyChanges(WorkflowWBSModel model, Workflow workflow, Workflow target, Map<String, String> changes) {
    // extract useful information from the various IDs
    String[] parts = workflow.getId().split(":", 3);
    String workflowProjectId = parts[1];
    Integer workflowUniqueId = Integer.valueOf(parts[2]);
    parts = target.getId().split(":", 3);
    String targetProjectId = parts[1];
    String targetUniqueId = parts[2];
    boolean sameProject = workflowProjectId.equals(targetProjectId);
    String targetRelativeId = (sameProject ? PROJECT_RELATIVE_PREFIX + targetUniqueId : target.getId());
    String attrName = PHASE_MAPPING_PREFIX + targetRelativeId;
    // collect useful information about the changes to be made
    Set<Integer> phaseUniqueIDsToChange = getPhaseUniqueIDs(changes);
    Set<String> targetPhaseFullIDs = getPhaseFullIDs(target, sameProject);
    // iterate over the workflow nodes, and update them
    for (WBSNode node : model.getWbsNodes()) {
        // only alter nodes for the set of phases we are changing
        if (!phaseUniqueIDsToChange.contains(node.getUniqueID()))
            continue;
        // remove any attributes from this node that specify obsolete
        // mappings to the target workflow
        deleteOldMappings(node, attrName, targetPhaseFullIDs);
        // store new mappings into this node as specified by the changes
        storeNewMappings(node, changes, attrName, sameProject);
    }
    // set/clear a flag on the workflow node to indicate whether the ETL
    // logic should disable mappings between these two workflows
    WBSNode workflowNode = model.getWorkflowNodeMap().get(workflowUniqueId);
    if (changes.containsKey(WorkflowMappingManager.DELETE_MAPPINGS))
        workflowNode.setAttribute(attrName, "*NONE*");
    else
        workflowNode.removeAttribute(attrName);
}
Also used : WBSNode(teamdash.wbs.WBSNode)

Example 32 with WBSNode

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

the class BlameDataFactory method recordNodeAdded.

private void recordNodeAdded(BlameModelData blameModelData, TreeNodeChange<Integer, WBSNodeContent> tnc, WBSModel wbs) {
    Integer nodeID = tnc.getNodeID();
    WBSNode node = wbs.getNodeMap().get(nodeID);
    String effAuthor = getAuthorOfNodeChange(node, Type.Add, author);
    BlamePoint effBlame = (effAuthor.equals(author) ? blamePoint : new BlamePoint(timestamp, effAuthor));
    BlameNodeData nodeData = blameModelData.getNodeData(nodeID);
    nodeData.setAddedBy(effBlame);
}
Also used : WBSNode(teamdash.wbs.WBSNode)

Example 33 with WBSNode

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

the class BlameDataFactory method recordNodeDeleted.

private void recordNodeDeleted(BlameModelData blameModelData, TreeNodeChange<Integer, WBSNodeContent> tnc, TreeDiff<Integer, WBSNodeContent> diff, WBSModel modelA) {
    // since the node has been removed, there won't be a row in the GUI for
    // this node where we can display any past blame changes. Remove its
    // blame data entry from our collection.
    Integer nodeID = tnc.getNodeID();
    BlameNodeData removedNodeData = blameModelData.remove(nodeID);
    // any details about this transient node to the user.
    if (removedNodeData != null && removedNodeData.getAddedBy() != null)
        return;
    // when an entire branch of the tree was deleted, we only need to report
    // the deletion of the branch's top-level parent.
    Integer parentID = tnc.getParentID();
    if (diff.getChangedNodeIDs(Type.Delete).contains(parentID))
        return;
    // Record an entry on the parent that this child was deleted.
    WBSNode deletedNode = modelA.getNodeMap().get(nodeID);
    BlameNodeData parentNodeData = blameModelData.getNodeData(parentID);
    parentNodeData.addDeletedChild(deletedNode, blamePoint);
}
Also used : WBSNode(teamdash.wbs.WBSNode)

Example 34 with WBSNode

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

the class ProxyEstBucketColumn method getBuckets.

private WBSNode[] getBuckets(WBSNode node) {
    Integer typeId = ProxyEstTypeColumn.getTypeIdAt(node);
    if (typeId == null)
        return NO_BUCKETS;
    WBSNode proxy = proxyModel.getNodeMap().get(typeId);
    if (proxy == null)
        return NO_BUCKETS;
    WBSNode[] buckets = proxyModel.getChildren(proxy);
    return buckets;
}
Also used : WBSNode(teamdash.wbs.WBSNode)

Example 35 with WBSNode

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

the class ProxyEstBucketColumn method setValueAt.

public void setValueAt(Object aValue, WBSNode node) {
    // if the user asks to clear the current value, oblige.
    if (aValue == null || "".equals(aValue)) {
        clearValueAt(node);
        return;
    }
    // find the bucket whose name matches the given value
    WBSNode selectedBucket = null;
    for (WBSNode bucket : getBuckets(node)) {
        if (bucket.getName().equals(aValue)) {
            selectedBucket = bucket;
            break;
        }
    }
    if (selectedBucket != null) {
        // store the name of the selected bucket for display purposes
        node.setAttribute(ATTR_NAME, selectedBucket.getName());
        // look for size and time estimates and apply if present
        maybeStoreTimeEstimate(node, selectedBucket);
        maybeStoreSizeEstimate(node, selectedBucket);
    }
}
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