本文整理汇总了Java中org.eclipse.jface.resource.ResourceManager.createImage方法的典型用法代码示例。如果您正苦于以下问题:Java ResourceManager.createImage方法的具体用法?Java ResourceManager.createImage怎么用?Java ResourceManager.createImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.resource.ResourceManager
的用法示例。
在下文中一共展示了ResourceManager.createImage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ThemeColorBlock
import org.eclipse.jface.resource.ResourceManager; //导入方法依赖的package包/类
public ThemeColorBlock(StyleDefinition def, Device device, ResourceManager resourceManager) {
this.def = def;
for (ThemeColor color : def.getColors()) {
RGB rgb = color.getRGB();
if (!colorMap.containsKey(rgb)) {
colorMap.put(rgb, resourceManager.createColor(rgb));
}
}
upImage = resourceManager.createImage(RCPUtils.getImageDescriptor(ThemeColorBlock.class, "icons/up.gif"));
downImage = resourceManager.createImage(RCPUtils.getImageDescriptor(ThemeColorBlock.class, "icons/down.gif"));
}
示例2: create
import org.eclipse.jface.resource.ResourceManager; //导入方法依赖的package包/类
@Override
public void create() {
super.create();
setTitle("Connect to " + nvl(conf.getName(), conf.getPrimaryConnectionString()));
setMessage("Please provide your credentials");
ResourceManager resourceManager = new LocalResourceManager(JFaceResources.getResources(), getShell());
Image titleImage = resourceManager
.createImage(RCPUtils.getImageDescriptor(LoginDialog.class, "icons/yamcs_banner.png"));
setTitleImage(titleImage);
}
示例3: draw
import org.eclipse.jface.resource.ResourceManager; //导入方法依赖的package包/类
@Override
public void draw(ImageAttribute imageAttr, Graphics graphics, ResourceManager resourceManager) {
try {
Image img = resourceManager.createImage(buildImageDescriptor(imageAttr));
Point tlp = getTopLeftLocation(imageAttr);
graphics.drawImage(img, tlp);
} catch (IllegalActionException e) {
LOGGER.error("Error reading image for " + imageAttr.getFullName(), e);
}
}
示例4: getDimension
import org.eclipse.jface.resource.ResourceManager; //导入方法依赖的package包/类
@Override
protected Dimension getDimension(ImageAttribute imageAttr, ResourceManager resourceManager) {
try {
Image img = resourceManager.createImage(buildImageDescriptor(imageAttr));
return new Dimension(img.getBounds().width, img.getBounds().height);
} catch (IllegalActionException e) {
LOGGER.error("Error reading dimensions for " + imageAttr.getFullName(), e);
return new Dimension(0, 0);
}
}
示例5: findOrCreateImage
import org.eclipse.jface.resource.ResourceManager; //导入方法依赖的package包/类
private Image findOrCreateImage(final ImageDescriptor imageDescriptor, final ResourceManager resourceManager) {
if (imageDescriptor == null) { return null; }
Image image = (Image) resourceManager.find(imageDescriptor);
if (image == null) {
try {
image = resourceManager.createImage(imageDescriptor);
} catch (final DeviceResourceException e) {
// WorkbenchPlugin.log(e);
}
}
return image;
}