當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。