本文整理了Java中org.eclipse.swt.graphics.Color.isDisposed()
方法的一些代码示例,展示了Color.isDisposed()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Color.isDisposed()
方法的具体详情如下:
包路径:org.eclipse.swt.graphics.Color
类名称:Color
方法名:isDisposed
[英]Returns true
if the color has been disposed, and false
otherwise.
This method gets the dispose state for the color. When a color has been disposed, it is an error to invoke any other method (except #dispose()) using the color.
[中]如果颜色已被处理,则返回true
,否则返回false
。
此方法获取颜色的dispose状态。处理颜色后,使用颜色调用任何其他方法(除了#dispose())都是错误的。
代码示例来源:origin: pentaho/pentaho-kettle
/**
* 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();
}
}
代码示例来源:origin: pentaho/pentaho-kettle
if ( background != null && !background.isDisposed() ) {
if ( control instanceof Button ) {
Button b = (Button) control;
代码示例来源:origin: pentaho/pentaho-kettle
Object object = objects[index];
if ( object instanceof Color ) {
if ( ( (Color) object ).isDisposed() ) {
return;
代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.css.swt
@Override
public Color getForegroundColor() {
if (this.fScrollForegroundColor != null && this.fScrollForegroundColor.isDisposed()) {
this.fScrollForegroundColor = null;
}
return this.fScrollForegroundColor;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.css.swt
@Override
public Color getBackgroundColor() {
if (this.fScrollBackgroundColor != null && this.fScrollBackgroundColor.isDisposed()) {
this.fScrollBackgroundColor = null;
}
return this.fScrollBackgroundColor;
}
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public boolean
isDisposed()
{
return( color.isDisposed());
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
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();
}
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.forms
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);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
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();
}
}
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
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();
}
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms
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);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms
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);
}
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void runSupport() {
if (!colorDefault.isDisposed())
AllocateColor.this.rgbDefault = colorDefault.getRGB();
else
AllocateColor.this.rgbDefault = new RGB(0, 0, 0);
}
}, false);
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.forms
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);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
@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;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text
@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;
}
代码示例来源:origin: BiglySoftware/BiglyBT
public static int[] colorToIntArray(Color color) {
if (color == null || color.isDisposed()) {
return null;
}
return new int[] {
color.getRed(),
color.getGreen(),
color.getBlue()
};
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.editors
@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;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
/**
* 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() +"}";
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
/**
* 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$
}
内容来源于网络,如有侵权,请联系作者删除!