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 run() { SwtGraphics gc = new SwtGraphics(instance.getParent().getDisplay()); gc.setFont(font); stringWidth = gc.stringWidth(str); gc.dispose(); } }
public void run() { SwtGraphics gc = new SwtGraphics(instance.getParent().getDisplay()); gc.setFont(font); fontMetrics = gc.getFontMetrics(); gc.dispose(); } }
public void run() { SwtGraphics gc = new SwtGraphics(instance.getParent().getDisplay()); gc.setAntialias(antialiasing); gc.setFont(new Font(instance.getParent().getDisplay(), name, size, style)); font = gc.getFont(); gc.dispose(); } }
public SwtDisplayGraphics(SwtGraphics a_g, MutableImage a_image) { this.g = a_g; this.image = a_image; Device device = DeviceFactory.getDevice(); this.g.setBackground(g.getColor(new RGB( ((SwtDeviceDisplay) device.getDeviceDisplay()).getBackgroundColor().getRed(), ((SwtDeviceDisplay) device.getDeviceDisplay()).getBackgroundColor().getGreen(), ((SwtDeviceDisplay) device.getDeviceDisplay()).getBackgroundColor().getBlue()))); SwtFont tmpFont = (SwtFont) ((SwtFontManager) device.getFontManager()).getFont(currentFont); this.g.setFont(tmpFont.getFont()); if (device.getDeviceDisplay().isColor()) { this.filter = new RGBImageFilter(); } else { if (device.getDeviceDisplay().numColors() == 2) { this.filter = new BWImageFilter(); } else { this.filter = new GrayImageFilter(); } } }
Font oldf = g.getFont(); ma.getDisplayAccess().paint(new SwtDisplayGraphics(g, getDisplayImage())); g.setFont(oldf); if (!(current instanceof Canvas) || ((Canvas) current).getWidth() != displayRectangle.width
SwtFontManager fontManager = (SwtFontManager) device.getFontManager(); SwtFont buttonFont = (SwtFont) fontManager.getFont(font); g.setFont(buttonFont.getFont());