src/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java

Print this page

        

*** 206,216 **** * @throws IllegalArgumentException if aContainer is not a focus cycle * root of aComponent or focus traversal policy provider, or if either aContainer or * aComponent is null */ public Component getComponentAfter(Container aContainer, Component aComponent) { ! if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Searching in " + aContainer + " for component after " + aComponent); if (aContainer == null || aComponent == null) { throw new IllegalArgumentException("aContainer and aComponent cannot be null"); } if (!aContainer.isFocusTraversalPolicyProvider() && !aContainer.isFocusCycleRoot()) { --- 206,218 ---- * @throws IllegalArgumentException if aContainer is not a focus cycle * root of aComponent or focus traversal policy provider, or if either aContainer or * aComponent is null */ public Component getComponentAfter(Container aContainer, Component aComponent) { ! if (log.isLoggable(PlatformLogger.FINE)) { ! log.fine("### Searching in " + aContainer + " for component after " + aComponent); ! } if (aContainer == null || aComponent == null) { throw new IllegalArgumentException("aContainer and aComponent cannot be null"); } if (!aContainer.isFocusTraversalPolicyProvider() && !aContainer.isFocusCycleRoot()) {
*** 245,263 **** Component afterComp = policy.getComponentAfter(provider, aComponent); // Null result means that we overstepped the limit of the FTP's cycle. // In that case we must quit the cycle, otherwise return the component found. if (afterComp != null) { ! if (log.isLoggable(PlatformLogger.FINE)) log.fine("### FTP returned " + afterComp); return afterComp; } aComponent = provider; } List<Component> cycle = getFocusTraversalCycle(aContainer); ! if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent); int index = getComponentIndex(cycle, aComponent); if (index < 0) { if (log.isLoggable(PlatformLogger.FINE)) { --- 247,269 ---- Component afterComp = policy.getComponentAfter(provider, aComponent); // Null result means that we overstepped the limit of the FTP's cycle. // In that case we must quit the cycle, otherwise return the component found. if (afterComp != null) { ! if (log.isLoggable(PlatformLogger.FINE)) { ! log.fine("### FTP returned " + afterComp); ! } return afterComp; } aComponent = provider; } List<Component> cycle = getFocusTraversalCycle(aContainer); ! if (log.isLoggable(PlatformLogger.FINE)) { ! log.fine("### Cycle is " + cycle + ", component is " + aComponent); ! } int index = getComponentIndex(cycle, aComponent); if (index < 0) { if (log.isLoggable(PlatformLogger.FINE)) {
*** 334,344 **** Component beforeComp = policy.getComponentBefore(provider, aComponent); // Null result means that we overstepped the limit of the FTP's cycle. // In that case we must quit the cycle, otherwise return the component found. if (beforeComp != null) { ! if (log.isLoggable(PlatformLogger.FINE)) log.fine("### FTP returned " + beforeComp); return beforeComp; } aComponent = provider; // If the provider is traversable it's returned. --- 340,352 ---- Component beforeComp = policy.getComponentBefore(provider, aComponent); // Null result means that we overstepped the limit of the FTP's cycle. // In that case we must quit the cycle, otherwise return the component found. if (beforeComp != null) { ! if (log.isLoggable(PlatformLogger.FINE)) { ! log.fine("### FTP returned " + beforeComp); ! } return beforeComp; } aComponent = provider; // If the provider is traversable it's returned.
*** 347,357 **** } } List<Component> cycle = getFocusTraversalCycle(aContainer); ! if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent); int index = getComponentIndex(cycle, aComponent); if (index < 0) { if (log.isLoggable(PlatformLogger.FINE)) { --- 355,367 ---- } } List<Component> cycle = getFocusTraversalCycle(aContainer); ! if (log.isLoggable(PlatformLogger.FINE)) { ! log.fine("### Cycle is " + cycle + ", component is " + aComponent); ! } int index = getComponentIndex(cycle, aComponent); if (index < 0) { if (log.isLoggable(PlatformLogger.FINE)) {
*** 399,409 **** * @throws IllegalArgumentException if aContainer is null */ public Component getFirstComponent(Container aContainer) { List<Component> cycle; ! if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Getting first component in " + aContainer); if (aContainer == null) { throw new IllegalArgumentException("aContainer cannot be null"); } --- 409,421 ---- * @throws IllegalArgumentException if aContainer is null */ public Component getFirstComponent(Container aContainer) { List<Component> cycle; ! if (log.isLoggable(PlatformLogger.FINE)) { ! log.fine("### Getting first component in " + aContainer); ! } if (aContainer == null) { throw new IllegalArgumentException("aContainer cannot be null"); }
*** 418,431 **** } else { cycle = getFocusTraversalCycle(aContainer); } if (cycle.size() == 0) { ! if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is empty"); return null; } ! if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle); for (Component comp : cycle) { if (accept(comp)) { return comp; } else if (comp != aContainer && --- 430,447 ---- } else { cycle = getFocusTraversalCycle(aContainer); } if (cycle.size() == 0) { ! if (log.isLoggable(PlatformLogger.FINE)) { ! log.fine("### Cycle is empty"); ! } return null; } ! if (log.isLoggable(PlatformLogger.FINE)) { ! log.fine("### Cycle is " + cycle); ! } for (Component comp : cycle) { if (accept(comp)) { return comp; } else if (comp != aContainer &&
*** 449,459 **** * or null if no suitable Component can be found * @throws IllegalArgumentException if aContainer is null */ public Component getLastComponent(Container aContainer) { List<Component> cycle; ! if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Getting last component in " + aContainer); if (aContainer == null) { throw new IllegalArgumentException("aContainer cannot be null"); } --- 465,477 ---- * or null if no suitable Component can be found * @throws IllegalArgumentException if aContainer is null */ public Component getLastComponent(Container aContainer) { List<Component> cycle; ! if (log.isLoggable(PlatformLogger.FINE)) { ! log.fine("### Getting last component in " + aContainer); ! } if (aContainer == null) { throw new IllegalArgumentException("aContainer cannot be null"); }
*** 468,481 **** } else { cycle = getFocusTraversalCycle(aContainer); } if (cycle.size() == 0) { ! if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is empty"); return null; } ! if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle); for (int i= cycle.size() - 1; i >= 0; i--) { Component comp = cycle.get(i); if (accept(comp)) { return comp; --- 486,503 ---- } else { cycle = getFocusTraversalCycle(aContainer); } if (cycle.size() == 0) { ! if (log.isLoggable(PlatformLogger.FINE)) { ! log.fine("### Cycle is empty"); ! } return null; } ! if (log.isLoggable(PlatformLogger.FINE)) { ! log.fine("### Cycle is " + cycle); ! } for (int i= cycle.size() - 1; i >= 0; i--) { Component comp = cycle.get(i); if (accept(comp)) { return comp;