public void componentResized(ComponentEvent e) { count++; DeviceDisplayImpl deviceDisplay = (DeviceDisplayImpl) DeviceFactory.getDevice().getDeviceDisplay(); if (deviceDisplay.isResizable()) { deviceDisplay.setDisplayRectangle(new Rectangle(0, 0, devicePanel.getWidth(), devicePanel.getHeight())); ((SwingDisplayComponent) devicePanel.getDisplayComponent()).init(); MIDletAccess ma = MIDletBridge.getMIDletAccess(); if (da != null) { da.sizeChanged(); deviceDisplay.repaint(0, 0, deviceDisplay.getFullWidth(), deviceDisplay.getFullHeight()); statusBarListener.statusBarChanged("New size: " + deviceDisplay.getFullWidth() + "x" + deviceDisplay.getFullHeight()); synchronized (statusBarListener) { if (timer == null) {
private Image loadImage(ClassLoader classLoader, String base, String src) throws IOException { URL url = getResourceUrl(classLoader, base, src); return ((DeviceDisplayImpl) getDeviceDisplay()).createSystemImage(url); }
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()); } }
deviceDisplay.setResizable(true); } else { deviceDisplay.setResizable(false); XMLElement tmp_display = (XMLElement) e_display.nextElement(); if (tmp_display.getName().equals("numcolors")) { deviceDisplay.setNumColors(Integer.parseInt(tmp_display.getContent())); } else if (tmp_display.getName().equals("iscolor")) { deviceDisplay.setIsColor(parseBoolean(tmp_display.getContent())); } else if (tmp_display.getName().equals("numalphalevels")) { deviceDisplay.setNumAlphaLevels(Integer.parseInt(tmp_display.getContent())); } else if (tmp_display.getName().equals("background")) { deviceDisplay.setBackgroundColor(new Color(Integer.parseInt(tmp_display.getContent(), 16))); } else if (tmp_display.getName().equals("foreground")) { deviceDisplay.setForegroundColor(new Color(Integer.parseInt(tmp_display.getContent(), 16))); } else if (tmp_display.getName().equals("rectangle")) { Rectangle rect = getRectangle(tmp_display); if (deviceDisplay.isResizable()) { rect.x = 0; rect.y = 0; deviceDisplay.setDisplayRectangle(rect); } else if (tmp_display.getName().equals("paintable")) { deviceDisplay.setDisplayPaintable(getRectangle(tmp_display)); SoftButton icon = deviceDisplay.createSoftButton(skinVersion, tmp_display .getStringAttribute("name"), getRectangle(tmp_display.getChild("paintable")), loadImage( classLoader, base, tmp_display.getStringAttribute("src")), loadImage(classLoader, base,
app.deviceEntry = app.selectDevicePanel.getSelectedDeviceEntry(); DeviceDisplayImpl deviceDisplay = (DeviceDisplayImpl) DeviceFactory.getDevice().getDeviceDisplay(); if (deviceDisplay.isResizable()) { Rectangle size = Config.getDeviceEntryDisplaySize(app.deviceEntry); if (size != null) { deviceDisplay.setDisplayRectangle(size);
private void parseInput(XMLElement tmp) { DeviceDisplayImpl deviceDisplay = (DeviceDisplayImpl) getDeviceDisplay(); boolean resizable = deviceDisplay.isResizable(); deviceDisplay.createButton(skinVersion, tmp_keyboard.getStringAttribute("name"), shape, keyCode, tmp_keyboard.getStringAttribute("key"), tmp_keyboard .getStringAttribute("keyboardChars"), inputToChars, tmp_keyboard SoftButton button = deviceDisplay.createSoftButton(skinVersion, tmp_keyboard.getStringAttribute("name"), shape, keyCode, tmp_keyboard.getStringAttribute("key"), paintable,
int width; int height; if (((DeviceDisplayImpl) device.getDeviceDisplay()).isResizable()) { width = device.getDeviceDisplay().getFullWidth(); height = device.getDeviceDisplay().getFullHeight();
DeviceDisplayImpl deviceDisplay = (DeviceDisplayImpl) DeviceFactory.getDevice().getDeviceDisplay(); if (overrideDeviceWidth != -1 && overrideDeviceHeight != -1) { deviceDisplay.setDisplayRectangle(new Rectangle(0, 0, overrideDeviceWidth, overrideDeviceHeight));
if (deviceDisplay.isResizable()) { Rectangle size = Config.getDeviceEntryDisplaySize(entry); if (size != null) { deviceDisplay.setDisplayRectangle(size);
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 void actionPerformed(ActionEvent ev) { if (resizeDeviceDisplayDialog == null) { resizeDeviceDisplayDialog = new ResizeDeviceDisplayDialog(); } DeviceDisplayImpl deviceDisplay = (DeviceDisplayImpl) DeviceFactory.getDevice().getDeviceDisplay(); resizeDeviceDisplayDialog.setDeviceDisplaySize(deviceDisplay.getFullWidth(), deviceDisplay .getFullHeight()); if (SwingDialogWindow.show(Main.this, "Enter new size...", resizeDeviceDisplayDialog, true)) { deviceDisplay.setDisplayRectangle(new Rectangle(0, 0, resizeDeviceDisplayDialog .getDeviceDisplayWidth(), resizeDeviceDisplayDialog.getDeviceDisplayHeight())); ((SwingDisplayComponent) devicePanel.getDisplayComponent()).init(); MIDletAccess ma = MIDletBridge.getMIDletAccess(); if (ma == null) { return; } DisplayAccess da = ma.getDisplayAccess(); if (da != null) { da.sizeChanged(); deviceDisplay.repaint(0, 0, deviceDisplay.getFullWidth(), deviceDisplay.getFullHeight()); } pack(); } } });
if (tmp.getName().equals("system-properties")) { parseSystemProperties(tmp); } else if (tmp.getName().equals("img") && !((DeviceDisplayImpl) getDeviceDisplay()).isResizable()) { try { if (tmp.getStringAttribute("name").equals("normal")) {
return; if (((DeviceDisplayImpl) device.getDeviceDisplay()).isResizable()) { return;
if (((DeviceDisplayImpl) device.getDeviceDisplay()).isResizable()) { resize(device.getDeviceDisplay().getFullWidth(), device.getDeviceDisplay().getFullHeight()); } else {