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

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

?? basicbuttonui.java

?? java1.6眾多例子參考
?? JAVA
字號:
/* * @(#)BasicButtonUI.java	1.118 06/07/20 * * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ package javax.swing.plaf.basic;import sun.swing.SwingUtilities2;import java.awt.*;import java.awt.event.*;import java.io.Serializable;import javax.swing.*;import javax.swing.border.*;import java.awt.*;import java.awt.event.*;import javax.swing.plaf.ButtonUI;import javax.swing.plaf.UIResource;import javax.swing.plaf.ComponentUI;import javax.swing.text.View;/** * BasicButton implementation * * @version 1.118 07/20/06 * @author Jeff Dinkins */public class BasicButtonUI extends ButtonUI{    // Shared UI object    private final static BasicButtonUI buttonUI = new BasicButtonUI();    // Visual constants    // NOTE: This is not used or set any where. Were we allowed to remove    // fields, this would be removed.    protected int defaultTextIconGap;        // Amount to offset text, the value of this comes from    // defaultTextShiftOffset once setTextShiftOffset has been invoked.    private int shiftOffset = 0;    // Value that is set in shiftOffset once setTextShiftOffset has been    // invoked. The value of this comes from the defaults table.    protected int defaultTextShiftOffset;    private final static String propertyPrefix = "Button" + ".";    // ********************************    //          Create PLAF    // ********************************    public static ComponentUI createUI(JComponent c) {        return buttonUI;    }    protected String getPropertyPrefix() {        return propertyPrefix;    }    // ********************************    //          Install PLAF    // ********************************    public void installUI(JComponent c) {        installDefaults((AbstractButton) c);        installListeners((AbstractButton) c);        installKeyboardActions((AbstractButton) c);	BasicHTML.updateRenderer(c, ((AbstractButton) c).getText());    }    protected void installDefaults(AbstractButton b) {        // load shared instance defaults        String pp = getPropertyPrefix();        defaultTextShiftOffset = UIManager.getInt(pp + "textShiftOffset");        // set the following defaults on the button        if (b.isContentAreaFilled()) {            LookAndFeel.installProperty(b, "opaque", Boolean.TRUE);        } else {            LookAndFeel.installProperty(b, "opaque", Boolean.FALSE);        }        if(b.getMargin() == null || (b.getMargin() instanceof UIResource)) {            b.setMargin(UIManager.getInsets(pp + "margin"));        }	LookAndFeel.installColorsAndFont(b, pp + "background",                                         pp + "foreground", pp + "font");        LookAndFeel.installBorder(b, pp + "border");        Object rollover = UIManager.get(pp + "rollover");        if (rollover != null) {            LookAndFeel.installProperty(b, "rolloverEnabled", rollover);        }        LookAndFeel.installProperty(b, "iconTextGap", new Integer(4));    }    protected void installListeners(AbstractButton b) {        BasicButtonListener listener = createButtonListener(b);        if(listener != null) {            b.addMouseListener(listener);            b.addMouseMotionListener(listener);            b.addFocusListener(listener);            b.addPropertyChangeListener(listener);            b.addChangeListener(listener);        }    }        protected void installKeyboardActions(AbstractButton b){        BasicButtonListener listener = getButtonListener(b);        if(listener != null) {            listener.installKeyboardActions(b);        }    }            // ********************************    //         Uninstall PLAF    // ********************************    public void uninstallUI(JComponent c) {        uninstallKeyboardActions((AbstractButton) c);        uninstallListeners((AbstractButton) c);        uninstallDefaults((AbstractButton) c);	BasicHTML.updateRenderer(c, "");    }    protected void uninstallKeyboardActions(AbstractButton b) {        BasicButtonListener listener = getButtonListener(b);        if(listener != null) {            listener.uninstallKeyboardActions(b);        }    }    protected void uninstallListeners(AbstractButton b) {        BasicButtonListener listener = getButtonListener(b);        if(listener != null) {            b.removeMouseListener(listener);            b.removeMouseMotionListener(listener);            b.removeFocusListener(listener);            b.removeChangeListener(listener);            b.removePropertyChangeListener(listener);        }    }    protected void uninstallDefaults(AbstractButton b) {        LookAndFeel.uninstallBorder(b);    }      // ********************************    //        Create Listeners     // ********************************    protected BasicButtonListener createButtonListener(AbstractButton b) {        return new BasicButtonListener(b);    }    public int getDefaultTextIconGap(AbstractButton b) {        return defaultTextIconGap;    }    /* These rectangles/insets are allocated once for all      * ButtonUI.paint() calls.  Re-using rectangles rather than      * allocating them in each paint call substantially reduced the time     * it took paint to run.  Obviously, this method can't be re-entered.     */    private static Rectangle viewRect = new Rectangle();    private static Rectangle textRect = new Rectangle();    private static Rectangle iconRect = new Rectangle();    // ********************************    //          Paint Methods    // ********************************    public void paint(Graphics g, JComponent c)     {        AbstractButton b = (AbstractButton) c;        ButtonModel model = b.getModel();        String text = layout(b, SwingUtilities2.getFontMetrics(b, g),               b.getWidth(), b.getHeight());        clearTextShiftOffset();        // perform UI specific press action, e.g. Windows L&F shifts text        if (model.isArmed() && model.isPressed()) {            paintButtonPressed(g,b);         }        // Paint the Icon        if(b.getIcon() != null) {             paintIcon(g,c,iconRect);        }        if (text != null && !text.equals("")){	    View v = (View) c.getClientProperty(BasicHTML.propertyKey);	    if (v != null) {		v.paint(g, textRect);	    } else {		paintText(g, b, textRect, text);	    }        }        if (b.isFocusPainted() && b.hasFocus()) {            // paint UI specific focus            paintFocus(g,b,viewRect,textRect,iconRect);        }    }        protected void paintIcon(Graphics g, JComponent c, Rectangle iconRect){            AbstractButton b = (AbstractButton) c;                                       ButtonModel model = b.getModel();            Icon icon = b.getIcon();            Icon tmpIcon = null;	    if(icon == null) {	       return;	    }            Icon selectedIcon = null;            /* the fallback icon should be based on the selected state */            if (model.isSelected()) {                selectedIcon = (Icon) b.getSelectedIcon();                if (selectedIcon != null) {                    icon = selectedIcon;                }            }            if(!model.isEnabled()) {		if(model.isSelected()) {                   tmpIcon = (Icon) b.getDisabledSelectedIcon();                   if (tmpIcon == null) {                       tmpIcon = selectedIcon;                   }                }                if (tmpIcon == null) {                    tmpIcon = (Icon) b.getDisabledIcon();                }            } else if(model.isPressed() && model.isArmed()) {                tmpIcon = (Icon) b.getPressedIcon();                if(tmpIcon != null) {                    // revert back to 0 offset                    clearTextShiftOffset();                }            } else if(b.isRolloverEnabled() && model.isRollover()) {		if(model.isSelected()) {                   tmpIcon = (Icon) b.getRolloverSelectedIcon();                   if (tmpIcon == null) {                       tmpIcon = selectedIcon;                   }                }                if (tmpIcon == null) {                    tmpIcon = (Icon) b.getRolloverIcon();                }            }              	    if(tmpIcon != null) {	        icon = tmpIcon;	    }                           if(model.isPressed() && model.isArmed()) {                icon.paintIcon(c, g, iconRect.x + getTextShiftOffset(),                        iconRect.y + getTextShiftOffset());            } else {                icon.paintIcon(c, g, iconRect.x, iconRect.y);            }    }    /**     * As of Java 2 platform v 1.4 this method should not be used or overriden.     * Use the paintText method which takes the AbstractButton argument.     */    protected void paintText(Graphics g, JComponent c, Rectangle textRect, String text) {        AbstractButton b = (AbstractButton) c;                               ButtonModel model = b.getModel();        FontMetrics fm = SwingUtilities2.getFontMetrics(c, g);        int mnemonicIndex = b.getDisplayedMnemonicIndex();	/* Draw the Text */	if(model.isEnabled()) {	    /*** paint the text normally */	    g.setColor(b.getForeground());	    SwingUtilities2.drawStringUnderlineCharAt(c, g,text, mnemonicIndex,					  textRect.x + getTextShiftOffset(),					  textRect.y + fm.getAscent() + getTextShiftOffset());	}	else {	    /*** paint the text disabled ***/	    g.setColor(b.getBackground().brighter());	    SwingUtilities2.drawStringUnderlineCharAt(c, g,text, mnemonicIndex,					  textRect.x, textRect.y + fm.getAscent());	    g.setColor(b.getBackground().darker());	    SwingUtilities2.drawStringUnderlineCharAt(c, g,text, mnemonicIndex,					  textRect.x - 1, textRect.y + fm.getAscent() - 1);	}    }    /**     * Method which renders the text of the current button.     * <p>     * @param g Graphics context     * @param b Current button to render     * @param textRect Bounding rectangle to render the text.     * @param text String to render     * @since 1.4     */    protected void paintText(Graphics g, AbstractButton b, Rectangle textRect, String text) {	paintText(g, (JComponent)b, textRect, text);    }    // Method signature defined here overriden in subclasses.     // Perhaps this class should be abstract?    protected void paintFocus(Graphics g, AbstractButton b,                              Rectangle viewRect, Rectangle textRect, Rectangle iconRect){    }      protected void paintButtonPressed(Graphics g, AbstractButton b){    }    protected void clearTextShiftOffset(){        this.shiftOffset = 0;    }    protected void setTextShiftOffset(){        this.shiftOffset = defaultTextShiftOffset;    }    protected int getTextShiftOffset() {        return shiftOffset;    }    // ********************************    //          Layout Methods    // ********************************    public Dimension getMinimumSize(JComponent c) {        Dimension d = getPreferredSize(c);	View v = (View) c.getClientProperty(BasicHTML.propertyKey);	if (v != null) {	    d.width -= v.getPreferredSpan(View.X_AXIS) - v.getMinimumSpan(View.X_AXIS);	}	return d;    }    public Dimension getPreferredSize(JComponent c) {        AbstractButton b = (AbstractButton)c;        return BasicGraphicsUtils.getPreferredButtonSize(b, b.getIconTextGap());    }    public Dimension getMaximumSize(JComponent c) {        Dimension d = getPreferredSize(c);	View v = (View) c.getClientProperty(BasicHTML.propertyKey);	if (v != null) {	    d.width += v.getMaximumSpan(View.X_AXIS) - v.getPreferredSpan(View.X_AXIS);	}	return d;    }    /**     * Returns the baseline.     *     * @throws NullPointerException {@inheritDoc}     * @throws IllegalArgumentException {@inheritDoc}     * @see javax.swing.JComponent#getBaseline(int, int)     * @since 1.6     */    public int getBaseline(JComponent c, int width, int height) {        super.getBaseline(c, width, height);        AbstractButton b = (AbstractButton)c;        String text = b.getText();        if (text == null || "".equals(text)) {            return -1;        }        FontMetrics fm = b.getFontMetrics(b.getFont());        layout(b, fm, width, height);        return BasicHTML.getBaseline(b, textRect.y, fm.getAscent(),                                     textRect.width, textRect.height);    }    /**     * Returns an enum indicating how the baseline of the component     * changes as the size changes.     *     * @throws NullPointerException {@inheritDoc}     * @see javax.swing.JComponent#getBaseline(int, int)     * @since 1.6     */    public Component.BaselineResizeBehavior getBaselineResizeBehavior(            JComponent c) {        super.getBaselineResizeBehavior(c);        if (c.getClientProperty(BasicHTML.propertyKey) != null) {            return Component.BaselineResizeBehavior.OTHER;        }        switch(((AbstractButton)c).getVerticalAlignment()) {        case AbstractButton.TOP:            return Component.BaselineResizeBehavior.CONSTANT_ASCENT;        case AbstractButton.BOTTOM:            return Component.BaselineResizeBehavior.CONSTANT_DESCENT;        case AbstractButton.CENTER:            return Component.BaselineResizeBehavior.CENTER_OFFSET;        }        return Component.BaselineResizeBehavior.OTHER;    }    private String layout(AbstractButton b, FontMetrics fm,                          int width, int height) {        Insets i = b.getInsets();        viewRect.x = i.left;        viewRect.y = i.top;        viewRect.width = width - (i.right + viewRect.x);        viewRect.height = height - (i.bottom + viewRect.y);        textRect.x = textRect.y = textRect.width = textRect.height = 0;        iconRect.x = iconRect.y = iconRect.width = iconRect.height = 0;        // layout the text and icon        return SwingUtilities.layoutCompoundLabel(            b, fm, b.getText(), b.getIcon(),             b.getVerticalAlignment(), b.getHorizontalAlignment(),            b.getVerticalTextPosition(), b.getHorizontalTextPosition(),            viewRect, iconRect, textRect,             b.getText() == null ? 0 : b.getIconTextGap());    }    /**     * Returns the ButtonListener for the passed in Button, or null if one     * could not be found.     */    private BasicButtonListener getButtonListener(AbstractButton b) {        MouseMotionListener[] listeners = b.getMouseMotionListeners();        if (listeners != null) {            for (int counter = 0; counter < listeners.length; counter++) {                if (listeners[counter] instanceof BasicButtonListener) {                    return (BasicButtonListener)listeners[counter];                }            }        }        return null;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久9999| 亚洲精品久久7777| 欧美v日韩v国产v| 26uuu精品一区二区| 亚洲免费观看高清完整版在线观看 | 2023国产精品自拍| 亚洲免费视频中文字幕| 日韩av电影天堂| 在线免费亚洲电影| 久久夜色精品一区| 图片区小说区区亚洲影院| 成人免费视频视频| 538在线一区二区精品国产| 亚洲女女做受ⅹxx高潮| 国产一区二区三区免费| 欧美日韩一区不卡| 亚洲欧美日本在线| 久久99最新地址| 91精品国产91久久综合桃花| 1024国产精品| 国产精品一区在线观看乱码| 制服丝袜亚洲网站| 一区二区三区在线观看视频| 精品影院一区二区久久久| 欧美日韩一本到| 中文字幕一区二区三区不卡 | 欧美男同性恋视频网站| 国产欧美日韩中文久久| 美女一区二区三区| 精品国产1区二区| 日日噜噜夜夜狠狠视频欧美人 | 天天爽夜夜爽夜夜爽精品视频| 大尺度一区二区| 久久伊99综合婷婷久久伊| 麻豆一区二区三| 日韩无一区二区| 精品写真视频在线观看| 欧美一卡在线观看| 精品在线观看视频| 精品少妇一区二区三区视频免付费 | 欧美无砖砖区免费| 国产精品麻豆欧美日韩ww| 国产成人精品免费在线| 久久久九九九九| 99久久久精品| 亚洲精品亚洲人成人网在线播放| 日本高清不卡视频| 亚洲一二三专区| 欧美乱熟臀69xxxxxx| 奇米色一区二区| 精品国内二区三区| heyzo一本久久综合| 亚洲欧洲三级电影| 欧美日韩亚洲综合在线| 日韩av中文字幕一区二区三区| 99久久精品国产精品久久| 性久久久久久久| 日韩欧美区一区二| 99精品欧美一区二区蜜桃免费| 自拍偷拍亚洲激情| 欧美精品v国产精品v日韩精品| 男女激情视频一区| 26uuuu精品一区二区| 丁香婷婷深情五月亚洲| 亚洲少妇30p| 91麻豆精品国产自产在线观看一区| 免费看日韩精品| 国产精品毛片久久久久久久| 色哟哟国产精品免费观看| 亚洲va韩国va欧美va精品 | 一区二区三区中文字幕| 91精品婷婷国产综合久久竹菊| 精品一区二区久久久| 国产偷国产偷亚洲高清人白洁| 色狠狠av一区二区三区| 秋霞影院一区二区| 亚洲婷婷在线视频| 欧美一区二区三区色| 另类小说图片综合网| 亚洲欧美日韩国产手机在线 | 成人av电影免费在线播放| 亚洲超碰精品一区二区| 国产亚洲成aⅴ人片在线观看| 欧美午夜精品一区二区蜜桃| 久久99精品久久久久久久久久久久 | 欧美mv和日韩mv的网站| 欧美日韩情趣电影| 国产成人综合网站| 日本aⅴ亚洲精品中文乱码| 国产亚洲一本大道中文在线| 欧美性一级生活| 国产99久久久国产精品潘金 | 一本色道亚洲精品aⅴ| 狠狠色丁香久久婷婷综合丁香| 中文字幕亚洲视频| 国产日韩精品一区二区三区| 欧美日本视频在线| 国产99久久久精品| 精品系列免费在线观看| 亚洲国产精品久久不卡毛片| 中文字幕中文在线不卡住| 日韩精品中文字幕一区二区三区| 91黄色在线观看| 国产suv精品一区二区883| 一区二区三区精品久久久| 精品国产91久久久久久久妲己| 欧美三级欧美一级| 欧美三级乱人伦电影| 91性感美女视频| 成人av片在线观看| 久久综合综合久久综合| 奇米精品一区二区三区四区| 亚洲成人自拍网| 国产偷国产偷亚洲高清人白洁 | 男女男精品视频网| 蜜臀av在线播放一区二区三区| 樱花草国产18久久久久| 一二三四区精品视频| 国产精品免费丝袜| 日韩欧美国产麻豆| 欧美一区二区福利在线| 欧美日韩aaaaaa| 91成人国产精品| 一本色道久久综合亚洲aⅴ蜜桃| 国产不卡视频在线观看| 9色porny自拍视频一区二区| 国产福利91精品一区二区三区| 国产成人精品在线看| 国产一区二区在线观看免费| 日韩精品一级二级 | 亚洲一区在线电影| 亚洲激情六月丁香| 午夜精品久久久久久久| 日韩精品色哟哟| 国产91综合一区在线观看| 国产成人精品网址| 91久久人澡人人添人人爽欧美| 欧美自拍丝袜亚洲| 99精品偷自拍| 91麻豆精品国产综合久久久久久| 91精品国产综合久久福利软件| 久久综合一区二区| 国产日韩欧美不卡在线| 亚洲午夜视频在线观看| 青青草精品视频| 成人精品国产免费网站| 97se狠狠狠综合亚洲狠狠| 欧美疯狂做受xxxx富婆| 欧美日韩在线直播| 精品欧美乱码久久久久久| 国产欧美一区二区三区鸳鸯浴| 国产欧美一区二区三区沐欲| 亚洲二区在线观看| 天天色图综合网| 成人福利视频在线看| 欧美专区亚洲专区| 国产午夜精品理论片a级大结局 | 黑人巨大精品欧美一区| 成a人片亚洲日本久久| 777午夜精品免费视频| 久久婷婷成人综合色| 夜夜精品视频一区二区| 久久99最新地址| 一区二区三区在线免费观看| 另类小说综合欧美亚洲| www.欧美.com| 欧美mv日韩mv国产网站| 一区二区三区四区在线播放| 国产精品一区二区在线播放| 色成人在线视频| 中文字幕 久热精品 视频在线| 亚洲伊人色欲综合网| 国产成人超碰人人澡人人澡| 国产精品18久久久久久久久 | 国产黄人亚洲片| 精品视频免费在线| 亚洲男人天堂一区| 国产一区二区在线观看视频| 在线综合亚洲欧美在线视频| 国产精品嫩草影院av蜜臀| 捆绑调教一区二区三区| 色综合视频在线观看| 中文字幕免费不卡在线| 久久国产人妖系列| 欧美一级午夜免费电影| 一区二区久久久| 91久久精品一区二区| 欧美激情一区二区在线| 国产一区二区伦理| 91精品国产综合久久精品图片| 亚洲最大成人综合| eeuss鲁一区二区三区| 中文久久乱码一区二区| 国产原创一区二区三区| 国产激情精品久久久第一区二区| www亚洲一区| 亚洲一二三专区| 欧美色图一区二区三区| 亚洲国产精品ⅴa在线观看| 成人app下载|