Search in sources :

Example 46 with AUndertaking

use of edu.cmu.cs.hcii.cogtool.model.AUndertaking in project cogtool by cogtool.

the class SWTTreeProjectSelectionState method deselectTask.

/*
     * Recursive step for deselecting tasks.
     */
protected void deselectTask(AUndertaking task) {
    if (task instanceof TaskGroup) {
        TaskGroup group = (TaskGroup) task;
        Iterator<AUndertaking> childTasks = group.getUndertakings().iterator();
        while (childTasks.hasNext()) {
            AUndertaking childTask = childTasks.next();
            deselectTask(childTask);
        }
    }
    // Remove from selected item map regardless of type
    selectedItems.remove(task);
}
Also used : AUndertaking(edu.cmu.cs.hcii.cogtool.model.AUndertaking) TaskGroup(edu.cmu.cs.hcii.cogtool.model.TaskGroup)

Example 47 with AUndertaking

use of edu.cmu.cs.hcii.cogtool.model.AUndertaking in project cogtool by cogtool.

the class ProjectUIModel method redisplayAllResults.

// Redisplay all results
protected void redisplayAllResults(TreeItem[] rows) {
    for (TreeItem row : rows) {
        AUndertaking task = (AUndertaking) row.getData();
        if (task.isTaskGroup()) {
            redisplayAllResults(row.getItems());
        }
        row.setText(getTaskRowStrings(task));
        setRowBackground(task, row);
    }
}
Also used : TreeItem(org.eclipse.swt.widgets.TreeItem) AUndertaking(edu.cmu.cs.hcii.cogtool.model.AUndertaking)

Example 48 with AUndertaking

use of edu.cmu.cs.hcii.cogtool.model.AUndertaking in project cogtool by cogtool.

the class ProjectUIModel method recolorItems.

protected void recolorItems(TreeItem[] items, int columnIndex, boolean nowSelected) {
    for (TreeItem item : items) {
        AUndertaking undertaking = (AUndertaking) item.getData();
        if (nowSelected) {
            item.setBackground(columnIndex, selectedBackgroundColor);
            item.setForeground(columnIndex, selectedTextColor);
        } else {
            item.setForeground(columnIndex, unselectedTextColor);
            if (undertaking.isTaskGroup()) {
                item.setBackground(columnIndex, unselectedGroupBackgroundColor);
            } else {
                item.setBackground(columnIndex, unselectedTaskBackgroundColor);
            }
        }
        recolorItems(item.getItems(), columnIndex, nowSelected);
    }
}
Also used : TreeItem(org.eclipse.swt.widgets.TreeItem) AUndertaking(edu.cmu.cs.hcii.cogtool.model.AUndertaking)

Example 49 with AUndertaking

use of edu.cmu.cs.hcii.cogtool.model.AUndertaking in project cogtool by cogtool.

the class ProjectUIModel method addTasks.

// Recursive step
protected void addTasks(Iterator<AUndertaking> children, TreeItem parentRow) {
    while (children.hasNext()) {
        AUndertaking undertaking = children.next();
        TreeItem row = new TreeItem(parentRow, SWT.NONE);
        parentRow.setExpanded(true);
        populateRow(undertaking, row);
    }
}
Also used : TreeItem(org.eclipse.swt.widgets.TreeItem) AUndertaking(edu.cmu.cs.hcii.cogtool.model.AUndertaking)

Example 50 with AUndertaking

use of edu.cmu.cs.hcii.cogtool.model.AUndertaking in project cogtool by cogtool.

the class SEDemoUIModel method getCurrentOverrides.

/**
     * Enumerates values from the current override "backward" until the
     * value defined by the attributed (which might be the default value).
     */
@Override
public Iterator<Object> getCurrentOverrides(IAttributed attributed, String attrName) {
    if (CogToolPref.HCIPA.getBoolean()) {
        AUndertaking t = script.getDemonstration().getTaskApplication().getTask();
        TaskGroup grp = t.getTaskGroup();
        if (grp != null) {
            return new AttributeOverrideIterator(grp.getUndertakings(), script, currentOverride, attributed, attrName);
        }
    }
    return new AttributeOverrideScriptIterator(script, currentOverride, attributed, attrName);
}
Also used : AUndertaking(edu.cmu.cs.hcii.cogtool.model.AUndertaking) TaskGroup(edu.cmu.cs.hcii.cogtool.model.TaskGroup)

Aggregations

AUndertaking (edu.cmu.cs.hcii.cogtool.model.AUndertaking)89 TaskApplication (edu.cmu.cs.hcii.cogtool.model.TaskApplication)38 TaskGroup (edu.cmu.cs.hcii.cogtool.model.TaskGroup)35 IListenerAction (edu.cmu.cs.hcii.cogtool.util.IListenerAction)30 Design (edu.cmu.cs.hcii.cogtool.model.Design)28 ITaskDesign (edu.cmu.cs.hcii.cogtool.model.Project.ITaskDesign)24 DoublePoint (edu.cmu.cs.hcii.cogtool.model.DoublePoint)18 ProjectSelectionState (edu.cmu.cs.hcii.cogtool.ui.ProjectSelectionState)17 AUndoableEdit (edu.cmu.cs.hcii.cogtool.util.AUndoableEdit)14 Script (edu.cmu.cs.hcii.cogtool.model.Script)13 CompoundUndoableEdit (edu.cmu.cs.hcii.cogtool.util.CompoundUndoableEdit)13 IOException (java.io.IOException)12 TaskSelectionState (edu.cmu.cs.hcii.cogtool.ui.TaskSelectionState)11 IPredictionAlgo (edu.cmu.cs.hcii.cogtool.model.IPredictionAlgo)10 IUndoableEdit (edu.cmu.cs.hcii.cogtool.util.IUndoableEdit)10 RcvrIOException (edu.cmu.cs.hcii.cogtool.util.RcvrIOException)10 Demonstration (edu.cmu.cs.hcii.cogtool.model.Demonstration)9 TaskParent (edu.cmu.cs.hcii.cogtool.model.TaskParent)9 TreeItem (org.eclipse.swt.widgets.TreeItem)9 ArrayList (java.util.ArrayList)7