本文整理汇总了Java中org.openide.util.ImageUtilities.icon2Image方法的典型用法代码示例。如果您正苦于以下问题:Java ImageUtilities.icon2Image方法的具体用法?Java ImageUtilities.icon2Image怎么用?Java ImageUtilities.icon2Image使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openide.util.ImageUtilities
的用法示例。
在下文中一共展示了ImageUtilities.icon2Image方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: computeIcon
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
/** Copied from PackageRootNode with modifications. */
private Image computeIcon(boolean opened, int type) {
Icon icon = g.getIcon(opened);
if (icon == null) {
Image image = opened ? super.getOpenedIcon(type) : super.getIcon(type);
return ImageUtilities.mergeImages(image, ImageUtilities.loadImage(PackageRootNode.PACKAGE_BADGE), 7, 7);
} else {
return ImageUtilities.icon2Image(icon);
}
}
示例2: computeIcon
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
private Image computeIcon( boolean opened, int type ) {
Image image;
Icon icon = group.getIcon( opened );
if ( icon == null ) {
image = opened ? getDataFolderNodeDelegate().getOpenedIcon( type ) :
getDataFolderNodeDelegate().getIcon( type );
image = ImageUtilities.mergeImages(image, ImageUtilities.loadImage(PACKAGE_BADGE), 7, 7);
}
else {
image = ImageUtilities.icon2Image(icon);
}
return image;
}
示例3: getIcon
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override
public Image getIcon(int type) {
if (nodeKind == null) {
return super.getIcon(type);
}
return ImageUtilities.icon2Image(
ElementIcons.getElementIcon(nodeKind, EnumSet.of(Modifier.PUBLIC, Modifier.STATIC))
);
}
示例4: findIcon
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
private Image findIcon (String key) {
Object obj = UIManager.get(key);
if (obj instanceof Image) {
return (Image)obj;
}
if (obj instanceof Icon) {
Icon icon = (Icon)obj;
return ImageUtilities.icon2Image(icon);
}
return null;
}
示例5: getIcon
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override
public Image getIcon(int param) {
Icon icon = info.getIcon();
if (icon == null) {
LOGGER.log(Level.WARNING, "no icon in {0}", info);
return super.getIcon(param);
}
return ImageUtilities.icon2Image(icon);
}
示例6: getIcon
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override
public Image getIcon(int type) {
if (description.getCustomIcon() != null) {
return ImageUtilities.icon2Image(description.getCustomIcon());
}
Icon icon = Icons.getElementIcon(description.getKind(), description.getModifiers());
if (icon != null) {
return ImageUtilities.icon2Image(icon);
} else {
return super.getIcon(type);
}
}
示例7: getIcon
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override
public Image getIcon(int type) {
if (cachedIcon == null) {
ProjectInformation info = getProjectInformation();
if (info != null) {
Icon icon = info.getIcon();
cachedIcon = ImageUtilities.icon2Image(icon);
}
else {
cachedIcon = ImageUtilities.loadImage(PROJECT_ICON);
}
}
return cachedIcon;
}
示例8: getIconImage
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
public Image getIconImage(boolean small) {
Image im = factoryDesc.getIconImage(small);
if (im == null) {
ImageIcon icon = ImageUtilities.loadImageIcon( getIconFile(getBrowserFamily(), small), true );
im = ImageUtilities.icon2Image( icon );
}
if (hasNetBeansIntegration() && factoryDesc.getBrowserFamily() != BrowserFamilyId.JAVAFX_WEBVIEW) {
// im = ImageUtilities.mergeImages(
// im,
// ImageUtilities.loadImage("org/netbeans/modules/web/browser/ui/resources/nb-badge.png"),
// 12, 12);
}
return im;
}
示例9: getIcon
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override
public Image getIcon(int type) {
Icon icon = info.getIcon();
if (icon == null) {
Logger.getLogger(ProjectsView.class.getName()).log(Level.WARNING, "Null project icon for {0}:{1}", //NOI18N
new Object[] { info.getDisplayName(), info.getProject() });
return getFolderIcon();
} else {
return ImageUtilities.icon2Image(icon);
}
}
示例10: getFolderIcon
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
private Image getFolderIcon (File file) {
FileObject fo = FileUtil.toFileObject(FileUtil.normalizeFile(file));
Icon icon = null;
if (fo != null) {
try {
ProjectManager.Result res = ProjectManager.getDefault().isProject2(fo);
if (res != null) {
icon = res.getIcon();
}
} catch (IllegalArgumentException ex) {
Logger.getLogger(FileTreeView.class.getName()).log(Level.INFO, null, ex);
}
}
return icon == null ? FileTreeView.getFolderIcon() : ImageUtilities.icon2Image(icon);
}
示例11: getIcon
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override
public Image getIcon(int type) {
return ImageUtilities.icon2Image(
ElementIcons.getElementIcon(
description.getHandle().getKind(),
EnumSet.noneOf(Modifier.class)));
}
示例12: getIcon
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override
public Image getIcon(int arg0) {
return ImageUtilities.icon2Image(pi.getIcon());
}
示例13: getIcon
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override
public Image getIcon(int type) {
return hasDelegate ?
super.getIcon(type):
ImageUtilities.icon2Image(result.getIcon());
}
示例14: initIcon
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
private Image initIcon (int type) {
Image beanInfoIcon = null;
try {
InstanceCookie ic = ic();
if (ic == null) return null;
Class<?> clazz = ic.instanceClass();
//Fixed bug #5610
//Class javax.swing.JToolBar$Separator does not have icon
//we will use temporarily icon from javax.swing.JSeparator
//New icon is requested.
String className = clazz.getName ();
BeanInfo bi;
if (
className.equals ("javax.swing.JSeparator") || // NOI18N
className.equals ("javax.swing.JToolBar$Separator") // NOI18N
) {
Class clazzTmp = Class.forName ("javax.swing.JSeparator"); // NOI18N
bi = Utilities.getBeanInfo (clazzTmp);
} else {
bi = Utilities.getBeanInfo (clazz);
}
if (bi != null) {
beanInfoIcon = bi.getIcon (type);
}
// Also specially handle SystemAction's.
if (SystemAction.class.isAssignableFrom (clazz)) {
SystemAction action = SystemAction.get (clazz.asSubclass(SystemAction.class));
if (beanInfoIcon == null) {
Icon icon = action.getIcon ();
if (icon != null) {
beanInfoIcon = ImageUtilities.icon2Image(icon);
}
}
}
} catch (Exception e) {
// Problem ==>> use default icon
Logger.getLogger(SerialDataNode.class.getName()).log(Level.WARNING, null, e);
}
return beanInfoIcon;
}
示例15: getIcon
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override
public Image getIcon(int type) {
return ImageUtilities.icon2Image(info.getIcon());
}