Search in sources :

Example 6 with NumericDataValue

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

the class TeamTimeColumn method getValueAt.

public Object getValueAt(WBSNode node, boolean ignoreErrors) {
    // get the numeric value from superclass logic
    NumericDataValue result = (NumericDataValue) super.getValueAt(node);
    if (result == null)
        return null;
    // get the filtered time on this node
    double filteredTime = getFilteredAmount(node);
    if (result.errorMessage != null) {
        // number to any child contribution, whether filtered or not.
        if (filteredTime > 0) {
            double bottomUpValue = result.expectedValue - filteredTime;
            result.errorMessage = getMismatchTooltip(bottomUpValue);
        }
    } else {
        // add informative warnings to the value if needed
        if (!ignoreErrors) {
            result.errorColor = Color.blue;
            result.errorMessage = getInfoTooltip(node, result, filteredTime);
        }
        // remove filtered time from the value we display
        if (filteredTime > 0) {
            result.value -= filteredTime;
            result.expectedValue -= filteredTime;
        }
    }
    return result;
}
Also used : NumericDataValue(teamdash.wbs.NumericDataValue)

Example 7 with NumericDataValue

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

the class TeamMemberTimeColumn method getValueAt.

/** Translate the value in this column into a TeamMemberTime object,
     * with an associated color. */
public Object getValueAt(WBSNode node) {
    NumericDataValue value = (NumericDataValue) super.getValueAt(node);
    value.isInvisible = (//
    value.value == 0 && value.errorMessage == null && isAssignedWithZero(node) == false);
    return new TeamMemberTime(value, teamMember.getColor());
}
Also used : NumericDataValue(teamdash.wbs.NumericDataValue) TeamMemberTime(teamdash.wbs.TeamMemberTime)

Example 8 with NumericDataValue

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

the class TopDownBottomUpColumn method getValueAt.

@Override
public Object getValueAt(WBSNode node) {
    // if this node has an inherited value, return it.
    double inheritedValue = node.getNumericAttribute(inheritedAttrName);
    if (!Double.isNaN(inheritedValue))
        return new NumericDataValue(inheritedValue, false, hideInheritedValues, null);
    double topDownValue = node.getNumericAttribute(topDownAttrName);
    double bottomUpValue = node.getNumericAttribute(bottomUpAttrName);
    // if there is no top-down value, return the bottom-up value, or zero.
    if (Double.isNaN(topDownValue))
        return new NumericDataValue(Double.isNaN(bottomUpValue) ? 0 : bottomUpValue);
    // if the top-down and bottom up values match, return them.
    if (equal(topDownValue, bottomUpValue))
        return new NumericDataValue(topDownValue);
    // return a "mismatch" object
    String errMsg = getMismatchTooltip(bottomUpValue);
    return new NumericDataValue(topDownValue, true, false, errMsg, bottomUpValue);
}
Also used : NumericDataValue(teamdash.wbs.NumericDataValue)

Example 9 with NumericDataValue

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

the class ProxyEstBucketColumn method maybeStoreSizeEstimate.

private void maybeStoreSizeEstimate(WBSNode node, WBSNode bucket) {
    // check for a valid size estimate on this bucket; abort if absent
    String sizeMetric = ProxySizeColumn.getSizeMetric(bucket);
    NumericDataValue size = ProxySizeColumn.getSizeValueAt(bucket);
    Integer sizeCol = sizeColumns.get(sizeMetric);
    if (sizeMetric == null || size == null || sizeCol == null)
        return;
    // only change size estimates for components, not for tasks.
    String currentType = (String) dataModel.getValueAt(node, nodeTypeColumn);
    String currentMetric = componentTypes.get(currentType);
    if (currentMetric == null)
        return;
    // clear out top-down size estimates of other types for this node
    for (Integer col : sizeColumns.values()) {
        if (col != sizeCol) {
            NumericDataValue oneSize = (NumericDataValue) dataModel.getValueAt(node, col);
            if (oneSize != null && oneSize.value > 0)
                dataModel.setValueAt("", node, col);
        }
    }
    // change the type of this node if necessary.
    if (!currentMetric.equals(sizeMetric)) {
        Object workflowSrcId = node.getAttribute(WORKFLOW_SOURCE_IDS_ATTR);
        dataModel.setValueAt(getTypeForSizeMetric(sizeMetric), node, nodeTypeColumn);
        node.setAttribute(WORKFLOW_SOURCE_IDS_ATTR, workflowSrcId);
    }
    // store the new size estimate for this node
    dataModel.setValueAt(size.value, node, sizeCol);
}
Also used : NumericDataValue(teamdash.wbs.NumericDataValue)

Example 10 with NumericDataValue

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

the class ProxyRateColumn method getValueAt.

@Override
public Object getValueAt(WBSNode node) {
    if (!ProxySizeColumn.hasSizeMetric(node))
        return null;
    double value = node.getNumericAttribute(ATTR_NAME);
    if (value > 0)
        return new NumericDataValue(value);
    value = node.getNumericAttribute(CALC_ATTR_NAME);
    if (value > 0) {
        NumericDataValue result = new NumericDataValue(value);
        result.errorMessage = CALCULATED_TOOLTIP;
        return result;
    }
    value = node.getNumericAttribute(INHERITED_ATTR_NAME);
    if (value > 0) {
        NumericDataValue result = new NumericDataValue(value);
        result.errorMessage = INHERITED_TOOLTIP;
        return result;
    }
    return null;
}
Also used : NumericDataValue(teamdash.wbs.NumericDataValue)

Aggregations

NumericDataValue (teamdash.wbs.NumericDataValue)13 WBSNode (teamdash.wbs.WBSNode)2 Component (java.awt.Component)1 Date (java.util.Date)1 JLabel (javax.swing.JLabel)1 HSSFRichTextString (org.apache.poi.hssf.usermodel.HSSFRichTextString)1 TeamMemberTime (teamdash.wbs.TeamMemberTime)1