/** * Free the managed resource if it hasn't already been done and if this is not a system color * */ public void dispose() { // System color and already disposed off colors don't need to be disposed! if ( !systemColor && !color.isDisposed() ) { color.dispose(); } }
if ( background != null && !background.isDisposed() ) { if ( control instanceof Button ) { Button b = (Button) control;
Object object = objects[index]; if ( object instanceof Color ) { if ( ( (Color) object ).isDisposed() ) { return;
@Override public Color getForegroundColor() { if (this.fScrollForegroundColor != null && this.fScrollForegroundColor.isDisposed()) { this.fScrollForegroundColor = null; } return this.fScrollForegroundColor; }
@Override public Color getBackgroundColor() { if (this.fScrollBackgroundColor != null && this.fScrollBackgroundColor.isDisposed()) { this.fScrollBackgroundColor = null; } return this.fScrollBackgroundColor; }
@Override public boolean isDisposed() { return( color.isDisposed()); }
public void dispose(Display display) { Map<RGB, Color> colorTable= fDisplayTable.get(display); if (colorTable != null) { Iterator<Color> e= colorTable.values().iterator(); while (e.hasNext()) { Color color= e.next(); if (color != null && !color.isDisposed()) color.dispose(); } } }
public Image getGradient(Color color1, Color color2, int realtheight, int theight, int marginHeight, Display display) { if (color1 == null || color1.isDisposed() || color2 == null || color2.isDisposed()) return null; AbstractImageDescriptor desc = new SimpleImageDescriptor(color1, color2, realtheight, theight, marginHeight); return getGradient(desc, display); }
public void dispose(Display display) { Map<RGB, Color> colorTable= fDisplayTable.get(display); if (colorTable != null) { Iterator<Color> e= colorTable.values().iterator(); while (e.hasNext()) { Color color= e.next(); if (color != null && !color.isDisposed()) color.dispose(); } } }
public void dispose(Display display) { Map colorTable= (Map) fDisplayTable.get(display); if (colorTable != null) { Iterator e= colorTable.values().iterator(); while (e.hasNext()) { Color color= (Color)e.next(); if (color != null && !color.isDisposed()) color.dispose(); } } }
public Image getGradient(Color color1, Color color2, int realtheight, int theight, int marginHeight, Display display) { if (color1 == null || color1.isDisposed() || color2 == null || color2.isDisposed()) return null; AbstractImageDescriptor desc = new SimpleImageDescriptor(color1, color2, realtheight, theight, marginHeight); return getGradient(desc, display); }
public Image getGradient(Color[] colors, int[] percents, int length, boolean vertical, Color bg, Display display) { if (colors.length == 0) return null; for (Color color : colors) if (color == null || color.isDisposed()) return null; if (bg != null && bg.isDisposed()) return null; AbstractImageDescriptor desc = new ComplexImageDescriptor(colors, length, percents, vertical, bg); return getGradient(desc, display); }
@Override public void runSupport() { if (!colorDefault.isDisposed()) AllocateColor.this.rgbDefault = colorDefault.getRGB(); else AllocateColor.this.rgbDefault = new RGB(0, 0, 0); } }, false);
public Image getSectionGradientImage(Color color1, Color color2, int realtheight, int theight, int marginHeight, Display display) { if (color1 == null || color1.isDisposed()) return null; AbstractImageDescriptor desc = new SimpleSectionGradientImageDescriptor(color1, color2, realtheight, theight, marginHeight); return getGradient(desc, display); }
@Override public void widgetDisposed(DisposeEvent event) { if (fStatusTextFont != null && !fStatusTextFont.isDisposed()) fStatusTextFont.dispose(); fStatusTextFont= null; if (fStatusTextForegroundColor != null && !fStatusTextForegroundColor.isDisposed()) fStatusTextForegroundColor.dispose(); fStatusTextForegroundColor= null; fTextFont= null; fShell= null; fText= null; }
@Override public void widgetDisposed(DisposeEvent event) { if (fStatusTextFont != null && !fStatusTextFont.isDisposed()) fStatusTextFont.dispose(); fStatusTextFont= null; if (fStatusTextForegroundColor != null && !fStatusTextForegroundColor.isDisposed()) fStatusTextForegroundColor.dispose(); fStatusTextForegroundColor= null; fTextFont= null; fShell= null; fText= null; }
public static int[] colorToIntArray(Color color) { if (color == null || color.isDisposed()) { return null; } return new int[] { color.getRed(), color.getGreen(), color.getBlue() }; }
@Override public void widgetDisposed(DisposeEvent event) { if (fStatusTextFont != null && !fStatusTextFont.isDisposed()) fStatusTextFont.dispose(); fStatusTextFont= null; if (fStatusTextForegroundColor != null && !fStatusTextForegroundColor.isDisposed()) fStatusTextForegroundColor.dispose(); fStatusTextForegroundColor= null; fTextFont= null; fShell= null; fText= null; }
/** * Returns a string containing a concise, human-readable * description of the receiver. * * @return a string representation of the receiver */ @Override public String toString () { if (isDisposed()) return "Color {*DISPOSED*}"; return "Color {" + getRed() + ", " + getGreen() + ", " + getBlue() + ", " + getAlpha() +"}"; }
/** * Returns a string containing a concise, human-readable * description of the receiver. * * @return a string representation of the receiver */ @Override public String toString () { if (isDisposed()) return "Color {*DISPOSED*}"; //$NON-NLS-1$ return "Color {" + getRed() + ", " + getGreen() + ", " + getBlue() + ", " + getAlpha() + "}"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ }