public void setInputMethodListener(InputMethodListener l) { super.setInputMethodListener(l); lastButton = null; lastButtonCharIndex = -1; }
public Device getDevice() { return DeviceFactory.getDevice(); }
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 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 Dimension getPreferredSize() { Device device = DeviceFactory.getDevice(); if (device == null) { return new Dimension(0, 0); } DeviceDisplayImpl deviceDisplay = (DeviceDisplayImpl) DeviceFactory.getDevice().getDeviceDisplay(); if (deviceDisplay.isResizable()) { return new Dimension(deviceDisplay.getFullWidth(), deviceDisplay.getFullHeight()); } else { javax.microedition.lcdui.Image img = device.getNormalImage(); return new Dimension(img.getWidth(), img.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 int filterRGB (int x, int y, int rgb) { int a = (rgb & 0xFF000000); int r = (rgb & 0x00FF0000) >>> 16; int g = (rgb & 0x0000FF00) >>> 8; int b = (rgb & 0x000000FF); int Y = (int)(Yr * r + Yg * g + Yb * b); if (Y > 127) { return a | ((J2SEDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay()).getBackgroundColor().getRGB(); } else { return a | ((J2SEDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay()).getForegroundColor().getRGB(); } }
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 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 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 setFont(javax.microedition.lcdui.Font font) { currentFont = font; J2SEFont tmpFont = (J2SEFont) ((J2SEFontManager) DeviceFactory.getDevice().getFontManager()) .getFont(currentFont); g.setFont(tmpFont.getFont()); }
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 void pointerDragged(int x, int y) { if (DeviceFactory.getDevice().hasPointerMotionEvents()) { MIDletBridge.getMIDletAccess().getDisplayAccess().pointerDragged(x, y); } }
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 void setDevice(Device device) { MIDletSystemProperties.setDevice(device); DeviceFactory.setDevice(device); }
public GrayImageFilter (double Yr, double Yg, double Yb) { this.Yr = Yr; this.Yg = Yg; this.Yb = Yb; canFilterIndexColorModel = true; Color backgroundColor = ((J2SEDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay()).getBackgroundColor(); Color foregroundColor = ((J2SEDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay()).getForegroundColor(); Rr = (backgroundColor.getRed() - foregroundColor.getRed()) / 256d; Rg = (backgroundColor.getGreen() - foregroundColor.getGreen()) / 256d; Rb = (backgroundColor.getBlue() - foregroundColor.getBlue()) / 256d; }
public void pointerPressed(int x, int y) { if (DeviceFactory.getDevice().hasPointerEvents()) { MIDletBridge.getMIDletAccess().getDisplayAccess().pointerPressed(x, y); } }
public int filterRGB (int x, int y, int rgb) { int a = (rgb & 0xFF000000); int r = (rgb & 0x00FF0000) >>> 16; int g = (rgb & 0x0000FF00) >>> 8; int b = (rgb & 0x000000FF); int Y = (int)(Yr * r + Yg * g + Yb * b) % 256; if (Y > 255) { Y = 255; } Color foregroundColor = ((J2SEDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay()).getForegroundColor(); r = (int) (Rr * Y) + foregroundColor.getRed(); g = (int) (Rg * Y) + foregroundColor.getGreen(); b = (int) (Rb * Y) + foregroundColor.getBlue(); return a | (r << 16) | (g << 8) | b; }