亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? demoframe.java

?? java的lookandfeel制作的API
?? JAVA
字號:
/*
 * Copyright (c) 2001-2004 JGoodies Karsten Lentzsch. All Rights Reserved.
 *
 * Redistribution and use in source and binary forms, with or without 
 * modification, are permitted provided that the following conditions are met:
 * 
 *  o Redistributions of source code must retain the above copyright notice, 
 *    this list of conditions and the following disclaimer. 
 *     
 *  o Redistributions in binary form must reproduce the above copyright notice, 
 *    this list of conditions and the following disclaimer in the documentation 
 *    and/or other materials provided with the distribution. 
 *     
 *  o Neither the name of JGoodies Karsten Lentzsch nor the names of 
 *    its contributors may be used to endorse or promote products derived 
 *    from this software without specific prior written permission. 
 *     
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 */

package com.jgoodies.looks.demo;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.URL;

import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
import javax.swing.plaf.UIResource;
import javax.swing.plaf.metal.DefaultMetalTheme;
import javax.swing.plaf.metal.MetalLookAndFeel;

import com.jgoodies.clearlook.ClearLookManager;
import com.jgoodies.plaf.LookUtils;
import com.jgoodies.plaf.Options;
import com.jgoodies.plaf.plastic.PlasticLookAndFeel;
import com.jgoodies.plaf.windows.ExtWindowsLookAndFeel;

/** 
 * Builds the main frame in the Simple Looks Demo. 
 * Demonstrates and tests different multi-platform issues by
 * showing a variety of Swing widgets in different configurations.
 * Also, this frame contains examples for Swing misuse,
 * that can be automatically corrected by ClearLook.<p>
 * 
 * This class provides a couple of protected methods that create
 * components or a builder. The full JGoodies Looks Demo overrides 
 * these methods to vend components or builders from the 
 * JGoodies UI framework that better handle different platforms.
 * 
 * @author Karsten Lentzsch
 * @version $Revision: 1.12 $
 */
public class DemoFrame extends JFrame {

    protected static final Dimension PREFERRED_SIZE =
        LookUtils.IS_LOW_RESOLUTION ? new Dimension(650, 510) : new Dimension(730, 560);

    /** Describes optional settings of the JGoodies Looks */
    private final Settings settings;

    /**
     * Constructs a <code>DemoFrame</code>, configures the UI, 
     * and builds the content.
     */
    protected DemoFrame(Settings settings) {
        this.settings = settings;
        configureUI();
        build();
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    }
    
    public static void main(String[] args) {
        DemoFrame instance = new DemoFrame(createSettings());
        instance.setSize(PREFERRED_SIZE);
        instance.locateOnScreen(instance);
        instance.setVisible(true);
    }
    
    private static Settings createSettings() {
        Settings settings = Settings.createDefault();
        
        // Configure the settings here.
        
        return settings;
    }
    

    /**
     * Configures the user interface; requests Swing settings and 
     * jGoodies Looks options from the launcher.
     */
    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());
        
        // Global options
        Options.setTabIconsEnabled(settings.isTabIconsEnabled());
        ClearLookManager.setMode(settings.getClearLookMode());
        ClearLookManager.setPolicy(settings.getClearLookPolicyName());
        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);
        }

    }

    /**
     * Builds the <code>DemoFrame</code> using Options from the Launcher.
     */
    private void build() {
        setContentPane(buildContentPane());
        setTitle(getWindowTitle());
        setJMenuBar(
            createMenuBuilder().buildMenuBar(
                settings,
                createHelpActionListener(),
                createAboutActionListener()));
        setIconImage(readImageIcon("eye_16x16.gif").getImage());
    }
    
    
    /** 
     * Creates and returns a builder that builds the menu.
     * This method is overriden by the full JGoodies Looks Demo to use
     * a more sophisticated menu builder that uses the JGoodies
     * UI Framework.
     * 
     * @return the builder that builds the menu bar
     */
    protected MenuBuilder createMenuBuilder() {
        return new MenuBuilder();
    }

    /**
     * Builds and answers the content.
     */
    private JComponent buildContentPane() {
        JPanel panel = new JPanel(new BorderLayout());
        panel.add(buildToolBar(), BorderLayout.NORTH);
        panel.add(buildMainPanel(), BorderLayout.CENTER);
        return panel;
    }

    // Tool Bar *************************************************************

    /**
     * Builds, configures and returns the toolbar. Requests
     * HeaderStyle, look-specific BorderStyles, and Plastic 3D Hint 
     * from Launcher.
     */
    private Component buildToolBar() {
        JToolBar toolBar = new JToolBar();
        toolBar.setFloatable(false);
        toolBar.putClientProperty("JToolBar.isRollover", Boolean.TRUE);
        // Swing
        toolBar.putClientProperty(
            Options.HEADER_STYLE_KEY,
            settings.getToolBarHeaderStyle());
        toolBar.putClientProperty(
            PlasticLookAndFeel.BORDER_STYLE_KEY,
            settings.getToolBarPlasticBorderStyle());
        toolBar.putClientProperty(
            ExtWindowsLookAndFeel.BORDER_STYLE_KEY,
            settings.getToolBarWindowsBorderStyle());
        toolBar.putClientProperty(
            PlasticLookAndFeel.IS_3D_KEY,
            settings.getToolBar3DHint());

        AbstractButton button;

        toolBar.add(createToolBarButton("backward.gif"));
        button = createToolBarButton("forward.gif");
        button.setEnabled(false);
        toolBar.add(button);
        toolBar.add(createToolBarButton("home.gif"));
        toolBar.addSeparator();
        toolBar.add(createOpenButton());
        toolBar.add(createToolBarButton("print.gif"));
        toolBar.add(createToolBarButton("refresh.gif"));
        toolBar.addSeparator();

        ButtonGroup group = new ButtonGroup();
        button = createToolBarRadioButton("pie_mode.png");
        button.setSelectedIcon(readImageIcon("pie_mode_selected.gif"));
        group.add(button);
        button.setSelected(true);
        toolBar.add(button);

        button = createToolBarRadioButton("bar_mode.png");
        button.setSelectedIcon(readImageIcon("bar_mode_selected.gif"));
        group.add(button);
        toolBar.add(button);

        button = createToolBarRadioButton("table_mode.png");
        button.setSelectedIcon(readImageIcon("table_mode_selected.gif"));
        group.add(button);
        toolBar.add(button);
        toolBar.addSeparator();

        button = createToolBarButton("help.gif");
        button.addActionListener(createHelpActionListener());
        toolBar.add(button);

        toolBar.add(Box.createGlue());

        button = new RolloverCheckButton();
        button.setToolTipText("Shall show border when mouse is over");
        button.setMargin(new Insets(0, 0, 0, 0));
        toolBar.add(button);
        return toolBar;
    }

    private AbstractButton createOpenButton() {
        AbstractButton button = createToolBarButton("open.gif");
        button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                new JFileChooser().showOpenDialog(DemoFrame.this);
            }

        });
        return button;
    }

    /**
     * Creates and returns a <code>JButton</code> 
     * configured for use in a JToolBar.<p>
     * 
     * This is a simplified method that is overriden by the Looks Demo.
     * The full code uses the JGoodies UI framework's ToolBarButton
     * that better handles platform differences.
     */
    protected AbstractButton createToolBarButton(String iconName) {
        JButton button = new JButton(readImageIcon(iconName));
        button.setFocusable(false);
        return button;
    }

    /**
     * Creates and returns a <code>JToggleButton</code> 
     * configured for use in a JToolBar.<p>
     * 
     * This is a simplified method that is overriden by the Looks Demo.
     * The full code uses the JGoodies UI framework's ToolBarButton
     * that better handles platform differences.
     */
    protected AbstractButton createToolBarRadioButton(String iconName) {
        JToggleButton button = new JToggleButton(readImageIcon(iconName));
        button.setFocusable(false);
        return button;
    }

    // Tabbed Pane **********************************************************

    /**
     * Builds and answers the tabbed pane.
     */
    private Component buildMainPanel() {
        JTabbedPane tabbedPane = new JTabbedPane(SwingConstants.TOP);
        //tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);

        addTabs(tabbedPane);

        tabbedPane.setBorder(new EmptyBorder(10, 10, 10, 10));
        return tabbedPane;
    }

    private void addTabs(JTabbedPane tabbedPane) {
        tabbedPane.addTab("State",     new StatesTab().build());
        tabbedPane.addTab("Align",     new AlignmentTab().build());
        tabbedPane.addTab("Tab",       new TabTestTab().build());
        tabbedPane.addTab("Split",     new SplitTab().build());
        tabbedPane.addTab("HTML",      new HtmlTab().build());
        tabbedPane.addTab("Dialog",    new DialogsTab().build(tabbedPane));
        tabbedPane.addTab("Desktop",   new DesktopTab().build());
        tabbedPane.addTab("Narrow",    new NarrowTab().build());
        tabbedPane.addTab("ClearLook", new ClearLookTab().build());
    }
    
    protected String getWindowTitle() {
        return "Simple Looks Demo";
    }
    

    // Helper Code **********************************************************************

    /*
     * Looks up and answers an icon for the specified filename suffix.<p>
     */
    protected static ImageIcon readImageIcon(String filename) {
        URL url =
            DemoFrame.class.getClassLoader().getResource("images/" + filename);
        return new ImageIcon(url);
    }

    /**
     * Locates the given component on the screen's center.
     */
    protected void locateOnScreen(Component component) {
        Dimension paneSize = component.getSize();
        Dimension screenSize = component.getToolkit().getScreenSize();
        component.setLocation(
            (screenSize.width  - paneSize.width)  / 2,
            (screenSize.height - paneSize.height) / 2);
    }

    /**
     * Creates and answers an ActionListener that opens the help viewer.
     */
    protected ActionListener createHelpActionListener() {
        return null;
    }

    /**
     * Creates and answers an ActionListener that opens the about dialog.
     */
    protected ActionListener createAboutActionListener() {
        return new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JOptionPane.showMessageDialog(
                    DemoFrame.this,
                    "The simple Looks Demo Application\n"
                        + "\n\u00a9 2001-2004 JGoodies Karsten Lentzsch. All Rights Reserved.\n\n");
            }
        };
    }

    // Checks that all tool bar buttons have a UIResource border
    private static class RolloverCheckButton extends JButton {

        private boolean checked = false;

        public void paint(Graphics g) {
            if (!checked) {
                checkAndSetResult();
            }
            super.paint(g);
        }

        private void checkAndSetResult() {
            Icon passedIcon = readImageIcon("passed.gif");
            Icon failedIcon = readImageIcon("failed.gif");

            boolean passed = allButtonBordersAreUIResources();
            setIcon(passed ? passedIcon : failedIcon);
            setText(passed ? "Can Swap L&F" : "Can't Swap L&F");

            checked = true;
        }

        /**
         * Checks and answers whether all button borders implement UIResource.
         */
        private boolean allButtonBordersAreUIResources() {
            JToolBar bar = (JToolBar) getParent();
            for (int i = bar.getComponentCount() - 1; i >= 0; i--) {
                Component child = bar.getComponent(i);
                if (child instanceof JButton) {
                    Border b = ((JButton) child).getBorder();
                    if (!(b instanceof UIResource))
                        return false;
                }
            }
            return true;
        }

    }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧洲生活片亚洲生活在线观看| 蜜臀91精品一区二区三区| 精品欧美久久久| 欧美三级乱人伦电影| 97久久超碰国产精品电影| 成人禁用看黄a在线| 岛国一区二区在线观看| 岛国一区二区在线观看| av男人天堂一区| 色婷婷综合在线| 欧美在线观看一二区| 欧美色电影在线| 6080yy午夜一二三区久久| 日韩欧美成人激情| 欧美激情一区二区在线| 成人免费在线播放视频| 一卡二卡三卡日韩欧美| 奇米影视7777精品一区二区| 久久精品国产秦先生| 国产精品夜夜嗨| 97久久超碰国产精品| 欧美日韩亚洲国产综合| 日韩精品一区二区三区在线| 中文成人av在线| 另类中文字幕网| 国产精品成人在线观看 | 亚洲免费在线看| 亚洲福利视频导航| 久久99久久99小草精品免视看| 成人午夜电影小说| 欧美中文字幕一区二区三区| 日韩欧美一区二区视频| 国产日韩欧美一区二区三区乱码| 亚洲欧美日韩在线播放| 老司机免费视频一区二区| youjizz久久| 欧美一区二区三区四区久久| 国产婷婷色一区二区三区在线| 亚洲美女屁股眼交| 国产自产视频一区二区三区| 欧美三级一区二区| 亚洲国产精华液网站w| 日韩av中文在线观看| 成人国产电影网| 日韩三级.com| 亚洲综合无码一区二区| 成人综合激情网| 日韩精品专区在线影院重磅| 亚洲男人天堂一区| 成人在线视频首页| 精品国产1区2区3区| 亚洲成人黄色小说| 91丨国产丨九色丨pron| 久久久精品免费观看| 免费看日韩a级影片| 欧美午夜一区二区三区| 亚洲日本乱码在线观看| 国产主播一区二区三区| 日韩欧美色综合网站| 舔着乳尖日韩一区| 91福利在线播放| 亚洲视频 欧洲视频| 国产69精品久久久久777| 2023国产精品自拍| 久久99国内精品| 欧美v日韩v国产v| 奇米精品一区二区三区四区| 欧美天堂亚洲电影院在线播放| 中文字幕亚洲一区二区av在线| 国产精品一区二区果冻传媒| 精品福利一区二区三区免费视频| 日本网站在线观看一区二区三区 | 91精品免费在线| 亚洲国产精品一区二区www| 91美女片黄在线| 亚洲精品国久久99热| 色婷婷av久久久久久久| ...xxx性欧美| 在线亚洲+欧美+日本专区| 伊人开心综合网| 欧美无砖专区一中文字| 亚洲国产欧美一区二区三区丁香婷| 色素色在线综合| 亚洲午夜在线观看视频在线| 欧美精品xxxxbbbb| 久久精品二区亚洲w码| 亚洲精品在线观| 成人亚洲一区二区一| 亚洲欧美综合色| 欧美色爱综合网| 免费久久精品视频| 欧美激情一区二区三区在线| 99久久久久久| 午夜一区二区三区在线观看| 日韩视频一区二区三区在线播放 | 日本成人在线网站| 精品入口麻豆88视频| 国产99久久精品| 亚洲精品视频在线观看免费 | 26uuuu精品一区二区| 国产精品一级在线| 一区二区三区在线视频播放| 欧美精品vⅰdeose4hd| 国产麻豆视频一区二区| 亚洲色图制服诱惑| 亚洲一区在线视频| 国产精品不卡一区二区三区| 91丨porny丨中文| 秋霞午夜鲁丝一区二区老狼| 国产亚洲污的网站| 91蝌蚪porny| 人妖欧美一区二区| 国产精品成人一区二区艾草| 欧美猛男男办公室激情| 国产成人免费在线观看不卡| 亚洲一区二区三区四区在线免费观看 | 国产精品剧情在线亚洲| 欧美剧情电影在线观看完整版免费励志电影 | 亚洲黄色免费网站| 欧美激情一二三区| 91精品国产色综合久久不卡电影 | 亚洲精品视频在线| 久久综合九色综合久久久精品综合| 色先锋aa成人| 国产成人精品影院| 日韩不卡免费视频| 一区二区三区不卡视频| 国产婷婷一区二区| 欧美成人bangbros| 欧美福利电影网| 欧美在线不卡视频| 不卡的av电影| 国产91富婆露脸刺激对白| 麻豆久久久久久久| 午夜精品福利一区二区三区蜜桃| 亚洲国产精品av| 久久久噜噜噜久久人人看| 91精品福利在线一区二区三区| 91亚洲精品久久久蜜桃| 成人免费视频免费观看| 国内精品伊人久久久久影院对白| 亚洲成人动漫一区| 一区二区三区在线不卡| 亚洲欧美日韩国产手机在线| 欧美国产精品专区| 国产午夜精品一区二区三区视频| 精品国精品国产尤物美女| 91精品国产综合久久久蜜臀粉嫩| 欧美丝袜丝交足nylons| 91激情在线视频| 欧美丝袜第三区| 欧美三级资源在线| 欧美精选午夜久久久乱码6080| 欧美亚洲一区二区在线| 欧美吻胸吃奶大尺度电影 | 国产91高潮流白浆在线麻豆| 国产一区二区主播在线| 国产一区二区美女诱惑| 国产高清一区日本| 国v精品久久久网| 91在线丨porny丨国产| 91丨porny丨国产入口| 色老汉一区二区三区| 91九色最新地址| 在线播放一区二区三区| 欧美一区二区三区视频在线观看| 欧美一区二区三区电影| 欧美成人性战久久| 久久久91精品国产一区二区三区| 国产精品网站在线观看| 一区二区三区在线观看网站| 亚洲自拍欧美精品| 久久超碰97人人做人人爱| 成人综合日日夜夜| 在线观看91视频| 亚洲精品一区二区三区影院| 中文欧美字幕免费| 亚洲一区二区三区四区不卡| 美国三级日本三级久久99| 成人免费电影视频| 欧美午夜在线观看| 久久一区二区三区四区| 亚洲日本成人在线观看| 日本不卡一区二区三区高清视频| 精品一区二区三区日韩| 91免费版pro下载短视频| 欧美男人的天堂一二区| 亚洲国产成人在线| 视频一区二区不卡| 国产激情精品久久久第一区二区| 色综合色综合色综合色综合色综合 | 久久久久9999亚洲精品| 一区二区三区在线免费观看| 精品在线观看免费| 91久久免费观看| 久久夜色精品国产欧美乱极品| 亚洲美女电影在线| 国产激情一区二区三区四区 | 久久精品男人的天堂| 一区二区三区在线视频免费|