public class PFocusManager extends DefaultFocusManager implements WindowListener, Runnable
FOCUS_MANAGER_CLASS_PROPERTY
BACKWARD_TRAVERSAL_KEYS, DOWN_CYCLE_TRAVERSAL_KEYS, FORWARD_TRAVERSAL_KEYS, UP_CYCLE_TRAVERSAL_KEYS
Constructor and Description |
---|
PFocusManager(Phantom p)
Called when creating the Phantom instance.
|
Modifier and Type | Method and Description |
---|---|
static void |
clearSelectedMenuPath()
Clears a selected menu path.
|
boolean |
compareTabOrder(Component a,
Component b)
Overridden to remove exception.
|
static boolean |
focusControl(PControl pc)
Checks if the focus can be set to a component, and if so does it.
|
static boolean |
focusControl(PControl pc,
KeyEvent event)
Checks if the focus can be set to a component, and if so does it.
|
static boolean |
focusControl(PControl pc,
KeyEvent event,
boolean checkForTabSkipped,
boolean doit)
Checks if the focus can be set to a component, and if so does it.
|
static boolean |
focusControl(PControl pc,
KeyEvent event,
PControl pcPrevious,
boolean checkForTabSkipped,
boolean doit)
Checks if the focus can be set to a component, and if so does it.
|
void |
focusNextComponent(Component c)
Cause the focus manager to set the focus on the next
focusable component You can call this method to cause
the focus manager to focus the next component.
|
static boolean |
focusNextComponent2(Component c)
Cause the focus manager to set the focus on the next
focusable component.
|
void |
focusPreviousComponent(Component c)
Cause the focus manager to set the focus on the previous
focusable component You can call this method to cause the
focus manager to focus the previous component.
|
Component |
getComponentAfter(Container cnr,
Component comp)
Returns the Component that should receive the focus after aComponent.
|
Component |
getComponentBefore(Container cnr,
Component comp)
Returns the Component that should receive the focus before aComponent.
|
Component |
getFirstComponent(Container cnr)
Returns the first Component in the traversal cycle.
|
Component |
getLastComponent(Container cnr)
Returns the last Component in the traversal cycle.
|
static PControl |
getPControl(Component c)
Gets the PControl instance of a component in a Phantom panel.
|
void |
processKeyEvent(Component c,
KeyEvent e)
This method is called by JComponents when a key event occurs.
|
static void |
processKeyEvent2(Component c,
KeyEvent e)
This method is called by JComponents when a key event occurs.
|
void |
run()
Focus a component later.
|
static void |
setFocus(JComponent jc)
Sets focus to the component and bringing the frame/dialog window
to the front.
|
void |
super_focusNextComponent(Component c)
Calls the method "super.focusNextComponent(c)", i.e.
|
void |
super_focusPreviousComponent(Component c)
Calls the method "super.focusPreviousComponent(c)", i.e.
|
void |
super_processKeyEvent(Component c,
KeyEvent e)
Calls the method "super.processKeyEvent(c,e)", i.e.
|
void |
windowActivated(WindowEvent e) |
void |
windowClosed(WindowEvent e) |
void |
windowClosing(WindowEvent e) |
void |
windowDeactivated(WindowEvent e)
Checks for deactivation for single Alt-keystrokes to activate the menu bar.
|
void |
windowDeiconified(WindowEvent e) |
void |
windowIconified(WindowEvent e) |
void |
windowOpened(WindowEvent e) |
disableSwingFocusManager, getCurrentManager, isFocusManagerEnabled, setCurrentManager
dequeueKeyEvents, discardKeyEvents, dispatchEvent, dispatchKeyEvent, downFocusCycle, enqueueKeyEvents, postProcessKeyEvent, upFocusCycle
addKeyEventDispatcher, addKeyEventPostProcessor, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, clearFocusOwner, clearGlobalFocusOwner, downFocusCycle, firePropertyChange, fireVetoableChange, focusNextComponent, focusPreviousComponent, getActiveWindow, getCurrentFocusCycleRoot, getCurrentKeyboardFocusManager, getDefaultFocusTraversalKeys, getDefaultFocusTraversalPolicy, getFocusedWindow, getFocusOwner, getGlobalActiveWindow, getGlobalCurrentFocusCycleRoot, getGlobalFocusedWindow, getGlobalFocusOwner, getGlobalPermanentFocusOwner, getKeyEventDispatchers, getKeyEventPostProcessors, getPermanentFocusOwner, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, redispatchEvent, removeKeyEventDispatcher, removeKeyEventPostProcessor, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener, setCurrentKeyboardFocusManager, setDefaultFocusTraversalKeys, setDefaultFocusTraversalPolicy, setGlobalActiveWindow, setGlobalCurrentFocusCycleRoot, setGlobalFocusedWindow, setGlobalFocusOwner, setGlobalPermanentFocusOwner, upFocusCycle
public PFocusManager(Phantom p)
public void windowDeactivated(WindowEvent e)
windowDeactivated
in interface WindowListener
public void windowIconified(WindowEvent e)
windowIconified
in interface WindowListener
public void windowClosed(WindowEvent e)
windowClosed
in interface WindowListener
public void windowOpened(WindowEvent e)
windowOpened
in interface WindowListener
public void windowActivated(WindowEvent e)
windowActivated
in interface WindowListener
public void windowDeiconified(WindowEvent e)
windowDeiconified
in interface WindowListener
public void windowClosing(WindowEvent e)
windowClosing
in interface WindowListener
public static void processKeyEvent2(Component c, KeyEvent e)
This method should look at the key event and change the focused component if the key event matches the receiver's focus manager hot keys. For example the default focus manager will change the focus if the key event matches TAB or Shift + TAB.
The focus manager should call consume() on e if
e
has been processed.
c
is the component that currently has
the focus.
Note: FocusManager will receive KEY_PRESSED, KEY_RELEASED and KEY_TYPED key events. If one event is consumed, all other events type should be consumed.
All events for Phantom panels are consumed when the session is locked.
Every key event is sent off to PPanel.processKeyPressed
(when the key
is pressed) and PPanel
sends it off to the control in question.
This is a static method!
public void super_processKeyEvent(Component c, KeyEvent e)
public void processKeyEvent(Component c, KeyEvent e)
This method should look at the key event and change the focused component if the key event matches the receiver's focus manager hot keys. For example the default focus manager will change the focus if the key event matches TAB or Shift + TAB.
The focus manager should call consume() on e if
e
has been processed.
c
is the component that currently has
the focus.
Note: FocusManager will receive KEY_PRESSED, KEY_RELEASED and KEY_TYPED key events. If one event is consumed, all other events type should be consumed.
All events for Phantom panels are consumed when the session is locked.
Every key event is sent off to PPanel.processKeyPressed
(when the key
is pressed) and PPanel
sends it off to the control in question.
processKeyEvent
in class DefaultKeyboardFocusManager
public static void clearSelectedMenuPath()
public static PControl getPControl(Component c)
public static boolean focusNextComponent2(Component c)
This is a static method!
public void super_focusNextComponent(Component c)
public void focusNextComponent(Component c)
focusNextComponent
in class DefaultKeyboardFocusManager
public void super_focusPreviousComponent(Component c)
public void focusPreviousComponent(Component c)
focusPreviousComponent
in class DefaultKeyboardFocusManager
public static boolean focusControl(PControl pc)
The Phantom setting "Skip tab stop" is not checked.
public static boolean focusControl(PControl pc, KeyEvent event)
The Phantom setting "Skip tab stop" is not checked.
public static boolean focusControl(PControl pc, KeyEvent event, boolean checkForTabSkipped, boolean doit)
The flag checkForTabSkipped
can be used to check for
the Phantom setting "Skip tab stop".
public static boolean focusControl(PControl pc, KeyEvent event, PControl pcPrevious, boolean checkForTabSkipped, boolean doit)
The flag checkForTabSkipped
can be used to check for
the Phantom setting "Skip tab stop".
Before the actual focus change, the pcPrevious
component (if not null) will be checked for implementing the
FieldCheck
interface. If it is, the method
isDeFocusAllowed(pc)
will be called. If this method
returns false
the focus change operation will be canceled.
Note that this will only be done when doit=true
. The return
code of focusControl
will be true
even if the
operation was canceled.
public static void setFocus(JComponent jc)
jc
- Component to focus.public boolean compareTabOrder(Component a, Component b)
compareTabOrder
in class DefaultFocusManager
public Component getFirstComponent(Container cnr)
getFirstComponent
in class DefaultFocusManager
cnr
- The focus cycle root or focus traversal policy provider
whose first Component is to be returned.public Component getLastComponent(Container cnr)
getLastComponent
in class DefaultFocusManager
cnr
- The focus cycle root or focus traversal policy
provider whose last Component is to be returnedpublic Component getComponentAfter(Container cnr, Component comp)
getComponentAfter
in class DefaultFocusManager
cnr
- A focus cycle root of aComponent or focus traversal policy provider.comp
- A (possibly indirect) child of cnr, or cnr itself.public Component getComponentBefore(Container cnr, Component comp)
getComponentBefore
in class DefaultFocusManager
cnr
- A focus cycle root of aComponent or focus traversal policy provider.comp
- A (possibly indirect) child of cnr, or cnr itself.Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.