public InputStream getResourceAsStream(String name) { return MIDletBridge.getCurrentMIDlet().getClass().getResourceAsStream(name); }
public InputStream getResourceAsStream(String name) { return MIDletBridge.getCurrentMIDlet().getClass().getResourceAsStream(name); }
public InputStream getResourceAsStream(String name) { return MIDletBridge.getCurrentMIDlet().getClass().getResourceAsStream(name); }
public InputStream getResourceAsStream(String name) { return MIDletBridge.getCurrentMIDlet().getClass().getResourceAsStream(name); }
public void windowDeiconified(WindowEvent ev) { try { MIDletBridge.getMIDletAccess(MIDletBridge.getCurrentMIDlet()).startApp(); } catch (MIDletStateChangeException ex) { System.err.println(ex); } } };
private Image getImage(String str) throws IOException { // TODO not always true, there could be some loading images before // invoke startApp, right now getCurrentMIDlet returns prevoius MIDlet Object midlet = MIDletBridge.getCurrentMIDlet(); if (midlet == null) { midlet = getClass(); } InputStream is = midlet.getClass().getResourceAsStream(str); if (is == null) { throw new IOException(str + " could not be found."); } try { return getImage(is); } finally { IOUtils.closeQuietly(is); } }
private Image getImage(String str) throws IOException { // TODO not always true, there could be some loading images before // invoke startApp, right now getCurrentMIDlet returns prevoius MIDlet Object midlet = MIDletBridge.getCurrentMIDlet(); if (midlet == null) { midlet = getClass(); } InputStream is = midlet.getClass().getResourceAsStream(str); if (is == null) { throw new IOException(str + " could not be found."); } try { return getImage(is); } finally { IOUtils.closeQuietly(is); } }
public void windowIconified(WindowEvent ev) { MIDletBridge.getMIDletAccess(MIDletBridge.getCurrentMIDlet()).pauseApp(); }
public void keyReleased(KeyEvent ev) { if (MIDletBridge.getCurrentMIDlet() == null) { return;
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 handleEvent(Event e) { if (selectDeviceDialog.open() == SwtDialog.OK) { if (selectDeviceDialog.getSelectedDeviceEntry().equals(getDevice())) { return; } if (MIDletBridge.getCurrentMIDlet() != getLauncher()) { if (!SwtMessageDialog.openQuestion(shell, "Question?", "Changing device needs MIDlet to be restarted. All MIDlet data will be lost. Are you sure?")) { return; } } setDevice(selectDeviceDialog.getSelectedDeviceEntry()); if (MIDletBridge.getCurrentMIDlet() != getLauncher()) { try { startMidlet(MIDletBridge.getCurrentMIDlet().getClass(), MIDletBridge.getMIDletAccess()); } catch (Exception ex) { System.err.println(ex); } } else { startLauncher(MIDletBridge.getMIDletContext()); } } } };
public void keyPressed(KeyEvent ev) { if (MIDletBridge.getCurrentMIDlet() == null) { return;
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(); } } };
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(); } }
pressedPoint = e.getPoint(); if (MIDletBridge.getCurrentMIDlet() == null) { return;
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(); } }
public void mouseReleased(MouseEvent e) { if (MIDletBridge.getCurrentMIDlet() == null) { return;
if (MIDletBridge.getCurrentMIDlet() != common.getLauncher()) { restartMidlet = JOptionPane.showConfirmDialog(Main.this, "Changing device may trigger MIDlet to the unpredictable state and restart of MIDlet is recommended. \n"
if (MIDletBridge.getCurrentMIDlet() == null) { return;
public void mouseUp(MouseEvent e) if (MIDletBridge.getCurrentMIDlet() == null) { return;