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