FileDocCategorySizeDatePackage
MetalIconFactory.javaAPI DocJava SE 6 API85136Tue Jun 10 00:26:50 BST 2008javax.swing.plaf.metal

MetalIconFactory

public class MetalIconFactory extends Object implements Serializable
Factory object that vends Icons for the JavaTM look and feel (Metal). These icons are used extensively in Metal via the defaults mechanism. While other look and feels often use GIFs for icons, creating icons in code facilitates switching to other themes.

Each method in this class returns either an Icon or null, where null implies that there is no default icon.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see {@link java.beans.XMLEncoder}.

version
1.64 11/17/05
author
Michael C. Albers

Fields Summary
private static Icon
fileChooserDetailViewIcon
private static Icon
fileChooserHomeFolderIcon
private static Icon
fileChooserListViewIcon
private static Icon
fileChooserNewFolderIcon
private static Icon
fileChooserUpFolderIcon
private static Icon
internalFrameAltMaximizeIcon
private static Icon
internalFrameCloseIcon
private static Icon
internalFrameDefaultMenuIcon
private static Icon
internalFrameMaximizeIcon
private static Icon
internalFrameMinimizeIcon
private static Icon
radioButtonIcon
private static Icon
treeComputerIcon
private static Icon
treeFloppyDriveIcon
private static Icon
treeHardDriveIcon
private static Icon
menuArrowIcon
private static Icon
menuItemArrowIcon
private static Icon
checkBoxMenuItemIcon
private static Icon
radioButtonMenuItemIcon
private static Icon
checkBoxIcon
private static Icon
oceanHorizontalSliderThumb
private static Icon
oceanVerticalSliderThumb
public static final boolean
DARK
public static final boolean
LIGHT
private static final Dimension
folderIcon16Size
private static final Dimension
fileIcon16Size
private static final Dimension
treeControlSize
private static final Dimension
menuArrowIconSize
private static final Dimension
menuCheckIconSize
private static final int
xOff
Constructors Summary
Methods Summary
public static javax.swing.IcongetCheckBoxIcon()
Returns a checkbox icon.

since
1.3

	if (checkBoxIcon == null) {
	    checkBoxIcon = new CheckBoxIcon();
	}
	return checkBoxIcon;
    
public static javax.swing.IcongetCheckBoxMenuItemIcon()

	if (checkBoxMenuItemIcon == null) {
	    checkBoxMenuItemIcon = new CheckBoxMenuItemIcon();
	}
	return checkBoxMenuItemIcon;
    
public static javax.swing.IcongetFileChooserDetailViewIcon()


    // Accessor functions for Icons. Does the caching work.
        
	if (fileChooserDetailViewIcon == null) {
	    fileChooserDetailViewIcon = new FileChooserDetailViewIcon();
	}
	return fileChooserDetailViewIcon;
    
public static javax.swing.IcongetFileChooserHomeFolderIcon()

	if (fileChooserHomeFolderIcon == null) {
	    fileChooserHomeFolderIcon = new FileChooserHomeFolderIcon();
	}
	return fileChooserHomeFolderIcon;
    
public static javax.swing.IcongetFileChooserListViewIcon()

	if (fileChooserListViewIcon == null) {
	    fileChooserListViewIcon = new FileChooserListViewIcon();
	}
	return fileChooserListViewIcon;
    
public static javax.swing.IcongetFileChooserNewFolderIcon()

	if (fileChooserNewFolderIcon == null) {
	    fileChooserNewFolderIcon = new FileChooserNewFolderIcon();
	}
	return fileChooserNewFolderIcon;
    
public static javax.swing.IcongetFileChooserUpFolderIcon()

	if (fileChooserUpFolderIcon == null) {
	    fileChooserUpFolderIcon = new FileChooserUpFolderIcon();
	}
	return fileChooserUpFolderIcon;
    
public static javax.swing.IcongetHorizontalSliderThumbIcon()

        if (MetalLookAndFeel.usingOcean()) {
            if (oceanHorizontalSliderThumb == null) {
                oceanHorizontalSliderThumb =
                               new OceanHorizontalSliderThumbIcon();
            }
            return oceanHorizontalSliderThumb;
        }
      // don't cache these, bumps don't get updated otherwise
	return new HorizontalSliderThumbIcon();
    
public static javax.swing.IcongetInternalFrameAltMaximizeIcon(int size)

	return new InternalFrameAltMaximizeIcon(size);
    
public static javax.swing.IcongetInternalFrameCloseIcon(int size)

	return new InternalFrameCloseIcon(size);
    
public static javax.swing.IcongetInternalFrameDefaultMenuIcon()

	if (internalFrameDefaultMenuIcon == null) {
	    internalFrameDefaultMenuIcon = new InternalFrameDefaultMenuIcon();
	}
	return internalFrameDefaultMenuIcon;
    
public static javax.swing.IcongetInternalFrameMaximizeIcon(int size)

	return new InternalFrameMaximizeIcon(size);
    
public static javax.swing.IcongetInternalFrameMinimizeIcon(int size)

	return new InternalFrameMinimizeIcon(size);
    
public static javax.swing.IcongetMenuArrowIcon()

	if (menuArrowIcon == null) {
	    menuArrowIcon = new MenuArrowIcon();
	}
	return menuArrowIcon;
    
public static javax.swing.IcongetMenuItemArrowIcon()

	if (menuItemArrowIcon == null) {
	    menuItemArrowIcon = new MenuItemArrowIcon();
	}
	return menuItemArrowIcon;
    
public static javax.swing.IcongetMenuItemCheckIcon()
Returns an icon to be used by JCheckBoxMenuItem.

return
the default icon for check box menu items, or null if no default exists

        return null;
    
public static javax.swing.IcongetRadioButtonIcon()

	if (radioButtonIcon == null) {
	    radioButtonIcon = new RadioButtonIcon();
	}
	return radioButtonIcon;
    
public static javax.swing.IcongetRadioButtonMenuItemIcon()

	if (radioButtonMenuItemIcon == null) {
	    radioButtonMenuItemIcon = new RadioButtonMenuItemIcon();
	}
	return radioButtonMenuItemIcon;
    
public static javax.swing.IcongetTreeComputerIcon()

        if ( treeComputerIcon == null ) {
	    treeComputerIcon = new TreeComputerIcon();
	}
	return treeComputerIcon;
    
public static javax.swing.IcongetTreeControlIcon(boolean isCollapsed)

	    return new TreeControlIcon( isCollapsed );
    
public static javax.swing.IcongetTreeFloppyDriveIcon()

        if ( treeFloppyDriveIcon == null ) {
	    treeFloppyDriveIcon = new TreeFloppyDriveIcon();
	}
	return treeFloppyDriveIcon;
    
public static javax.swing.IcongetTreeFolderIcon()

	return new TreeFolderIcon();
    
public static javax.swing.IcongetTreeHardDriveIcon()

        if ( treeHardDriveIcon == null ) {
	    treeHardDriveIcon = new TreeHardDriveIcon();
	}
	return treeHardDriveIcon;
    
public static javax.swing.IcongetTreeLeafIcon()

	return new TreeLeafIcon();
    
public static javax.swing.IcongetVerticalSliderThumbIcon()

        if (MetalLookAndFeel.usingOcean()) {
            if (oceanVerticalSliderThumb == null) {
                oceanVerticalSliderThumb = new OceanVerticalSliderThumbIcon();
            }
            return oceanVerticalSliderThumb;
        }
        // don't cache these, bumps don't get updated otherwise
	return new VerticalSliderThumbIcon();