SwingDisplayComponent(SwingDeviceComponent deviceComponent) { this.deviceComponent = deviceComponent; setFocusable(false); addMouseListener(mouseListener); addMouseMotionListener(mouseMotionListener); addMouseWheelListener(mouseWheelListener); }
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()); } }
private void updateScaledImage(int scale, JFrame scaledLCDFrame) { J2SEMutableImage scaledImage = (J2SEMutableImage) ((SwingDisplayComponent) emulatorContext .getDisplayComponent()).getScaledDisplayImage(scale); ((ImageIcon) (((JLabel) scaledLCDFrame.getContentPane()).getIcon())).setImage(scaledImage.getImage()); ((JLabel) scaledLCDFrame.getContentPane()).repaint(); } };
int width = e.getX() - pressedPoint.x; int height = e.getY() - pressedPoint.y; Point p = deviceCoordinate(DeviceFactory.getDevice().getDeviceDisplay(), pressedPoint); buf.append(p.x).append(",").append(p.y).append(" ").append(width).append("x").append(height); Common.setStatusBar(buf.toString()); if (!initialPressedSoftButton.isPressed()) { initialPressedSoftButton.setPressed(true); repaintRequest(pb.x, pb.y, pb.width, pb.height); repaintRequest(pb.x, pb.y, pb.width, pb.height); Point p = deviceCoordinate(device.getDeviceDisplay(), e.getPoint()); inputMethod.pointerDragged(p.x, p.y);
fireDisplayRepaint(displayImage); repaint(x, y, width, height); } else { repaint(0, 0, displayImage.getWidth(), displayImage.getHeight());
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(); }
public SwingDeviceComponent() { dc = new SwingDisplayComponent(this); setLayout(new XYLayout()); addMouseListener(mouseListener); addMouseMotionListener(mouseMotionListener); }
initialPressedSoftButton = button; button.setPressed(true); repaintRequest(pb.x, pb.y, pb.width, pb.height); break; Point p = deviceCoordinate(device.getDeviceDisplay(), e.getPoint()); inputMethod.pointerPressed(p.x, p.y);
if (deviceDisplay.isResizable()) { deviceDisplay.setDisplayRectangle(new Rectangle(0, 0, devicePanel.getWidth(), devicePanel.getHeight())); ((SwingDisplayComponent) devicePanel.getDisplayComponent()).init(); MIDletAccess ma = MIDletBridge.getMIDletAccess(); if (ma == null) {
org.microemu.device.impl.Rectangle pb = initialPressedSoftButton.getPaintable(); if (pb != null) { repaintRequest(pb.x, pb.y, pb.width, pb.height); if (pb.contains(e.getX(), e.getY())) { MIDletAccess ma = MIDletBridge.getMIDletAccess(); Point p = deviceCoordinate(device.getDeviceDisplay(), e.getPoint()); inputMethod.pointerReleased(p.x, p.y);
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(); } } });