@Override public void keyTyped(KeyEvent e) { KeyListener[] kls = getKeyListeners(); if (kls != null) { e.setSource(ModelComponentDecorator.this); for (KeyListener kl : kls) { kl.keyTyped(e); } } }
@Override public void keyPressed(KeyEvent e) { KeyListener[] kls = getKeyListeners(); if (kls != null) { e.setSource(ModelComponentDecorator.this); for (KeyListener kl : kls) { kl.keyPressed(e); } } }
@Override public void keyReleased(KeyEvent e) { KeyListener[] kls = getKeyListeners(); if (kls != null) { e.setSource(ModelComponentDecorator.this); for (KeyListener kl : kls) { kl.keyReleased(e); } } } });
/** * In addition to the default Dialog processKeyEvent, this method * dispatches a KeyEvent to the client gui. * This enables all of the gui hotkeys. */ @Override protected void processKeyEvent(KeyEvent e) { //menuBar.dispatchEvent(e); // Make the source be the ClientGUI and not the dialog // This prevents a ClassCastException in ToolTipManager e.setSource(ClientGUI.this); curPanel.dispatchEvent(e); if (!e.isConsumed()) { super.processKeyEvent(e); } } }; //$NON-NLS-1$
/** * In addition to the default Dialog processKeyEvent, this method * dispatches a KeyEvent to the client gui. * This enables all of the gui hotkeys. */ @Override protected void processKeyEvent(KeyEvent e) { //menuBar.dispatchEvent(e); e.setSource(ClientGUI.this);// avoid ClassCastException in TooltipManager curPanel.dispatchEvent(e); if (!e.isConsumed()) { super.processKeyEvent(e); } } }; //$NON-NLS-1$
dispatcher = new KeyEventDispatcher() { public boolean dispatchKeyEvent(KeyEvent e) { e.setSource(c); for (KeyListener keyListener : c.getKeyListeners()) { if (e.getID() == KeyEvent.KEY_PRESSED) {
evt.setSource(comp); ((PluginManager)comp).processKeyEvents(evt);