本文整理汇总了Java中org.eclipse.jface.resource.ColorDescriptor类的典型用法代码示例。如果您正苦于以下问题:Java ColorDescriptor类的具体用法?Java ColorDescriptor怎么用?Java ColorDescriptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ColorDescriptor类属于org.eclipse.jface.resource包,在下文中一共展示了ColorDescriptor类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getPreview
import org.eclipse.jface.resource.ColorDescriptor; //导入依赖的package包/类
@Override
public Image getPreview ( final int width, final int height )
{
final Point p = new Point ( width, height );
final Image img = this.previews.get ( p );
if ( img == null )
{
RGB rgb = getLineRenderer ().getLineColor ();
if ( rgb == null )
{
rgb = DEFAULT_COLOR;
}
final Color color = (Color)this.resourceManager.get ( ColorDescriptor.createFrom ( rgb ) );
final Image newImage = makePreview ( Display.getDefault (), getLineRenderer ().getLineAttributes (), color, p );
this.previews.put ( p, newImage );
return newImage;
}
return img;
}
开发者ID:eclipse,项目名称:neoscada,代码行数:21,代码来源:LineInput.java
示例2: getColor
import org.eclipse.jface.resource.ColorDescriptor; //导入依赖的package包/类
private Color getColor(Object element, boolean forground) {
IWorkbenchAdapter2 adapter = getAdapter2(element);
if (adapter == null) {
return null;
}
RGB descriptor = forground ? adapter.getForeground(element) : adapter.getBackground(element);
if (descriptor == null) {
return null;
}
try {
return resourceManager.createColor(ColorDescriptor.createFrom(descriptor));
} catch (Exception e) {
Log.log(e);
return null;
}
}
开发者ID:fabioz,项目名称:Pydev,代码行数:19,代码来源:CopiedWorkbenchLabelProvider.java
示例3: setBackground
import org.eclipse.jface.resource.ColorDescriptor; //导入依赖的package包/类
@Override
public void setBackground ( final RGB color )
{
if ( color != null )
{
this.gc.setBackground ( (Color)this.resourceManager.get ( ColorDescriptor.createFrom ( color ) ) );
}
else
{
this.gc.setBackground ( this.gc.getDevice ().getSystemColor ( SWT.COLOR_WIDGET_BACKGROUND ) );
}
}
开发者ID:eclipse,项目名称:neoscada,代码行数:13,代码来源:SWTGraphics.java
示例4: setForeground
import org.eclipse.jface.resource.ColorDescriptor; //导入依赖的package包/类
@Override
public void setForeground ( final RGB color )
{
if ( color != null )
{
this.gc.setForeground ( (Color)this.resourceManager.get ( ColorDescriptor.createFrom ( color ) ) );
}
else
{
this.gc.setForeground ( this.gc.getDevice ().getSystemColor ( SWT.COLOR_WIDGET_FOREGROUND ) );
}
}
开发者ID:eclipse,项目名称:neoscada,代码行数:13,代码来源:SWTGraphics.java
示例5: ColorUpdater
import org.eclipse.jface.resource.ColorDescriptor; //导入依赖的package包/类
public ColorUpdater ( final String name, final ResourceManager manager, final ColorDescriptor defaultColor )
{
this.name = name;
this.manager = manager;
this.defaultColor = defaultColor;
JFaceResources.getColorRegistry ().addListener ( this );
refresh ();
}
开发者ID:eclipse,项目名称:neoscada,代码行数:9,代码来源:ColorUpdater.java
示例6: getColor
import org.eclipse.jface.resource.ColorDescriptor; //导入依赖的package包/类
private Color getColor(Object element, boolean forground) {
IWorkbenchAdapter2 adapter = getAdapter2(element);
if (adapter == null) {
return null;
}
RGB descriptor = forground ? adapter.getForeground(element) : adapter.getBackground(element);
if (descriptor == null) {
return null;
}
return (Color) getResourceManager().get(ColorDescriptor.createFrom(descriptor));
}
开发者ID:heartsome,项目名称:translationstudio8,代码行数:13,代码来源:WorkbenchLabelProvider.java
示例7: setForeground
import org.eclipse.jface.resource.ColorDescriptor; //导入依赖的package包/类
@Override
public void setForeground ( final RGB color )
{
this.g.setForegroundColor ( (Color)this.resourceManager.get ( ColorDescriptor.createFrom ( color ) ) );
}
开发者ID:eclipse,项目名称:neoscada,代码行数:6,代码来源:Draw2DGraphics.java
示例8: setBackground
import org.eclipse.jface.resource.ColorDescriptor; //导入依赖的package包/类
@Override
public void setBackground ( final RGB color )
{
this.g.setBackgroundColor ( (Color)this.resourceManager.get ( ColorDescriptor.createFrom ( color ) ) );
}
开发者ID:eclipse,项目名称:neoscada,代码行数:6,代码来源:Draw2DGraphics.java
示例9: getColor
import org.eclipse.jface.resource.ColorDescriptor; //导入依赖的package包/类
private Color getColor( RGB rgb ) {
return resourceManager.createColor( ColorDescriptor.createFrom( rgb ) );
}
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:4,代码来源:JUnitTestRunListener.java
示例10: dispose
import org.eclipse.jface.resource.ColorDescriptor; //导入依赖的package包/类
public void dispose() {
colorManager.destroy(ColorDescriptor.createFrom(cellBackgroundColor));
}
开发者ID:smaccm,项目名称:smaccm,代码行数:4,代码来源:VariablesView.java
注:本文中的org.eclipse.jface.resource.ColorDescriptor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论