下面列出了怎么用javax.swing.plaf.metal.MetalIconFactory的API类实例代码及写法,或者点击链接到github查看源代码。
@Override
public void addCustomEntriesToTable(UIDefaults table) {
super.addCustomEntriesToTable(table);
final int internalFrameIconSize = 22;
table.put("InternalFrame.closeIcon", MetalIconFactory.
getInternalFrameCloseIcon(internalFrameIconSize));
table.put("InternalFrame.maximizeIcon", MetalIconFactory.
getInternalFrameMaximizeIcon(internalFrameIconSize));
table.put("InternalFrame.iconifyIcon", MetalIconFactory.
getInternalFrameMinimizeIcon(internalFrameIconSize));
table.put("InternalFrame.minimizeIcon", MetalIconFactory.
getInternalFrameAltMaximizeIcon(internalFrameIconSize));
table.put("ScrollBar.width", 21);
}
@Override
public void addCustomEntriesToTable(UIDefaults table) {
super.addCustomEntriesToTable(table);
final int internalFrameIconSize = 22;
table.put("InternalFrame.closeIcon", MetalIconFactory.
getInternalFrameCloseIcon(internalFrameIconSize));
table.put("InternalFrame.maximizeIcon", MetalIconFactory.
getInternalFrameMaximizeIcon(internalFrameIconSize));
table.put("InternalFrame.iconifyIcon", MetalIconFactory.
getInternalFrameMinimizeIcon(internalFrameIconSize));
table.put("InternalFrame.minimizeIcon", MetalIconFactory.
getInternalFrameAltMaximizeIcon(internalFrameIconSize));
table.put("ScrollBar.width", 21);
}
@Override
public void addCustomEntriesToTable(UIDefaults table) {
super.addCustomEntriesToTable(table);
final int internalFrameIconSize = 22;
table.put("InternalFrame.closeIcon", MetalIconFactory.
getInternalFrameCloseIcon(internalFrameIconSize));
table.put("InternalFrame.maximizeIcon", MetalIconFactory.
getInternalFrameMaximizeIcon(internalFrameIconSize));
table.put("InternalFrame.iconifyIcon", MetalIconFactory.
getInternalFrameMinimizeIcon(internalFrameIconSize));
table.put("InternalFrame.minimizeIcon", MetalIconFactory.
getInternalFrameAltMaximizeIcon(internalFrameIconSize));
table.put("ScrollBar.width", 21);
}
@Override
public void addCustomEntriesToTable(UIDefaults table) {
super.addCustomEntriesToTable(table);
final int internalFrameIconSize = 22;
table.put("InternalFrame.closeIcon", MetalIconFactory.
getInternalFrameCloseIcon(internalFrameIconSize));
table.put("InternalFrame.maximizeIcon", MetalIconFactory.
getInternalFrameMaximizeIcon(internalFrameIconSize));
table.put("InternalFrame.iconifyIcon", MetalIconFactory.
getInternalFrameMinimizeIcon(internalFrameIconSize));
table.put("InternalFrame.minimizeIcon", MetalIconFactory.
getInternalFrameAltMaximizeIcon(internalFrameIconSize));
table.put("ScrollBar.width", 21);
}
@Override
public void addCustomEntriesToTable(UIDefaults table) {
super.addCustomEntriesToTable(table);
final int internalFrameIconSize = 22;
table.put("InternalFrame.closeIcon", MetalIconFactory.
getInternalFrameCloseIcon(internalFrameIconSize));
table.put("InternalFrame.maximizeIcon", MetalIconFactory.
getInternalFrameMaximizeIcon(internalFrameIconSize));
table.put("InternalFrame.iconifyIcon", MetalIconFactory.
getInternalFrameMinimizeIcon(internalFrameIconSize));
table.put("InternalFrame.minimizeIcon", MetalIconFactory.
getInternalFrameAltMaximizeIcon(internalFrameIconSize));
table.put("ScrollBar.width", 21);
}
@Override
public void addCustomEntriesToTable(UIDefaults table) {
super.addCustomEntriesToTable(table);
final int internalFrameIconSize = 22;
table.put("InternalFrame.closeIcon", MetalIconFactory.
getInternalFrameCloseIcon(internalFrameIconSize));
table.put("InternalFrame.maximizeIcon", MetalIconFactory.
getInternalFrameMaximizeIcon(internalFrameIconSize));
table.put("InternalFrame.iconifyIcon", MetalIconFactory.
getInternalFrameMinimizeIcon(internalFrameIconSize));
table.put("InternalFrame.minimizeIcon", MetalIconFactory.
getInternalFrameAltMaximizeIcon(internalFrameIconSize));
table.put("ScrollBar.width", 21);
}
@Override
public void addCustomEntriesToTable(UIDefaults table) {
super.addCustomEntriesToTable(table);
final int internalFrameIconSize = 22;
table.put("InternalFrame.closeIcon", MetalIconFactory.
getInternalFrameCloseIcon(internalFrameIconSize));
table.put("InternalFrame.maximizeIcon", MetalIconFactory.
getInternalFrameMaximizeIcon(internalFrameIconSize));
table.put("InternalFrame.iconifyIcon", MetalIconFactory.
getInternalFrameMinimizeIcon(internalFrameIconSize));
table.put("InternalFrame.minimizeIcon", MetalIconFactory.
getInternalFrameAltMaximizeIcon(internalFrameIconSize));
table.put("ScrollBar.width", 21);
}
@Override
public void addCustomEntriesToTable(UIDefaults table) {
super.addCustomEntriesToTable(table);
final int internalFrameIconSize = 22;
table.put("InternalFrame.closeIcon", MetalIconFactory.
getInternalFrameCloseIcon(internalFrameIconSize));
table.put("InternalFrame.maximizeIcon", MetalIconFactory.
getInternalFrameMaximizeIcon(internalFrameIconSize));
table.put("InternalFrame.iconifyIcon", MetalIconFactory.
getInternalFrameMinimizeIcon(internalFrameIconSize));
table.put("InternalFrame.minimizeIcon", MetalIconFactory.
getInternalFrameAltMaximizeIcon(internalFrameIconSize));
table.put("ScrollBar.width", 21);
}
@Override
public void addCustomEntriesToTable(UIDefaults table) {
super.addCustomEntriesToTable(table);
final int internalFrameIconSize = 22;
table.put("InternalFrame.closeIcon", MetalIconFactory.
getInternalFrameCloseIcon(internalFrameIconSize));
table.put("InternalFrame.maximizeIcon", MetalIconFactory.
getInternalFrameMaximizeIcon(internalFrameIconSize));
table.put("InternalFrame.iconifyIcon", MetalIconFactory.
getInternalFrameMinimizeIcon(internalFrameIconSize));
table.put("InternalFrame.minimizeIcon", MetalIconFactory.
getInternalFrameAltMaximizeIcon(internalFrameIconSize));
table.put("ScrollBar.width", 21);
}
@Override
public void addCustomEntriesToTable(UIDefaults table) {
super.addCustomEntriesToTable(table);
final int internalFrameIconSize = 22;
table.put("InternalFrame.closeIcon", MetalIconFactory.
getInternalFrameCloseIcon(internalFrameIconSize));
table.put("InternalFrame.maximizeIcon", MetalIconFactory.
getInternalFrameMaximizeIcon(internalFrameIconSize));
table.put("InternalFrame.iconifyIcon", MetalIconFactory.
getInternalFrameMinimizeIcon(internalFrameIconSize));
table.put("InternalFrame.minimizeIcon", MetalIconFactory.
getInternalFrameAltMaximizeIcon(internalFrameIconSize));
table.put("ScrollBar.width", 21);
}
@Override
public void addCustomEntriesToTable(UIDefaults table) {
super.addCustomEntriesToTable(table);
final int internalFrameIconSize = 22;
table.put("InternalFrame.closeIcon", MetalIconFactory.
getInternalFrameCloseIcon(internalFrameIconSize));
table.put("InternalFrame.maximizeIcon", MetalIconFactory.
getInternalFrameMaximizeIcon(internalFrameIconSize));
table.put("InternalFrame.iconifyIcon", MetalIconFactory.
getInternalFrameMinimizeIcon(internalFrameIconSize));
table.put("InternalFrame.minimizeIcon", MetalIconFactory.
getInternalFrameAltMaximizeIcon(internalFrameIconSize));
table.put("ScrollBar.width", 21);
}
@Override
public void addCustomEntriesToTable(UIDefaults table) {
super.addCustomEntriesToTable(table);
final int internalFrameIconSize = 22;
table.put("InternalFrame.closeIcon", MetalIconFactory.
getInternalFrameCloseIcon(internalFrameIconSize));
table.put("InternalFrame.maximizeIcon", MetalIconFactory.
getInternalFrameMaximizeIcon(internalFrameIconSize));
table.put("InternalFrame.iconifyIcon", MetalIconFactory.
getInternalFrameMinimizeIcon(internalFrameIconSize));
table.put("InternalFrame.minimizeIcon", MetalIconFactory.
getInternalFrameAltMaximizeIcon(internalFrameIconSize));
table.put("ScrollBar.width", 21);
}
@Override
public void addCustomEntriesToTable(UIDefaults table) {
super.addCustomEntriesToTable(table);
final int internalFrameIconSize = 22;
table.put("InternalFrame.closeIcon", MetalIconFactory.
getInternalFrameCloseIcon(internalFrameIconSize));
table.put("InternalFrame.maximizeIcon", MetalIconFactory.
getInternalFrameMaximizeIcon(internalFrameIconSize));
table.put("InternalFrame.iconifyIcon", MetalIconFactory.
getInternalFrameMinimizeIcon(internalFrameIconSize));
table.put("InternalFrame.minimizeIcon", MetalIconFactory.
getInternalFrameAltMaximizeIcon(internalFrameIconSize));
table.put("ScrollBar.width", 21);
}
/**
* Displays a notification in the default notification UI containing
* information on the plugin's incompatibility with the current IDE's version
* of the JVM
*/
private static void registerIncompatabilityNotification() {
//These are the title, message and icon displayed in the notification area and within popup if user interacts with notification
final String incompatTitle = NbBundle.getMessage(Installer.class, "wlc-nbeditorconfig-version-error-title");
final String incompatMessage = NbBundle.getMessage(Installer.class, "wlc-nbeditorconfig-version-error-message");
final Icon incompatIcon = new MetalIconFactory.FileIcon16();
INSTALLER_LOGGER.log(Level.SEVERE, incompatMessage);
final ActionListener notificationInteractionListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
NotifyDescriptor.Message pluginIncompatiableMessage = new NotifyDescriptor.Message(incompatMessage, NotifyDescriptor.ERROR_MESSAGE);
DialogDisplayer.getDefault().notify(pluginIncompatiableMessage);
}
};
NotificationDisplayer.getDefault().notify(incompatTitle, incompatIcon, incompatMessage, notificationInteractionListener);
}
public void dragGestureRecognized(DragGestureEvent e) {
Object o = view.locationToObject(e.getComponent(), e.getDragOrigin());
if(o != null) {
if(e.getDragSource().isDragImageSupported()) {
if(FILE == null) {
FILE = Swing.iconToImage(MetalIconFactory.getTreeLeafIcon());
FOLDER = Swing.iconToImage(MetalIconFactory.getTreeFolderIcon());
}
BufferedImage image = model.isLeaf(o) ? FILE : FOLDER;
e.startDrag(DragSource.DefaultMoveDrop,
image,
new Point(image.getWidth() / 2, image.getHeight() / 2),
new StringSelection(o.toString()),
this);
} else
e.startDrag(DragSource.DefaultMoveDrop, // cursor
new StringSelection(o.toString()), // transferable
this); // drag source listener
}
}
LibraryNode(Library library)
{
this.library = library;
if(library.isStdLib()) {
icon = MetalIconFactory.getTreeHardDriveIcon();
} else {
icon = MetalIconFactory.getTreeFloppyDriveIcon();
}
}
public Component getListCellRendererComponent(JList list,
Object value,
int index,
boolean isSelected,
boolean cellHasFocus)
{
DefaultListCellRenderer result =
(DefaultListCellRenderer)super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
result.setIcon(tree.isLeaf(value) ?
MetalIconFactory.getTreeLeafIcon() :
MetalIconFactory.getTreeFolderIcon());
return result;
}
RootNode()
{
parent = null;
label = "FidoCadJ";
icon = MetalIconFactory.getTreeComputerIcon();
}
RootNode(String label)
{
parent=null;
this.label=label;
icon = MetalIconFactory.getTreeComputerIcon();
}