Changeset 808 for trunk/quest-core-tasktrees/src/main
- Timestamp:
- 09/12/12 08:41:06 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/temporalrelation/TrackBarSelectionDetectionRule.java
r655 r808 123 123 124 124 /** 125 *126 */125 * 126 */ 127 127 private void addChildIfNecessary(ISelection parentSelection, 128 128 ITaskTreeNode node, … … 134 134 ITaskTreeNode child = parentSelection.getChildren().get(i); 135 135 136 if (child instanceof IEventTask) { 137 // check, if the new node is a variant for the current event task 138 NodeEquality nodeEquality = nodeEqualityRuleManager.applyRules(child, node); 139 if (nodeEquality.isAtLeast(NodeEquality.SEMANTICALLY_EQUAL)) { 140 // the node is a variant. If it not structurally equal, a new sub-selection for 141 // the existing and the new node must be created. Otherwise, the new node does 142 // not need to be added 143 if (!nodeEquality.isAtLeast(NodeEquality.LEXICALLY_EQUAL)) { 144 ISelection selection = nodeFactory.createNewSelection(); 145 result.addNewlyCreatedParentNode(selection); 146 builder.addChild(parentSelection, selection); 147 148 builder.addChild(selection, child); 149 builder.addChild(selection, node); 150 builder.removeChild(parentSelection, child); 151 } 152 153 return; 154 } 155 } 156 else if (child instanceof ISelection) { 157 // check, if the new node is a variant for the semantically equal children of the 158 // current 159 // selection 160 boolean addNode = true; 161 for (int j = 0; j < child.getChildren().size(); j++) { 162 NodeEquality nodeEquality = nodeEqualityRuleManager.applyRules(child, node); 163 if (!nodeEquality.isAtLeast(NodeEquality.SEMANTICALLY_EQUAL)) { 164 // the new node is no semantical equivalent of the nodes in the current 165 // selection - break up 166 addNode = false; 167 break; 168 } 169 else if (nodeEquality.isAtLeast(NodeEquality.LEXICALLY_EQUAL)) { 170 addNode = false; 171 break; 172 } 173 } 174 175 if (addNode) { 176 // the node is a semantical equivalent to all the nodes in the existing 177 // sub-selection 178 // but it is not structurally identical to either of them. Therefore add it. 179 builder.addChild((ISelection) child, node); 180 return; 181 } 136 // check, if the new node is a variant for the current event task 137 NodeEquality nodeEquality = nodeEqualityRuleManager.applyRules(child, node); 138 if (nodeEquality.isAtLeast(NodeEquality.SYNTACTICALLY_EQUAL)) { 139 return; 182 140 } 183 141 }
Note: See TracChangeset
for help on using the changeset viewer.