< prev index next >

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

Print this page
rev 1527 : 6727662: Code improvement and warnings removing from swing packages
Summary: Removed unnecessary castings and other warnings
Reviewed-by: malenkov


  48  */
  49 public class LayoutFocusTraversalPolicy extends SortingFocusTraversalPolicy
  50     implements Serializable
  51 {
  52     // Delegate most of our fitness test to Default so that we only have to
  53     // code the algorithm once.
  54     private static final SwingDefaultFocusTraversalPolicy fitnessTestPolicy =
  55         new SwingDefaultFocusTraversalPolicy();
  56 
  57     /**
  58      * Constructs a LayoutFocusTraversalPolicy.
  59      */
  60     public LayoutFocusTraversalPolicy() {
  61         super(new LayoutComparator());
  62     }
  63 
  64     /**
  65      * Constructs a LayoutFocusTraversalPolicy with the passed in
  66      * <code>Comparator</code>.
  67      */
  68     LayoutFocusTraversalPolicy(Comparator c) {
  69         super(c);
  70     }
  71 
  72     /**
  73      * Returns the Component that should receive the focus after aComponent.
  74      * aContainer must be a focus cycle root of aComponent.
  75      * <p>
  76      * By default, LayoutFocusTraversalPolicy implicitly transfers focus down-
  77      * cycle. That is, during normal focus traversal, the Component
  78      * traversed after a focus cycle root will be the focus-cycle-root's
  79      * default Component to focus. This behavior can be disabled using the
  80      * <code>setImplicitDownCycleTraversal</code> method.
  81      * <p>
  82      * If aContainer is <a href="../../java/awt/doc-files/FocusSpec.html#FocusTraversalPolicyProviders">focus
  83      * traversal policy provider</a>, the focus is always transferred down-cycle.
  84      *
  85      * @param aContainer a focus cycle root of aComponent or a focus traversal policy provider
  86      * @param aComponent a (possibly indirect) child of aContainer, or
  87      *        aContainer itself
  88      * @return the Component that should receive the focus after aComponent, or




  48  */
  49 public class LayoutFocusTraversalPolicy extends SortingFocusTraversalPolicy
  50     implements Serializable
  51 {
  52     // Delegate most of our fitness test to Default so that we only have to
  53     // code the algorithm once.
  54     private static final SwingDefaultFocusTraversalPolicy fitnessTestPolicy =
  55         new SwingDefaultFocusTraversalPolicy();
  56 
  57     /**
  58      * Constructs a LayoutFocusTraversalPolicy.
  59      */
  60     public LayoutFocusTraversalPolicy() {
  61         super(new LayoutComparator());
  62     }
  63 
  64     /**
  65      * Constructs a LayoutFocusTraversalPolicy with the passed in
  66      * <code>Comparator</code>.
  67      */
  68     LayoutFocusTraversalPolicy(Comparator<? super Component> c) {
  69         super(c);
  70     }
  71 
  72     /**
  73      * Returns the Component that should receive the focus after aComponent.
  74      * aContainer must be a focus cycle root of aComponent.
  75      * <p>
  76      * By default, LayoutFocusTraversalPolicy implicitly transfers focus down-
  77      * cycle. That is, during normal focus traversal, the Component
  78      * traversed after a focus cycle root will be the focus-cycle-root's
  79      * default Component to focus. This behavior can be disabled using the
  80      * <code>setImplicitDownCycleTraversal</code> method.
  81      * <p>
  82      * If aContainer is <a href="../../java/awt/doc-files/FocusSpec.html#FocusTraversalPolicyProviders">focus
  83      * traversal policy provider</a>, the focus is always transferred down-cycle.
  84      *
  85      * @param aContainer a focus cycle root of aComponent or a focus traversal policy provider
  86      * @param aComponent a (possibly indirect) child of aContainer, or
  87      *        aContainer itself
  88      * @return the Component that should receive the focus after aComponent, or


< prev index next >