001    /*
002     * $Id: JXLoginPanelAddon.java,v 1.1 2005/11/11 23:05:13 rbair Exp $
003     *
004     * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
005     * Santa Clara, California 95054, U.S.A. All rights reserved.
006     *
007     * This library is free software; you can redistribute it and/or
008     * modify it under the terms of the GNU Lesser General Public
009     * License as published by the Free Software Foundation; either
010     * version 2.1 of the License, or (at your option) any later version.
011     * 
012     * This library is distributed in the hope that it will be useful,
013     * but WITHOUT ANY WARRANTY; without even the implied warranty of
014     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
015     * Lesser General Public License for more details.
016     * 
017     * You should have received a copy of the GNU Lesser General Public
018     * License along with this library; if not, write to the Free Software
019     * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
020     */
021    
022    package org.jdesktop.swingx.plaf;
023    
024    import java.awt.Color;
025    import java.awt.Font;
026    import java.util.Arrays;
027    import java.util.List;
028    import javax.swing.ImageIcon;
029    import javax.swing.plaf.ColorUIResource;
030    import javax.swing.plaf.FontUIResource;
031    import javax.swing.plaf.IconUIResource;
032    import javax.swing.plaf.metal.MetalLookAndFeel;
033    import org.jdesktop.swingx.JXLoginPanel;
034    /**
035     *
036     * @author rbair
037     */
038    public class JXLoginPanelAddon extends AbstractComponentAddon {
039        
040        /** Creates a new instance of JXLoginPanelAddon */
041        public JXLoginPanelAddon() {
042            super("JXLoginPanel");
043        }
044        
045      @Override
046      protected void addBasicDefaults(LookAndFeelAddons addon, List<Object> defaults) {
047        super.addBasicDefaults(addon, defaults);
048        defaults.addAll(Arrays.asList(new Object[] { 
049          JXLoginPanel.uiClassID,
050          "org.jdesktop.swingx.plaf.basic.BasicLoginPanelUI",
051          "JXLoginPanel.error.icon",
052          new IconUIResource(new ImageIcon(getClass().getResource("resources/error16.png"))),
053          "JXLoginPanel.banner.font",
054          new FontUIResource("Arial Bold", Font.PLAIN, 36),
055          "JXLoginPanel.banner.foreground", new ColorUIResource(Color.WHITE),
056          "JXLoginPanel.banner.darkBackground", new ColorUIResource(Color.GRAY),
057          "JXLoginPanel.banner.lightBackground", new ColorUIResource(Color.LIGHT_GRAY),
058        }));
059      }
060      
061      @Override
062      protected void addMetalDefaults(LookAndFeelAddons addon, List<Object> defaults) {
063        super.addMetalDefaults(addon, defaults);
064    
065        if (isPlastic()) {
066          defaults.addAll(Arrays.asList(new Object[] { 
067            "JXLoginPanel.banner.foreground", new ColorUIResource(Color.WHITE),
068            "JXLoginPanel.banner.darkBackground", new ColorUIResource(Color.GRAY),
069            "JXLoginPanel.banner.lightBackground", new ColorUIResource(Color.LIGHT_GRAY),
070          }));
071        } else {
072          defaults.addAll(Arrays.asList(new Object[] { 
073            "JXLoginPanel.banner.foreground", new ColorUIResource(255, 255, 255),
074            "JXLoginPanel.banner.darkBackground", MetalLookAndFeel.getCurrentTheme().getPrimaryControlDarkShadow(),
075            "JXLoginPanel.banner.lightBackground", MetalLookAndFeel.getCurrentTheme().getPrimaryControl()
076          }));
077        }
078      }
079    
080      @Override
081      protected void addWindowsDefaults(LookAndFeelAddons addon, List<Object> defaults) {
082        super.addWindowsDefaults(addon, defaults);
083        defaults.addAll(Arrays.asList(new Object[] { 
084          "JXLoginPanel.banner.foreground", new ColorUIResource(255, 255, 255),
085          "JXLoginPanel.banner.darkBackground", new ColorUIResource(49, 121, 242),
086          "JXLoginPanel.banner.lightBackground", new ColorUIResource(198, 211, 247),
087        }));
088      }
089    }