|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.FocusTraversalPolicy uic.widgets.UICFocusTraversalPolicy
A focus traversalPolicy for predefined traversal. The concept of focustraversal means that changing the focus (which widget receives keyboard input) using the TAB key follows a defined order of widgets. This class allows you to set the order to a list where each member is added using the addComponent(Component c) method.
Notice that this class uses a Swing concept introduced in Java version 1.4 which means this class will not compile with older versions of Java.
Common usage:
myJPanel.setFocusCycleRoot(true); // if the component is not a normal root // then we need to do this in order to make sure // our policy is queried in the first place. UICFocusTraversalPolicy policy = new UICFocusTraversalPolicy(); policy.addComponent(childWidget1); // first widget to get focus policy.addComponent(childWidget2); // the order in adding equals the order in tabbing. // all the other widgets that need to be used in traversal myJPanel.setFocusTraversalPolicy(policy);
Constructor Summary | |
UICFocusTraversalPolicy()
|
Method Summary | |
void |
addComponent(Component c)
|
Component |
getComponentAfter(Container focusCycleRoot,
Component aComponent)
Returns the Component that should receive the focus after aComponent. |
Component |
getComponentBefore(Container focusCycleRoot,
Component aComponent)
Returns the Component that should receive the focus before aComponent. |
Component |
getDefaultComponent(Container focusCycleRoot)
Returns the default Component to focus. |
Component |
getFirstComponent(Container focusCycleRoot)
Returns the first Component in the traversal cycle. |
Component |
getInitialComponent(Window window)
Returns the Component that should receive the focus when a Window is made visible for the first time. |
Component |
getLastComponent(Container focusCycleRoot)
Returns the last Component in the traversal cycle. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public UICFocusTraversalPolicy()
Method Detail |
public void addComponent(Component c)
public Component getComponentAfter(Container focusCycleRoot, Component aComponent)
public Component getComponentBefore(Container focusCycleRoot, Component aComponent)
public Component getDefaultComponent(Container focusCycleRoot)
public Component getFirstComponent(Container focusCycleRoot)
public Component getInitialComponent(Window window)
public Component getLastComponent(Container focusCycleRoot)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |