public void setFont(javax.microedition.lcdui.Font font) { currentFont = font; J2SEFont tmpFont = (J2SEFont) ((J2SEFontManager) DeviceFactory.getDevice().getFontManager()) .getFont(currentFont); g.setFont(tmpFont.getFont()); }
public void setFont(javax.microedition.lcdui.Font font) { currentFont = font; SwtFont tmpFont = (SwtFont)((SwtFontManager) DeviceFactory.getDevice().getFontManager()).getFont(currentFont); g.setFont(tmpFont.getFont()); }
public J2SEDisplayGraphics(java.awt.Graphics2D a_g, MutableImage a_image) // Andres Navarro { this.g = a_g; this.image = a_image; this.clip = a_g.getClipBounds(); Device device = DeviceFactory.getDevice(); J2SEFontManager fontManager = (J2SEFontManager) device.getFontManager(); J2SEFont tmpFont = (J2SEFont) fontManager.getFont(currentFont); this.g.setFont(tmpFont.getFont()); if (fontManager.getAntialiasing()) { this.g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); } else { this.g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF); } J2SEDeviceDisplay display = (J2SEDeviceDisplay) device.getDeviceDisplay(); if (display.isColor()) { if (display.backgroundColor.getRed() != 255 || display.backgroundColor.getGreen() != 255 || display.backgroundColor.getBlue() != 255 || display.foregroundColor.getRed() != 0 || display.foregroundColor.getGreen() != 0 || display.foregroundColor.getBlue() != 0) { this.filter = new RGBImageFilter(); } } else { if (display.numColors() == 2) { this.filter = new BWImageFilter(); } else { this.filter = new GrayImageFilter(); } } }
if (command != null) { if (font != null) { J2SEFontManager fontManager = (J2SEFontManager) device.getFontManager(); J2SEFont buttonFont = (J2SEFont) fontManager.getFont(font); g.setFont(buttonFont.getFont());
boolean textAntialiasing = ((SwtFontManager) DeviceFactory.getDevice().getFontManager()).getAntialiasing(); boolean graphicsAntialiasing = g.getAntialias(); if (textAntialiasing != graphicsAntialiasing) {
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(); } } }
if (command != null) { if (font != null) { SwtFontManager fontManager = (SwtFontManager) device.getFontManager(); SwtFont buttonFont = (SwtFont) fontManager.getFont(font); g.setFont(buttonFont.getFont());