Example usage for com.jgoodies.looks Options setTabIconsEnabled

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

Introduction

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

Prototype

public static void setTabIconsEnabled(boolean b) 

Source Link

Document

Enables or disables the use of icons in JTabbedPanes.

Usage

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  v  a2 s  . c o  m

        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: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  ww. j av  a  2 s  .  c o m*/
    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  w w w  .j  a v a2  s  .com
 */
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.xplib.xdbm.ui.Application.java

License:Open Source License

/**
 * Sets global user interface options.// www.  j a  va2s  .  c  om
 */
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.//  w  w  w . ja  v a  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:net.dpml.depot.desktop.Desktop.java

License:Apache License

/**
 * Configures the UI; tries to set the system look on Mac, 
 * WindowsLookAndFeel on general Windows, and
 * Plastic3DLookAndFeel on Windows XP and all other OS.
 *///from   w  w  w .j av  a  2  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.setTabIconsEnabled(settings.isTabIconsEnabled());
    UIManager.put(Options.POPUP_DROP_SHADOW_ENABLED_KEY, settings.isPopupDropShadowEnabled());

    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());
    }

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

    try {
        UIManager.setLookAndFeel(selectedLaf);
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:net.pms.newgui.LooksFrame.java

License:Open Source License

/**
 * Constructs a <code>DemoFrame</code>, configures the UI,
 * and builds the content.//from   ww w . ja v a 2 s. c  om
 */
public LooksFrame(AutoUpdater autoUpdater, PmsConfiguration configuration) {
    this.autoUpdater = autoUpdater;
    this.configuration = configuration;
    assert this.configuration != null;
    Options.setDefaultIconSize(new Dimension(18, 18));
    Options.setUseNarrowButtons(true);

    // Global options
    Options.setTabIconsEnabled(true);
    UIManager.put(Options.POPUP_DROP_SHADOW_ENABLED_KEY, null);

    // Swing Settings
    initializeLookAndFeel();

    // wait till the look and feel has been initialized before (possibly) displaying the update notification dialog
    if (autoUpdater != null) {
        autoUpdater.addObserver(this);
        autoUpdater.pollServer();
    }

    // http://propedit.sourceforge.jp/propertieseditor.jnlp
    Font sf = null;

    // Set an unicode font for testing exotics languages (japanese)
    final String language = configuration.getLanguage();
    if (language != null && (language.equals("ja") || language.startsWith("zh"))) {
        sf = new Font("Serif", Font.PLAIN, 12);
    }

    if (sf != null) {
        UIManager.put("Button.font", sf);
        UIManager.put("ToggleButton.font", sf);
        UIManager.put("RadioButton.font", sf);
        UIManager.put("CheckBox.font", sf);
        UIManager.put("ColorChooser.font", sf);
        UIManager.put("ToggleButton.font", sf);
        UIManager.put("ComboBox.font", sf);
        UIManager.put("ComboBoxItem.font", sf);
        UIManager.put("InternalFrame.titleFont", sf);
        UIManager.put("Label.font", sf);
        UIManager.put("List.font", sf);
        UIManager.put("MenuBar.font", sf);
        UIManager.put("Menu.font", sf);
        UIManager.put("MenuItem.font", sf);
        UIManager.put("RadioButtonMenuItem.font", sf);
        UIManager.put("CheckBoxMenuItem.font", sf);
        UIManager.put("PopupMenu.font", sf);
        UIManager.put("OptionPane.font", sf);
        UIManager.put("Panel.font", sf);
        UIManager.put("ProgressBar.font", sf);
        UIManager.put("ScrollPane.font", sf);
        UIManager.put("Viewport", sf);
        UIManager.put("TabbedPane.font", sf);
        UIManager.put("TableHeader.font", sf);
        UIManager.put("TextField.font", sf);
        UIManager.put("PasswordFiled.font", sf);
        UIManager.put("TextArea.font", sf);
        UIManager.put("TextPane.font", sf);
        UIManager.put("EditorPane.font", sf);
        UIManager.put("TitledBorder.font", sf);
        UIManager.put("ToolBar.font", sf);
        UIManager.put("ToolTip.font", sf);
        UIManager.put("Tree.font", sf);
    }

    setTitle("Test");
    setIconImage(readImageIcon("icon-32.png").getImage());

    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

    JComponent jp = buildContent();
    String showScrollbars = System.getProperty("scrollbars", "").toLowerCase();

    /*
     * handle scrollbars:
     *
     * 1) forced scrollbars (-Dscrollbars=true): always display them
     * 2) optional scrollbars (-Dscrollbars=optional): display them as needed
     * 3) otherwise (default): don't display them
     */
    if (showScrollbars.equals("true")) {
        setContentPane(new JScrollPane(jp, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
                ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS));
    } else if (showScrollbars.equals("optional")) {
        setContentPane(new JScrollPane(jp, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
                ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED));
    } else {
        setContentPane(jp);
    }

    String projectName = PropertiesUtil.getProjectProperties().get("project.name");
    String projectVersion = PropertiesUtil.getProjectProperties().get("project.version");
    String title = projectName + " " + projectVersion;

    // If the version contains a "-" (e.g. "1.50.1-SNAPSHOT" or "1.50.1-beta1"), add a warning message
    if (projectVersion.indexOf("-") > -1) {
        title = title + " - " + Messages.getString("LooksFrame.26");
    }

    this.setTitle(title);
    this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
    Dimension screenSize = getToolkit().getScreenSize();

    if (screenSize.width < minimumSize.width || screenSize.height < minimumSize.height) {
        setMinimumSize(screenSize);
    } else {
        setMinimumSize(minimumSize);
    }

    if (screenSize.width < preferredSize.width || screenSize.height < preferredSize.height) {
        setSize(screenSize);
    } else {
        setSize(preferredSize);
    }

    setResizable(true);
    Dimension paneSize = getSize();
    setLocation(((screenSize.width > paneSize.width) ? ((screenSize.width - paneSize.width) / 2) : 0),
            ((screenSize.height > paneSize.height) ? ((screenSize.height - paneSize.height) / 2) : 0));
    if (!configuration.isMinimized() && System.getProperty(START_SERVICE) == null) {
        setVisible(true);
    }
    PMS.get().getRegistry().addSystemTray(this);
}

From source file:org.qedeq.gui.se.util.GuiHelper.java

License:Open Source License

/**
 * Configures the user interface; requests Swing settings and JGoodies Looks
 * options from the launcher.//  ww w. j a v  a  2s  .  co  m
 *
 * @param   options Set these options.
 */
public static void configureUI(final GuiOptions options) {
    UIManager.put("ClassLoader", CLASS.getClassLoader());

    Options.setDefaultIconSize(new Dimension(18, 18));
    Options.setUseNarrowButtons(options.isUseNarrowButtons());
    Options.setTabIconsEnabled(options.isTabIconsEnabled());
    UIManager.put(Options.POPUP_DROP_SHADOW_ENABLED_KEY, options.isPopupDropShadowEnabled());
    // LATER m31 20100319: we make this now direct in QedeqPane, this line
    // didn't help. Why?
    // we want our disabled TextAreas to look same if not editable
    UIManager.put("TextArea.disabledBackground", UIManager.get("TextArea.background"));

    UIManager.put("ToolTip.font",
            new FontUIResource("Lucida Sans Unicode", Font.PLAIN, UIManager.getFont("ToolTip.font").getSize()));

    // Swing Settings
    LookAndFeel selectedLaf = options.getSelectedLookAndFeel();
    if (selectedLaf instanceof PlasticLookAndFeel) {
        PlasticLookAndFeel.setPlasticTheme(options.getSelectedTheme());
        PlasticLookAndFeel.setTabStyle(options.getPlasticTabStyle());
        PlasticLookAndFeel.setHighContrastFocusColorsEnabled(options.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) {
        Trace.trace(CLASS, "configureUI", "Can't change L&F", e);
    }

}

From source file:org.springframework.richclient.application.config.JGoodiesLooksConfigurer.java

License:Apache License

/**
 * @param enabled set to <code>true</code> if tab icons should be enabled.
 * @see com.jgoodies.looks.Options#setTabIconsEnabled(boolean)
 *//*from  www.  jav  a2 s  . co m*/
public void setTabIconsEnabled(boolean enabled) {
    Options.setTabIconsEnabled(enabled);
}