public class DockFocusTraversalPolicy extends FocusTraversalPolicy
FocusTraversalPolicy
that uses the algorithms of a SimplifiedFocusTraversalPolicy
to do its work. This policy ensures that only valid Component
s
are selected, and it respects the constraints for nested policies.Constructor and Description |
---|
DockFocusTraversalPolicy(SimplifiedFocusTraversalPolicy policy,
boolean circle)
Creates a new policy.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
accept(Component component)
Tells whether
component can be focused or not. |
protected Component |
after(Component component)
Searches the next
Component which might gain the focus. |
protected Component |
before(Component component)
Searches the previous
Component which might gain the focus. |
Component |
getComponentAfter(Container container,
Component component) |
Component |
getComponentBefore(Container container,
Component component) |
Component |
getDefaultComponent(Container container) |
Component |
getFirstComponent(Container container) |
protected FocusTraversalPolicy |
getFocusTraversalPolicy(Container provider)
Searches the
FocusTraversalPolicy which should be used by
provider . |
Component |
getLastComponent(Container container) |
protected Container |
getRootOrProvider(Component component)
|
getInitialComponent
public DockFocusTraversalPolicy(SimplifiedFocusTraversalPolicy policy, boolean circle)
policy
- the delegate providing algorithms for this policycircle
- if true
then this policy does not respect
the exact description of the functionality of FocusTraversalPolicy
in order to ensure that getComponentAfter( getComponentBefore( x )) == x
and
getComponentBefore( getComponentAfter( x )) == x
.protected boolean accept(Component component)
component
can be focused or not.component
- some Component
which might gain the focus.true
if component
is allowed to
gain the focus, false
otherwisepublic Component getComponentAfter(Container container, Component component)
getComponentAfter
in class FocusTraversalPolicy
public Component getComponentBefore(Container container, Component component)
getComponentBefore
in class FocusTraversalPolicy
public Component getDefaultComponent(Container container)
getDefaultComponent
in class FocusTraversalPolicy
public Component getFirstComponent(Container container)
getFirstComponent
in class FocusTraversalPolicy
public Component getLastComponent(Container container)
getLastComponent
in class FocusTraversalPolicy
protected Container getRootOrProvider(Component component)
component
- some componentnull
protected FocusTraversalPolicy getFocusTraversalPolicy(Container provider)
FocusTraversalPolicy
which should be used by
provider
. This method searches for a focus cycle root or
policy provider whose traversal policy is set
.provider
- a focus cycle root or policy provider whose
SimplifiedFocusTraversalPolicy
is searched.provider
or null