Ignore:
Timestamp:
04/04/13 16:06:07 (11 years ago)
Author:
pharms
Message:
  • complete refactoring of task tree model with a separation of task models and task instances
  • appropriate adaptation of task tree generation process
  • appropriate adaptation of commands and task tree visualization
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeimpl/Iteration.java

    r1126 r1146  
    1616 
    1717import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; 
    18 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode; 
     18import de.ugoe.cs.autoquest.tasktrees.treeifc.IOptional; 
     19import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 
    1920 
    2021/** 
     
    2425 * @author 2012, last modified by $Author: patrick$ 
    2526 */ 
    26 public class Iteration extends TaskTreeNode implements IIteration { 
     27class Iteration extends MarkingTemporalRelationship implements IIteration { 
     28 
     29    /**  */ 
     30    private static final long serialVersionUID = 1L; 
    2731 
    2832    /** 
     
    3034     */ 
    3135    Iteration() { 
    32         super("Iteration"); 
     36        super("iteration"); 
    3337    } 
    3438 
    35     /* 
    36      * (non-Javadoc) 
    37      *  
    38      * @see de.ugoe.cs.tasktree.treeifc.TaskTreeNode#addChild(TaskTreeNode) 
     39    /* (non-Javadoc) 
     40     * @see MarkingTemporalRelationship#setMarkedTask(ITask) 
    3941     */ 
    4042    @Override 
    41     public void addChild(ITaskTreeNode child) { 
    42         // adding more children is not allowed 
    43         throw new UnsupportedOperationException 
    44             ("iterations may not have a list of children. Use setChild() instead."); 
    45     } 
    46  
    47     /** 
    48      * TODO: comment 
    49      *  
    50      * @param selection 
    51      * @return 
    52      */ 
    53     public void setChild(ITaskTreeNode child) { 
    54         if (super.getChildren().size() > 0) { 
    55             super.removeChild(0); 
     43    protected void setMarkedTask(ITask markedTask) { 
     44        if (markedTask instanceof IIteration) { 
     45            throw new IllegalArgumentException 
     46                ("the marked task of an iteration must not be an iteration"); 
    5647        } 
    57         super.addChild(child); 
     48        else if (markedTask instanceof IOptional) { 
     49            throw new IllegalArgumentException 
     50                ("the marked task of an iteration must not be an optional"); 
     51        } 
     52         
     53        super.setMarkedTask(markedTask); 
    5854    } 
    5955 
Note: See TracChangeset for help on using the changeset viewer.