public boolean setColor(RGB color) { RGB oldColor= fIndicatorColor; fIndicatorColor= color; if (color == null) return oldColor != null; if (oldColor != null) return !color.equals(oldColor); return true; }
@Override public boolean equals(Object obj) { if (obj instanceof RGBColorDescriptor) { RGBColorDescriptor other = (RGBColorDescriptor) obj; return other.color.equals(color) && other.originalColor == originalColor; } return false; }
@Override public boolean equals(Object obj) { if (obj instanceof RGBColorDescriptor) { RGBColorDescriptor other = (RGBColorDescriptor) obj; return other.color.equals(color) && other.originalColor == originalColor; } return false; }
public boolean setColor(RGB color) { RGB oldColor= fIndicatorColor; fIndicatorColor= color; if (color == null) return oldColor != null; if (oldColor != null) return !color.equals(oldColor); return true; }
public boolean equals(Object obj) { if (obj instanceof RGBColorDescriptor) { RGBColorDescriptor other = (RGBColorDescriptor) obj; return other.color.equals(color) && other.originalColor == originalColor; } return false; }
@Override public boolean equals(Object obj) { if (obj instanceof AbstractImageDescriptor) { AbstractImageDescriptor id = (AbstractImageDescriptor)obj; if (id.fRGBs.length == fRGBs.length) { boolean result = id.fLength == fLength; for (int i = 0; i < fRGBs.length && result; i++) { result = result && id.fRGBs[i].equals(fRGBs[i]); } return result; } } return false; }
@Override public boolean equals(Object obj) { if (obj instanceof AbstractImageDescriptor) { AbstractImageDescriptor id = (AbstractImageDescriptor)obj; if (id.fRGBs.length == fRGBs.length) { boolean result = id.fLength == fLength; for (int i = 0; i < fRGBs.length && result; i++) { result = result && id.fRGBs[i].equals(fRGBs[i]); } return result; } } return false; }
public void setColorValue(RGB rgb) { if (fColorValue.equals(rgb)) return; RGB oldrgb = fColorValue; fColorValue = rgb; firePropertyChange(new PropertyChangeEvent(this, fColorKey, oldrgb, rgb)); }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof CommRenderer.Builder) { CommRenderer.Builder that = (CommRenderer.Builder) o; return (this.reliableColor.equals(that.reliableColor())) && (this.unreliableColor.equals(that.unreliableColor())) && (this.viewOptions.equals(that.viewOptions())); } return false; }
private static boolean equals( Color color1, Color color2 ) { return color1.getRGB().equals( color2.getRGB() ); } }
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 checkForColorUpdate(Display display) { if (fIsUsingSystemBackground) { RGB bg= display.getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB(); if (!bg.equals(getBackground(display))) { updateColors(display); } } }
private boolean setForeground(final RGB rgb) { Color colorFG = getForeground(); boolean changed = colorFG == null || colorFG.isDisposed() || !colorFG.getRGB().equals(rgb); if (changed) { Utils.execSWTThread(new AERunnable() { @Override public void runSupport() { setForeground(ColorCache.getColor(Display.getCurrent(), rgb)); } }); } return changed; }
private boolean setForeground(final RGB rgb) { Color colorFG = getForegroundSWT(); boolean changed = colorFG == null || colorFG.isDisposed() || !colorFG.getRGB().equals(rgb); if (changed) { Utils.execSWTThread(new SWTRunnable() { @Override public void runWithDisplay(Display display) { setForeground(ColorCache.getColor(Display.getCurrent(), rgb)); } }); } return changed; }
/** * Sets the current value of the preference with the given name * in the given preference store. * * @param store the preference store * @param name the name of the preference * @param value the new current value of the preference */ public static void setValue(IPreferenceStore store, String name, RGB value) { RGB oldValue = getColor(store, name); if (oldValue == null || !oldValue.equals(value)) { store.putValue(name, StringConverter.asString(value)); store.firePropertyChangeEvent(name, oldValue, value); } } }
/** * Sets the current value of the preference with the given name * in the given preference store. * * @param store the preference store * @param name the name of the preference * @param value the new current value of the preference */ public static void setValue(IPreferenceStore store, String name, RGB value) { RGB oldValue = getColor(store, name); if (oldValue == null || !oldValue.equals(value)) { store.putValue(name, StringConverter.asString(value)); store.firePropertyChangeEvent(name, oldValue, value); } } }
/** * Sets the current value of the preference with the given name * in the given preference store. * * @param store the preference store * @param name the name of the preference * @param value the new current value of the preference */ public static void setValue(IPreferenceStore store, String name, RGB value) { RGB oldValue = getColor(store, name); if (oldValue == null || !oldValue.equals(value)) { store.putValue(name, StringConverter.asString(value)); store.firePropertyChangeEvent(name, oldValue, value); } } }
public boolean equals(Object object) { if(!(object instanceof RulePreferenceData)) { return false; } RulePreferenceData data = (RulePreferenceData)object; if( data.getPosition() == this.getPosition() & data.getBackgroundColor().equals(this.getBackgroundColor()) & data.getForegroundColor().equals(this.getForegroundColor()) & data.getRuleName().equals(this.getRuleName()) & data.getRuleValue().equals(this.getRuleValue()) & data.isCaseInsensitive() == this.isCaseInsensitive() & data.getMatchMode().equals(this.getMatchMode())) { return true; } return false; }
private void roundTripTestCase(int r, int g, int b) { RGB expected = new RGB(r, g, b); RGB yCbCr = ColorPicker.toYCbCr(expected); RGB roundTrip = ColorPicker.fromYCbCr(yCbCr); if (!expected.equals(roundTrip)) { // if they don't match exactly, allow a maximum delta of 1 for rounding errors int deltaR = Math.abs(roundTrip.red - expected.red); int deltaG = Math.abs(roundTrip.green - expected.green); int deltaB = Math.abs(roundTrip.blue - expected.blue); int maxDelta = Math.max(Math.max(deltaR, deltaG), deltaB); Assert.assertTrue(maxDelta <= 1); } } }
private void editColor(ColorDefinition definition, Display display) { if (definition == null) return; RGB currentColor = colorRegistry.getRGB(definition.getId()); ColorDialog colorDialog = new ColorDialog(display.getActiveShell()); colorDialog.setRGB(currentColor); RGB selectedColor = colorDialog.open(); if ((selectedColor != null) && (!selectedColor.equals(currentColor))) { setColorPreferenceValue(definition, selectedColor, false); setRegistryValue(definition, selectedColor); refreshElement(definition); } }