public static J2SEButton getSkinButton(MouseEvent ev) { for (Enumeration en = DeviceFactory.getDevice().getButtons().elements(); en.hasMoreElements();) { J2SEButton button = (J2SEButton) en.nextElement(); if (button.getShape() != null) { if (button.getShape().contains(ev.getX(), ev.getY())) { return button; } } } return null; }
pressedButton = null; if (prevOverButton != null) { org.microemu.device.impl.Shape shape = prevOverButton.getShape(); if (shape != null) { repaint(shape.getBounds());
keyChar = '\0'; org.microemu.device.impl.Shape shape = button.getShape(); if (shape != null) { repaint(shape.getBounds());
org.microemu.device.impl.Shape shape = prevOverButton.getShape(); if (shape != null) { drawImageInShape(offg, ((J2SEImmutableImage) device.getNormalImage()).getImage(), shape); org.microemu.device.impl.Shape shape = overButton.getShape(); if (shape != null) { drawImageInShape(offg, ((J2SEImmutableImage) device.getOverImage()).getImage(), shape); org.microemu.device.impl.Shape shape = pressedButton.getShape(); if (shape != null) { drawImageInShape(offg, ((J2SEImmutableImage) device.getPressedImage()).getImage(), shape);
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(); } }
repaint(pressedButton.getShape().getBounds());