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

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

?? basiceditorpaneui.java

?? java1.6眾多例子參考
?? JAVA
字號:
/* * @(#)BasicEditorPaneUI.java	1.39 06/04/20 * * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */package javax.swing.plaf.basic;import java.awt.*;import java.awt.event.*;import java.beans.*;import java.net.URL;import java.net.MalformedURLException;import javax.swing.*;import javax.swing.text.*;import javax.swing.text.html.*;import javax.swing.plaf.*;import javax.swing.border.*;/** * Provides the look and feel for a JEditorPane. * <p> * <strong>Warning:</strong> * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing.  As of 1.4, support for long term storage * of all JavaBeans<sup><font size="-2">TM</font></sup> * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. * * @author  Timothy Prinzing * @version 1.39 04/20/06 */public class BasicEditorPaneUI extends BasicTextUI {    /**     * Creates a UI for the JTextPane.     *     * @param c the JTextPane component     * @return the UI     */    public static ComponentUI createUI(JComponent c) {        return new BasicEditorPaneUI();    }    /**     * Creates a new BasicEditorPaneUI.     */    public BasicEditorPaneUI() {	super();    }    /**     * Fetches the name used as a key to lookup properties through the     * UIManager.  This is used as a prefix to all the standard     * text properties.     *     * @return the name ("EditorPane")     */    protected String getPropertyPrefix() {	return "EditorPane";    }    /**     *{@inheritDoc}     *     * @since 1.5     */    public void installUI(JComponent c) {        super.installUI(c);        updateDisplayProperties(c.getFont(),                                c.getForeground());    }    /**     *{@inheritDoc}     *     * @since 1.5     */    public void uninstallUI(JComponent c) {        cleanDisplayProperties();        super.uninstallUI(c);    }        /**     * Fetches the EditorKit for the UI.  This is whatever is     * currently set in the associated JEditorPane.     *     * @return the editor capabilities     * @see TextUI#getEditorKit     */    public EditorKit getEditorKit(JTextComponent tc) {	JEditorPane pane = (JEditorPane) getComponent();	return pane.getEditorKit();    }    /**     * Fetch an action map to use.  The map for a JEditorPane     * is not shared because it changes with the EditorKit.     */    ActionMap getActionMap() {        ActionMap am = new ActionMapUIResource();        am.put("requestFocus", new FocusAction());	EditorKit editorKit = getEditorKit(getComponent());	if (editorKit != null) {	    Action[] actions = editorKit.getActions();	    if (actions != null) {		addActions(am, actions);	    }	}        am.put(TransferHandler.getCutAction().getValue(Action.NAME),                TransferHandler.getCutAction());        am.put(TransferHandler.getCopyAction().getValue(Action.NAME),                TransferHandler.getCopyAction());        am.put(TransferHandler.getPasteAction().getValue(Action.NAME),                TransferHandler.getPasteAction());	return am;    }    /**     * This method gets called when a bound property is changed     * on the associated JTextComponent.  This is a hook     * which UI implementations may change to reflect how the     * UI displays bound properties of JTextComponent subclasses.     * This is implemented to rebuild the ActionMap based upon an     * EditorKit change.     *     * @param evt the property change event     */    protected void propertyChange(PropertyChangeEvent evt) {        super.propertyChange(evt);        String name = evt.getPropertyName();	if ("editorKit".equals(name)) {	    ActionMap map = SwingUtilities.getUIActionMap(getComponent());	    if (map != null) {		Object oldValue = evt.getOldValue();		if (oldValue instanceof EditorKit) {		    Action[] actions = ((EditorKit)oldValue).getActions();		    if (actions != null) {			removeActions(map, actions);		    }		}		Object newValue = evt.getNewValue();		if (newValue instanceof EditorKit) {		    Action[] actions = ((EditorKit)newValue).getActions();		    if (actions != null) {			addActions(map, actions);		    }		}	    }	    updateFocusTraversalKeys();	} else if ("editable".equals(name)) {	    updateFocusTraversalKeys();	} else if ("foreground".equals(name)                   || "font".equals(name)                   || "document".equals(name)                   || JEditorPane.W3C_LENGTH_UNITS.equals(name)                   || JEditorPane.HONOR_DISPLAY_PROPERTIES.equals(name)                   ) {            JComponent c = getComponent();            updateDisplayProperties(c.getFont(), c.getForeground());            if ( JEditorPane.W3C_LENGTH_UNITS.equals(name)                 || JEditorPane.HONOR_DISPLAY_PROPERTIES.equals(name) ) {                modelChanged();            }            if ("foreground".equals(name)) {                Object honorDisplayPropertiesObject = c.                    getClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES);                boolean honorDisplayProperties = false;                if (honorDisplayPropertiesObject instanceof Boolean) {                    honorDisplayProperties =                         ((Boolean)honorDisplayPropertiesObject).booleanValue();                }                if (honorDisplayProperties) {                    modelChanged();                }            }                       }    }    void removeActions(ActionMap map, Action[] actions) {	int n = actions.length;	for (int i = 0; i < n; i++) {	    Action a = actions[i];	    map.remove(a.getValue(Action.NAME));	}    }    void addActions(ActionMap map, Action[] actions) {	int n = actions.length;	for (int i = 0; i < n; i++) {	    Action a = actions[i];	    map.put(a.getValue(Action.NAME), a);	}    }    void updateDisplayProperties(Font font, Color fg) {        JComponent c = getComponent();        Object honorDisplayPropertiesObject = c.            getClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES);        boolean honorDisplayProperties = false;        Object w3cLengthUnitsObject = c.getClientProperty(JEditorPane.                                                          W3C_LENGTH_UNITS);        boolean w3cLengthUnits = false;        if (honorDisplayPropertiesObject instanceof Boolean) {            honorDisplayProperties =                 ((Boolean)honorDisplayPropertiesObject).booleanValue();        }        if (w3cLengthUnitsObject instanceof Boolean) {            w3cLengthUnits = ((Boolean)w3cLengthUnitsObject).booleanValue();        }        if (this instanceof BasicTextPaneUI            || honorDisplayProperties) {             //using equals because can not use UIResource for Boolean            Document doc = getComponent().getDocument();            if (doc instanceof StyledDocument) {                if (doc instanceof HTMLDocument                    && honorDisplayProperties) {                    updateCSS(font, fg);                } else {                    updateStyle(font, fg);                }            }        } else {            cleanDisplayProperties();        }        if ( w3cLengthUnits ) {            Document doc = getComponent().getDocument();            if (doc instanceof HTMLDocument) {                StyleSheet documentStyleSheet =                     ((HTMLDocument)doc).getStyleSheet();                documentStyleSheet.addRule("W3C_LENGTH_UNITS_ENABLE");            }        } else {            Document doc = getComponent().getDocument();            if (doc instanceof HTMLDocument) {                StyleSheet documentStyleSheet =                     ((HTMLDocument)doc).getStyleSheet();                documentStyleSheet.addRule("W3C_LENGTH_UNITS_DISABLE");            }        }    }        /**     * Attribute key to reference the default font.     * used in javax.swing.text.StyleContext.getFont     * to resolve the default font.     */    private static final String FONT_ATTRIBUTE_KEY = "FONT_ATTRIBUTE_KEY";    void cleanDisplayProperties() {        Document document = getComponent().getDocument();        if (document instanceof HTMLDocument) {            StyleSheet documentStyleSheet =                 ((HTMLDocument)document).getStyleSheet();            StyleSheet[] styleSheets = documentStyleSheet.getStyleSheets();            if (styleSheets != null) {                for (StyleSheet s : styleSheets) {                    if (s instanceof StyleSheetUIResource) {                        documentStyleSheet.removeStyleSheet(s);                        documentStyleSheet.addRule("BASE_SIZE_DISABLE");                        break;                    }                }            }            Style style = ((StyledDocument) document).getStyle(StyleContext.DEFAULT_STYLE);            if (style.getAttribute(FONT_ATTRIBUTE_KEY) != null) {                style.removeAttribute(FONT_ATTRIBUTE_KEY);            }        }    }        static class StyleSheetUIResource extends StyleSheet implements UIResource {    }        private void updateCSS(Font font, Color fg) {        JTextComponent component = getComponent();        Document document = component.getDocument();        if (document instanceof HTMLDocument) {            StyleSheet styleSheet = new StyleSheetUIResource();            StyleSheet documentStyleSheet =                 ((HTMLDocument)document).getStyleSheet();            StyleSheet[] styleSheets = documentStyleSheet.getStyleSheets();            if (styleSheets != null) {                for (StyleSheet s : styleSheets) {                    if (s instanceof StyleSheetUIResource) {                        documentStyleSheet.removeStyleSheet(s);                    }                }            }            String cssRule = sun.swing.                SwingUtilities2.displayPropertiesToCSS(font,                                                       fg);            styleSheet.addRule(cssRule);            documentStyleSheet.addStyleSheet(styleSheet);            documentStyleSheet.addRule("BASE_SIZE " +                                        component.getFont().getSize());            Style style = ((StyledDocument) document).getStyle(StyleContext.DEFAULT_STYLE);            if (! font.equals(style.getAttribute(FONT_ATTRIBUTE_KEY))) {                style.addAttribute(FONT_ATTRIBUTE_KEY, font);            }        }    }    private void updateStyle(Font font, Color fg) {        updateFont(font);        updateForeground(fg);    }    /**     * Update the color in the default style of the document.     *     * @param color the new color to use or null to remove the color attribute     *              from the document's style     */    private void updateForeground(Color color) {        StyledDocument doc = (StyledDocument)getComponent().getDocument();        Style style = doc.getStyle(StyleContext.DEFAULT_STYLE);        if (style == null) {            return;        }        if (color == null) {            if (style.getAttribute(StyleConstants.Foreground) != null) {                style.removeAttribute(StyleConstants.Foreground);            }        } else {            if (! color.equals(StyleConstants.getForeground(style))) {                StyleConstants.setForeground(style, color);            }        }    }        /**     * Update the font in the default style of the document.     *     * @param font the new font to use or null to remove the font attribute     *             from the document's style     */    private void updateFont(Font font) {        StyledDocument doc = (StyledDocument)getComponent().getDocument();        Style style = doc.getStyle(StyleContext.DEFAULT_STYLE);        if (style == null) {            return;        }        String fontFamily = (String) style.getAttribute(StyleConstants.FontFamily);         Integer fontSize = (Integer) style.getAttribute(StyleConstants.FontSize);        Boolean isBold = (Boolean) style.getAttribute(StyleConstants.Bold);        Boolean isItalic = (Boolean) style.getAttribute(StyleConstants.Italic);        Font  fontAttribute = (Font) style.getAttribute(FONT_ATTRIBUTE_KEY);        if (font == null) {            if (fontFamily != null) {                style.removeAttribute(StyleConstants.FontFamily);            }            if (fontSize != null) {                style.removeAttribute(StyleConstants.FontSize);            }            if (isBold != null) {                style.removeAttribute(StyleConstants.Bold);            }            if (isItalic != null) {                style.removeAttribute(StyleConstants.Italic);            }            if (fontAttribute != null) {                style.removeAttribute(FONT_ATTRIBUTE_KEY);           }         } else {            if (! font.getName().equals(fontFamily)) {                StyleConstants.setFontFamily(style, font.getName());            }            if (fontSize == null                   || fontSize.intValue() != font.getSize()) {                StyleConstants.setFontSize(style, font.getSize());            }            if (isBold == null                   || isBold.booleanValue() != font.isBold()) {                StyleConstants.setBold(style, font.isBold());            }            if (isItalic == null                   || isItalic.booleanValue() != font.isItalic()) {                StyleConstants.setItalic(style, font.isItalic());            }            if (! font.equals(fontAttribute)) {                style.addAttribute(FONT_ATTRIBUTE_KEY, font);            }        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人av一区二区三区在线| 欧美欧美午夜aⅴ在线观看| 一本到不卡免费一区二区| 日韩一级黄色大片| 亚洲免费视频中文字幕| 久久www免费人成看片高清| 91美女片黄在线观看91美女| 欧美不卡视频一区| 一区二区三区国产精华| 国产成人在线视频免费播放| 欧美一区二区在线免费观看| 亚洲蜜桃精久久久久久久| 国产综合一区二区| 欧美午夜精品理论片a级按摩| 久久精品无码一区二区三区| 日本亚洲三级在线| 在线视频观看一区| 国产无人区一区二区三区| 日韩精品亚洲专区| 欧美日韩精品电影| 亚洲精品国产无天堂网2021| 成人性色生活片| 久久久久久麻豆| 韩国成人福利片在线播放| 91麻豆精品国产自产在线观看一区| 国产精品二三区| 成人久久18免费网站麻豆| 国产天堂亚洲国产碰碰| 成人av网站免费观看| 欧美精品一区二| 韩国一区二区视频| 91精品久久久久久久99蜜桃 | 亚洲国产精品影院| 色哟哟在线观看一区二区三区| 日本一区二区视频在线| 国产精品911| 国产精品亲子伦对白| 国产精品一区二区久久不卡| 国产偷国产偷亚洲高清人白洁 | av中文字幕亚洲| 综合欧美一区二区三区| 99久久777色| 一区二区在线观看视频| 欧美色男人天堂| 奇米四色…亚洲| 国产亚洲va综合人人澡精品 | 色综合天天性综合| 亚洲精品视频在线观看免费| 日本精品一区二区三区高清| 亚洲国产成人va在线观看天堂| 88在线观看91蜜桃国自产| 免费日韩伦理电影| 精品国产电影一区二区| 成人av网址在线| 亚洲国产日产av| 91精品国产黑色紧身裤美女| 国产一区二区三区av电影| 久久久久高清精品| 一本大道久久精品懂色aⅴ| 亚洲一区二区三区不卡国产欧美| 欧美剧情电影在线观看完整版免费励志电影 | 国产日韩三级在线| aaa欧美大片| 亚洲chinese男男1069| 欧美变态tickling挠脚心| 不卡一区中文字幕| 亚洲国产视频在线| 久久亚洲捆绑美女| 91久久精品一区二区二区| 老司机精品视频线观看86| 国产精品九色蝌蚪自拍| 欧美福利视频一区| 从欧美一区二区三区| 亚洲成av人影院| 亚洲国产精品成人综合| 欧美伊人久久大香线蕉综合69| 成人一区在线观看| 亚洲成人午夜影院| 国产欧美日韩综合精品一区二区 | 洋洋av久久久久久久一区| 欧美成人三级电影在线| 99视频在线精品| 精品一二三四区| 午夜视频在线观看一区二区三区| 久久久久久久久免费| 欧美人与性动xxxx| av一本久道久久综合久久鬼色| 麻豆中文一区二区| 亚洲成人动漫精品| 一区二区三区四区精品在线视频| 欧美国产欧美综合| 日韩一级免费观看| 欧美精品v日韩精品v韩国精品v| 91麻豆国产福利精品| 国产二区国产一区在线观看| 免费观看在线综合色| 亚洲午夜久久久久| 亚洲精品乱码久久久久久日本蜜臀| 欧美激情中文不卡| 精品国产免费久久| 日韩三级高清在线| 欧美一区二区三区免费视频| 欧美日韩国产天堂| 在线欧美小视频| 91浏览器在线视频| 99re成人在线| 色综合一个色综合亚洲| 99精品欧美一区二区蜜桃免费| 国产成人自拍网| 国产精品一区二区无线| 国产在线播精品第三| 韩国午夜理伦三级不卡影院| 久久99国产精品免费| 亚洲bdsm女犯bdsm网站| 日韩和的一区二区| 日韩精品电影在线观看| 蜜臀久久99精品久久久久久9| 奇米影视7777精品一区二区| 美女精品一区二区| 韩国v欧美v亚洲v日本v| 国产麻豆视频一区二区| 国产成人av在线影院| 99久久99久久精品免费观看| 欧美一级高清大全免费观看| 这里是久久伊人| 日韩一区二区在线观看| 日韩女优制服丝袜电影| 26uuu亚洲综合色| 中文字幕欧美一| 亚洲免费在线电影| 图片区日韩欧美亚洲| 裸体健美xxxx欧美裸体表演| 精品一区二区三区欧美| 成人午夜视频在线| 一本一道久久a久久精品| 在线91免费看| 国产亚洲欧美色| 一区二区三区色| 青娱乐精品视频| 国产麻豆一精品一av一免费 | 欧美一区二区视频观看视频| 欧美mv和日韩mv国产网站| 国产视频一区在线观看| 亚洲男女一区二区三区| 蜜桃av噜噜一区二区三区小说| 国产麻豆精品在线| 色94色欧美sute亚洲线路二| 日韩精品一区二区三区在线观看| 欧美精品一区视频| 亚洲欧美一区二区三区孕妇| 日韩高清不卡在线| 国产传媒欧美日韩成人| 91传媒视频在线播放| 精品奇米国产一区二区三区| 亚洲欧美日韩人成在线播放| 免费观看在线综合| 91美女视频网站| 欧美mv日韩mv国产网站app| 亚洲精品视频一区二区| 国产乱人伦偷精品视频免下载| 欧美三级在线播放| 久久综合久久久久88| 一区二区三区欧美日| 国产精品99久久久久久久女警| 欧亚一区二区三区| 久久精品视频免费观看| 五月天一区二区| 色噜噜狠狠一区二区三区果冻| 久久综合999| 日韩va欧美va亚洲va久久| 欧美精品一卡两卡| 国产欧美视频一区二区| 男人的j进女人的j一区| 色婷婷激情综合| 欧美国产成人在线| 蜜臀av一级做a爰片久久| 97se亚洲国产综合在线| 久久久久久夜精品精品免费| 日本美女一区二区三区视频| 色综合久久久久综合体桃花网| 久久这里只有精品视频网| 亚洲成人精品一区| 91浏览器在线视频| 亚洲欧洲性图库| 成人黄色a**站在线观看| 欧美大度的电影原声| 亚洲超丰满肉感bbw| 日本高清不卡一区| 中文字幕不卡三区| 国产美女一区二区三区| 精品国产1区二区| 国产综合色在线视频区| 欧美成人一区二区三区片免费| 日韩av网站在线观看| 欧美三级中文字幕在线观看| 亚洲一区二区三区中文字幕| 欧洲av一区二区嗯嗯嗯啊| 亚洲一卡二卡三卡四卡无卡久久| 91老师片黄在线观看| 亚洲乱码国产乱码精品精小说 |