Lines Matching defs:cycle

37  * Components of a focus traversal cycle based on a given Comparator. Portions
42 * cycle. That is, during normal focus traversal, the Component
43 * traversed after a focus cycle root will be the focus-cycle-root's default
94 * When true (by default), the legacy merge-sort algo is used to sort an FTP cycle.
108 * before installing this FocusTraversalPolicy on a focus cycle root or
124 List<Component> cycle = new ArrayList<Component>();
125 enumerateAndSortCycle(aContainer, cycle);
126 return cycle;
128 private int getComponentIndex(List<Component> cycle, Component aComponent) {
131 index = Collections.binarySearch(cycle, aComponent, comparator);
143 index = cycle.indexOf(aComponent);
148 private void enumerateAndSortCycle(Container focusCycleRoot, List<Component> cycle) {
150 enumerateCycle(focusCycleRoot, cycle);
152 legacySort(cycle, comparator);
154 cycle.sort(comparator);
173 private void enumerateCycle(Container container, List<Component> cycle) {
178 cycle.add(container);
189 enumerateCycle(cont, cycle);
193 cycle.add(comp);
213 * Checks if a new focus cycle takes place and returns a Component to traverse focus to.
214 * @param comp a possible focus cycle root or policy provider
217 * and implicit down-cycle is set, otherwise {@code null}
230 log.fine("### Transfered focus down-cycle to " + retComp +
231 " in the focus cycle root " + cont);
251 * aContainer must be a focus cycle root of aComponent or a focus traversal policy provider.
254 * cycle. That is, during normal focus traversal, the Component
255 * traversed after a focus cycle root will be the focus-cycle-root's
260 * traversal policy provider</a>, the focus is always transferred down-cycle.
262 * @param aContainer a focus cycle root of aComponent or a focus traversal policy provider
267 * @throws IllegalArgumentException if aContainer is not a focus cycle
280 throw new IllegalArgumentException("aContainer should be focus cycle root or focus traversal policy provider");
283 throw new IllegalArgumentException("aContainer is not a focus cycle root of aComponent");
286 // Before all the ckecks below we first see if it's an FTP provider or a focus cycle root.
287 // If it's the case just go down cycle (if it's set to "implicit").
304 // Null result means that we overstepped the limit of the FTP's cycle.
305 // In that case we must quit the cycle, otherwise return the component found.
315 List<Component> cycle = getFocusTraversalCycle(aContainer);
318 log.fine("### Cycle is " + cycle + ", component is " + aComponent);
321 int index = getComponentIndex(cycle, aComponent);
325 log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer);
330 for (index++; index < cycle.size(); index++) {
331 comp = cycle.get(index);
341 this.cachedCycle = cycle;
355 * aContainer must be a focus cycle root of aComponent or a focus traversal policy provider.
358 * cycle. That is, during normal focus traversal, the Component
359 * traversed after a focus cycle root will be the focus-cycle-root's
364 * traversal policy provider</a>, the focus is always transferred down-cycle.
366 * @param aContainer a focus cycle root of aComponent or a focus traversal policy provider
371 * @throws IllegalArgumentException if aContainer is not a focus cycle
380 throw new IllegalArgumentException("aContainer should be focus cycle root or focus traversal policy provider");
383 throw new IllegalArgumentException("aContainer is not a focus cycle root of aComponent");
397 // Null result means that we overstepped the limit of the FTP's cycle.
398 // In that case we must quit the cycle, otherwise return the component found.
413 List<Component> cycle = getFocusTraversalCycle(aContainer);
416 log.fine("### Cycle is " + cycle + ", component is " + aComponent);
419 int index = getComponentIndex(cycle, aComponent);
423 log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer);
432 comp = cycle.get(index);
442 this.cachedCycle = cycle;
455 * Returns the first Component in the traversal cycle. This method is used
459 * @param aContainer a focus cycle root of aComponent or a focus traversal policy provider whose
461 * @return the first Component in the traversal cycle of aContainer,
466 List<Component> cycle;
476 cycle = this.cachedCycle;
478 cycle = getFocusTraversalCycle(aContainer);
481 if (cycle.size() == 0) {
488 log.fine("### Cycle is " + cycle);
491 for (Component comp : cycle) {
504 * Returns the last Component in the traversal cycle. This method is used
508 * @param aContainer a focus cycle root of aComponent or a focus traversal policy provider whose
510 * @return the last Component in the traversal cycle of aContainer,
515 List<Component> cycle;
525 cycle = this.cachedCycle;
527 cycle = getFocusTraversalCycle(aContainer);
530 if (cycle.size() == 0) {
537 log.fine("### Cycle is " + cycle);
540 for (int i= cycle.size() - 1; i >= 0; i--) {
541 Component comp = cycle.get(i);
559 * to receive focus when traversing down into a new focus traversal cycle
563 * @param aContainer a focus cycle root of aComponent or a focus traversal policy provider whose
565 * @return the default Component in the traversal cycle of aContainer,
575 * Sets whether this SortingFocusTraversalPolicy transfers focus down-cycle
577 * the Component traversed after a focus cycle root will be the focus-
578 * cycle-root's default Component to focus. If <code>false</code>, the
579 * next Component in the focus traversal cycle rooted at the specified
580 * focus cycle root will be traversed instead. The default value for this
584 * SortingFocusTraversalPolicy transfers focus down-cycle implicitly
594 * cycle implicitly. If <code>true</code>, during normal focus
595 * traversal, the Component traversed after a focus cycle root will be the
596 * focus-cycle-root's default Component to focus. If <code>false</code>,
597 * the next Component in the focus traversal cycle rooted at the specified
598 * focus cycle root will be traversed instead.
601 * cycle implicitly
611 * focus traversal cycle.
621 * focus traversal cycle.