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


Java ImageUtilities.loadImage方法代码示例

本文整理汇总了Java中org.openide.util.ImageUtilities.loadImage方法的典型用法代码示例。如果您正苦于以下问题:Java ImageUtilities.loadImage方法的具体用法?Java ImageUtilities.loadImage怎么用?Java ImageUtilities.loadImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openide.util.ImageUtilities的用法示例。


在下文中一共展示了ImageUtilities.loadImage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getIcon

import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
/** Provides an icon to be used for the layout node in Component
 * Inspector. Only 16x16 color icon is required.
 * @param type is one of BeanInfo constants: ICON_COLOR_16x16,
 *        ICON_COLOR_32x32, ICON_MONO_16x16, ICON_MONO_32x32
 * @return icon to be displayed for node in Component Inspector
 */
@Override
public Image getIcon(int type) {
    switch (type) {
        case BeanInfo.ICON_COLOR_16x16:
        case BeanInfo.ICON_MONO_16x16:
            return ImageUtilities.loadImage(iconURL);
        default:
            return ImageUtilities.loadImage(icon32URL);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:NullLayoutSupport.java

示例2: getIcon

import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
public Icon getIcon() {
    Image badge;

    if (overriddenFlag) {
        badge = ImageUtilities.loadImage("org/netbeans/modules/java/editor/resources/is-overridden-badge.png");
    } else {
        badge = ImageUtilities.loadImage("org/netbeans/modules/java/editor/resources/overrides-badge.png");
    }

    Image icon = ImageUtilities.icon2Image(ElementIcons.getElementIcon(imageKind, modifiers));

    return ImageUtilities.image2Icon(ImageUtilities.mergeImages(icon, badge, 16, 0));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:ElementDescription.java

示例3: create

import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
public static CurrentEditorScanningScope create() {
    return new CurrentEditorScanningScope(
            NbBundle.getBundle( CurrentEditorScanningScope.class ).getString( "LBL_CurrentEditorScope" ), //NOI18N)
            NbBundle.getBundle( CurrentEditorScanningScope.class ).getString( "HINT_CurrentEditorScope" ), //NOI18N
            ImageUtilities.loadImage( "org/netbeans/modules/tasklist/ui/resources/cur_editor_scope.png" ) //NOI18N
            );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:CurrentEditorScanningScope.java

示例4: annotateIcon

import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override
public Image annotateIcon(Image icon, int iconType, Set<? extends FileObject> files) {
    int n = files.size();
    if (n == 1) {
        FileObject fo = files.iterator().next();
        if (fo.isRoot()) {
            return ImageUtilities.loadImage(
                    "org/netbeans/modules/web/clientproject/ui/resources/remotefiles.png"); //NOI18N
        }
    }
    return icon;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:RemoteFSDecoratorUI.java

示例5: initialize

import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
/**
 * Initializes a specified presenter.
 *
 * @param  presenter  presenter to initialize
 */
private void initialize(AbstractButton presenter, boolean useIcons) {

    if (useIcons) {
        // set the presenter's icon:
        Image icon = ImageUtilities.loadImage(
                "org/netbeans/modules/url/urlObject.png");              //NOI18N
        try {
            FileObject file = dataObject.getPrimaryFile();
            icon = FileUIUtils.getImageDecorator(file.getFileSystem()).
                    annotateIcon(icon,
                        BeanInfo.ICON_COLOR_16x16,
                        dataObject.files());
        } catch (FileStateInvalidException fsie) {
            // OK, so we use the default icon
        }
        presenter.setIcon(new ImageIcon(icon));
    }

    /* set the presenter's text and ensure it is maintained up-to-date: */
    NameChangeListener listener = new NameChangeListener(presenter);
    presenter.addPropertyChangeListener(
            WeakListeners.propertyChange(listener, dataObject));
    updateName(presenter);
    /*
     * The above code works with the assumption that it is called
     * from the AWT event dispatching thread (it manipulates
     * the presenter's display name). The same applies to
     * NameChangeListener's method propertyChange(...).
     *
     * At least, both mentioned parts of code should be called from
     * the same thread since method updateText(...) is not thread-safe.
     */

    presenter.addActionListener(this);
    HelpCtx.setHelpIDString(presenter,
                            dataObject.getHelpCtx().getHelpID());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:43,代码来源:URLPresenter.java

示例6: 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:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:14,代码来源:ProjectNode.java

示例7: getIcon

import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
public Image getIcon (int type) {
    if (type == BeanInfo.ICON_COLOR_16x16 || type == BeanInfo.ICON_MONO_16x16) {
        return ImageUtilities.loadImage("org/netbeans/modules/dbschema/jdbcimpl/DBschemaDataIcon.gif"); //NOI18N
    } else {
        return ImageUtilities.loadImage("org/netbeans/modules/dbschema/jdbcimpl/DBschemaDataIcon32.gif"); //NOI18N
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:DBschemaDataLoaderBeanInfo.java

示例8: getIcon

import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override
public Image getIcon(int type) {
    if (type != BeanInfo.ICON_COLOR_16x16) {
        return null;
    }
    String resource;
    
    switch (docEl.getType()) {
        case XML_TAG:
        case XML_EMPTY_TAG:
            resource = TAG_16; 
            break;
        case XML_PI:
            resource = PI_16;
            break;
        case XML_CDATA:
            resource = CDATA_16;
            break;
        case XML_DOCTYPE:
            resource = DOCTYPE_16;
            break;
        default:
            // unsupported nodes
            throw new IllegalArgumentException();
    }
    return ImageUtilities.loadImage(resource, true);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:BreadcrumbProvider.java

示例9: getIcon

import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
/** Gets icon. */
@Override
public Image getIcon(int type) {
    return ImageUtilities.loadImage("org/netbeans/modules/pdf/PDFDataIcon.png"); // NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:PDFDataLoaderBeanInfo.java

示例10: getIcon

import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override
public Image getIcon(int i) {
    return ImageUtilities.loadImage("com/sun/hotspot/igv/coordinator/images/folder.png");
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:5,代码来源:FolderNode.java

示例11: getIcon

import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override
public Image getIcon(int type) {
    return ImageUtilities.loadImage("cz/cuni/amis/nb/pogamut/ut2004/server/AgentsNodeIcon.png");
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:5,代码来源:AgentsNode.java

示例12: getIcon

import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
private Image getIcon(boolean opened) {
    Image badge = ImageUtilities.loadImage(PF_BADGE, true); //NOI18N
    Image img = ImageUtilities.mergeImages(NodeUtils.getTreeFolderIcon(opened), badge, 8, 8);
    return img;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:ProjectFilesNode.java

示例13: getIcon

import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override
public Icon getIcon() {
    return new ImageIcon(ImageUtilities.loadImage("com/sun/hotspot/igv/settings/settings.png"));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:ViewOptionsCategory.java

示例14: loadAgentIcon

import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override
public Image loadAgentIcon() {
    return ImageUtilities.loadImage("cz/cuni/amis/nb/pogamut/unreal/agent/UTPlayer.png");
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:5,代码来源:UnrealBotNode.java

示例15: testPropertyMarking

import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
public void testPropertyMarking() throws Exception{
    if (!canRun) return;
    
    if (!checkGraphicsEnvironment()) {
        System.err.println("  Cannot run this test in a < 16 bit graphics environment");
    }
    custRen.setUpdatePolicy(custRen.UPDATE_ON_CONFIRMATION);
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            try {
                throwMe = null;
                custRen.getProperty().setValue("Value");
                custRen.refresh();
            } catch (Exception e) {
                throwMe = e;
            }
        }
    });
    
    if (throwMe != null) {
        Exception exc = throwMe;
        throwMe = null;
        throw exc;
    }
    
    
    requestFocus(custRen);
    
    typeKey(custRen, KeyEvent.VK_S);
    typeKey(custRen, KeyEvent.VK_N);
    typeKey(custRen, KeyEvent.VK_O);
    typeKey(custRen, KeyEvent.VK_R);
    typeKey(custRen, KeyEvent.VK_K);
    typeKey(custRen, KeyEvent.VK_E);
    typeKey(custRen, KeyEvent.VK_L);
    
    //The property marking image
    Image i = ImageUtilities.loadImage("org/openide/resources/propertysheet/invalid.gif");
    ImageIcon icon = new ImageIcon(i);
    int yOffset = (custRen.getHeight() / 2) - (icon.getIconHeight()/2);
    
    //        assertPixelFromImage(i, custRen, 7, 7, 7, yOffset + 7);
    assertImageMatch("Error icon should be painted for invalid value", i, custRen, 0, yOffset);
    
    requestFocus(custRen);
    
    //        SLEEP_LENGTH=1000;
    sleep();
    typeKey(custRen, KeyEvent.VK_M);
    typeKey(custRen, KeyEvent.VK_R);
    typeKey(custRen, KeyEvent.VK_F);
    typeKey(custRen, KeyEvent.VK_ENTER);
    pressKey(custRen, KeyEvent.VK_ENTER);
    pressKey(custRen, KeyEvent.VK_ENTER);
    custRen.commit();
    sleep();
    sleep();
    
    Icon icon2 = new ValueIcon();
    int yOffset2 = (custRen.getHeight() / 2) - (icon2.getIconHeight()/2);
    
    assertPixel("Supplied value icon should be drawn on panel, not the error marking icon, after committing a valid value.",
            custRen, Color.BLUE, icon2.getIconWidth() / 2, (icon2.getIconHeight() / 2) + yOffset2);
    
    requestFocus(custRen);
    
    typeKey(custRen, KeyEvent.VK_V);
    typeKey(custRen, KeyEvent.VK_A);
    typeKey(custRen, KeyEvent.VK_L);
    typeKey(custRen, KeyEvent.VK_U);
    typeKey(custRen, KeyEvent.VK_E);
    custRen.setEnteredValue("VALUE");
    pressKey(custRen, KeyEvent.VK_ENTER);
    custRen.commit();
    sleep();
    sleep();
    sleep();
    custRen.paintImmediately(0,0,custRen.getWidth(),custRen.getHeight());
    assertImageMatch("After reentering an invalid value, the icon should change back to the error icon", i, custRen, 0, yOffset);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:81,代码来源:EditableDisplayerTest.java


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