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; }
private J2SEButton getButtonByButtonName(ButtonName buttonName) { J2SEButton result; for (Enumeration e = DeviceFactory.getDevice().getButtons().elements(); e.hasMoreElements();) { result = (J2SEButton) e.nextElement(); if (result.getFunctionalName() == buttonName) { return result; } } return null; } }
public void mouseMoved(MouseEvent e) { if (showMouseCoordinates) { StringBuffer buf = new StringBuffer(); Point p = deviceCoordinate(DeviceFactory.getDevice().getDeviceDisplay(), e.getPoint()); buf.append(p.x).append(",").append(p.y); Common.setStatusBar(buf.toString()); } }
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; }
public void setScrollDown(boolean state) { Enumeration en = DeviceFactory.getDevice().getSoftButtons().elements(); while (en.hasMoreElements()) { SoftButton button = (SoftButton) en.nextElement(); if (button.getType() == SoftButton.TYPE_ICON && button.getName().equals("down")) { button.setVisible(state); } } }
public void setScrollDown(boolean state) { Enumeration en = DeviceFactory.getDevice().getSoftButtons().elements(); while (en.hasMoreElements()) { SoftButton button = (SoftButton) en.nextElement(); if (button.getType() == SoftButton.TYPE_ICON && button.getName().equals("down")) { button.setVisible(state); } } }
public void setScrollUp(boolean state) { Enumeration en = DeviceFactory.getDevice().getSoftButtons().elements(); while (en.hasMoreElements()) { SoftButton button = (SoftButton) en.nextElement(); if (button.getType() == SoftButton.TYPE_ICON && button.getName().equals("up")) { button.setVisible(state); } } }
public void setScrollUp(boolean state) { Enumeration en = DeviceFactory.getDevice().getSoftButtons().elements(); while (en.hasMoreElements()) { SoftButton button = (SoftButton) en.nextElement(); if (button.getType() == SoftButton.TYPE_ICON && button.getName().equals("up")) { button.setVisible(state); } } }
public void setFont(javax.microedition.lcdui.Font font) { currentFont = font; J2SEFont tmpFont = (J2SEFont) ((J2SEFontManager) DeviceFactory.getDevice().getFontManager()) .getFont(currentFont); g.setFont(tmpFont.getFont()); }
public Point computeSize(int wHint, int hHint, boolean changed) { javax.microedition.lcdui.Image tmp = DeviceFactory.getDevice().getNormalImage(); return new Point(tmp.getWidth(), tmp.getHeight()); }
public Dimension getPreferredSize() { Device device = DeviceFactory.getDevice(); if (device == null) { return new Dimension(0, 0); } return new Dimension(device.getDeviceDisplay().getFullWidth(), device.getDeviceDisplay().getFullHeight()); }
public void pointerPressed(int x, int y) { if (DeviceFactory.getDevice().hasPointerEvents()) { MIDletBridge.getMIDletAccess().getDisplayAccess().pointerPressed(x, y); } }
public void setFont(javax.microedition.lcdui.Font font) { currentFont = font; SwtFont tmpFont = (SwtFont)((SwtFontManager) DeviceFactory.getDevice().getFontManager()).getFont(currentFont); g.setFont(tmpFont.getFont()); }
public void pointerReleased(int x, int y) { if (DeviceFactory.getDevice().hasPointerEvents()) { MIDletBridge.getMIDletAccess().getDisplayAccess().pointerReleased(x, y); } }
public void pointerDragged(int x, int y) { if (DeviceFactory.getDevice().hasPointerMotionEvents()) { MIDletBridge.getMIDletAccess().getDisplayAccess().pointerDragged(x, y); } }
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); } }
protected void updateDevice() { devicePanel.init(); if (((DeviceDisplayImpl) DeviceFactory.getDevice().getDeviceDisplay()).isResizable()) { setResizable(true); resizeButton.setVisible(true); } else { setResizable(false); resizeButton.setVisible(false); } pack(); devicePanel.requestFocus(); }
public RGBImageFilter() { canFilterIndexColorModel = true; backgroundColor = ((J2SEDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay()).getBackgroundColor(); foregroundColor = ((J2SEDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay()).getForegroundColor(); Rr = foregroundColor.getRed() - backgroundColor.getRed(); Rg = foregroundColor.getGreen() - backgroundColor.getGreen(); Rb = foregroundColor.getBlue() - backgroundColor.getBlue(); }
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(); }
public void init() { dc.init(); remove(dc); Rectangle r = ((J2SEDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay()).getDisplayRectangle(); add(dc, new XYConstraints(r.x, r.y, -1, -1)); revalidate(); }