FileDocCategorySizeDatePackage
MetalHighContrastTheme.javaAPI DocJava SE 5 API5538Fri Aug 26 14:58:06 BST 2005javax.swing.plaf.metal

MetalHighContrastTheme

public class MetalHighContrastTheme extends DefaultMetalTheme
A high contrast theme. This is used on Windows if the system property awt.highContrast.on is true.
version
@(#)MetalHighContrastTheme.java 1.4 03/12/19
author
Michael C. Albers

Fields Summary
private static final ColorUIResource
primary1
private static final ColorUIResource
primary2
private static final ColorUIResource
primary3
private static final ColorUIResource
primaryHighlight
private static final ColorUIResource
secondary2
private static final ColorUIResource
secondary3
private static final ColorUIResource
controlHighlight
Constructors Summary
Methods Summary
public voidaddCustomEntriesToTable(javax.swing.UIDefaults table)

        Border blackLineBorder = new BorderUIResource(new LineBorder(
                    getBlack()));
        Border whiteLineBorder = new BorderUIResource(new LineBorder(
                    getWhite()));
	Object textBorder = new BorderUIResource(new CompoundBorder(
                   blackLineBorder, new BasicBorders.MarginBorder()));

        Object[] defaults = new Object[] {
            "ToolTip.border", blackLineBorder,

            "TitledBorder.border", blackLineBorder,

            "TextField.border", textBorder,

            "PasswordField.border", textBorder,

            "TextArea.border", textBorder,

            "TextPane.border", textBorder,

            "EditorPane.border", textBorder,

            "ComboBox.background", getWindowBackground(),
            "ComboBox.foreground", getUserTextColor(),
            "ComboBox.selectionBackground", getTextHighlightColor(),
            "ComboBox.selectionForeground", getHighlightedTextColor(),

	    "ProgressBar.foreground",  getUserTextColor(),
	    "ProgressBar.background", getWindowBackground(),
	    "ProgressBar.selectionForeground", getWindowBackground(),
	    "ProgressBar.selectionBackground", getUserTextColor(),

            "OptionPane.errorDialog.border.background",
                        getPrimary1(),
            "OptionPane.errorDialog.titlePane.foreground",
                        getPrimary3(),
            "OptionPane.errorDialog.titlePane.background",
                        getPrimary1(),
            "OptionPane.errorDialog.titlePane.shadow",
                        getPrimary2(),
            "OptionPane.questionDialog.border.background",
                        getPrimary1(),
            "OptionPane.questionDialog.titlePane.foreground",
                        getPrimary3(),
            "OptionPane.questionDialog.titlePane.background",
                        getPrimary1(),
            "OptionPane.questionDialog.titlePane.shadow",
                        getPrimary2(),
            "OptionPane.warningDialog.border.background",
                        getPrimary1(),
            "OptionPane.warningDialog.titlePane.foreground",
                        getPrimary3(),
            "OptionPane.warningDialog.titlePane.background",
                        getPrimary1(),
            "OptionPane.warningDialog.titlePane.shadow",
                        getPrimary2(),
        };

        table.putDefaults(defaults);
    
public javax.swing.plaf.ColorUIResourcegetAcceleratorForeground()

        return getBlack();
    
public javax.swing.plaf.ColorUIResourcegetAcceleratorSelectedForeground()

        return getWhite();
    
public javax.swing.plaf.ColorUIResourcegetControlHighlight()

        // This was super.getSecondary3();
        return secondary2;
    
public javax.swing.plaf.ColorUIResourcegetFocusColor()

        return getBlack();
    
public javax.swing.plaf.ColorUIResourcegetHighlightedTextColor()

        return getWhite();
    
public javax.swing.plaf.ColorUIResourcegetMenuSelectedBackground()

        return getBlack();
    
public javax.swing.plaf.ColorUIResourcegetMenuSelectedForeground()

        return getWhite();
    
public java.lang.StringgetName()



    // This does not override getSecondary1 (102,102,102)

       
        return "Contrast";
    
protected javax.swing.plaf.ColorUIResourcegetPrimary1()

        return primary1;
    
protected javax.swing.plaf.ColorUIResourcegetPrimary2()

        return primary2;
    
protected javax.swing.plaf.ColorUIResourcegetPrimary3()

        return primary3;
    
public javax.swing.plaf.ColorUIResourcegetPrimaryControlHighlight()

        return primaryHighlight;
    
protected javax.swing.plaf.ColorUIResourcegetSecondary2()

        return secondary2;
    
protected javax.swing.plaf.ColorUIResourcegetSecondary3()

        return secondary3;
    
public javax.swing.plaf.ColorUIResourcegetTextHighlightColor()

        return getBlack();
    
booleanisSystemTheme()
Returns true if this is a theme provided by the core platform.

        return (getClass() == MetalHighContrastTheme.class);