public void widgetSelected( SelectionEvent e ) { ColorDialog cd = new ColorDialog( shell ); cd.setText( BaseMessages.getString( PKG, "NotePadDialog.Font.Color.Dialog.Label" ) ); cd.setRGB( wBorderColor.getBackground().getRGB() ); RGB newColor = cd.open(); if ( newColor == null ) { return; } borderColor.dispose(); borderColor = new Color( shell.getDisplay(), newColor ); wBorderColor.setBackground( borderColor ); } } );
public void widgetSelected( SelectionEvent e ) { ColorDialog cd = new ColorDialog( shell ); cd.setText( BaseMessages.getString( PKG, "NotePadDialog.Font.Color.Dialog.Label" ) ); cd.setRGB( wFontColor.getBackground().getRGB() ); RGB newColor = cd.open(); if ( newColor == null ) { return; } fontColor.dispose(); fontColor = new Color( shell.getDisplay(), newColor ); wFontColor.setBackground( fontColor ); refreshTextNote(); } } );
public void widgetSelected( SelectionEvent e ) { ColorDialog cd = new ColorDialog( shell ); cd.setText( BaseMessages.getString( PKG, "NotePadDialog.Font.Color.Dialog.Label" ) ); cd.setRGB( wBackGroundColor.getBackground().getRGB() ); RGB newColor = cd.open(); if ( newColor == null ) { return; } bgColor.dispose(); bgColor = new Color( shell.getDisplay(), newColor ); wBackGroundColor.setBackground( bgColor ); refreshTextNote(); } } );
public void getData() { fixedFontData = props.getFixedFont(); fixedFont = new Font( display, fixedFontData ); graphFontData = props.getGraphFont(); graphFont = new Font( display, graphFontData ); noteFontData = props.getNoteFont(); noteFont = new Font( display, noteFontData ); backgroundRGB = props.getBackgroundRGB(); if ( backgroundRGB == null ) { backgroundRGB = display.getSystemColor( SWT.COLOR_WIDGET_BACKGROUND ).getRGB(); } background = new Color( display, backgroundRGB ); graphColorRGB = props.getGraphColorRGB(); graphColor = new Color( display, graphColorRGB ); tabColorRGB = props.getTabColorRGB(); tabColor = new Color( display, tabColorRGB ); }
AbstractImageDescriptor(Color[] colors, int length) { fRGBs = new RGB[colors.length]; for (int i = 0; i < colors.length; i++) { Color color = colors[i]; fRGBs[i] = color == null ? null : color.getRGB(); } fLength = length; }
AbstractImageDescriptor(Color[] colors, int length) { fRGBs = new RGB[colors.length]; for (int i = 0; i < colors.length; i++) { Color color = colors[i]; fRGBs[i] = color == null ? null : color.getRGB(); } fLength = length; }
/** * Creates a new RGBColorDescriptor that describes an existing color. * * @since 3.1 * * @param originalColor a color to describe */ public RGBColorDescriptor(Color originalColor) { this(originalColor.getRGB()); this.originalColor = originalColor; }
@Override public Object convert ( final Object fromObject ) { return ( (Color)fromObject ).getRGB (); }
/** * Creates a new RGBColorDescriptor that describes an existing color. * * @since 3.1 * * @param originalColor a color to describe */ public RGBColorDescriptor(Color originalColor) { this(originalColor.getRGB()); this.originalColor = originalColor; }
public void startDocument() throws SAXException { ElementState elementState = state.push(new ElementState(null, "<document>", new FontState(), getOffset())); //$NON-NLS-1$ elementState.fontState.foreground = defaultForeground == null ? null : defaultForeground.getRGB(); elementState.fontState.background = defaultBackground == null ? null : defaultBackground.getRGB(); }
@Override public void runSupport() { if (!colorDefault.isDisposed()) AllocateColor.this.rgbDefault = colorDefault.getRGB(); else AllocateColor.this.rgbDefault = new RGB(0, 0, 0); } }, false);
/** * Returns the RGB value of the system color represented by the code * argument, as defined in <code>SWT</code> class. * * @param code * the system color constant as defined in <code>SWT</code> * class. * @return the RGB value of the system color */ public RGB getSystemColor(int code) { return getDisplay().getSystemColor(code).getRGB(); }
private void initializeDefaultColors() { // TODO This is temporary. // These should be initialized by the workbench theme, but not yet. // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=133731 Display display = Display.getCurrent(); colorRegistry.put(JFacePreferences.CONTENT_ASSIST_BACKGROUND_COLOR, display.getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB()); colorRegistry.put(JFacePreferences.CONTENT_ASSIST_FOREGROUND_COLOR, display.getSystemColor(SWT.COLOR_LIST_FOREGROUND).getRGB()); } }
public void setWidgetNormalShadowColor(Color color) { widgetNormalShadow = color; RGB white = Display.getCurrent().getSystemColor(SWT.COLOR_WHITE).getRGB(); navigationElementShadowStroke = factory.getColors().createColor("TabbedPropertyList.shadowStroke", //$NON-NLS-1$ FormColors.blend(white, widgetNormalShadow.getRGB(), 55)); }
private void putColor(String property, RGB setting) { Color oldColor = fColorTable.get(property); if (oldColor != null) { if (oldColor.getRGB().equals(setting)) return; oldColor.dispose(); } fColorTable.put(property, new Color(Display.getCurrent(), setting)); }
private void setStatusLabelColors(Color foreground, Color background) { if (foreground == null || background == null) return; if (fStatusLabelForeground != null) { fStatusLabelForeground.dispose(); } fStatusLabelForeground = new Color(fStatusLabel.getDisplay(), Colors.blend(background.getRGB(), foreground.getRGB(), 0.56f)); fStatusLabel.setForeground(fStatusLabelForeground); fStatusLabel.setBackground(background); }
@Override protected void setForeground(Color color) { getControl().setForeground(color); fForegroundColorRGB= color.getRGB(); refresh(); }
static Image createNewTransparentImg(Display d, int w, int h) { final Color bg = d.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND); final PaletteData palette = new PaletteData(new RGB[] {bg.getRGB()}); final ImageData sourceData = new ImageData(w, h, 1, palette); if (IS_MAC_OR_WINDOWS) { sourceData.transparentPixel = 0; } return new Image(d, sourceData); }
private void createTwistieColors() { RGB rgb = getColor(IFormColors.TITLE).getRGB(); RGB white = getSystemColor(SWT.COLOR_WHITE); createColor(TB_TOGGLE, rgb); rgb = blend(rgb, white, 60); createColor(TB_TOGGLE_HOVER, rgb); }
/** * Allocates colors for the following keys: BORDER, SEPARATOR and * TITLE. Subclasses can override to allocate these colors differently. */ protected void initializeColorTable() { createTitleColor(); createColor(IFormColors.SEPARATOR, getColor(IFormColors.TITLE).getRGB()); RGB black = getSystemColor(SWT.COLOR_BLACK); RGB borderRGB = getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT); createColor(IFormColors.BORDER, blend(borderRGB, black, 80)); }