当前位置: 首页>>代码示例>>Java>>正文


Java ImageUtilities.icon2Image方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:TreeRootNode.java

示例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;        
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:PackageRootNode.java

示例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))
    );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:SnippetNodes.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:RepositoryBrowserPanel.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:MavenProjectNode.java

示例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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:ElementNode.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:ProjectNode.java

示例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;
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:WebBrowser.java

示例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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:ProjectsView.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:FileTreeView.java

示例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)));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:Nodes.java

示例12: getIcon

import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override
public Image getIcon(int arg0) {
    return ImageUtilities.icon2Image(pi.getIcon());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:AddDependencyUI.java

示例13: getIcon

import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override
public Image getIcon(int type) {
    return hasDelegate ?
        super.getIcon(type):
        ImageUtilities.icon2Image(result.getIcon());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:ExtProjectConvertorServices.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:44,代码来源:SerialDataNode.java

示例15: getIcon

import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override
public Image getIcon(int type) {
    return ImageUtilities.icon2Image(info.getIcon());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:View.java


注:本文中的org.openide.util.ImageUtilities.icon2Image方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。