Holger's Java API

## com.antelmann.util.gui
Class ListFocusTraversalPolicy

    java.lang.Object
      java.awt.FocusTraversalPolicy
          com.antelmann.util.gui.ListFocusTraversalPolicy

    public class ListFocusTraversalPolicy

extends FocusTraversalPolicy

allows to customize the focus traversal based on a list

Since:
  03.12.2013, 23:03:25
Author:
  holger
See Also:
  `Container.setFocusTraversalPolicyProvider(boolean)`

Field Summary
`protected ArrayList<Component>` `order`

Constructor Summary
`ListFocusTraversalPolicy(Collection<? extends Component> list)`
`ListFocusTraversalPolicy(Component... comp)`

Method Summary
`Component` `getComponentAfter(Container focusCycleRoot, Component aComponent)`
`Component` `getComponentBefore(Container focusCycleRoot, Component aComponent)`
`Component` `getDefaultComponent(Container focusCycleRoot)`
`Component` `getFirstComponent(Container focusCycleRoot)`
`Component` `getLastComponent(Container focusCycleRoot)`
`static Comparator<Component>` `getTopDownComparator()` provides top-down and then left-right ordering of components

Methods inherited from class java.awt.FocusTraversalPolicy
`getInitialComponent`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### order

    protected final ArrayList<Component> order

Constructor Detail

### ListFocusTraversalPolicy

    public ListFocusTraversalPolicy(Component... comp)

### ListFocusTraversalPolicy

    public ListFocusTraversalPolicy(Collection<? extends Component> list)

Method Detail

### getComponentAfter

    public Component getComponentAfter(Container focusCycleRoot,
                                       Component aComponent)

  Specified by:
    `getComponentAfter` in class `FocusTraversalPolicy`

### getComponentBefore

    public Component getComponentBefore(Container focusCycleRoot,
                                        Component aComponent)

  Specified by:
    `getComponentBefore` in class `FocusTraversalPolicy`

### getDefaultComponent

    public Component getDefaultComponent(Container focusCycleRoot)

  Specified by:
    `getDefaultComponent` in class `FocusTraversalPolicy`

### getLastComponent

    public Component getLastComponent(Container focusCycleRoot)

  Specified by:
    `getLastComponent` in class `FocusTraversalPolicy`

### getFirstComponent

    public Component getFirstComponent(Container focusCycleRoot)

  Specified by:
    `getFirstComponent` in class `FocusTraversalPolicy`

### getTopDownComparator

    public static Comparator<Component> getTopDownComparator()

  provides top-down and then left-right ordering of components

  See Also:
    `SortingFocusTraversalPolicy.SortingFocusTraversalPolicy(Comparator)`

(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads