Changeset 134:c4130551faad
- Timestamp:
- 08/01/2008 09:53:22 AM
(4 months ago)
- Author:
- marc@f1.local
- branch:
- default
- Message:
Large changes for #80 --- watch these with some care and be prepared to roll back in the case of wierdness
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r99 |
r134 |
|
| 4 | 4 | import java.awt.event.MouseEvent; |
|---|
| 5 | 5 | import java.util.Collection; |
|---|
| | 6 | import java.util.HashSet; |
|---|
| 6 | 7 | import java.util.LinkedList; |
|---|
| 7 | 8 | import java.util.List; |
|---|
| … | … | |
| 17 | 18 | * we're 'de-abstracting' our Dispatch<x,y> code for the purposes of speed. For |
|---|
| 18 | 19 | * many things, this has become part of our inner loops. |
|---|
| 19 | | * |
|---|
| | 20 | * |
|---|
| 20 | 21 | * @author marc |
|---|
| 21 | | * |
|---|
| | 22 | * |
|---|
| 22 | 23 | */ |
|---|
| 23 | 24 | public class FastVisualElementOverridesDispatch implements iVisualElementOverrides { |
|---|
| … | … | |
| 30 | 31 | |
|---|
| 31 | 32 | public VisitCode added(iVisualElement newSource) { |
|---|
| 32 | | |
|---|
| 33 | | // System.out.println(" inside added dispatch for <"+newSource+">"); |
|---|
| 34 | | |
|---|
| 35 | | List<iVisualElement> fringe = new LinkedList<iVisualElement>(); |
|---|
| 36 | | fringe.add(iVisualElementOverrides.topology.getAt()); |
|---|
| 37 | | |
|---|
| 38 | | while (fringe.size() > 0) { |
|---|
| 39 | | iVisualElement next = fringe.remove(0); |
|---|
| 40 | | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| 41 | | if (over != null) { |
|---|
| 42 | | VisitCode o = over.added(newSource); |
|---|
| 43 | | if (o.equals(VisitCode.skip)) |
|---|
| 44 | | { |
|---|
| 45 | | } |
|---|
| 46 | | else if (o.equals(VisitCode.stop)) |
|---|
| 47 | | { |
|---|
| 48 | | return VisitCode.stop; |
|---|
| 49 | | } |
|---|
| 50 | | else |
|---|
| 51 | | { |
|---|
| 52 | | if (backwards) |
|---|
| 53 | | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| 54 | | else |
|---|
| 55 | | fringe.addAll((Collection<? extends iVisualElement>) next.getChildren()); |
|---|
| 56 | | } |
|---|
| | 33 | |
|---|
| | 34 | List<iVisualElement> fringe = new LinkedList<iVisualElement>(); |
|---|
| | 35 | fringe.add(iVisualElementOverrides.topology.getAt()); |
|---|
| | 36 | |
|---|
| | 37 | HashSet<iVisualElement> seen = new HashSet<iVisualElement>(); |
|---|
| | 38 | |
|---|
| | 39 | while (fringe.size() > 0) { |
|---|
| | 40 | iVisualElement next = fringe.remove(0); |
|---|
| | 41 | if (!seen.contains(next)) { |
|---|
| | 42 | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| | 43 | if (over != null) { |
|---|
| | 44 | VisitCode o = over.added(newSource); |
|---|
| | 45 | if (o.equals(VisitCode.skip)) { |
|---|
| | 46 | } else if (o.equals(VisitCode.stop)) { |
|---|
| | 47 | return VisitCode.stop; |
|---|
| | 48 | } else { |
|---|
| | 49 | if (backwards) |
|---|
| | 50 | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| | 51 | else |
|---|
| | 52 | fringe.addAll(next.getChildren()); |
|---|
| | 53 | } |
|---|
| | 54 | } |
|---|
| | 55 | seen.add(next); |
|---|
| 57 | 56 | } |
|---|
| 58 | 57 | } |
|---|
| … | … | |
| 64 | 63 | fringe.add(iVisualElementOverrides.topology.getAt()); |
|---|
| 65 | 64 | |
|---|
| 66 | | while (fringe.size() > 0) { |
|---|
| 67 | | iVisualElement next = fringe.remove(0); |
|---|
| 68 | | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| 69 | | if (over != null) { |
|---|
| 70 | | VisitCode o = over.beginExecution(source); |
|---|
| 71 | | if (o.equals(VisitCode.skip)) |
|---|
| 72 | | { |
|---|
| 73 | | } |
|---|
| 74 | | else if (o.equals(VisitCode.stop)) |
|---|
| 75 | | { |
|---|
| 76 | | return VisitCode.stop; |
|---|
| 77 | | } |
|---|
| 78 | | else |
|---|
| 79 | | { |
|---|
| 80 | | if (backwards) |
|---|
| 81 | | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| 82 | | else |
|---|
| 83 | | fringe.addAll((Collection<? extends iVisualElement>) next.getChildren()); |
|---|
| 84 | | } |
|---|
| | 65 | HashSet<iVisualElement> seen = new HashSet<iVisualElement>(); |
|---|
| | 66 | |
|---|
| | 67 | while (fringe.size() > 0) { |
|---|
| | 68 | iVisualElement next = fringe.remove(0); |
|---|
| | 69 | if (!seen.contains(next)) { |
|---|
| | 70 | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| | 71 | if (over != null) { |
|---|
| | 72 | VisitCode o = over.beginExecution(source); |
|---|
| | 73 | if (o.equals(VisitCode.skip)) { |
|---|
| | 74 | } else if (o.equals(VisitCode.stop)) { |
|---|
| | 75 | return VisitCode.stop; |
|---|
| | 76 | } else { |
|---|
| | 77 | if (backwards) |
|---|
| | 78 | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| | 79 | else |
|---|
| | 80 | fringe.addAll(next.getChildren()); |
|---|
| | 81 | } |
|---|
| | 82 | } |
|---|
| | 83 | seen.add(next); |
|---|
| 85 | 84 | } |
|---|
| 86 | 85 | } |
|---|
| … | … | |
| 92 | 91 | fringe.add(iVisualElementOverrides.topology.getAt()); |
|---|
| 93 | 92 | |
|---|
| 94 | | while (fringe.size() > 0) { |
|---|
| 95 | | iVisualElement next = fringe.remove(0); |
|---|
| 96 | | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| 97 | | if (over != null) { |
|---|
| 98 | | VisitCode o = over.deleteProperty(source, prop); |
|---|
| 99 | | if (o.equals(VisitCode.skip)) |
|---|
| 100 | | { |
|---|
| 101 | | } |
|---|
| 102 | | else if (o.equals(VisitCode.stop)) |
|---|
| 103 | | { |
|---|
| 104 | | return VisitCode.stop; |
|---|
| 105 | | } |
|---|
| 106 | | else |
|---|
| 107 | | { |
|---|
| 108 | | if (backwards) |
|---|
| 109 | | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| 110 | | else |
|---|
| 111 | | fringe.addAll((Collection<? extends iVisualElement>) next.getChildren()); |
|---|
| 112 | | } |
|---|
| | 93 | HashSet<iVisualElement> seen = new HashSet<iVisualElement>(); |
|---|
| | 94 | |
|---|
| | 95 | while (fringe.size() > 0) { |
|---|
| | 96 | iVisualElement next = fringe.remove(0); |
|---|
| | 97 | if (!seen.contains(next)) { |
|---|
| | 98 | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| | 99 | if (over != null) { |
|---|
| | 100 | VisitCode o = over.deleteProperty(source, prop); |
|---|
| | 101 | if (o.equals(VisitCode.skip)) { |
|---|
| | 102 | } else if (o.equals(VisitCode.stop)) { |
|---|
| | 103 | return VisitCode.stop; |
|---|
| | 104 | } else { |
|---|
| | 105 | if (backwards) |
|---|
| | 106 | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| | 107 | else |
|---|
| | 108 | fringe.addAll(next.getChildren()); |
|---|
| | 109 | } |
|---|
| | 110 | } |
|---|
| | 111 | seen.add(next); |
|---|
| 113 | 112 | } |
|---|
| 114 | 113 | } |
|---|
| … | … | |
| 120 | 119 | fringe.add(iVisualElementOverrides.topology.getAt()); |
|---|
| 121 | 120 | |
|---|
| 122 | | while (fringe.size() > 0) { |
|---|
| 123 | | iVisualElement next = fringe.remove(0); |
|---|
| 124 | | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| 125 | | if (over != null) { |
|---|
| 126 | | VisitCode o = over.deleted(source); |
|---|
| 127 | | if (o.equals(VisitCode.skip)) |
|---|
| 128 | | { |
|---|
| 129 | | } |
|---|
| 130 | | else if (o.equals(VisitCode.stop)) |
|---|
| 131 | | { |
|---|
| 132 | | return VisitCode.stop; |
|---|
| 133 | | } |
|---|
| 134 | | else |
|---|
| 135 | | { |
|---|
| 136 | | if (backwards) |
|---|
| 137 | | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| 138 | | else |
|---|
| 139 | | fringe.addAll((Collection<? extends iVisualElement>) next.getChildren()); |
|---|
| 140 | | } |
|---|
| | 121 | HashSet<iVisualElement> seen = new HashSet<iVisualElement>(); |
|---|
| | 122 | |
|---|
| | 123 | while (fringe.size() > 0) { |
|---|
| | 124 | iVisualElement next = fringe.remove(0); |
|---|
| | 125 | if (!seen.contains(next)) { |
|---|
| | 126 | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| | 127 | if (over != null) { |
|---|
| | 128 | VisitCode o = over.deleted(source); |
|---|
| | 129 | if (o.equals(VisitCode.skip)) { |
|---|
| | 130 | } else if (o.equals(VisitCode.stop)) { |
|---|
| | 131 | return VisitCode.stop; |
|---|
| | 132 | } else { |
|---|
| | 133 | if (backwards) |
|---|
| | 134 | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| | 135 | else |
|---|
| | 136 | fringe.addAll(next.getChildren()); |
|---|
| | 137 | } |
|---|
| | 138 | } |
|---|
| | 139 | seen.add(next); |
|---|
| 141 | 140 | } |
|---|
| 142 | 141 | } |
|---|
| … | … | |
| 148 | 147 | fringe.add(iVisualElementOverrides.topology.getAt()); |
|---|
| 149 | 148 | |
|---|
| 150 | | while (fringe.size() > 0) { |
|---|
| 151 | | iVisualElement next = fringe.remove(0); |
|---|
| 152 | | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| 153 | | if (over != null) { |
|---|
| 154 | | VisitCode o = over.endExecution(source); |
|---|
| 155 | | if (o.equals(VisitCode.skip)) |
|---|
| 156 | | { |
|---|
| 157 | | } |
|---|
| 158 | | else if (o.equals(VisitCode.stop)) |
|---|
| 159 | | { |
|---|
| 160 | | return VisitCode.stop; |
|---|
| 161 | | } |
|---|
| 162 | | else |
|---|
| 163 | | { |
|---|
| 164 | | if (backwards) |
|---|
| 165 | | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| 166 | | else |
|---|
| 167 | | fringe.addAll((Collection<? extends iVisualElement>) next.getChildren()); |
|---|
| 168 | | } |
|---|
| | 149 | HashSet<iVisualElement> seen = new HashSet<iVisualElement>(); |
|---|
| | 150 | |
|---|
| | 151 | while (fringe.size() > 0) { |
|---|
| | 152 | iVisualElement next = fringe.remove(0); |
|---|
| | 153 | if (!seen.contains(next)) { |
|---|
| | 154 | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| | 155 | if (over != null) { |
|---|
| | 156 | VisitCode o = over.endExecution(source); |
|---|
| | 157 | if (o.equals(VisitCode.skip)) { |
|---|
| | 158 | } else if (o.equals(VisitCode.stop)) { |
|---|
| | 159 | return VisitCode.stop; |
|---|
| | 160 | } else { |
|---|
| | 161 | if (backwards) |
|---|
| | 162 | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| | 163 | else |
|---|
| | 164 | fringe.addAll(next.getChildren()); |
|---|
| | 165 | } |
|---|
| | 166 | } |
|---|
| | 167 | seen.add(next); |
|---|
| 169 | 168 | } |
|---|
| 170 | 169 | } |
|---|
| … | … | |
| 173 | 172 | |
|---|
| 174 | 173 | public <T> VisitCode getProperty(iVisualElement source, VisualElementProperty<T> prop, Ref<T> ref) { |
|---|
| 175 | | |
|---|
| 176 | | List<iVisualElement> fringe = new LinkedList<iVisualElement>(); |
|---|
| 177 | | fringe.add(iVisualElementOverrides.topology.getAt()); |
|---|
| 178 | | |
|---|
| 179 | | while (fringe.size() > 0) { |
|---|
| 180 | | iVisualElement next = fringe.remove(0); |
|---|
| 181 | | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| 182 | | if (over != null) { |
|---|
| 183 | | VisitCode o = over.getProperty(source, prop, ref); |
|---|
| 184 | | if (o.equals(VisitCode.skip)) |
|---|
| 185 | | { |
|---|
| 186 | | } |
|---|
| 187 | | else if (o.equals(VisitCode.stop)) |
|---|
| 188 | | { |
|---|
| 189 | | return VisitCode.stop; |
|---|
| 190 | | } |
|---|
| 191 | | else |
|---|
| 192 | | { |
|---|
| 193 | | if (backwards) |
|---|
| 194 | | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| 195 | | else |
|---|
| 196 | | fringe.addAll((Collection<? extends iVisualElement>) next.getChildren()); |
|---|
| 197 | | } |
|---|
| | 174 | |
|---|
| | 175 | List<iVisualElement> fringe = new LinkedList<iVisualElement>(); |
|---|
| | 176 | fringe.add(iVisualElementOverrides.topology.getAt()); |
|---|
| | 177 | |
|---|
| | 178 | HashSet<iVisualElement> seen = new HashSet<iVisualElement>(); |
|---|
| | 179 | |
|---|
| | 180 | while (fringe.size() > 0) { |
|---|
| | 181 | iVisualElement next = fringe.remove(0); |
|---|
| | 182 | if (!seen.contains(next)) { |
|---|
| | 183 | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| | 184 | if (over != null) { |
|---|
| | 185 | VisitCode o = over.getProperty(source, prop, ref); |
|---|
| | 186 | if (o.equals(VisitCode.skip)) { |
|---|
| | 187 | } else if (o.equals(VisitCode.stop)) { |
|---|
| | 188 | return VisitCode.stop; |
|---|
| | 189 | } else { |
|---|
| | 190 | if (backwards) |
|---|
| | 191 | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| | 192 | else |
|---|
| | 193 | fringe.addAll(next.getChildren()); |
|---|
| | 194 | } |
|---|
| | 195 | } |
|---|
| | 196 | seen.add(next); |
|---|
| 198 | 197 | } |
|---|
| 199 | 198 | } |
|---|
| … | … | |
| 205 | 204 | fringe.add(iVisualElementOverrides.topology.getAt()); |
|---|
| 206 | 205 | |
|---|
| 207 | | while (fringe.size() > 0) { |
|---|
| 208 | | iVisualElement next = fringe.remove(0); |
|---|
| 209 | | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| 210 | | if (over != null) { |
|---|
| 211 | | VisitCode o = over.handleKeyboardEvent(newSource, event); |
|---|
| 212 | | if (o.equals(VisitCode.skip)) |
|---|
| 213 | | { |
|---|
| 214 | | } |
|---|
| 215 | | else if (o.equals(VisitCode.stop)) |
|---|
| 216 | | { |
|---|
| 217 | | return VisitCode.stop; |
|---|
| 218 | | } |
|---|
| 219 | | else |
|---|
| 220 | | { |
|---|
| 221 | | if (backwards) |
|---|
| 222 | | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| 223 | | else |
|---|
| 224 | | fringe.addAll((Collection<? extends iVisualElement>) next.getChildren()); |
|---|
| 225 | | } |
|---|
| | 206 | HashSet<iVisualElement> seen = new HashSet<iVisualElement>(); |
|---|
| | 207 | |
|---|
| | 208 | while (fringe.size() > 0) { |
|---|
| | 209 | iVisualElement next = fringe.remove(0); |
|---|
| | 210 | if (!seen.contains(next)) { |
|---|
| | 211 | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| | 212 | if (over != null) { |
|---|
| | 213 | VisitCode o = over.handleKeyboardEvent(newSource, event); |
|---|
| | 214 | if (o.equals(VisitCode.skip)) { |
|---|
| | 215 | } else if (o.equals(VisitCode.stop)) { |
|---|
| | 216 | return VisitCode.stop; |
|---|
| | 217 | } else { |
|---|
| | 218 | if (backwards) |
|---|
| | 219 | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| | 220 | else |
|---|
| | 221 | fringe.addAll(next.getChildren()); |
|---|
| | 222 | } |
|---|
| | 223 | } |
|---|
| | 224 | seen.add(next); |
|---|
| 226 | 225 | } |
|---|
| 227 | 226 | } |
|---|
| … | … | |
| 233 | 232 | fringe.add(iVisualElementOverrides.topology.getAt()); |
|---|
| 234 | 233 | |
|---|
| 235 | | while (fringe.size() > 0) { |
|---|
| 236 | | iVisualElement next = fringe.remove(0); |
|---|
| 237 | | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| 238 | | if (over != null) { |
|---|
| 239 | | VisitCode o = over.inspectablePropertiesFor(source, properties); |
|---|
| 240 | | if (o.equals(VisitCode.skip)) |
|---|
| 241 | | { |
|---|
| 242 | | } |
|---|
| 243 | | else if (o.equals(VisitCode.stop)) |
|---|
| 244 | | { |
|---|
| 245 | | return VisitCode.stop; |
|---|
| 246 | | } |
|---|
| 247 | | else |
|---|
| 248 | | { |
|---|
| 249 | | if (backwards) |
|---|
| 250 | | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| 251 | | else |
|---|
| 252 | | fringe.addAll((Collection<? extends iVisualElement>) next.getChildren()); |
|---|
| 253 | | } |
|---|
| | 234 | HashSet<iVisualElement> seen = new HashSet<iVisualElement>(); |
|---|
| | 235 | |
|---|
| | 236 | while (fringe.size() > 0) { |
|---|
| | 237 | iVisualElement next = fringe.remove(0); |
|---|
| | 238 | if (!seen.contains(next)) { |
|---|
| | 239 | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| | 240 | if (over != null) { |
|---|
| | 241 | VisitCode o = over.inspectablePropertiesFor(source, properties); |
|---|
| | 242 | if (o.equals(VisitCode.skip)) { |
|---|
| | 243 | } else if (o.equals(VisitCode.stop)) { |
|---|
| | 244 | return VisitCode.stop; |
|---|
| | 245 | } else { |
|---|
| | 246 | if (backwards) |
|---|
| | 247 | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| | 248 | else |
|---|
| | 249 | fringe.addAll(next.getChildren()); |
|---|
| | 250 | } |
|---|
| | 251 | } |
|---|
| | 252 | seen.add(next); |
|---|
| 254 | 253 | } |
|---|
| 255 | 254 | } |
|---|
| … | … | |
| 258 | 257 | |
|---|
| 259 | 258 | public VisitCode isHit(iVisualElement source, MouseEvent event, Ref<Boolean> is) { |
|---|
| 260 | | |
|---|
| 261 | | List<iVisualElement> fringe = new LinkedList<iVisualElement>(); |
|---|
| 262 | | fringe.add(iVisualElementOverrides.topology.getAt()); |
|---|
| 263 | | |
|---|
| 264 | | while (fringe.size() > 0) { |
|---|
| 265 | | iVisualElement next = fringe.remove(0); |
|---|
| 266 | | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| 267 | | if (over != null) { |
|---|
| 268 | | VisitCode o = over.isHit(source, event, is); |
|---|
| 269 | | if (o.equals(VisitCode.skip)) |
|---|
| 270 | | { |
|---|
| 271 | | } |
|---|
| 272 | | else if (o.equals(VisitCode.stop)) |
|---|
| 273 | | { |
|---|
| 274 | | return VisitCode.stop; |
|---|
| 275 | | } |
|---|
| 276 | | else |
|---|
| 277 | | { |
|---|
| 278 | | if (backwards) |
|---|
| 279 | | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| 280 | | else |
|---|
| 281 | | fringe.addAll((Collection<? extends iVisualElement>) next.getChildren()); |
|---|
| 282 | | } |
|---|
| | 259 | |
|---|
| | 260 | List<iVisualElement> fringe = new LinkedList<iVisualElement>(); |
|---|
| | 261 | fringe.add(iVisualElementOverrides.topology.getAt()); |
|---|
| | 262 | |
|---|
| | 263 | HashSet<iVisualElement> seen = new HashSet<iVisualElement>(); |
|---|
| | 264 | |
|---|
| | 265 | while (fringe.size() > 0) { |
|---|
| | 266 | iVisualElement next = fringe.remove(0); |
|---|
| | 267 | if (!seen.contains(next)) { |
|---|
| | 268 | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| | 269 | if (over != null) { |
|---|
| | 270 | VisitCode o = over.isHit(source, event, is); |
|---|
| | 271 | if (o.equals(VisitCode.skip)) { |
|---|
| | 272 | } else if (o.equals(VisitCode.stop)) { |
|---|
| | 273 | return VisitCode.stop; |
|---|
| | 274 | } else { |
|---|
| | 275 | if (backwards) |
|---|
| | 276 | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| | 277 | else |
|---|
| | 278 | fringe.addAll(next.getChildren()); |
|---|
| | 279 | } |
|---|
| | 280 | } |
|---|
| | 281 | seen.add(next); |
|---|
| 283 | 282 | } |
|---|
| 284 | 283 | } |
|---|
| … | … | |
| 290 | 289 | fringe.add(iVisualElementOverrides.topology.getAt()); |
|---|
| 291 | 290 | |
|---|
| 292 | | while (fringe.size() > 0) { |
|---|
| 293 | | iVisualElement next = fringe.remove(0); |
|---|
| 294 | | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| 295 | | if (over != null) { |
|---|
| 296 | | VisitCode o = over.menuItemsFor(source, items); |
|---|
| 297 | | if (o.equals(VisitCode.skip)) |
|---|
| 298 | | { |
|---|
| 299 | | } |
|---|
| 300 | | else if (o.equals(VisitCode.stop)) |
|---|
| 301 | | { |
|---|
| 302 | | return VisitCode.stop; |
|---|
| 303 | | } |
|---|
| 304 | | else |
|---|
| 305 | | { |
|---|
| 306 | | if (backwards) |
|---|
| 307 | | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| 308 | | else |
|---|
| 309 | | fringe.addAll((Collection<? extends iVisualElement>) next.getChildren()); |
|---|
| 310 | | } |
|---|
| | 291 | HashSet<iVisualElement> seen = new HashSet<iVisualElement>(); |
|---|
| | 292 | |
|---|
| | 293 | while (fringe.size() > 0) { |
|---|
| | 294 | iVisualElement next = fringe.remove(0); |
|---|
| | 295 | if (!seen.contains(next)) { |
|---|
| | 296 | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| | 297 | if (over != null) { |
|---|
| | 298 | VisitCode o = over.menuItemsFor(source, items); |
|---|
| | 299 | if (o.equals(VisitCode.skip)) { |
|---|
| | 300 | } else if (o.equals(VisitCode.stop)) { |
|---|
| | 301 | return VisitCode.stop; |
|---|
| | 302 | } else { |
|---|
| | 303 | if (backwards) |
|---|
| | 304 | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| | 305 | else |
|---|
| | 306 | fringe.addAll(next.getChildren()); |
|---|
| | 307 | } |
|---|
| | 308 | } |
|---|
| | 309 | seen.add(next); |
|---|
| 311 | 310 | } |
|---|
| 312 | 311 | } |
|---|
| … | … | |
| 318 | 317 | fringe.add(iVisualElementOverrides.topology.getAt()); |
|---|
| 319 | 318 | |
|---|
| 320 | | while (fringe.size() > 0) { |
|---|
| 321 | | iVisualElement next = fringe.remove(0); |
|---|
| 322 | | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| 323 | | if (over != null) { |
|---|
| 324 | | VisitCode o = over.paintNow(source, bounds, visible); |
|---|
| 325 | | if (o.equals(VisitCode.skip)) |
|---|
| 326 | | { |
|---|
| 327 | | } |
|---|
| 328 | | else if (o.equals(VisitCode.stop)) |
|---|
| 329 | | { |
|---|
| 330 | | return VisitCode.stop; |
|---|
| 331 | | } |
|---|
| 332 | | else |
|---|
| 333 | | { |
|---|
| 334 | | if (backwards) |
|---|
| 335 | | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| 336 | | else |
|---|
| 337 | | fringe.addAll((Collection<? extends iVisualElement>) next.getChildren()); |
|---|
| 338 | | } |
|---|
| | 319 | HashSet<iVisualElement> seen = new HashSet<iVisualElement>(); |
|---|
| | 320 | |
|---|
| | 321 | while (fringe.size() > 0) { |
|---|
| | 322 | iVisualElement next = fringe.remove(0); |
|---|
| | 323 | if (!seen.contains(next)) { |
|---|
| | 324 | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| | 325 | if (over != null) { |
|---|
| | 326 | VisitCode o = over.paintNow(source, bounds, visible); |
|---|
| | 327 | if (o.equals(VisitCode.skip)) { |
|---|
| | 328 | } else if (o.equals(VisitCode.stop)) { |
|---|
| | 329 | return VisitCode.stop; |
|---|
| | 330 | } else { |
|---|
| | 331 | if (backwards) |
|---|
| | 332 | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| | 333 | else |
|---|
| | 334 | fringe.addAll(next.getChildren()); |
|---|
| | 335 | } |
|---|
| | 336 | } |
|---|
| | 337 | seen.add(next); |
|---|
| 339 | 338 | } |
|---|
| 340 | 339 | } |
|---|
| … | … | |
| 346 | 345 | fringe.add(iVisualElementOverrides.topology.getAt()); |
|---|
| 347 | 346 | |
|---|
| 348 | | while (fringe.size() > 0) { |
|---|
| 349 | | iVisualElement next = fringe.remove(0); |
|---|
| 350 | | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| 351 | | if (over != null) { |
|---|
| 352 | | VisitCode o = over.prepareForSave(); |
|---|
| 353 | | if (o.equals(VisitCode.skip)) |
|---|
| 354 | | { |
|---|
| 355 | | } |
|---|
| 356 | | else if (o.equals(VisitCode.stop)) |
|---|
| 357 | | { |
|---|
| 358 | | return VisitCode.stop; |
|---|
| 359 | | } |
|---|
| 360 | | else |
|---|
| 361 | | { |
|---|
| 362 | | if (backwards) |
|---|
| 363 | | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| 364 | | else |
|---|
| 365 | | fringe.addAll((Collection<? extends iVisualElement>) next.getChildren()); |
|---|
| 366 | | } |
|---|
| | 347 | HashSet<iVisualElement> seen = new HashSet<iVisualElement>(); |
|---|
| | 348 | |
|---|
| | 349 | while (fringe.size() > 0) { |
|---|
| | 350 | iVisualElement next = fringe.remove(0); |
|---|
| | 351 | if (!seen.contains(next)) { |
|---|
| | 352 | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| | 353 | if (over != null) { |
|---|
| | 354 | VisitCode o = over.prepareForSave(); |
|---|
| | 355 | if (o.equals(VisitCode.skip)) { |
|---|
| | 356 | } else if (o.equals(VisitCode.stop)) { |
|---|
| | 357 | return VisitCode.stop; |
|---|
| | 358 | } else { |
|---|
| | 359 | if (backwards) |
|---|
| | 360 | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| | 361 | else |
|---|
| | 362 | fringe.addAll(next.getChildren()); |
|---|
| | 363 | } |
|---|
| | 364 | } |
|---|
| | 365 | seen.add(next); |
|---|
| 367 | 366 | } |
|---|
| 368 | 367 | } |
|---|
| … | … | |
| 374 | 373 | fringe.add(iVisualElementOverrides.topology.getAt()); |
|---|
| 375 | 374 | |
|---|
| 376 | | while (fringe.size() > 0) { |
|---|
| 377 | | iVisualElement next = fringe.remove(0); |
|---|
| 378 | | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| 379 | | if (over != null) { |
|---|
| 380 | | VisitCode o = over.setProperty(source, prop, to); |
|---|
| 381 | | if (o.equals(VisitCode.skip)) |
|---|
| 382 | | { |
|---|
| 383 | | } |
|---|
| 384 | | else if (o.equals(VisitCode.stop)) |
|---|
| 385 | | { |
|---|
| 386 | | return VisitCode.stop; |
|---|
| 387 | | } |
|---|
| 388 | | else |
|---|
| 389 | | { |
|---|
| 390 | | if (backwards) |
|---|
| 391 | | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| 392 | | else |
|---|
| 393 | | fringe.addAll((Collection<? extends iVisualElement>) next.getChildren()); |
|---|
| 394 | | } |
|---|
| | 375 | HashSet<iVisualElement> seen = new HashSet<iVisualElement>(); |
|---|
| | 376 | |
|---|
| | 377 | while (fringe.size() > 0) { |
|---|
| | 378 | iVisualElement next = fringe.remove(0); |
|---|
| | 379 | if (!seen.contains(next)) { |
|---|
| | 380 | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| | 381 | if (over != null) { |
|---|
| | 382 | VisitCode o = over.setProperty(source, prop, to); |
|---|
| | 383 | if (o.equals(VisitCode.skip)) { |
|---|
| | 384 | } else if (o.equals(VisitCode.stop)) { |
|---|
| | 385 | return VisitCode.stop; |
|---|
| | 386 | } else { |
|---|
| | 387 | if (backwards) |
|---|
| | 388 | fringe.addAll((Collection<? extends iVisualElement>) next.getParents()); |
|---|
| | 389 | else |
|---|
| | 390 | fringe.addAll(next.getChildren()); |
|---|
| | 391 | } |
|---|
| | 392 | } |
|---|
| | 393 | seen.add(next); |
|---|
| 395 | 394 | } |
|---|
| 396 | 395 | } |
|---|
| … | … | |
| 402 | 401 | fringe.add(iVisualElementOverrides.topology.getAt()); |
|---|
| 403 | 402 | |
|---|
| 404 | | while (fringe.size() > 0) { |
|---|
| 405 | | iVisualElement next = fringe.remove(0); |
|---|
| 406 | | iVisualElementOverrides over = next.getProperty(iVisualElement.overrides); |
|---|
| 407 | | if (over != null) { |
|---|
| 408 | | VisitCode o = over.shouldChangeFrame(source, newFrame, oldFrame, now); |
|---|
| 409 | | if (o.equals(VisitCode.skip)) |
|---|
| 410 | | { |
|---|
| 411 | | } |
|---|
| 412 | | else if (o.equals(VisitCode.stop)) |
|---|
| 413 | | |
|---|