Codota Logo
org.microemu.device
Code IndexAdd Codota to your IDE (free)

How to use org.microemu.device

Best Java code snippets using org.microemu.device (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: org.microemu/microemu-javase

public void setInputMethodListener(InputMethodListener l) {
  super.setInputMethodListener(l);
  lastButton = null;
  lastButtonCharIndex = -1;
}

origin: org.microemu/microemu-javase

public Device getDevice() {
  return DeviceFactory.getDevice();
}
origin: org.microemu/microemu-javase-swing

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();
}
origin: org.microemu/microemu-javase-swt

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);
    }
  }
}
origin: org.microemu/microemu-javase-swing

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());
  }
}
origin: org.microemu/microemu-javase-swing

public Dimension getPreferredSize() {
  Device device = DeviceFactory.getDevice();
  if (device == null) {
    return new Dimension(0, 0);
  }
  return new Dimension(device.getDeviceDisplay().getFullWidth(), device.getDeviceDisplay().getFullHeight());
}
origin: org.microemu/microemu-javase-swing

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();
   }
}
origin: org.microemu/microemu-javase-swing

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);
  }
}
origin: org.microemu/microemu-javase-swt

public void setFont(javax.microedition.lcdui.Font font) 
{
  currentFont = font;
  SwtFont tmpFont = (SwtFont)((SwtFontManager) DeviceFactory.getDevice().getFontManager()).getFont(currentFont);
  g.setFont(tmpFont.getFont());
}
origin: org.microemu/microemu-javase

public void pointerReleased(int x, int y) {
  if (DeviceFactory.getDevice().hasPointerEvents()) {
    MIDletBridge.getMIDletAccess().getDisplayAccess().pointerReleased(x, y);
  }
}
origin: org.microemu/microemu-javase

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();
}
origin: org.microemu/microemu-javase-swing

public void setFont(javax.microedition.lcdui.Font font) {
  currentFont = font;
  J2SEFont tmpFont = (J2SEFont) ((J2SEFontManager) DeviceFactory.getDevice().getFontManager())
      .getFont(currentFont);
  g.setFont(tmpFont.getFont());
}
origin: org.microemu/microemu-javase-swing

  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;
  }
}
origin: org.microemu/microemu-javase-swing

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());
  }
}
origin: org.microemu/microemu-javase

public void pointerDragged(int x, int y) {
  if (DeviceFactory.getDevice().hasPointerMotionEvents()) {
    MIDletBridge.getMIDletAccess().getDisplayAccess().pointerDragged(x, y);
  }
}

origin: org.microemu/microemu-javase-swt

public Point computeSize(int wHint, int hHint, boolean changed)
{
  javax.microedition.lcdui.Image tmp = DeviceFactory.getDevice().getNormalImage();
  return new Point(tmp.getWidth(), tmp.getHeight());		
}
             
origin: org.microemu/microemu-javase

public void setDevice(Device device) {
  MIDletSystemProperties.setDevice(device);
  DeviceFactory.setDevice(device);
}
origin: org.microemu/microemu-javase-swing

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;
}
origin: org.microemu/microemu-javase

public void pointerPressed(int x, int y) {		
  if (DeviceFactory.getDevice().hasPointerEvents()) {
    MIDletBridge.getMIDletAccess().getDisplayAccess().pointerPressed(x, y);
  }
}
origin: org.microemu/microemu-javase-swing

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;
}
org.microemu.device

Most used classes

  • Device
  • DeviceFactory
  • InputMethod
  • InputMethodEvent
  • InputMethodListener
  • DeviceImpl,
  • PositionedImage,
  • Rectangle,
  • SoftButton,
  • DeviceDisplay,
  • FontManager,
  • ButtonDetaultDeviceKeyCodes,
  • ButtonName,
  • DeviceDisplayImpl,
  • Font,
  • InputMethodImpl,
  • Shape,
  • CommandManager,
  • FontManagerImpl
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now