|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.FocusTraversalPolicy
javax.swing.InternalFrameFocusTraversalPolicy
javax.swing.SortingFocusTraversalPolicy
public class SortingFocusTraversalPolicy
Constructor Summary | |
---|---|
protected |
SortingFocusTraversalPolicy()
Creates a new SortingFocusTraversalPolicy with no
comparator set. |
|
SortingFocusTraversalPolicy(Comparator<? super Component> comparator)
Creates a new SortingFocusTraversalPolicy with the given
comparator set. |
Method Summary | |
---|---|
protected boolean |
accept(Component comp)
Decide whether a component is an acceptable focus owner. |
protected Comparator<? super Component> |
getComparator()
Get the current value of the comparator property. |
Component |
getComponentAfter(Container root,
Component comp)
Return the component which follows the specified component in this focus cycle, relative to the order imposed by comparator . |
Component |
getComponentBefore(Container root,
Component comp)
Return the component which precedes the specified component in this focus cycle, relative to the order imposed by comparator . |
Component |
getDefaultComponent(Container root)
Return the default component of root , which is by default
the same as the first component, returned by getFirstComponent(java.awt.Container) . |
Component |
getFirstComponent(Container root)
Return the first focusable component of the focus cycle root comp under the ordering imposed by the comparator property. |
boolean |
getImplicitDownCycleTraversal()
Return the current value of the implicitDownCycleTraversal
property. |
Component |
getLastComponent(Container root)
Return the last focusable component of the focus cycle root comp under the ordering imposed by the comparator property. |
protected void |
setComparator(Comparator<? super Component> comparator)
Set the current value of the comparator property. |
void |
setImplicitDownCycleTraversal(boolean down)
Set the current value of the implicitDownCycleTraversal
property. |
Methods inherited from class javax.swing.InternalFrameFocusTraversalPolicy |
---|
getInitialComponent |
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 |
Constructor Detail |
---|
protected SortingFocusTraversalPolicy()
SortingFocusTraversalPolicy
with no
comparator set.
public SortingFocusTraversalPolicy(Comparator<? super Component> comparator)
SortingFocusTraversalPolicy
with the given
comparator set.
comparator
- the comparator to setMethod Detail |
---|
protected boolean accept(Component comp)
comp
- The component which is a candidate for focus ownership.
protected Comparator<? super Component> getComparator()
comparator
property.
setComparator(java.util.Comparator super java.awt.Component>)
protected void setComparator(Comparator<? super Component> comparator)
comparator
property.
comparator
- the new value of the propertygetComparator()
public Component getComponentAfter(Container root, Component comp)
comparator
. Candidate components are only considered if they are
accepted by the accept(java.awt.Component)
method.
If getImplicitDownCycleTraversal()
is true
and the
comp
is a focus cycle root, an "implicit DownCycle"
occurs and the method returns the
getDefaultComponent(comp)
.
getComponentAfter
in class FocusTraversalPolicy
root
- the focus cycle root to search for a successor withincomp
- the component to search for the successor of
IllegalArgumentException
- if either argument is null, or
if the root is not a focus cycle root of the componentpublic Component getComponentBefore(Container root, Component comp)
comparator
. Candidate components are only considered if they are
accepted by the accept(java.awt.Component)
method.
getComponentBefore
in class FocusTraversalPolicy
root
- the focus cycle root to search for a predecessor withincomp
- the component to search for the predecessor of
IllegalArgumentException
- if either argument is null, or
if the root is not a focus cycle root of the componentpublic Component getDefaultComponent(Container root)
root
, which is by default
the same as the first component, returned by getFirstComponent(java.awt.Container)
.
getDefaultComponent
in class FocusTraversalPolicy
root
- the focus cycle root to return the default component of
root
IllegalArgumentException
- if root is nullpublic Component getFirstComponent(Container root)
comp
under the ordering imposed by the comparator
property. Candidate components are only considered if
they are accepted by the accept(java.awt.Component)
method.
getFirstComponent
in class FocusTraversalPolicy
root
- the focus cycle root to search for the first component of
root
, or null if
no components are found.
IllegalArgumentException
- if root is nullpublic Component getLastComponent(Container root)
comp
under the ordering imposed by the comparator
property. Candidate components are only considered if
they are accepted by the accept(java.awt.Component)
method.
getLastComponent
in class FocusTraversalPolicy
root
- the focus cycle root to search for the last component of
root
, or null if
no components are found.
IllegalArgumentException
- if root is nullpublic boolean getImplicitDownCycleTraversal()
implicitDownCycleTraversal
property.
setImplicitDownCycleTraversal(boolean)
public void setImplicitDownCycleTraversal(boolean down)
implicitDownCycleTraversal
property.
down
- the new value of the propertygetImplicitDownCycleTraversal()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |