public javax.microedition.lcdui.Graphics getGraphics() { SwtDisplayGraphics displayGraphics = new SwtDisplayGraphics(new SwtGraphics(gc), this); displayGraphics.setColor(0x00000000); displayGraphics.setClip(0, 0, getWidth(), getHeight()); displayGraphics.translate(-displayGraphics.getTranslateX(), -displayGraphics.getTranslateY()); return displayGraphics; }
public void clipRect(int x, int y, int width, int height) { Rectangle rect = new Rectangle(x, y, width, height); if (rect.x < getClipX()) { rect.x = getClipX(); } if (rect.y < getClipY()) { rect.y = getClipY(); } if (x + width > getClipX() + getClipWidth()) { rect.width = getClipX() + getClipWidth() - rect.x; } else { rect.width = x + width - rect.x; } if (y + height > getClipY() + getClipHeight()) { rect.height = getClipY() + getClipHeight() - rect.y; } else { rect.height = y + height - rect.y; } setClip(rect.x, rect.y, rect.width, rect.height); }
public SwtMutableImage(int width, int height) { this.img = SwtDeviceComponent.createImage(width, height); this.gc = new GC(this.img); SwtDisplayGraphics displayGraphics = new SwtDisplayGraphics(new SwtGraphics(gc), this); displayGraphics.setColor(0x00ffffff); displayGraphics.fillRect(0, 0, width, height); }
ma.getDisplayAccess().paint(new SwtDisplayGraphics(g, getDisplayImage())); g.setFont(oldf); if (!(current instanceof Canvas)