Example usage for com.jgoodies.looks Options setDefaultIconSize

List of usage examples for com.jgoodies.looks Options setDefaultIconSize

Introduction

In this page you can find the example usage for com.jgoodies.looks Options setDefaultIconSize.

Prototype

public static void setDefaultIconSize(Dimension defaultIconSize) 

Source Link

Document

Sets the default icon size.

Usage

From source file:com.salas.bb.core.ApplicationLauncher.java

License:Open Source License

/** Configures GUI part. */
protected void configureUI() {
    if (LOG.isLoggable(Level.FINE))
        LOG.fine("configureUI starting...");

    // Configure displaying anti-aliased text (SHOULD BE RUN BEFORE SWING INIT)
    configureAntiAliasing();/*from   ww w . j  a v a  2 s  .c  om*/

    // Configure Mac OS X dock icon (we had problems with JWS dock icon: ugly and cannot be badged)
    OSXSupport.setApplicationIcon();

    // Images cache
    Cache imagesCache = new Cache(new File(getContextPath() + "cache"), 20000000);
    ImageFetcher.setCache(imagesCache);

    // Stylesheets
    try {
        URL baseStylesheetURL = new URL("http://www.blogbridge.com/bbstyles/");
        StylesheetManager.init(new File(getContextPath() + "stylesheets"), baseStylesheetURL);
    } catch (MalformedURLException e) {
        // Impossible to have
    }

    Options.setDefaultIconSize(new Dimension(DEFAULT_ICON_WIDTH, DEFAULT_ICON_HEIGHT));
    UIManager.put("ToolBar.separatorSize", new DimensionUIResource(TOOLBAR_SEP_WIDTH, TOOLBAR_SEP_HEIGHT));
    Options.setPopupDropShadowEnabled(true);

    // In Java Web Start, indicate where to find the l&f classes. Set the Swing class loader.
    UIManager.put("ClassLoader", LookUtils.class.getClassLoader());

    // Make Swing update everything dynamically during resize operations.
    Toolkit.getDefaultToolkit().setDynamicLayout(true);
    super.configureUI();
    configureFonts();

    if (LOG.isLoggable(Level.FINE)) {
        LOG.fine("configureUI done...");
    }

    OSXSupport.setupLAF();

    // Custom icons
    UIManager.getLookAndFeelDefaults().put("html.missingImage", new UIDefaults.LazyValue() {
        /**
         * Creates the actual value retrieved from the <code>UIDefaults</code> table. When an object that implements
         * this interface is retrieved from the table, this method is used to create the real value, which is then
         * stored in the table and returned to the calling method.
         *
         * @param table a <code>UIDefaults</code> table
         *
         * @return the created <code>Object</code>
         */
        public Object createValue(UIDefaults table) {
            return ResourceUtils.getIcon("application.icon");
        }
    });
}

From source file:com.sittinglittleduck.DirBuster.gui.StartGUI.java

License:Open Source License

