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


Java ImageUtilities类代码示例

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


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

示例1: createActivateBreakpointsActionButton

import org.openide.util.ImageUtilities; //导入依赖的package包/类
@NbBundle.Messages({"CTL_DeactivateAllBreakpoints=Deactivate all breakpoints in current session",
                    "CTL_ActivateAllBreakpoints=Activate all breakpoints in current session",
                    "CTL_NoDeactivation=The current session does not allow to deactivate breakpoints",
                    "CTL_NoSession=No debugger session"})
public static AbstractButton createActivateBreakpointsActionButton() {
    ImageIcon icon = ImageUtilities.loadImageIcon(DEACTIVATED_LINE_BREAKPOINT, false);
    final JToggleButton button = new JToggleButton(icon);
    // ensure small size, just for the icon
    Dimension size = new Dimension(icon.getIconWidth() + 8, icon.getIconHeight() + 8);
    button.setPreferredSize(size);
    button.setMargin(new Insets(1, 1, 1, 1));
    button.setBorder(new EmptyBorder(button.getBorder().getBorderInsets(button)));
    button.setToolTipText(Bundle.CTL_DeactivateAllBreakpoints());
    button.setFocusable(false);
    final BreakpointsActivator ba = new BreakpointsActivator(button);
    button.addActionListener(ba);
    DebuggerManager.getDebuggerManager().addDebuggerListener(DebuggerManager.PROP_CURRENT_ENGINE, new DebuggerManagerAdapter() {
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            DebuggerEngine de = (DebuggerEngine) evt.getNewValue();
            ba.setCurrentEngine(de);
        }
    });
    ba.setCurrentEngine(DebuggerManager.getDebuggerManager().getCurrentEngine());
    return button;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:BreakpointsViewButtons.java

示例2: showWaitPanel

import org.openide.util.ImageUtilities; //导入依赖的package包/类
public void showWaitPanel() {
    if (!SwingUtilities.isEventDispatchThread()) {
        SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {
                if (!isLoading()) {
                    return;
                }
                showWaitPanel();
            }
            
        });
    }
    removeAll();
    if (waitIcon == null) {
        waitIcon = ImageUtilities.loadImageIcon("org/netbeans/modules/xml/text/navigator/resources/wait.gif", false); //NOI18N
    }
    msgLabel.setIcon(waitIcon);
    msgLabel.setHorizontalAlignment(SwingConstants.LEFT);
    msgLabel.setForeground(Color.BLACK);
    msgLabel.setText(NbBundle.getMessage(AbstractXMLNavigatorContent.class, "LBL_Wait"));
    add(emptyPanel, BorderLayout.NORTH);
    revalidate();
    repaint();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:AbstractXMLNavigatorContent.java

示例3: getJFXBadge

import org.openide.util.ImageUtilities; //导入依赖的package包/类
/**
 * Gets the badge
 * @return badge or null if badge icon does not exist
 */
@NullUnknown
private Image getJFXBadge() {
    Image img = badgeCache.get();
    if (img == null) {
        if(!EventQueue.isDispatchThread()) {
            img = ImageUtilities.loadImage(JFX_BADGE_PATH);
            badgeCache.set(img);
        } else {
            final Runnable runLoadIcon = new Runnable() {
                @Override
                public void run() {            
                    badgeCache.set(ImageUtilities.loadImage(JFX_BADGE_PATH));
                    cs.fireChange();
                }
            };
            final RequestProcessor RP = new RequestProcessor(JFXProjectIconAnnotator.class.getName());
            RP.post(runLoadIcon);
        }
    }
    return img;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:JFXProjectIconAnnotator.java

示例4: notifyWritePermissionProblem

import org.openide.util.ImageUtilities; //导入依赖的package包/类
@Messages({
    "# {0} - plugin_name",
    "inBackground_WritePermission=You don''t have permission to install plugin {0} into the installation directory.",
    "inBackground_WritePermission_Details=details", "cancel=Cancel", "install=Install anyway"})
private void notifyWritePermissionProblem(final OperationException ex, final UpdateElement culprit) {
    // lack of privileges for writing
    ActionListener onMouseClickAction = new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            ProblemPanel problem = new ProblemPanel(ex, culprit, false);
            problem.showWriteProblemDialog();
        }
    };
    String title = inBackground_WritePermission(culprit.getDisplayName());
    String description = inBackground_WritePermission_Details();
    NotificationDisplayer.getDefault().notify(title,
            ImageUtilities.loadImageIcon("org/netbeans/modules/autoupdate/ui/resources/error.png", false), // NOI18N
            description, onMouseClickAction, NotificationDisplayer.Priority.HIGH, NotificationDisplayer.Category.ERROR);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:InstallStep.java

