public void setColor(int RGB) { color = RGB; g.setForeground(g.getColor(filter.filterRGB(0, 0, new RGB((color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff)))); }
SwtDeviceDisplay deviceDisplay = (SwtDeviceDisplay) device.getDeviceDisplay(); if (pressed) { g.setForeground(g.getColor(new RGB(deviceDisplay .getForegroundColor().getRed(), deviceDisplay .getForegroundColor().getGreen(), deviceDisplay .getForegroundColor().getBlue()))); } else { g.setBackground(g.getColor(new RGB(deviceDisplay .getBackgroundColor().getRed(), deviceDisplay .getBackgroundColor().getGreen(), deviceDisplay g.setBackground(g.getColor(new RGB(deviceDisplay .getBackgroundColor().getRed(), deviceDisplay .getBackgroundColor().getGreen(), deviceDisplay .getBackgroundColor().getBlue()))); } else { g.setForeground(g.getColor(new RGB(deviceDisplay .getForegroundColor().getRed(), deviceDisplay .getForegroundColor().getGreen(), deviceDisplay
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(); } } }
g.setForeground(g.getColor(new RGB( foregroundColor.getRed(), foregroundColor.getGreen(),