Ignore:
Timestamp:
08/17/12 08:33:29 (12 years ago)
Author:
pharms
Message:
  • adapted task tree creation stuff to more general event handling
File:
1 moved

Legend:

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

    r498 r557  
    1 //------------------------------------------------------------------------------------------------- 
    21// Module    : $RCSfile: Iteration.java,v $ 
    32// Version   : $Revision: 0.0 $  $Author: patrick $  $Date: 19.02.2012 $ 
     
    54// Creation  : 2012 by patrick 
    65// Copyright : Patrick Harms, 2012 
    7 //------------------------------------------------------------------------------------------------- 
     6 
     7 
    88package de.ugoe.cs.quest.tasktrees.treeimpl; 
    99 
    10 import de.ugoe.cs.quest.tasktrees.treeifc.Iteration; 
    11 import de.ugoe.cs.quest.tasktrees.treeifc.TaskTreeNode; 
     10import de.ugoe.cs.quest.tasktrees.treeifc.IIteration; 
     11import de.ugoe.cs.quest.tasktrees.treeifc.ITaskTreeNode; 
    1212 
    13 //------------------------------------------------------------------------------------------------- 
    1413/** 
    1514 * TODO comment 
     
    1817 * @author 2012, last modified by $Author: patrick$ 
    1918 */ 
    20 //------------------------------------------------------------------------------------------------- 
    21 public class IterationImpl extends TaskTreeNodeImpl implements Iteration 
    22 { 
     19public class Iteration extends TaskTreeNode implements IIteration { 
    2320 
    24   //----------------------------------------------------------------------------------------------- 
    25   /** 
    26    * 
    27    */ 
    28   //----------------------------------------------------------------------------------------------- 
    29   IterationImpl() 
    30   { 
    31     super("Iteration"); 
    32   } 
     21    /** 
     22     * 
     23     */ 
     24    Iteration() { 
     25        super("Iteration"); 
     26    } 
    3327 
    34   //----------------------------------------------------------------------------------------------- 
    35   /* (non-Javadoc) 
    36    * @see de.ugoe.cs.tasktree.treeifc.TaskTreeNode#addChild(TaskTreeNode) 
    37    */ 
    38   //----------------------------------------------------------------------------------------------- 
    39   @Override 
    40   public void addChild(TaskTreeNode child) 
    41   { 
    42     // adding more children is not allowed 
    43     throw new UnsupportedOperationException(); 
    44   } 
     28    /* 
     29     * (non-Javadoc) 
     30     *  
     31     * @see de.ugoe.cs.tasktree.treeifc.TaskTreeNode#addChild(TaskTreeNode) 
     32     */ 
     33    @Override 
     34    public void addChild(ITaskTreeNode child) { 
     35        // adding more children is not allowed 
     36        throw new UnsupportedOperationException 
     37          ("iterations may not have a list of children. Use setChild() instead."); 
     38    } 
    4539 
    46   //----------------------------------------------------------------------------------------------- 
    47   /** 
    48    * TODO: comment 
    49    * 
    50    * @param selection 
    51    * @return 
    52    */ 
    53   //----------------------------------------------------------------------------------------------- 
    54   public void setChild(TaskTreeNode child) 
    55   { 
    56     if (super.getChildren().size() > 0) 
    57     { 
    58       super.removeChild(0); 
     40    /** 
     41     * TODO: comment 
     42     *  
     43     * @param selection 
     44     * @return 
     45     */ 
     46    public void setChild(ITaskTreeNode child) { 
     47        if (super.getChildren().size() > 0) { 
     48            super.removeChild(0); 
     49        } 
     50        super.addChild(child); 
    5951    } 
    60     super.addChild(child); 
    61   } 
    6252 
    63   //----------------------------------------------------------------------------------------------- 
    64   /* (non-Javadoc) 
    65    * @see java.lang.Object#clone() 
    66    */ 
    67   //----------------------------------------------------------------------------------------------- 
    68   @Override 
    69   public IterationImpl clone() 
    70   { 
    71     return (IterationImpl) super.clone(); 
    72   } 
     53    /* 
     54     * (non-Javadoc) 
     55     *  
     56     * @see java.lang.Object#clone() 
     57     */ 
     58    @Override 
     59    public Iteration clone() { 
     60        return (Iteration) super.clone(); 
     61    } 
    7362 
    7463} 
Note: See TracChangeset for help on using the changeset viewer.