Lines Matching defs:cycle

36  * Components of a focus traversal cycle based on a given Comparator. Portions
41 * cycle. That is, during normal focus traversal, the Component
42 * traversed after a focus cycle root will be the focus-cycle-root's default
95 * before installing this FocusTraversalPolicy on a focus cycle root or
109 List<Component> cycle = new ArrayList<Component>();
110 enumerateAndSortCycle(aContainer, cycle);
111 return cycle;
113 private int getComponentIndex(List<Component> cycle, Component aComponent) {
116 index = Collections.binarySearch(cycle, aComponent, comparator);
128 index = cycle.indexOf(aComponent);
133 private void enumerateAndSortCycle(Container focusCycleRoot, List<Component> cycle) {
135 enumerateCycle(focusCycleRoot, cycle);
136 Collections.sort(cycle, comparator);
140 private void enumerateCycle(Container container, List<Component> cycle) {
145 cycle.add(container);
156 enumerateCycle(cont, cycle);
160 cycle.add(comp);
180 * Checks if a new focus cycle takes place and returns a Component to traverse focus to.
181 * @param comp a possible focus cycle root or policy provider
184 * and implicit down-cycle is set, otherwise {@code null}
197 log.fine("### Transfered focus down-cycle to " + retComp +
198 " in the focus cycle root " + cont);
218 * aContainer must be a focus cycle root of aComponent or a focus traversal policy provider.
221 * cycle. That is, during normal focus traversal, the Component
222 * traversed after a focus cycle root will be the focus-cycle-root's
227 * traversal policy provider</a>, the focus is always transferred down-cycle.
229 * @param aContainer a focus cycle root of aComponent or a focus traversal policy provider
234 * @throws IllegalArgumentException if aContainer is not a focus cycle
247 throw new IllegalArgumentException("aContainer should be focus cycle root or focus traversal policy provider");
250 throw new IllegalArgumentException("aContainer is not a focus cycle root of aComponent");
253 // Before all the ckecks below we first see if it's an FTP provider or a focus cycle root.
254 // If it's the case just go down cycle (if it's set to "implicit").
271 // Null result means that we overstepped the limit of the FTP's cycle.
272 // In that case we must quit the cycle, otherwise return the component found.
280 List<Component> cycle = getFocusTraversalCycle(aContainer);
282 if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
284 int index = getComponentIndex(cycle, aComponent);
288 log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer);
293 for (index++; index < cycle.size(); index++) {
294 comp = cycle.get(index);
304 this.cachedCycle = cycle;
318 * aContainer must be a focus cycle root of aComponent or a focus traversal policy provider.
321 * cycle. That is, during normal focus traversal, the Component
322 * traversed after a focus cycle root will be the focus-cycle-root's
327 * traversal policy provider</a>, the focus is always transferred down-cycle.
329 * @param aContainer a focus cycle root of aComponent or a focus traversal policy provider
334 * @throws IllegalArgumentException if aContainer is not a focus cycle
343 throw new IllegalArgumentException("aContainer should be focus cycle root or focus traversal policy provider");
346 throw new IllegalArgumentException("aContainer is not a focus cycle root of aComponent");
360 // Null result means that we overstepped the limit of the FTP's cycle.
361 // In that case we must quit the cycle, otherwise return the component found.
374 List<Component> cycle = getFocusTraversalCycle(aContainer);
376 if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
378 int index = getComponentIndex(cycle, aComponent);
382 log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer);
391 comp = cycle.get(index);
401 this.cachedCycle = cycle;
414 * Returns the first Component in the traversal cycle. This method is used
418 * @param aContainer a focus cycle root of aComponent or a focus traversal policy provider whose
420 * @return the first Component in the traversal cycle of aContainer,
425 List<Component> cycle;
433 cycle = this.cachedCycle;
435 cycle = getFocusTraversalCycle(aContainer);
438 if (cycle.size() == 0) {
442 if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle);
444 for (Component comp : cycle) {
457 * Returns the last Component in the traversal cycle. This method is used
461 * @param aContainer a focus cycle root of aComponent or a focus traversal policy provider whose
463 * @return the last Component in the traversal cycle of aContainer,
468 List<Component> cycle;
476 cycle = this.cachedCycle;
478 cycle = getFocusTraversalCycle(aContainer);
481 if (cycle.size() == 0) {
485 if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle);
487 for (int i= cycle.size() - 1; i >= 0; i--) {
488 Component comp = cycle.get(i);
503 * to receive focus when traversing down into a new focus traversal cycle
507 * @param aContainer a focus cycle root of aComponent or a focus traversal policy provider whose
509 * @return the default Component in the traversal cycle of aContainer,
519 * Sets whether this SortingFocusTraversalPolicy transfers focus down-cycle
521 * the Component traversed after a focus cycle root will be the focus-
522 * cycle-root's default Component to focus. If <code>false</code>, the
523 * next Component in the focus traversal cycle rooted at the specified
524 * focus cycle root will be traversed instead. The default value for this
528 * SortingFocusTraversalPolicy transfers focus down-cycle implicitly
538 * cycle implicitly. If <code>true</code>, during normal focus
539 * traversal, the Component traversed after a focus cycle root will be the
540 * focus-cycle-root's default Component to focus. If <code>false</code>,
541 * the next Component in the focus traversal cycle rooted at the specified
542 * focus cycle root will be traversed instead.
545 * cycle implicitly
555 * focus traversal cycle.
565 * focus traversal cycle.