Search in sources :

Example 1 with BlameModelData

use of teamdash.hist.BlameModelData 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 2 with BlameModelData

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

the class WBSJTable method setBlameData.

public void setBlameData(BlameData blame) {
    BlameModelData blameData = BlameData.getModel(blame, wbsModel.getModelType());
    if (this.blameData != blameData) {
        if (this.blameData != null)
            this.blameData.removeBlameModelDataListener(BLAME_LISTENER);
        if (this.blameSelectionListener != null) {
            this.blameSelectionListener.dispose();
            this.blameSelectionListener = null;
        }
        this.blameData = blameData;
        FILTER_ACTION.setBlameData(blameData);
        if (this.blameData != null) {
            this.blameData.addBlameModelDataListener(BLAME_LISTENER);
            this.blameSelectionListener = new BlameSelectionListener(this, blame);
        }
        repaint();
    }
}
Also used : BlameModelData(teamdash.hist.BlameModelData) BlameSelectionListener(teamdash.hist.ui.BlameSelectionListener)

Example 3 with BlameModelData

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

the class DataJTable method setBlameData.

public void setBlameData(BlameData blame) {
    BlameModelData blameData = BlameData.getModel(blame, ((DataTableModel) getModel()).getWBSModel().getModelType());
    if (this.blameData != blameData) {
        if (this.blameData != null)
            this.blameData.removeBlameModelDataListener(BLAME_LISTENER);
        if (this.blameSelectionListener != null) {
            this.blameSelectionListener.dispose();
            this.blameSelectionListener = null;
        }
        this.blameData = blameData;
        if (this.blameData != null) {
            this.blameData.addBlameModelDataListener(BLAME_LISTENER);
            this.blameSelectionListener = new BlameSelectionListener(this, blame);
        }
        repaint();
    }
}
Also used : BlameModelData(teamdash.hist.BlameModelData) BlameSelectionListener(teamdash.hist.ui.BlameSelectionListener)

Aggregations

BlameModelData (teamdash.hist.BlameModelData)3 BlameSelectionListener (teamdash.hist.ui.BlameSelectionListener)2 BlameNodeData (teamdash.hist.BlameNodeData)1 BlameValueList (teamdash.hist.BlameValueList)1 ModelType (teamdash.merge.ModelType)1 WBSNode (teamdash.wbs.WBSNode)1