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);
}
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);
}
}
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);
}
}
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);
}
}
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);
}
Aggregations