示例5: getIcon

import org.openide.util.ImageUtilities; //导入依赖的package包/类
@Override
protected ImageIcon getIcon() {
    if (icon != null) {
        return icon;
    }
    synchronized (cache) {
        icon = cache.get(iconResource);
    }
    if (icon == null) {
        icon = ImageUtilities.loadImageIcon(iconResource, false);
    }
    synchronized (cache) {
        cache.put(iconResource, icon);
    }
    return icon;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:ValueItem.java

示例6: updateMessagePanel

import org.openide.util.ImageUtilities; //导入依赖的package包/类
@NbBundle.Messages({
    "IssuePanel.noSummary=Missing summary."
})
private void updateMessagePanel () {
    messagePanel.removeAll();
    if (noSummary) {
        JLabel noSummaryLabel = new JLabel();
        noSummaryLabel.setText(Bundle.IssuePanel_noSummary());
        String icon = "org/netbeans/modules/localtasks/resources/error.gif"; //NOI18N
        noSummaryLabel.setIcon(new ImageIcon(ImageUtilities.loadImage(icon)));
        messagePanel.add(noSummaryLabel);
    }
    if (noSummary) {
        messagePanel.setVisible(true);
        messagePanel.revalidate();
    } else {
        messagePanel.setVisible(false);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:TaskPanel.java

示例7: setErrorMessage

import org.openide.util.ImageUtilities; //导入依赖的package包/类
private void setErrorMessage(String msg, Boolean canContinue) {
    errorMessage.setForeground(nbErrorForeground);
    if (msg != null && msg.trim().length() > 0 && canContinue != null) {
        if (canContinue.booleanValue()) {
            errorMessage.setIcon(ImageUtilities.loadImageIcon(WARNING_GIF, false));
            errorMessage.setForeground(nbWarningForeground);
        } else {
            errorMessage.setIcon(ImageUtilities.loadImageIcon(ERROR_GIF, false));
        }
        errorMessage.setToolTipText(msg);
    } else {
        errorMessage.setIcon(null);
        errorMessage.setToolTipText(null);
    }
    
    errorMessage.setText(msg);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:PersistenceLibraryPanel.java

示例8: getToolbarPresenter

import org.openide.util.ImageUtilities; //导入依赖的package包/类
public static Component getToolbarPresenter(Action action) {
    JButton button = new JButton(action);
    button.setBorderPainted(false);
    button.setOpaque(false);
    button.setText(null);
    button.putClientProperty("hideActionText", Boolean.TRUE); // NOI18N
    Object icon = action.getValue(Action.SMALL_ICON);
    if (icon == null) {
        icon = ImageUtilities.loadImageIcon("org/netbeans/modules/dlight/terminal/action/local_term.png", false);// NOI18N
    }
    if (!(icon instanceof Icon)) {
        throw new IllegalStateException("No icon provided for " + action); // NOI18N
    }
    button.setDisabledIcon(ImageUtilities.createDisabledIcon((Icon) icon));
    return button;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:TerminalSupportImpl.java

示例9: getCloseTabPressedImage

import org.openide.util.ImageUtilities; //导入依赖的package包/类
private static Icon getCloseTabPressedImage() {
    if( null == closeTabPressedImage ) {
        String path = UIManager.getString("nb.close.tab.icon.pressed.name" ); //NOI18N
        if( null != path ) {
            closeTabPressedImage = ImageUtilities.loadImageIcon(path, true); // NOI18N
        }
    }
    if( null == closeTabPressedImage ) {
        if( isWindows8LaF() || isWindows10LaF() ) {
            closeTabPressedImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/win8_bigclose_pressed.png", true); // NOI18N
        } else if( isWindowsVistaLaF() ) {
            closeTabPressedImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/vista_close_pressed.png", true); // NOI18N
        } else if( isWindowsXPLaF() ) {
            closeTabPressedImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/xp_close_pressed.png", true); // NOI18N
        } else if( isWindowsLaF() ) {
            closeTabPressedImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/win_close_pressed.png", true); // NOI18N
        } else if( isAquaLaF() ) {
            closeTabPressedImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/mac_close_pressed.png", true); // NOI18N
        } else if( isGTKLaF() ) {
            closeTabPressedImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/gtk_close_pressed.png", true); // NOI18N
        } else {
            closeTabPressedImage = ImageUtilities.loadImageIcon("org/openide/awt/resources/metal_close_pressed.png", true); // NOI18N
        }
    }
    return closeTabPressedImage;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:CloseButtonFactory.java

示例10: getBaseIcon

import org.openide.util.ImageUtilities; //导入依赖的package包/类
@Override
protected ImageIcon getBaseIcon() {
    int level = getProtectionLevel(modifiers);
    ImageIcon cachedIcon = icon[level];
    if (cachedIcon != null) {
        return cachedIcon;
    }
    String iconPath = CONSTRUCTOR_PUBLIC;
    switch (level) {
        case PRIVATE_LEVEL:
            iconPath = CONSTRUCTOR_PRIVATE;
            break;
        case PACKAGE_LEVEL:
            iconPath = CONSTRUCTOR_PACKAGE;
            break;
        case PROTECTED_LEVEL:
            iconPath = CONSTRUCTOR_PROTECTED;
            break;
        case PUBLIC_LEVEL:
            iconPath = CONSTRUCTOR_PUBLIC;
            break;
    }
    ImageIcon newIcon = ImageUtilities.loadImageIcon(iconPath, false);
    icon[level] = newIcon;
    return newIcon;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:JavaCompletionItem.java

示例11: startAnnotation

import org.openide.util.ImageUtilities; //导入依赖的package包/类
private void startAnnotation(final Set<FileObject> files) {
    EventQueue.invokeLater(new Runnable() {
        @Override
        public void run() {
            lastEvent = System.currentTimeMillis();
            long time = System.currentTimeMillis();
            for (FileObject fo : files) {
                String name = fo.getNameExt();
                name = VersioningAnnotationProvider.getDefault().annotateNameHtml(name, Collections.singleton(fo));
                annotationsLabels.put(fo, name);
                Image image = ImageUtilities.assignToolTipToImage(VCSAnnotationProviderTestCase.IMAGE, fo.getNameExt());
                ImageUtilities.getImageToolTip(image);
                image = VersioningAnnotationProvider.getDefault().annotateIcon(image, 0, Collections.singleton(fo));
                annotationsIcons.put(fo, image);
            }
            time = System.currentTimeMillis() - time;
            if (time > 500) {
                ex = new Exception("Annotation takes more than 200ms");
            }
        }     
    });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:VCSAnnotationProviderTestCase.java

示例12: FiltersMenuButton

import org.openide.util.ImageUtilities; //导入依赖的package包/类
/** Creates a new instance of FiltersMenuButton */
public FiltersMenuButton( TaskFilter currentFilter ) {
    super( ImageUtilities.loadImageIcon("org/netbeans/modules/tasklist/ui/resources/filter.png", false), ImageUtilities.loadImageIcon("org/netbeans/modules/tasklist/ui/resources/filter_rollover.png", false), 4 );  //NOI18N
    taskManager = TaskManagerImpl.getInstance();
    
    updateState( currentFilter );

    addActionListener( new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            if( !isSelected() ) {
                taskManager.observe( taskManager.getScope(), TaskFilter.EMPTY );
            } else {
                openFilterEditor();
                updateState( taskManager.getFilter() );
            }
        }
    });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:FiltersMenuButton.java

示例13: createFilters

import org.openide.util.ImageUtilities; //导入依赖的package包/类
/** Creates filter descriptions and filters itself */
private FiltersManager createFilters() {
    FiltersDescription desc = new FiltersDescription();
    
    desc.addFilter(ATTRIBUTES_FILTER,
            NbBundle.getMessage(NavigatorContent.class, "LBL_ShowAttributes"),     //NOI18N
            NbBundle.getMessage(NavigatorContent.class, "LBL_ShowAttributesTip"),     //NOI18N
            showAttributes, ImageUtilities.loadImageIcon("org/netbeans/modules/xml/text/navigator/resources/a.png", false), //NOI18N
            null
            );
    desc.addFilter(CONTENT_FILTER,
            NbBundle.getMessage(NavigatorContent.class, "LBL_ShowContent"),     //NOI18N
            NbBundle.getMessage(NavigatorContent.class, "LBL_ShowContentTip"),     //NOI18N
            showContent, ImageUtilities.loadImageIcon("org/netbeans/modules/xml/text/navigator/resources/content.png", false), //NOI18N
            null
            );
    
    return FiltersDescription.createManager(desc);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:NavigatorContent.java

示例14: getTableCellRendererComponent

import org.openide.util.ImageUtilities; //导入依赖的package包/类
@Override
public Component getTableCellRendererComponent (
        JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
    JLabel renderComponent = (JLabel)super.getTableCellRendererComponent (table, value, isSelected, hasFocus, row, column);
    
    if (value instanceof Image) {
        Unit u = model.getUnitAtRow(table.convertRowIndexToModel(row));
        if (u instanceof Unit.Available) {
            Unit.Available a = (Unit.Available)u;
            renderComponent.setIcon(ImageUtilities.image2Icon(a.getSourceIcon()));
            renderComponent.setText ("");
            renderComponent.setHorizontalAlignment (SwingConstants.CENTER);
        }
        
    }
    Component retval = renderComponent;
    return retval;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:UnitTab.java

示例15: initComponents

import org.openide.util.ImageUtilities; //导入依赖的package包/类
private void initComponents() {
    setLayout (new BorderLayout ());
    contentComponent = new javax.swing.JPanel(new BorderLayout ());
    add (contentComponent, BorderLayout.CENTER);  //NOI18N
    JToolBar toolBar = new JToolBar(JToolBar.VERTICAL);
    toolBar.setFloatable(false);
    toolBar.setRollover(true);
    toolBar.setBorderPainted(true);
    if( "Aqua".equals(UIManager.getLookAndFeel().getID()) ) { //NOI18N
        toolBar.setBackground(UIManager.getColor("NbExplorerView.background")); //NOI18N
    }
    toolBar.setBorder(javax.swing.BorderFactory.createCompoundBorder(
            javax.swing.BorderFactory.createMatteBorder(0, 0, 0, 1,
            javax.swing.UIManager.getDefaults().getColor("Separator.background")),
            javax.swing.BorderFactory.createMatteBorder(0, 0, 0, 1,
            javax.swing.UIManager.getDefaults().getColor("Separator.foreground"))));
    add(toolBar, BorderLayout.WEST);
    JComponent buttonsPane = toolBar;
    viewModelListener = new ViewModelListener (
        name,
        contentComponent,
        buttonsPane,
        propertiesHelpID,
        ImageUtilities.loadImage(icon)
    );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:ViewComponent.java


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