private static DeviceInformation getDeviceInformation() { Device dev = DeviceFactory.getDevice(); DeviceInformation inf; synchronized (J2SEDeviceButtonsHelper.class) { inf = (DeviceInformation) devices.get(dev); if (inf == null) { inf = createDeviceInformation(dev); } } return inf; }
public static J2SEButton getButton(ButtonName functionalName) { DeviceInformation inf = getDeviceInformation(); return (J2SEButton) inf.functions.get(functionalName); }
overButton = J2SEDeviceButtonsHelper.getSkinButton(e); if (overButton != prevOverButton) {
/** * * * @return a key code corresponding to this game action * @throws IllegalArgumentException * if <code>gameAction</code> is not a valid game action */ public int getKeyCode(int gameAction) { ButtonName name = ButtonDetaultDeviceKeyCodes.getButtonNameByGameAction(gameAction); return J2SEDeviceButtonsHelper.getButton(name).getKeyCode(); }
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 J2SEButton getButton(KeyEvent ev) { J2SEButton button = J2SEDeviceButtonsHelper.getButton(ev); if (button != null) { return button; } if (getInputMode() != INPUT_123) { for (Enumeration e = DeviceFactory.getDevice().getButtons().elements(); e.hasMoreElements();) { button = (J2SEButton) e.nextElement(); if (button.isChar(ev.getKeyChar(), getInputMode())) { return button; } } } return null; } }
pressedButton = J2SEDeviceButtonsHelper.getSkinButton(e); if (pressedButton != null) { if (pressedButton instanceof SoftButton && !fullScreenMode) {
public static J2SEButton getButton(KeyEvent ev) { DeviceInformation inf = getDeviceInformation(); J2SEButton button = (J2SEButton) inf.keyboardCharCodes.get(new Integer(ev.getKeyChar())); if (button != null) { return button; } return (J2SEButton) inf.keyboardKeyCodes.get(new Integer(ev.getKeyCode())); }