< prev index next >

src/java.desktop/share/classes/javax/swing/LayoutFocusTraversalPolicy.java

Print this page

        

*** 37,47 **** * position, and orientation. Based on their size and position, Components are * roughly categorized into rows and columns. For a Container with horizontal * orientation, columns run left-to-right or right-to-left, and rows run top- * to-bottom. For a Container with vertical orientation, columns run top-to- * bottom and rows run left-to-right or right-to-left. See ! * <code>ComponentOrientation</code> for more information. All columns in a * row are fully traversed before proceeding to the next row. * * @author David Mendenhall * * @see java.awt.ComponentOrientation --- 37,47 ---- * position, and orientation. Based on their size and position, Components are * roughly categorized into rows and columns. For a Container with horizontal * orientation, columns run left-to-right or right-to-left, and rows run top- * to-bottom. For a Container with vertical orientation, columns run top-to- * bottom and rows run left-to-right or right-to-left. See ! * {@code ComponentOrientation} for more information. All columns in a * row are fully traversed before proceeding to the next row. * * @author David Mendenhall * * @see java.awt.ComponentOrientation
*** 63,73 **** super(new LayoutComparator()); } /** * Constructs a LayoutFocusTraversalPolicy with the passed in ! * <code>Comparator</code>. */ LayoutFocusTraversalPolicy(Comparator<? super Component> c) { super(c); } --- 63,73 ---- super(new LayoutComparator()); } /** * Constructs a LayoutFocusTraversalPolicy with the passed in ! * {@code Comparator}. */ LayoutFocusTraversalPolicy(Comparator<? super Component> c) { super(c); }
*** 77,87 **** * <p> * By default, LayoutFocusTraversalPolicy implicitly transfers focus down- * cycle. That is, during normal 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="../../java/awt/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 --- 77,87 ---- * <p> * By default, LayoutFocusTraversalPolicy implicitly transfers focus down- * cycle. That is, during normal 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="../../java/awt/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
*** 113,123 **** * <p> * By default, LayoutFocusTraversalPolicy implicitly transfers focus down- * cycle. That is, during normal 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="../../java/awt/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 --- 113,123 ---- * <p> * By default, LayoutFocusTraversalPolicy implicitly transfers focus down- * cycle. That is, during normal 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="../../java/awt/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
*** 190,231 **** } return super.getLastComponent(aContainer); } /** ! * Determines whether the specified <code>Component</code> * is an acceptable choice as the new focus owner. * This method performs the following sequence of operations: * <ol> ! * <li>Checks whether <code>aComponent</code> is visible, displayable, * enabled, and focusable. If any of these properties is ! * <code>false</code>, this method returns <code>false</code>. ! * <li>If <code>aComponent</code> is an instance of <code>JTable</code>, ! * returns <code>true</code>. ! * <li>If <code>aComponent</code> is an instance of <code>JComboBox</code>, * then returns the value of ! * <code>aComponent.getUI().isFocusTraversable(aComponent)</code>. ! * <li>If <code>aComponent</code> is a <code>JComponent</code> ! * with a <code>JComponent.WHEN_FOCUSED</code> ! * <code>InputMap</code> that is neither <code>null</code> ! * nor empty, returns <code>true</code>. * <li>Returns the value of ! * <code>DefaultFocusTraversalPolicy.accept(aComponent)</code>. * </ol> * ! * @param aComponent the <code>Component</code> whose fitness * as a focus owner is to be tested * @see java.awt.Component#isVisible * @see java.awt.Component#isDisplayable * @see java.awt.Component#isEnabled * @see java.awt.Component#isFocusable * @see javax.swing.plaf.ComboBoxUI#isFocusTraversable * @see javax.swing.JComponent#getInputMap * @see java.awt.DefaultFocusTraversalPolicy#accept ! * @return <code>true</code> if <code>aComponent</code> is a valid choice * for a focus owner; ! * otherwise <code>false</code> */ protected boolean accept(Component aComponent) { if (!super.accept(aComponent)) { return false; } else if (SunToolkit.isInstanceOf(aComponent, "javax.swing.JTable")) { --- 190,231 ---- } return super.getLastComponent(aContainer); } /** ! * Determines whether the specified {@code Component} * is an acceptable choice as the new focus owner. * This method performs the following sequence of operations: * <ol> ! * <li>Checks whether {@code aComponent} is visible, displayable, * enabled, and focusable. If any of these properties is ! * {@code false}, this method returns {@code false}. ! * <li>If {@code aComponent} is an instance of {@code JTable}, ! * returns {@code true}. ! * <li>If {@code aComponent} is an instance of {@code JComboBox}, * then returns the value of ! * {@code aComponent.getUI().isFocusTraversable(aComponent)}. ! * <li>If {@code aComponent} is a {@code JComponent} ! * with a {@code JComponent.WHEN_FOCUSED} ! * {@code InputMap} that is neither {@code null} ! * nor empty, returns {@code true}. * <li>Returns the value of ! * {@code DefaultFocusTraversalPolicy.accept(aComponent)}. * </ol> * ! * @param aComponent the {@code Component} whose fitness * as a focus owner is to be tested * @see java.awt.Component#isVisible * @see java.awt.Component#isDisplayable * @see java.awt.Component#isEnabled * @see java.awt.Component#isFocusable * @see javax.swing.plaf.ComboBoxUI#isFocusTraversable * @see javax.swing.JComponent#getInputMap * @see java.awt.DefaultFocusTraversalPolicy#accept ! * @return {@code true} if {@code aComponent} is a valid choice * for a focus owner; ! * otherwise {@code false} */ protected boolean accept(Component aComponent) { if (!super.accept(aComponent)) { return false; } else if (SunToolkit.isInstanceOf(aComponent, "javax.swing.JTable")) {
< prev index next >