Examples of PlasticTheme


Examples of com.jgoodies.looks.plastic.PlasticTheme

        try {
            // only install theme if L&F is Plastic;
            // bomb out if the L&F class cannot be found at all.
            Class lf = Class.forName(lfName);
            if (PlasticLookAndFeel.class.isAssignableFrom(lf)) {
                PlasticTheme foundTheme = themeWithName(themeName);
                if (foundTheme == null) {
                    logObj.warn("Could not set selected theme '"
                            + themeName
                            + "' - using default '"
                            + ModelerConstants.DEFAULT_THEME_NAME
                            + "'.");

                    themeName = ModelerConstants.DEFAULT_THEME_NAME;
                    foundTheme = themeWithName(themeName);
                }

                // try to configure theme
                PlasticLookAndFeel.setMyCurrentTheme(foundTheme);
            }

            // try to set set L&F
            UIManager.setLookAndFeel(lfName);
        }
        catch (Exception e) {
            logObj.warn("Could not set selected LookAndFeel '"
                    + lfName
                    + "' - using default '"
                    + ModelerConstants.DEFAULT_LAF_NAME
                    + "'.");

            // re-try with defaults
            lfName = ModelerConstants.DEFAULT_LAF_NAME;
            themeName = ModelerConstants.DEFAULT_THEME_NAME;
            PlasticTheme defaultTheme = themeWithName(themeName);
            PlasticLookAndFeel.setMyCurrentTheme(defaultTheme);

            try {
                UIManager.setLookAndFeel(lfName);
            }
View Full Code Here

Examples of com.jgoodies.looks.plastic.PlasticTheme

    }

    protected PlasticTheme themeWithName(String themeName) {
        List availableThemes = PlasticLookAndFeel.getInstalledThemes();
        for (Iterator i = availableThemes.iterator(); i.hasNext();) {
            PlasticTheme aTheme = (PlasticTheme) i.next();
            if (themeName.equals(aTheme.getName())) {
                return aTheme;
            }
        }
        return null;
    }
View Full Code Here

Examples of com.jgoodies.looks.plastic.PlasticTheme

    public static void main(String[] args) {
        try {
            UIManager.setLookAndFeel(DEFAULT_LAF_NAME);
           
            PlasticTheme foundTheme = themeWithName(DEFAULT_THEME_NAME);
            if (foundTheme != null) {
                PlasticLookAndFeel.setMyCurrentTheme(foundTheme);
            }
        }
        catch (Throwable th) {
View Full Code Here

Examples of com.jgoodies.looks.plastic.PlasticTheme

    }
   
    static PlasticTheme themeWithName(String themeName) {
        List availableThemes = PlasticLookAndFeel.getInstalledThemes();
        for (Iterator i = availableThemes.iterator(); i.hasNext();) {
            PlasticTheme aTheme = (PlasticTheme) i.next();
            if (themeName.equals(aTheme.getName())) {
                return aTheme;
            }
        }
       
        return null;
View Full Code Here

Examples of com.jgoodies.looks.plastic.PlasticTheme

        try {
            // only install theme if L&F is Plastic;
            // bomb out if the L&F class cannot be found at all.
            Class lf = Class.forName(lfName);
            if (PlasticLookAndFeel.class.isAssignableFrom(lf)) {
                PlasticTheme foundTheme = themeWithName(themeName);
                if (foundTheme == null) {
                    logObj.warn("Could not set selected theme '"
                            + themeName
                            + "' - using default '"
                            + ModelerConstants.DEFAULT_THEME_NAME
                            + "'.");

                    themeName = ModelerConstants.DEFAULT_THEME_NAME;
                    foundTheme = themeWithName(themeName);
                }

                // try to configure theme
                PlasticLookAndFeel.setMyCurrentTheme(foundTheme);
            }

            // try to set set L&F
            UIManager.setLookAndFeel(lfName);
        }
        catch (Exception e) {
            logObj.warn("Could not set selected LookAndFeel '"
                    + lfName
                    + "' - using default '"
                    + ModelerConstants.DEFAULT_LAF_NAME
                    + "'.");

            // re-try with defaults
            lfName = ModelerConstants.DEFAULT_LAF_NAME;
            themeName = ModelerConstants.DEFAULT_THEME_NAME;
            PlasticTheme defaultTheme = themeWithName(themeName);
            PlasticLookAndFeel.setMyCurrentTheme(defaultTheme);

            try {
                UIManager.setLookAndFeel(lfName);
            }
View Full Code Here

Examples of com.jgoodies.looks.plastic.PlasticTheme

    }

    protected PlasticTheme themeWithName(String themeName) {
        List availableThemes = PlasticLookAndFeel.getInstalledThemes();
        for (Iterator i = availableThemes.iterator(); i.hasNext();) {
            PlasticTheme aTheme = (PlasticTheme) i.next();
            if (themeName.equals(aTheme.getName())) {
                return aTheme;
            }
        }
        return null;
    }
View Full Code Here

Examples of com.jgoodies.looks.plastic.PlasticTheme

        // noop - default menus are fine
    }

    public void initLookAndFeel() {

        PlasticTheme theme = findTheme();

        if (theme != null) {
            PlasticLookAndFeel.setMyCurrentTheme(theme);
        }
View Full Code Here

Examples of com.jgoodies.looks.plastic.PlasticTheme

    }

    protected PlasticTheme findTheme() {

        for (Object object : PlasticLookAndFeel.getInstalledThemes()) {
            PlasticTheme theme = (PlasticTheme) object;
            if (DEFAULT_THEME_NAME.equals(theme.getName())) {
                return theme;
            }
        }
        return null;
    }
View Full Code Here

Examples of com.jgoodies.looks.plastic.PlasticTheme

     */
    private static void initThemes() {
            THEMES = new HashMap<String,MetalTheme>();
            List list = PlasticLookAndFeel.getInstalledThemes();
            for (Iterator itr = list.iterator(); itr.hasNext();) {
                    PlasticTheme element = (PlasticTheme) itr.next();
                    THEMES.put(element.getClass().getName(), element);
            }
            //add the normal swing themes
            THEMES.put("javax.swing.plaf.metal.DefaultMetalTheme", new javax.swing.plaf.metal.DefaultMetalTheme());
            THEMES.put("javax.swing.plaf.metal.OceanTheme", new javax.swing.plaf.metal.OceanTheme());
    }
View Full Code Here

Examples of com.jgoodies.plaf.plastic.PlasticTheme

    public void applyPlasticTheme() {
        if (getLookAndFeel().startsWith("com.jgoodies.plaf.plastic")) {
            List themeList = PlasticLookAndFeel.getInstalledThemes();
            String name = getPlasticTheme();
            for (Iterator it = themeList.iterator(); it.hasNext();) {
                PlasticTheme theme = (PlasticTheme) it.next();
                if (theme.getName().equalsIgnoreCase(name)) {
                    PlasticLookAndFeel.setMyCurrentTheme(theme);
                }
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.