/** Creates new form StartGUI */
public StartGUI() {
    try {/*from w w w .ja  va2s.  c  om*/

        System.out.println("Starting OWASP DirBuster " + Config.version);

        /*
         * Set the look and feel
         */
        Options.setTabIconsEnabled(true);
        Options.setDefaultIconSize(new Dimension(18, 18));

        PlasticXPLookAndFeel.setPlasticTheme(new Silver());

        UIManager.setLookAndFeel(Options.PLASTICXP_NAME);

        initComponents();

        /*
         * Detect if the OS is vista, as we need to rsize the gui, as the buttons are not visable
         */
        String os = System.getProperty("os.name");

        if (os.contains("Vista")) {

            java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
            setBounds((screenSize.width - 771) / 2, (screenSize.height - 590) / 2, 771, 590);

        }

        this.setTitle("OWASP DirBuster " + Config.version + " - Web Application Brute Forcing");
        jPanelSetup = new JPanelSetup(this);
        jPanelRunning = new JPanelRunning(this);
        jPanelReport = new JPanelReport(this);
        getContentPane().add(jPanelSetup, java.awt.BorderLayout.CENTER);
        //setIconImage(new ImageIcon(getClass().getResource("/com/sittinglittleduck/DirBuster/images/duck.gif")).getImage());
        setIconImage(ImageCreator.OWASP_IMAGE.getImage());
        manager = Manager.getInstance();
        //set the checkbox for following redirects
        jCheckBoxMenuFollowRedirets.setSelected(Config.followRedirects);
        jCheckBoxMenuDebug.setSelected(Config.debug);
        jCheckBoxMenuParseHTML.setSelected(Config.parseHTML);
        jCheckBoxMenuItemCaseInsensativeMode.setSelected(Config.caseInsensativeMode);

        /*
         * populate the setting with the values from user prefs
         */
        jPanelSetup.jTextFieldFile.setText(manager.getDefaultList());
        jPanelSetup.jTextFieldFileExtention.setText(manager.getDefaultExts());
        jPanelSetup.jSliderThreads.setValue(manager.getDefaultNoThreads());
        jPanelSetup.jLabelThreadsDisplay.setText(manager.getDefaultNoThreads() + " Threads");

        /*
         * load the help
         */
        loadHelp();

        /*
         * check for an update
         */
        checkForUpdate();

    } catch (ClassNotFoundException ex) {
        Logger.getLogger(StartGUI.class.getName()).log(Level.SEVERE, null, ex);
    } catch (InstantiationException ex) {
        Logger.getLogger(StartGUI.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IllegalAccessException ex) {
        Logger.getLogger(StartGUI.class.getName()).log(Level.SEVERE, null, ex);
    } catch (UnsupportedLookAndFeelException ex) {
        Logger.getLogger(StartGUI.class.getName()).log(Level.SEVERE, null, ex);
    }

}

From source file:cytoscape.CyMain.java

License:Open Source License

protected void setupLookAndFeel() {
    try {/*from  w  w w .  ja  v  a  2s  . c  o  m*/
        if (LookUtils.IS_OS_WINDOWS) {
            /*
             * For Windows: just use platform default look & feel.
             */
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        } else if (LookUtils.IS_OS_MAC) {
            /*
             * For Mac: move menu bar to OS X default bar (next to Apple
             * icon)
             */
            System.setProperty("apple.laf.useScreenMenuBar", "true");

        } else {
            final JavaVersion javaVersion = JavaVersion.getJavaVersion();
            if (javaVersion.getMajor() >= 2 || javaVersion.getMinor() > 6
                    || (javaVersion.getMinor() == 6 && javaVersion.getUpdate() >= 10))
                UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
            else {
                /*
                 * For Unix platforms, use JGoodies Looks
                 */
                UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
                Plastic3DLookAndFeel.set3DEnabled(true);
                Plastic3DLookAndFeel.setCurrentTheme(new com.jgoodies.looks.plastic.theme.SkyBluer());
                Plastic3DLookAndFeel.setTabStyle(Plastic3DLookAndFeel.TAB_STYLE_METAL_VALUE);
                Plastic3DLookAndFeel.setHighContrastFocusColorsEnabled(true);

                Options.setDefaultIconSize(new Dimension(18, 18));
                Options.setHiResGrayFilterEnabled(true);
                Options.setPopupDropShadowEnabled(true);
                Options.setUseSystemFonts(true);

                UIManager.put("Button.defaultButtonFollowsFocus", Boolean.TRUE);
                UIManager.put(Options.USE_SYSTEM_FONTS_APP_KEY, Boolean.TRUE);
            }
        }
    } catch (Exception e) {
        logger.warn("Can't set look & feel:" + e.getMessage(), e);
    }
}

From source file:de.dfki.dmas.owls2wsdl.gui.OWLS2WSDLGui.java

License:Open Source License

private void configureUI() {
    // UIManager.put("ToolTip.hideAccelerator", Boolean.FALSE);
    Options.setDefaultIconSize(new Dimension(18, 18));
    Options.setUseNarrowButtons(settings.isUseNarrowButtons());
    Options.setTabIconsEnabled(settings.isTabIconsEnabled());
    UIManager.put(Options.POPUP_DROP_SHADOW_ENABLED_KEY, settings.isPopupDropShadowEnabled());

    // Swing Settings
    LookAndFeel selectedLaf = settings.getSelectedLookAndFeel();

    // Work around caching in MetalRadioButtonUI
    JRadioButton radio = new JRadioButton();
    radio.getUI().uninstallUI(radio);//from   w  w  w. ja  v  a  2  s. c om
    JCheckBox checkBox = new JCheckBox();
    checkBox.getUI().uninstallUI(checkBox);

    try {
        UIManager.setLookAndFeel(selectedLaf);
        SwingUtilities.updateComponentTreeUI(this);
    } catch (UnsupportedLookAndFeelException uslafe) {
        System.out.println("UnsupportedLookAndFeelException: " + uslafe.getMessage());
    } catch (Exception e) {
        System.out.println("Can't change L&F: " + e);
    }

    // // FensterIcon
    // String IconLocation = ResourceManager.getString("icon.IconImage");
    // System.out.println("[i] set IconImage: " +
    // getClass().getResource(IconLocation).toString());
    // setIconImage( new
    // ImageIcon(getClass().getResource(IconLocation)).getImage());

}

From source file:de.kimminich.agile.demos.lecture4.StartGUI.java

License:Open Source License

/**
 * Creates new form StartGUI//from ww w . ja va 2s .co m
 */
public StartGUI() {
    try {

        System.out.println("Starting OWASP DirBuster " + Config.version);

        /*
         * Set the look and feel
         */
        Options.setTabIconsEnabled(true);
        Options.setDefaultIconSize(new Dimension(18, 18));

        PlasticXPLookAndFeel.setPlasticTheme(new Silver());

        UIManager.setLookAndFeel(Options.PLASTICXP_NAME);

        initComponents();

        /*
         * Detect if the OS is vista, as we need to rsize the gui, as the buttons are not visable
         */
        String os = System.getProperty("os.name");

        if (os.contains("Vista")) {

            Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
            setBounds((screenSize.width - 771) / 2, (screenSize.height - 590) / 2, 771, 590);

        }

        this.setTitle("OWASP DirBuster " + Config.version + " - Web Application Brute Forcing");
        //            jPanelSetup = new JPanelSetup(this);
        //            jPanelRunning = new JPanelRunning(this);
        //            jPanelReport = new JPanelReport(this);
        getContentPane().add(jPanelSetup, java.awt.BorderLayout.CENTER);
        //setIconImage(new ImageIcon(getClass().getResource("/com/sittinglittleduck/DirBuster/images/duck.gif")).getImage());
        setIconImage(ImageCreator.OWASP_IMAGE.getImage());
        manager = Manager.getInstance();
        //set the checkbox for following redirects
        jCheckBoxMenuFollowRedirets.setSelected(Config.followRedirects);
        jCheckBoxMenuDebug.setSelected(Config.debug);
        jCheckBoxMenuParseHTML.setSelected(Config.parseHTML);
        jCheckBoxMenuItemCaseInsensativeMode.setSelected(Config.caseInsensativeMode);

        /*
         * populate the setting with the values from user prefs
         */
        jPanelSetup.jTextFieldFile.setText(manager.getDefaultList());
        jPanelSetup.jTextFieldFileExtention.setText(manager.getDefaultExts());
        jPanelSetup.jSliderThreads.setValue(manager.getDefaultNoThreads());
        jPanelSetup.jLabelThreadsDisplay.setText(manager.getDefaultNoThreads() + " Threads");

        /*
         * load the help
         */
        loadHelp();

        /*
         * check for an update
         */
        checkForUpdate();

    } catch (ClassNotFoundException ex) {
        Logger.getLogger(StartGUI.class.getName()).log(Level.SEVERE, null, ex);
    } catch (InstantiationException ex) {
        Logger.getLogger(StartGUI.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IllegalAccessException ex) {
        Logger.getLogger(StartGUI.class.getName()).log(Level.SEVERE, null, ex);
    } catch (UnsupportedLookAndFeelException ex) {
        Logger.getLogger(StartGUI.class.getName()).log(Level.SEVERE, null, ex);
    }

}

From source file:de.maklerpoint.office.Gui.CRMView.java

License:Open Source License

/**
 * /*from  ww  w  .  j  a v  a  2s  .c o m*/
 * @param uiTheme
 */
public final void configureUI(String uiTheme) {
    UIManager.put(Options.USE_SYSTEM_FONTS_KEY, Boolean.TRUE);
    Options.setDefaultIconSize(new Dimension(18, 18));

    if (uiTheme == null) {
        uiTheme = UIManager.getSystemLookAndFeelClassName();
    }

    //            uiTheme = LookUtils.IS_OS_WINDOWS_XP ? Options.getCrossPlatformLookAndFeelClassName()
    //                    : Options.getSystemLookAndFeelClassName();

    try {
        UIManager.setLookAndFeel(uiTheme);
        //            SwingUtilities.updateComponentTreeUI(super.getComponent());
        SwingUtilities.updateComponentTreeUI(CRMView.super.getFrame());
        //            SwingUtilities.updateComponentTreeUI(CRMView.super.getRootPane().getJMenuBar());
    } catch (Exception ex) {
        Log.logger.fatal("Fehler: Konnte das Theme \"" + uiTheme + "\" nicht aktivieren", ex);
        ShowException.showException(
                "Konnte das graphische Theme nicht aktivieren. Eventuell"
                        + " untersttzt Ihr Betriebssystem das gewhlte Theme nicht.",
                ExceptionDialogGui.LEVEL_WARNING, ex, "Schwerwiegend: Konnte Theme nicht aktivieren");

    }
}

From source file:de.xplib.xdbm.ui.Application.java

License:Open Source License

/**
 * Sets global user interface options./*from   w w w. j  a  va2  s  .  c o  m*/
 */
private void configureUI() {

    Options.setDefaultIconSize(new Dimension(18, 18));

    // Set font options      
    UIManager.put(Options.USE_SYSTEM_FONTS_APP_KEY, settings.isUseSystemFonts());
    Options.setGlobalFontSizeHints(settings.getFontSizeHints());
    Options.setUseNarrowButtons(settings.isUseNarrowButtons());
    Options.setPopupDropShadowEnabled(settings.isPopupDropShadowEnabled().booleanValue());

    // Global options
    Options.setTabIconsEnabled(settings.isTabIconsEnabled());
    UIManager.put(Options.POPUP_DROP_SHADOW_ENABLED_KEY, settings.isPopupDropShadowEnabled());

    // Swing Settings
    LookAndFeel selectedLaf = settings.getSelectedLookAndFeel();
    if (selectedLaf instanceof PlasticLookAndFeel) {
        PlasticLookAndFeel.setMyCurrentTheme(settings.getSelectedTheme());
        PlasticLookAndFeel.setTabStyle(settings.getPlasticTabStyle());
        PlasticLookAndFeel.setHighContrastFocusColorsEnabled(settings.isPlasticHighContrastFocusEnabled());
    } else if (selectedLaf.getClass() == MetalLookAndFeel.class) {
        MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
    }

    // Work around caching in MetalRadioButtonUI
    JRadioButton radio = new JRadioButton();
    radio.getUI().uninstallUI(radio);
    JCheckBox checkBox = new JCheckBox();
    checkBox.getUI().uninstallUI(checkBox);

    try {
        UIManager.setLookAndFeel(selectedLaf);
    } catch (Exception e) {
        System.out.println("Can't change L&F: " + e);
    }
}

From source file:etomica.virial.cluster2.mvc.view.ApplicationUI.java

License:Mozilla Public License

/**
 * Configures the user interface; requests Swing settings and JGoodies Looks options
 * from the launcher./*from  ww w .  j a  va  2  s.c  o  m*/
 */
public static void configure() {

    // UIManager.put("ToolTip.hideAccelerator", Boolean.FALSE);
    Options.setDefaultIconSize(DF_ICON_SIZE);
    Options.setUseNarrowButtons(uiSettings.isUseNarrowButtons());
    // Global options
    Options.setTabIconsEnabled(uiSettings.isTabIconsEnabled());
    UIManager.put(Options.POPUP_DROP_SHADOW_ENABLED_KEY, uiSettings.isPopupDropShadowEnabled());
    // Swing Settings
    LookAndFeel selectedLaf = uiSettings.getSelectedLookAndFeel();
    if (selectedLaf instanceof PlasticLookAndFeel) {
        PlasticLookAndFeel.setPlasticTheme(uiSettings.getSelectedTheme());
        PlasticLookAndFeel.setTabStyle(uiSettings.getPlasticTabStyle());
        PlasticLookAndFeel.setHighContrastFocusColorsEnabled(uiSettings.isPlasticHighContrastFocusEnabled());
    } else if (selectedLaf.getClass() == MetalLookAndFeel.class) {
        MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
    }
    // Work around caching in MetalRadioButtonUI
    JRadioButton radio = new JRadioButton();
    radio.getUI().uninstallUI(radio);
    JCheckBox checkBox = new JCheckBox();
    checkBox.getUI().uninstallUI(checkBox);
    // try setting the look and feel
    try {
        UIManager.setLookAndFeel(selectedLaf);
    } catch (Exception e) {
        System.out.println("Can't change the look and feel: " + e);
    }
}

From source file:loci.visbio.util.LAFUtil.java

License:Open Source License

/** Initializes some look and feel parameters. */
public static void initLookAndFeel() {
    if (System.getProperty("swing.defaultlaf") == null) {
        // use JGoodies Plastic 3D as default if no Look & Feel is set
        try {/*  ww w  . j  a  va 2  s  .  c o  m*/
            UIManager.setLookAndFeel("com.jgoodies.looks.plastic.Plastic3DLookAndFeel");
        } catch (final Exception exc) {
            exc.printStackTrace();
        }
    }

    UIManager.put(Options.USE_SYSTEM_FONTS_APP_KEY, Boolean.TRUE);
    Options.setDefaultIconSize(new Dimension(18, 18));

    if (!isMacLookAndFeel()) {
        System.setProperty("apple.laf.useScreenMenuBar", "false");
    }
    UIManager.installLookAndFeel("JGoodies Windows", "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel");
    UIManager.installLookAndFeel("JGoodies Plastic", "com.jgoodies.plaf.plastic.PlasticLookAndFeel");
    UIManager.installLookAndFeel("JGoodies Plastic 3D", "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel");
    UIManager.installLookAndFeel("JGoodies Plastic XP", "com.jgoodies.plaf.plastic.PlasticXPLookAndFeel");
}

From source file:musite.MusiteMain.java

License:Open Source License

private static void setupLookAndFeel() {
    try {/*from ww w.  j  a va 2 s .co  m*/
        if (SystemUtils.IS_OS_WINDOWS) {
            /*
             * For Windows: just use platform default look & feel.
             */
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        } else if (SystemUtils.IS_OS_MAC) {
            /*
             * For Mac: move menue bar to OS X default bar (next to Apple
             * icon)
             */
            System.setProperty("apple.laf.useScreenMenuBar", "true");
        } else {
            /*
             * For Unix platforms, use JGoodies Looks
             */
            UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
            Plastic3DLookAndFeel.set3DEnabled(true);
            Plastic3DLookAndFeel.setCurrentTheme(new com.jgoodies.looks.plastic.theme.SkyBluer());
            Plastic3DLookAndFeel.setTabStyle(Plastic3DLookAndFeel.TAB_STYLE_METAL_VALUE);
            Plastic3DLookAndFeel.setHighContrastFocusColorsEnabled(true);

            Options.setDefaultIconSize(new Dimension(18, 18));
            Options.setHiResGrayFilterEnabled(true);
            Options.setPopupDropShadowEnabled(true);
            Options.setUseSystemFonts(true);

            UIManager.put("Button.defaultButtonFollowsFocus", Boolean.TRUE);
            UIManager.put(Options.USE_SYSTEM_FONTS_APP_KEY, Boolean.TRUE);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}