本文整理匯總了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());
}