Search in sources :

Example 1 with DataTableModel

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

the class WorkflowSizeUnitsColumn method isProbeTask.

private static boolean isProbeTask(JTable table, int row) {
    DataTableModel dataModel = (DataTableModel) table.getModel();
    WBSNode node = dataModel.getWBSModel().getNodeForRow(row);
    return isProbeTask(node);
}
Also used : DataTableModel(teamdash.wbs.DataTableModel) WBSNode(teamdash.wbs.WBSNode)

Example 2 with DataTableModel

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

the class BlameSelectionListener method actionPerformed.

public void actionPerformed(ActionEvent e) {
    if (!hasFocus())
        return;
    int[] selectedRows = table.getSelectedRows();
    int[] selectedColumns = table.getSelectedColumns();
    if (selectedRows.length == 0 || selectedColumns.length == 0)
        return;
    WBSModel wbsModel;
    List<String> columns = new ArrayList(selectedColumns.length);
    if (table.getModel() instanceof DataTableModel) {
        wbsModel = ((DataTableModel) table.getModel()).getWBSModel();
        for (int i = 0; i < selectedColumns.length; i++) {
            String identifier = (String) table.getColumnModel().getColumn(selectedColumns[i]).getIdentifier();
            columns.add(identifier);
        }
    } else {
        wbsModel = (WBSModel) table.getModel();
        columns.add(WBSNodeColumn.COLUMN_ID);
    }
    List<Integer> nodes = new ArrayList();
    for (int i = 0; i < selectedRows.length; i++) {
        WBSNode node = wbsModel.getNodeForRow(selectedRows[i]);
        nodes.add(node.getTreeNodeID());
    }
    BlameCaretPos caretPos = new BlameCaretPos(wbsModel.getModelType(), nodes, columns);
    if (SET_EMPTY_CARETS || blameData.countAnnotations(caretPos) > 0)
        blameData.setCaretPos(caretPos);
}
Also used : WBSModel(teamdash.wbs.WBSModel) ArrayList(java.util.ArrayList) DataTableModel(teamdash.wbs.DataTableModel) WBSNode(teamdash.wbs.WBSNode) BlameCaretPos(teamdash.hist.BlameCaretPos)

Aggregations

DataTableModel (teamdash.wbs.DataTableModel)2 WBSNode (teamdash.wbs.WBSNode)2 ArrayList (java.util.ArrayList)1 BlameCaretPos (teamdash.hist.BlameCaretPos)1 WBSModel (teamdash.wbs.WBSModel)1