Changeset 467
- Timestamp:
- 07/25/12 11:58:00 (12 years ago)
- Location:
- trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/treeimpl
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/treeimpl/InteractionTaskImpl.java
r451 r467 98 98 //----------------------------------------------------------------------------------------------- 99 99 @Override 100 public TaskTreeNodeclone()100 public InteractionTaskImpl clone() 101 101 { 102 return new InteractionTaskImpl(mGUIElement, mInteraction); 102 // GUI element and interaction are unchangeable and do not need to be cloned 103 return (InteractionTaskImpl) super.clone(); 103 104 } 104 105 -
trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/treeimpl/IterationImpl.java
r439 r467 67 67 //----------------------------------------------------------------------------------------------- 68 68 @Override 69 public TaskTreeNodeclone()69 public IterationImpl clone() 70 70 { 71 IterationImpl clone = new IterationImpl(); 72 clone.setDescription(super.getDescription()); 73 74 if (super.getChildren().size() > 0) 75 { 76 clone.setChild(super.getChildren().get(0)); 77 } 78 return clone; 71 return (IterationImpl) super.clone(); 79 72 } 80 73 -
trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/treeimpl/SelectionImpl.java
r439 r467 9 9 10 10 import de.ugoe.cs.quest.tasktrees.treeifc.Selection; 11 import de.ugoe.cs.quest.tasktrees.treeifc.TaskTreeNode;12 11 13 12 //------------------------------------------------------------------------------------------------- … … 40 39 //----------------------------------------------------------------------------------------------- 41 40 @Override 42 public TaskTreeNodeclone()41 public SelectionImpl clone() 43 42 { 44 SelectionImpl clone = new SelectionImpl(); 45 clone.setDescription(super.getDescription()); 46 47 for (TaskTreeNode child : getChildren()) 48 { 49 clone.addChild(child); 50 } 51 52 return clone; 43 return (SelectionImpl) super.clone(); 53 44 } 54 45 -
trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/treeimpl/SequenceImpl.java
r439 r467 9 9 10 10 import de.ugoe.cs.quest.tasktrees.treeifc.Sequence; 11 import de.ugoe.cs.quest.tasktrees.treeifc.TaskTreeNode;12 11 13 12 //------------------------------------------------------------------------------------------------- … … 53 52 public SequenceImpl clone() 54 53 { 55 SequenceImpl clone = new SequenceImpl(); 56 clone.setDescription(super.getDescription()); 57 58 for (TaskTreeNode child : getChildren()) 59 { 60 clone.addChild(child); 61 } 62 63 return clone; 54 return (SequenceImpl) super.clone(); 64 55 } 65 56 -
trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/treeimpl/TaskTreeImpl.java
r439 r467 101 101 } 102 102 103 //----------------------------------------------------------------------------------------------- 104 /* (non-Javadoc) 105 * @see java.lang.Object#clone() 106 */ 107 //----------------------------------------------------------------------------------------------- 108 @Override 109 public TaskTreeImpl clone() 110 { 111 TaskTreeImpl clone = null; 112 try 113 { 114 clone = (TaskTreeImpl) super.clone(); 115 116 clone.mRootNode = mRootNode.clone(); 117 118 // the clone will create the task map itself, when it is first retrieved 119 clone.mTaskMap = null; 120 121 } 122 catch (CloneNotSupportedException e) 123 { 124 // this should never happen. Therefore simply dump the exception 125 e.printStackTrace(); 126 } 127 128 return clone; 129 } 130 103 131 } -
trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/treeimpl/TaskTreeNodeImpl.java
r465 r467 23 23 */ 24 24 //------------------------------------------------------------------------------------------------- 25 public abstractclass TaskTreeNodeImpl implements TaskTreeNode25 public class TaskTreeNodeImpl implements TaskTreeNode 26 26 { 27 27 /** */ … … 282 282 //----------------------------------------------------------------------------------------------- 283 283 @Override 284 public abstract TaskTreeNode clone(); 284 public TaskTreeNode clone() 285 { 286 TaskTreeNodeImpl clone = null; 287 try 288 { 289 clone = (TaskTreeNodeImpl) super.clone(); 290 291 clone.mChildren = new ArrayList<TaskTreeNode>(); 292 293 for (TaskTreeNode child : mChildren) 294 { 295 clone.mChildren.add(child.clone()); 296 } 297 298 } 299 catch (CloneNotSupportedException e) 300 { 301 // this should never happen. Therefore simply dump the exception 302 e.printStackTrace(); 303 } 304 305 return clone; 306 } 285 307 286 308 } -
trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/treeimpl/TextInputInteractionTaskImpl.java
r451 r467 10 10 import de.ugoe.cs.quest.eventcore.guimodel.GUIElement; 11 11 import de.ugoe.cs.quest.eventcore.userinteraction.TextInput; 12 import de.ugoe.cs.quest.tasktrees.treeifc.TaskTreeNode;13 12 import de.ugoe.cs.quest.tasktrees.treeifc.TextInputInteractionTask; 14 13 … … 48 47 public TextInputInteractionTaskImpl clone() 49 48 { 50 TextInputInteractionTaskImpl clone = new TextInputInteractionTaskImpl(super.getGUIElement()); 51 clone.setDescription(super.getDescription()); 52 clone.setEnteredText(this.getEnteredText()); 53 54 for (TaskTreeNode child : getChildren()) 55 { 56 clone.addChild(child); 57 } 58 59 return clone; 49 // entered text is unchangeable and does not need to be cloned 50 return (TextInputInteractionTaskImpl) super.clone(); 60 51 } 61 52
Note: See TracChangeset
for help on using the changeset viewer.