| Method from java.awt.DefaultKeyboardFocusManager Detail: |
protected void dequeueKeyEvents(long a0,
Component a1) {
toolkit.lockAWT();
try {
// currently do nothing, this method
// is never called by AWT implementation
} finally {
toolkit.unlockAWT();
}
}
|
protected void discardKeyEvents(Component a0) {
toolkit.lockAWT();
try {
// currently do nothing, this method
// is never called by AWT implementation
} finally {
toolkit.unlockAWT();
}
}
|
public boolean dispatchEvent(AWTEvent e) {
if (e instanceof KeyEvent) {
KeyEvent ke = (KeyEvent) e;
return (preProcessKeyEvent(ke) || dispatchKeyEvent(ke));
} else if (e instanceof FocusEvent) {
FocusEvent fe = (FocusEvent) e;
return dispatchFocusEvent(fe);
} else if (e instanceof WindowEvent) {
WindowEvent we = (WindowEvent) e;
return dispatchWindowEvent(we);
} else if (e == null) {
throw new NullPointerException();
}
return false;
}
|
public boolean dispatchKeyEvent(KeyEvent e) {
boolean doRedispatch = false;
toolkit.lockAWT();
try {
if ((focusOwner != null) && focusOwner.isKeyEnabled()) {
doRedispatch = !e.isConsumed();
}
} finally {
toolkit.unlockAWT();
}
if (doRedispatch) {
e.setSource(focusOwner);
redispatchEvent(focusOwner, e);
}
postProcessKeyEvent(e);
return true; // no further dispatching
}
|
public void downFocusCycle(Container aContainer) {
toolkit.lockAWT();
try {
if (aContainer != null) {
aContainer.transferFocusDownCycle();
}
} finally {
toolkit.unlockAWT();
}
}
|
protected void enqueueKeyEvents(long a0,
Component a1) {
toolkit.lockAWT();
try {
// currently do nothing,
// this method is never called by AWT implementation
} finally {
toolkit.unlockAWT();
}
}
|
public void focusNextComponent(Component aComponent) {
toolkit.lockAWT();
try {
if (aComponent != null) {
aComponent.transferFocus();
}
} finally {
toolkit.unlockAWT();
}
}
|
public void focusPreviousComponent(Component aComponent) {
toolkit.lockAWT();
try {
if (aComponent != null) {
aComponent.transferFocusBackward();
}
} finally {
toolkit.unlockAWT();
}
}
|
static boolean isActivateable(Window w) {
// return true if activeWindow can be set to w
return ( (w == null) || w.isActivateable());
}
|
public boolean postProcessKeyEvent(KeyEvent ke) {
// pass event to every key event postprocessor:
for (KeyEventPostProcessor kep : getKeyEventPostProcessors()) {
if (kep.postProcessKeyEvent(ke)) {
return true;
}
}
// postprocess the event if no KeyEventPostProcessor dispatched it
if (!ke.isConsumed()) {
handleShortcut(ke);
}
return true;// discard KeyEvents if there's no focus owner
}
|
public void processKeyEvent(Component focusedComponent,
KeyEvent e) {
toolkit.lockAWT();
try {
AWTKeyStroke ks = ((e.getID() == KeyEvent.KEY_TYPED) ?
null :
AWTKeyStroke.getAWTKeyStrokeForEvent(e));
Container container = ((focusedComponent instanceof Container) ?
(Container)focusedComponent :
null);
Set< ? > back = focusedComponent.getFocusTraversalKeys(BACKWARD_TRAVERSAL_KEYS);
Set< ? > forward = focusedComponent.getFocusTraversalKeys(FORWARD_TRAVERSAL_KEYS);
Set< ? > up = focusedComponent.getFocusTraversalKeys(UP_CYCLE_TRAVERSAL_KEYS);
Set< ? > down = (((container != null) && container.isFocusCycleRoot()) ?
container.getFocusTraversalKeys(DOWN_CYCLE_TRAVERSAL_KEYS) :
null);
// all KeyEvents related to the focus traversal key, including the
// associated KEY_TYPED event,
// will be consumed, and will not be dispatched to any Component
Set< ? >[] sets = { back, forward, up, down };
consume(e, sets);
if (back.contains(ks)) {
focusPreviousComponent(focusedComponent);
} else if (forward.contains(ks)) {
focusNextComponent(focusedComponent);
} else if (up.contains(ks)) {
upFocusCycle(focusedComponent);
} else if ((down != null) &&
(container != null) &&
down.contains(ks)) {
downFocusCycle(container);
}
} finally {
toolkit.unlockAWT();
}
}
|
public void upFocusCycle(Component aComponent) {
toolkit.lockAWT();
try {
if (aComponent != null) {
aComponent.transferFocusUpCycle();
}
} finally {
toolkit.unlockAWT();
}
}
|