|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.zaval.lw.LwFocusManager
This class is an implementation of the LwFocusManager for the libarary.
According to the implementation the light weight component can be a focus owner
if the component canHaveFocus
method returns true
and
the component is enabled and visible.
The focus manager implements the mouse listener interface to deliver focus to a light weight component. The manager controls (by implementing LwComponentListener, LwContainerListener listeners interfaces) when the focus owner component is disabled, hidden or removed from the parent component to take away the focus if it is necessary.
The manager implements keyboard listener interface to change focus owner when the "TAB" key has been pressed.
The manager provides following methods that are used by other components of the library:
requestFocus
. The method is called to try pass the focus to the specified
component or some other component. The method tests if the specified component
can have focus by the isFocusable
method.
hasFocus
. The method is called to test if the component has the focus or not.
getFocusOwner
. The method returns a component which has the focus.
findFocusable
. The method looks for a component that can get the focus.
Constructor Summary | |
LwFocusManager()
|
Method Summary | |
void |
compAdded(LwContainerEvent e)
Invoked when the light weight component has been added to the container. |
void |
compDisabled(LwComponentEvent e)
Invoked when the light weight component has been disabled. |
void |
compEnabled(LwComponentEvent e)
Invoked when the light weight component has been enabled. |
void |
compHidden(LwComponentEvent e)
Invoked when the light weight component has been hidden. |
void |
compRemoved(LwContainerEvent e)
Invoked when the light weight component has been removed from the container. |
void |
compShown(LwComponentEvent e)
Invoked when the light weight component has been shown. |
void |
dispose()
|
LwComponent |
findFocusable(LwComponent c)
Looks for a component that can be the focus owner starting from the specified component. |
LwComponent |
getFocusOwner()
Gets the focus owner component. |
boolean |
hasFocus(LwComponent c)
Tests if the specified component has the focus. |
protected boolean |
isFocusable(LwComponent c)
Tests if the component can have the focus. |
void |
keyPressed(LwKeyEvent e)
Invoked when a key has been pressed. |
void |
keyReleased(LwKeyEvent e)
Invoked when a key has been released. |
void |
keyTyped(LwKeyEvent e)
Invoked when a key has been typed. |
void |
mouseClicked(LwMouseEvent e)
Invoked when the mouse has been clicked on a light weight component. |
void |
mouseEntered(LwMouseEvent e)
Invoked when the mouse enters a light weight component. |
void |
mouseExited(LwMouseEvent e)
Invoked when the mouse exits a light weight component. |
void |
mousePressed(LwMouseEvent e)
Invoked when the mouse has been pressed on a light weight component. |
void |
mouseReleased(LwMouseEvent e)
Invoked when the mouse has been released on a light weight component. |
void |
requestFocus(LwComponent c)
Requests the input focus for the specified component. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LwFocusManager()
Method Detail |
public void requestFocus(LwComponent c)
c
- the specified component.public LwComponent findFocusable(LwComponent c)
c
- the specified starting component.null
if the component has
not been found.public boolean hasFocus(LwComponent c)
c
- the specified component.true
if the component is a focus owner; otherwise
false
.public LwComponent getFocusOwner()
public void mousePressed(LwMouseEvent e)
mousePressed
in interface LwMouseListener
e
- the specified mouse event.public void mouseClicked(LwMouseEvent e)
mouseClicked
in interface LwMouseListener
e
- the specified mouse event.public void mouseEntered(LwMouseEvent e)
mouseEntered
in interface LwMouseListener
e
- the specified mouse event.public void mouseExited(LwMouseEvent e)
mouseExited
in interface LwMouseListener
e
- the specified mouse event.public void mouseReleased(LwMouseEvent e)
mouseReleased
in interface LwMouseListener
e
- the specified mouse event.public void compDisabled(LwComponentEvent e)
compDisabled
in interface LwComponentListener
e
- the specified component event.public void compEnabled(LwComponentEvent e)
compEnabled
in interface LwComponentListener
e
- the specified component event.public void compShown(LwComponentEvent e)
compShown
in interface LwComponentListener
e
- the specified component event.public void compHidden(LwComponentEvent e)
compHidden
in interface LwComponentListener
e
- the specified component event.public void compAdded(LwContainerEvent e)
compAdded
in interface LwContainerListener
e
- the specified container event.public void compRemoved(LwContainerEvent e)
compRemoved
in interface LwContainerListener
e
- the specified container event.public void keyPressed(LwKeyEvent e)
LwKeyListener
keyPressed
in interface LwKeyListener
org.zaval.lw.event.LwKeyListener
e
- the specified key event.public void keyReleased(LwKeyEvent e)
LwKeyListener
keyReleased
in interface LwKeyListener
org.zaval.lw.event.LwKeyListener
e
- the specified key event.public void keyTyped(LwKeyEvent e)
LwKeyListener
keyTyped
in interface LwKeyListener
org.zaval.lw.event.LwKeyListener
e
- the specified key event.public void dispose()
dispose
in interface LwManager
protected boolean isFocusable(LwComponent c)
c
- the specified component to test.true
if the component can have the focus.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |