Search in sources :

Example 1 with BlameNodeData

use of teamdash.hist.BlameNodeData in project processdash by dtuma.

the class WBSJTable method prepareRenderer.

@Override
public Component prepareRenderer(TableCellRenderer renderer, int row, int column) {
    Component result = super.prepareRenderer(renderer, row, column);
    boolean needsBlameAnnotation = false;
    BlameNodeData blame = getBlameDataForRow(row);
    if (blame != null) {
        column = convertColumnIndexToModel(column);
        if (column == 0) {
            needsBlameAnnotation = blame.hasStructuralChange();
        } else if (dataModel != null) {
            String columnID = dataModel.getColumn(column).getColumnID();
            needsBlameAnnotation = blame.isColumnAffected(columnID);
        }
    }
    if (needsBlameAnnotation)
        BlameAnnotationBorder.annotate(result);
    return result;
}
Also used : BlameNodeData(teamdash.hist.BlameNodeData) Component(java.awt.Component) JComponent(javax.swing.JComponent)

Example 2 with BlameNodeData

use of teamdash.hist.BlameNodeData in project processdash by dtuma.

the class BlameHistoryDialog method setBlameComments.

private boolean setBlameComments(BlameCaretPos caretPos) {
    breadcrumb.clear();
    blameChanges.clearRows();
    dataProblems.setCurrentNode(null);
    rejectAction.setEnabled(false);
    if (caretPos == null || blameData == null)
        return false;
    if (!caretPos.isSingleCell()) {
        int numChanges = blameData.countAnnotations(caretPos);
        String message = resources.format("Message.Multiple_FMT", numChanges);
        blameChanges.showMessage(message);
        return numChanges > 0;
    }
    ModelType modelType = caretPos.getModelType();
    BlameModelData modelData = blameData.get(modelType);
    if (modelData == null)
        return false;
    Integer nodeID = caretPos.getSingleNode();
    BlameNodeData nodeData = modelData.get(nodeID);
    if (nodeData == null)
        return false;
    WBSNode node = wbsDataModel.getWBSModel().getNodeMap().get(nodeID);
    String nodePath = (node == null ? null : node.getFullName());
    String columnID = caretPos.getSingleColumn();
    if (WBSNodeColumn.COLUMN_ID.equals(columnID)) {
        breadcrumb.setPath(nodePath, null);
        blameChanges.setBlameNodeStructure(nodeData);
        dataProblems.setCurrentNode(nodeID);
        rejectAction.setEnabled(true);
        return nodeData.hasStructuralChange();
    }
    if (nodeData.getAttributes() == null)
        return false;
    for (BlameValueList val : nodeData.getAttributes().values()) {
        if (val.columnMatches(columnID)) {
            int col = wbsDataModel.findColumn(columnID);
            String columnName = wbsDataModel.getColumnName(col);
            breadcrumb.setPath(nodePath, columnName);
            blameChanges.setBlameValueList(val);
            dataProblems.setCurrentNode(nodeID);
            rejectAction.setEnabled(true);
            return true;
        }
    }
    return false;
}
Also used : BlameNodeData(teamdash.hist.BlameNodeData) BlameModelData(teamdash.hist.BlameModelData) BlameValueList(teamdash.hist.BlameValueList) ModelType(teamdash.merge.ModelType) WBSNode(teamdash.wbs.WBSNode)

Example 3 with BlameNodeData

use of teamdash.hist.BlameNodeData in project processdash by dtuma.

the class DataJTable method prepareRenderer.

@Override
public Component prepareRenderer(TableCellRenderer renderer, int row, int column) {
    Component result = super.prepareRenderer(renderer, row, column);
    BlameNodeData blame = getBlameDataForRow(row);
    if (blame != null) {
        DataTableModel dataModel = (DataTableModel) getModel();
        column = convertColumnIndexToModel(column);
        String columnID = dataModel.getColumn(column).getColumnID();
        if (blame.isColumnAffected(columnID))
            BlameAnnotationBorder.annotate(result);
    }
    return result;
}
Also used : BlameNodeData(teamdash.hist.BlameNodeData) Component(java.awt.Component) JTextComponent(javax.swing.text.JTextComponent)

Aggregations

BlameNodeData (teamdash.hist.BlameNodeData)3 Component (java.awt.Component)2 JComponent (javax.swing.JComponent)1 JTextComponent (javax.swing.text.JTextComponent)1 BlameModelData (teamdash.hist.BlameModelData)1 BlameValueList (teamdash.hist.BlameValueList)1 ModelType (teamdash.merge.ModelType)1 WBSNode (teamdash.wbs.WBSNode)1