< prev index next >

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

Print this page

        

*** 31,52 **** /** * A FocusTraversalPolicy that determines traversal order based on the order * of child Components in a Container. From a particular focus cycle root, the * policy makes a pre-order traversal of the Component hierarchy, and traverses * a Container's children according to the ordering of the array returned by ! * <code>Container.getComponents()</code>. Portions of the hierarchy that are * not visible and displayable will not be searched. * <p> * By default, ContainerOrderFocusTraversalPolicy implicitly transfers focus * down-cycle. That is, during normal forward focus traversal, the Component * traversed after a focus cycle root will be the focus-cycle-root's default * Component to focus. This behavior can be disabled using the ! * <code>setImplicitDownCycleTraversal</code> method. * <p> * By default, methods of this class will return a Component only if it is * visible, displayable, enabled, and focusable. Subclasses can modify this ! * behavior by overriding the <code>accept</code> method. * <p> * This policy takes into account <a * href="doc-files/FocusSpec.html#FocusTraversalPolicyProviders">focus traversal * policy providers</a>. When searching for first/last/next/previous Component, * if a focus traversal policy provider is encountered, its focus traversal --- 31,52 ---- /** * A FocusTraversalPolicy that determines traversal order based on the order * of child Components in a Container. From a particular focus cycle root, the * policy makes a pre-order traversal of the Component hierarchy, and traverses * a Container's children according to the ordering of the array returned by ! * {@code Container.getComponents()}. Portions of the hierarchy that are * not visible and displayable will not be searched. * <p> * By default, ContainerOrderFocusTraversalPolicy implicitly transfers focus * down-cycle. That is, during normal forward focus traversal, the Component * traversed after a focus cycle root will be the focus-cycle-root's default * Component to focus. This behavior can be disabled using the ! * {@code setImplicitDownCycleTraversal} method. * <p> * By default, methods of this class will return a Component only if it is * visible, displayable, enabled, and focusable. Subclasses can modify this ! * behavior by overriding the {@code accept} method. * <p> * This policy takes into account <a * href="doc-files/FocusSpec.html#FocusTraversalPolicyProviders">focus traversal * policy providers</a>. When searching for first/last/next/previous Component, * if a focus traversal policy provider is encountered, its focus traversal
*** 191,201 **** * <p> * By default, ContainerOrderFocusTraversalPolicy implicitly transfers * focus down-cycle. That is, during normal forward focus traversal, the * Component traversed after a focus cycle root will be the focus-cycle- * root's default Component to focus. This behavior can be disabled using ! * the <code>setImplicitDownCycleTraversal</code> method. * <p> * If aContainer is <a href="doc-files/FocusSpec.html#FocusTraversalPolicyProviders">focus * traversal policy provider</a>, the focus is always transferred down-cycle. * * @param aContainer a focus cycle root of aComponent or a focus traversal policy provider --- 191,201 ---- * <p> * By default, ContainerOrderFocusTraversalPolicy implicitly transfers * focus down-cycle. That is, during normal forward focus traversal, the * Component traversed after a focus cycle root will be the focus-cycle- * root's default Component to focus. This behavior can be disabled using ! * the {@code setImplicitDownCycleTraversal} method. * <p> * If aContainer is <a href="doc-files/FocusSpec.html#FocusTraversalPolicyProviders">focus * traversal policy provider</a>, the focus is always transferred down-cycle. * * @param aContainer a focus cycle root of aComponent or a focus traversal policy provider
*** 517,527 **** /** * Returns the default Component to focus. This Component will be the first * to receive focus when traversing down into a new focus traversal cycle * rooted at aContainer. The default implementation of this method ! * returns the same Component as <code>getFirstComponent</code>. * * @param aContainer the focus cycle root or focus traversal policy provider whose default * Component is to be returned * @return the default Component in the traversal cycle of aContainer, * or null if no suitable Component can be found --- 517,527 ---- /** * Returns the default Component to focus. This Component will be the first * to receive focus when traversing down into a new focus traversal cycle * rooted at aContainer. The default implementation of this method ! * returns the same Component as {@code getFirstComponent}. * * @param aContainer the focus cycle root or focus traversal policy provider whose default * Component is to be returned * @return the default Component in the traversal cycle of aContainer, * or null if no suitable Component can be found
*** 532,547 **** return getFirstComponent(aContainer); } /** * Sets whether this ContainerOrderFocusTraversalPolicy transfers focus ! * down-cycle implicitly. If <code>true</code>, during normal forward focus * traversal, the Component traversed after a focus cycle root will be the ! * focus-cycle-root's default Component to focus. If <code>false</code>, * the next Component in the focus traversal cycle rooted at the specified * focus cycle root will be traversed instead. The default value for this ! * property is <code>true</code>. * * @param implicitDownCycleTraversal whether this * ContainerOrderFocusTraversalPolicy transfers focus down-cycle * implicitly * @see #getImplicitDownCycleTraversal --- 532,547 ---- return getFirstComponent(aContainer); } /** * Sets whether this ContainerOrderFocusTraversalPolicy transfers focus ! * down-cycle implicitly. If {@code true}, during normal forward focus * traversal, the Component traversed after a focus cycle root will be the ! * focus-cycle-root's default Component to focus. If {@code false}, * the next Component in the focus traversal cycle rooted at the specified * focus cycle root will be traversed instead. The default value for this ! * property is {@code true}. * * @param implicitDownCycleTraversal whether this * ContainerOrderFocusTraversalPolicy transfers focus down-cycle * implicitly * @see #getImplicitDownCycleTraversal
*** 551,563 **** this.implicitDownCycleTraversal = implicitDownCycleTraversal; } /** * Returns whether this ContainerOrderFocusTraversalPolicy transfers focus ! * down-cycle implicitly. If <code>true</code>, during normal forward focus * traversal, the Component traversed after a focus cycle root will be the ! * focus-cycle-root's default Component to focus. If <code>false</code>, * the next Component in the focus traversal cycle rooted at the specified * focus cycle root will be traversed instead. * * @return whether this ContainerOrderFocusTraversalPolicy transfers focus * down-cycle implicitly --- 551,563 ---- this.implicitDownCycleTraversal = implicitDownCycleTraversal; } /** * Returns whether this ContainerOrderFocusTraversalPolicy transfers focus ! * down-cycle implicitly. If {@code true}, during normal forward focus * traversal, the Component traversed after a focus cycle root will be the ! * focus-cycle-root's default Component to focus. If {@code false}, * the next Component in the focus traversal cycle rooted at the specified * focus cycle root will be traversed instead. * * @return whether this ContainerOrderFocusTraversalPolicy transfers focus * down-cycle implicitly
*** 573,584 **** * focus owner. By default, this method will accept a Component if and * only if it is visible, displayable, enabled, and focusable. * * @param aComponent the Component whose fitness as a focus owner is to * be tested ! * @return <code>true</code> if aComponent is visible, displayable, ! * enabled, and focusable; <code>false</code> otherwise */ protected boolean accept(Component aComponent) { if (!aComponent.canBeFocusOwner()) { return false; } --- 573,584 ---- * focus owner. By default, this method will accept a Component if and * only if it is visible, displayable, enabled, and focusable. * * @param aComponent the Component whose fitness as a focus owner is to * be tested ! * @return {@code true} if aComponent is visible, displayable, ! * enabled, and focusable; {@code false} otherwise */ protected boolean accept(Component aComponent) { if (!aComponent.canBeFocusOwner()) { return false; }
< prev index next >