J2SEInputMethod inputMethod = (J2SEInputMethod) device.getInputMethod();
public void keyTyped(KeyEvent ev) { if (MIDletBridge.getCurrentMIDlet() == null) { return; } J2SEInputMethod inputMethod = ((J2SEInputMethod) DeviceFactory.getDevice().getInputMethod()); J2SEButton button = inputMethod.getButton(ev); if (button != null) { inputMethod.buttonTyped(button); } }
public void paintControls(Graphics g) { Device device = DeviceFactory.getDevice(); g.setColor(backgroundColor); g.fillRect(0, 0, displayRectangle.width, displayPaintable.y); g.fillRect(0, displayPaintable.y, displayPaintable.x, displayPaintable.height); g.fillRect(displayPaintable.x + displayPaintable.width, displayPaintable.y, displayRectangle.width - displayPaintable.x - displayPaintable.width, displayPaintable.height); g.fillRect(0, displayPaintable.y + displayPaintable.height, displayRectangle.width, displayRectangle.height - displayPaintable.y - displayPaintable.height); g.setColor(foregroundColor); for (Enumeration s = device.getSoftButtons().elements(); s.hasMoreElements();) { ((J2SESoftButton) s.nextElement()).paint(g); } int inputMode = device.getInputMethod().getInputMode(); if (inputMode == InputMethod.INPUT_123) { g.drawImage(((J2SEImmutableImage) mode123Image.getImage()).getImage(), mode123Image.getRectangle().x, mode123Image.getRectangle().y, null); } else if (inputMode == InputMethod.INPUT_ABC_UPPER) { g.drawImage(((J2SEImmutableImage) modeAbcUpperImage.getImage()).getImage(), modeAbcUpperImage .getRectangle().x, modeAbcUpperImage.getRectangle().y, null); } else if (inputMode == InputMethod.INPUT_ABC_LOWER) { g.drawImage(((J2SEImmutableImage) modeAbcLowerImage.getImage()).getImage(), modeAbcLowerImage .getRectangle().x, modeAbcLowerImage.getRectangle().y, null); } }
public static void dispose() { try { MIDletAccess midletAccess = MIDletBridge.getMIDletAccess(); if (midletAccess != null) { midletAccess.destroyApp(true); } } catch (MIDletStateChangeException ex) { Logger.error(ex); } // TODO to be removed when event dispatcher will run input method task DeviceFactory.getDevice().getInputMethod().dispose(); }
J2SEInputMethod inputMethod = (J2SEInputMethod) device.getInputMethod();
public void keyPressed(KeyEvent ev) { if (MIDletBridge.getCurrentMIDlet() == null) { return; } Device device = DeviceFactory.getDevice(); for (Iterator it = device.getButtons().iterator(); it.hasNext(); ) { SwtButton button = (SwtButton) it.next(); if (ev.keyCode == button.getKeyboardKey()) { ev.keyCode = button.getKeyCode(); break; } } ((SwtInputMethod) device.getInputMethod()).keyPressed(ev); pressedButton = ((SwtInputMethod) device.getInputMethod()).getButton(ev); if (pressedButton != null) { org.microemu.device.impl.Shape shape = pressedButton.getShape(); if (shape != null) { Rectangle r = shape.getBounds(); redraw(r.x, r.y, r.width, r.height, true); } } else { redraw(); } }
InputMethodImpl inputMethod = (InputMethodImpl) device.getInputMethod(); boolean fullScreenMode = device.getDeviceDisplay().isFullScreenMode(); if (device.hasPointerMotionEvents()) {
public void keyReleased(KeyEvent ev) { if (MIDletBridge.getCurrentMIDlet() == null) { return; } Device device = DeviceFactory.getDevice(); for (Iterator it = device.getButtons().iterator(); it.hasNext(); ) { SwtButton button = (SwtButton) it.next(); if (ev.keyCode == button.getKeyboardKey()) { ev.keyCode = button.getKeyCode(); break; } } ((SwtInputMethod) device.getInputMethod()).keyReleased(ev); prevOverButton = pressedButton; pressedButton = null; if (prevOverButton != null) { org.microemu.device.impl.Shape shape = prevOverButton.getShape(); if (shape != null) { Rectangle r = shape.getBounds(); redraw(r.x, r.y, r.width, r.height, true); } } else { redraw(); } } };
J2SEInputMethod inputMethod = (J2SEInputMethod) device.getInputMethod();
J2SEInputMethod inputMethod = (J2SEInputMethod) device.getInputMethod(); boolean fullScreenMode = device.getDeviceDisplay().isFullScreenMode(); if (device.hasPointerEvents()) {
public void mouseReleased(MouseEvent e) { mouseButtonDown = false; MouseRepeatedTimerTask.stop(); if (pressedButton == null) { return; } if (MIDletBridge.getCurrentMIDlet() == null) { return; } Device device = DeviceFactory.getDevice(); J2SEInputMethod inputMethod = (J2SEInputMethod) device.getInputMethod(); J2SEButton prevOverButton = J2SEDeviceButtonsHelper.getSkinButton(e); if (prevOverButton != null) { inputMethod.buttonReleased(prevOverButton, '\0'); } pressedButton = null; // optimize for some video cards. if (prevOverButton != null) { repaint(prevOverButton.getShape().getBounds()); } else { repaint(); } }
J2SEInputMethod inputMethod = (J2SEInputMethod) device.getInputMethod();
SwtInputMethod inputMethod = (SwtInputMethod) device.getInputMethod();
int inputMode = device.getInputMethod().getInputMode(); if (inputMode == InputMethod.INPUT_123) { g.drawImage(((SwtImmutableImage) mode123Image.getImage()).getImage(),
Device device = DeviceFactory.getDevice(); org.microemu.device.impl.Rectangle rect = ((SwtDeviceDisplay) device.getDeviceDisplay()).getDisplayRectangle(); SwtInputMethod inputMethod = (SwtInputMethod) device.getInputMethod(); boolean fullScreenMode = device.getDeviceDisplay().isFullScreenMode(); if (rect.x <= e.x && (rect.x + rect.width) > e.x
SwtInputMethod inputMethod = (SwtInputMethod) device.getInputMethod(); boolean fullScreenMode = device.getDeviceDisplay().isFullScreenMode(); if (rect.x <= e.x && (rect.x + rect.width) > e.x