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

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

?? basichtml.java

?? JAVA的一些源碼 JAVA2 STANDARD EDITION DEVELOPMENT KIT 5.0
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * @(#)BasicHTML.java	1.22 04/07/23 * * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */package javax.swing.plaf.basic;import java.io.*;import java.awt.*;import java.net.URL;import javax.swing.*;import javax.swing.text.*;import javax.swing.text.html.*;import com.sun.java.swing.SwingUtilities2;/** * Support for providing html views for the swing components. * This translates a simple html string to a javax.swing.text.View * implementation that can render the html and provide the necessary * layout semantics. * * @author  Timothy Prinzing * @version 1.22 07/23/04 */public class BasicHTML {    /**     * Create an html renderer for the given component and     * string of html.     */    public static View createHTMLView(JComponent c, String html) {	BasicEditorKit kit = getFactory();	Document doc = kit.createDefaultDocument(c.getFont(),                                                 c.getForeground());	Object base = c.getClientProperty(documentBaseKey);	if (base instanceof URL) {	    ((HTMLDocument)doc).setBase((URL)base);	}	Reader r = new StringReader(html);	try {	    kit.read(r, doc, 0);	} catch (Throwable e) {	}	ViewFactory f = kit.getViewFactory();	View hview = f.create(doc.getDefaultRootElement());	View v = new Renderer(c, f, hview);	return v;    }    /**     * Check the given string to see if it should trigger the     * html rendering logic in a non-text component that supports      * html rendering.     */    public static boolean isHTMLString(String s) {	if (s != null) {	    if ((s.length() >= 6) && (s.charAt(0) == '<') && (s.charAt(5) == '>')) {		String tag = s.substring(1,5);		return tag.equalsIgnoreCase(propertyKey);	    }	}	return false;    }    /**     * Stash the HTML render for the given text into the client     * properties of the given JComponent. If the given text is      * <em>NOT HTML</em> the property will be cleared of any     * renderer.     * <p>     * This method is useful for ComponentUI implementations     * that are static (i.e. shared) and get their state     * entirely from the JComponent.     */    public static void updateRenderer(JComponent c, String text) {	View value = null;        View oldValue = (View)c.getClientProperty(BasicHTML.propertyKey);        Boolean htmlDisabled = (Boolean) c.getClientProperty(htmlDisable);	if (htmlDisabled != Boolean.TRUE && BasicHTML.isHTMLString(text)) {	    value = BasicHTML.createHTMLView(c, text);	}        if (value != oldValue && oldValue != null) {            for (int i = 0; i < oldValue.getViewCount(); i++) {                oldValue.getView(i).setParent(null);            }        }	c.putClientProperty(BasicHTML.propertyKey, value);    }    /**     * If this client property of a JComponent is set to Boolean.TRUE     * the component's 'text' property is never treated as HTML.     */    private static final String htmlDisable = "html.disable";    /**     * Key to use for the html renderer when stored as a      * client property of a JComponent.     */    public static final String propertyKey = "html";    /**     * Key stored as a client property to indicate the base that relative     * references are resolved against. For example, lets say you keep     * your images in the directory resources relative to the code path,     * you would use the following the set the base:     * <pre>     *   jComponent.putClientProperty(documentBaseKey,     *                                xxx.class.getResource("resources/"));     * </pre>     */    public static final String documentBaseKey = "html.base";    static BasicEditorKit getFactory() {	if (basicHTMLFactory == null) {            basicHTMLViewFactory = new BasicHTMLViewFactory();	    basicHTMLFactory = new BasicEditorKit();	}	return basicHTMLFactory;    }    /**     * The source of the html renderers     */    private static BasicEditorKit basicHTMLFactory;    /**     * Creates the Views that visually represent the model.     */    private static ViewFactory basicHTMLViewFactory;    /**     * Overrides to the default stylesheet.  Should consider     * just creating a completely fresh stylesheet.     */    private static final String styleChanges =     "p { margin-top: 0; margin-bottom: 0; margin-left: 0; margin-right: 0 }" +    "body { margin-top: 0; margin-bottom: 0; margin-left: 0; margin-right: 0 }";    /**     * The views produced for the ComponentUI implementations aren't     * going to be edited and don't need full html support.  This kit     * alters the HTMLEditorKit to try and trim things down a bit.       * It does the following:     * <ul>     * <li>It doesn't produce Views for things like comments,      * head, title, unknown tags, etc.       * <li>It installs a different set of css settings from the default     * provided by HTMLEditorKit.     * </ul>     */    static class BasicEditorKit extends HTMLEditorKit {	/** Shared base style for all documents created by us use. */	private static StyleSheet defaultStyles;	/**	 * Overriden to return our own slimmed down style sheet.	 */	public StyleSheet getStyleSheet() {	    if (defaultStyles == null) {		defaultStyles = new StyleSheet();		StringReader r = new StringReader(styleChanges);		try {		    defaultStyles.loadRules(r, null);		} catch (Throwable e) {		    // don't want to die in static initialization... 		    // just display things wrong.		}		r.close();		defaultStyles.addStyleSheet(super.getStyleSheet());	    }	    return defaultStyles;	}	/**	 * Sets the async policy to flush everything in one chunk, and	 * to not display unknown tags.	 */        public Document createDefaultDocument(Font defaultFont,                                              Color foreground) {	    StyleSheet styles = getStyleSheet();	    StyleSheet ss = new StyleSheet();	    ss.addStyleSheet(styles);	    BasicDocument doc = new BasicDocument(ss, defaultFont, foreground);	    doc.setAsynchronousLoadPriority(Integer.MAX_VALUE);	    doc.setPreservesUnknownTags(false);	    return doc;	}        /**         * Returns the ViewFactory that is used to make sure the Views don't         * load in the background.         */        public ViewFactory getViewFactory() {            return basicHTMLViewFactory;        }    }    /**     * BasicHTMLViewFactory extends HTMLFactory to force images to be loaded     * synchronously.     */    static class BasicHTMLViewFactory extends HTMLEditorKit.HTMLFactory {        public View create(Element elem) {            View view = super.create(elem);            if (view instanceof ImageView) {                ((ImageView)view).setLoadsSynchronously(true);            }            return view;        }    }    /**     * The subclass of HTMLDocument that is used as the model. getForeground     * is overridden to return the foreground property from the Component this     * was created for.     */    static class BasicDocument extends HTMLDocument {	/** The host, that is where we are rendering. */	// private JComponent host;	BasicDocument(StyleSheet s, Font defaultFont, Color foreground) {	    super(s);	    setPreservesUnknownTags(false);            setFontAndColor(defaultFont, foreground);	}        /**         * Sets the default font and default color. These are set by         * adding a rule for the body that specifies the font and color.         * This allows the html to override these should it wish to have         * a custom font or color.         */	private void setFontAndColor(Font font, Color fg) {            getStyleSheet().addRule(com.sun.java.swing.SwingUtilities2.                                    displayPropertiesToCSS(font,fg));	}    }    /**     * Root text view that acts as an HTML renderer.     */    static class Renderer extends View {        Renderer(JComponent c, ViewFactory f, View v) {            super(null);	    host = c;	    factory = f;	    view = v;	    view.setParent(this);	    // initially layout to the preferred size	    setSize(view.getPreferredSpan(X_AXIS), view.getPreferredSpan(Y_AXIS));        }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美自拍丝袜亚洲| 欧美性猛交xxxxxx富婆| 午夜久久久久久| 亚洲综合在线五月| 一区二区三区四区视频精品免费 | 蜜桃传媒麻豆第一区在线观看| 樱花草国产18久久久久| 国产精品高潮呻吟久久| 国产精品色在线观看| 中文一区二区在线观看| 国产精品视频九色porn| 亚洲同性gay激情无套| 国产精品护士白丝一区av| 国产精品久久午夜| 亚洲精品国产a| 亚洲一区精品在线| 亚洲另类中文字| 亚洲第一综合色| 奇米色一区二区| 黄色日韩网站视频| 国产精品一区二区在线看| 国产成人av电影在线播放| 菠萝蜜视频在线观看一区| 成人免费福利片| 欧美日韩你懂的| 久久人人爽人人爽| 亚洲免费观看高清完整版在线观看| 欧美曰成人黄网| 69堂亚洲精品首页| 国产日韩欧美激情| 亚洲成人动漫精品| 久久99精品国产麻豆婷婷| 成人av综合在线| 正在播放一区二区| 国产精品国产三级国产| 亚洲一区二区三区小说| 狠狠v欧美v日韩v亚洲ⅴ| 成人av网站在线观看| 欧美日韩久久不卡| 国产亚洲欧美激情| 午夜精品久久久久久久99水蜜桃| 亚洲国产成人一区二区三区| 亚洲激情中文1区| 麻豆专区一区二区三区四区五区| 中文字幕日本不卡| 麻豆精品国产传媒mv男同| 国产精品一二三四| 欧美一区二区久久久| 国产精品乱人伦| 美女视频第一区二区三区免费观看网站| 亚洲精品成a人| 国产精品一线二线三线精华| 欧美精品1区2区3区| 中文字幕一区二区三区蜜月| 日韩高清不卡一区| 91啪九色porn原创视频在线观看| 国产在线麻豆精品观看| 在线视频国产一区| 国产精品国产三级国产aⅴ中文| 日韩女优毛片在线| 一区二区三区四区国产精品| 成人av网站免费观看| 精品国产欧美一区二区| 日韩高清欧美激情| 欧美久久婷婷综合色| 亚洲男人的天堂在线观看| www.在线欧美| 久久精品欧美一区二区三区麻豆| 久久久久久久久久美女| 三级不卡在线观看| 欧美人成免费网站| 亚洲国产欧美日韩另类综合 | 一区二区三区国产豹纹内裤在线| 亚洲精品写真福利| 国产不卡视频在线观看| 精品成人一区二区三区| 精品一区二区三区的国产在线播放 | 久久精品国产99久久6| 欧美日韩中文一区| 亚洲一区在线观看网站| 94-欧美-setu| 亚洲欧美日本在线| 91麻豆国产福利在线观看| 国产精品电影一区二区| av在线免费不卡| 亚洲人123区| 在线一区二区视频| 偷拍一区二区三区四区| 538prom精品视频线放| 蜜桃精品视频在线| 欧美va亚洲va国产综合| 麻豆精品久久久| 国产日产欧美一区| 91论坛在线播放| 亚洲成年人影院| 日韩午夜av电影| 国产一区二区h| 亚洲视频一区二区在线| 欧美日韩一区二区三区高清| 久久99精品久久久久久动态图| 色综合中文字幕国产 | 91.com视频| 国精产品一区一区三区mba桃花| 成人综合婷婷国产精品久久| 国产欧美在线观看一区| 色婷婷av一区二区三区软件| 亚洲成人一区二区在线观看| wwwwxxxxx欧美| 91丨porny丨户外露出| 亚洲大片一区二区三区| 欧美电影免费观看高清完整版在线 | 日韩高清在线一区| 国产欧美一区二区三区沐欲| 91久久线看在观草草青青| 天天综合日日夜夜精品| 国产喷白浆一区二区三区| 欧美亚洲日本国产| 国产毛片精品国产一区二区三区| 欧美性xxxxxx少妇| 激情成人综合网| 一区二区在线观看视频在线观看| 国产在线麻豆精品观看| 一区二区三区成人| 国产人伦精品一区二区| 欧美精品v日韩精品v韩国精品v| 亚洲色图在线播放| 精品国产一区二区三区久久影院| 亚洲五码中文字幕| 欧美精品一区二区久久久| 欧美在线观看18| 国产suv精品一区二区883| 免费在线视频一区| 一区二区高清在线| 中日韩av电影| 欧美v日韩v国产v| 欧美一级电影网站| 欧日韩精品视频| 成人18视频日本| 福利电影一区二区| 麻豆精品在线播放| 日韩影院精彩在线| 五月天久久比比资源色| 一区二区三区在线观看动漫 | 一区二区三区欧美在线观看| 亚洲精品在线免费播放| 在线播放91灌醉迷j高跟美女| 亚洲国产aⅴ天堂久久| 国产日韩欧美一区二区三区乱码| 国产精品自在在线| 精品一区二区三区免费视频| 婷婷久久综合九色国产成人| 亚洲一级二级三级| 亚洲日本韩国一区| 国产精品电影一区二区| 欧美国产精品专区| 中文字幕在线观看不卡| 亚洲国产精品成人综合| 中文字幕欧美日韩一区| 久久久久久99久久久精品网站| 国产 欧美在线| 国产夫妻精品视频| 处破女av一区二区| 91欧美一区二区| 在线看一区二区| 在线影院国内精品| 在线不卡中文字幕| 欧美刺激脚交jootjob| 精品少妇一区二区三区| 亚洲精品一区二区精华| 欧美不卡一二三| 国产色爱av资源综合区| 国产精品久久久久久亚洲伦| 日韩美女视频19| 日韩精品久久理论片| 精彩视频一区二区| 成人影视亚洲图片在线| 色av综合在线| 欧美猛男gaygay网站| 精品国产乱码久久久久久闺蜜| 欧洲视频一区二区| 欧美视频日韩视频在线观看| 91精品国产综合久久精品| 国产清纯白嫩初高生在线观看91| 欧美日本国产视频| 久久人人97超碰com| 中文字幕一区av| 亚洲国产日韩一区二区| 国产一区美女在线| 色噜噜狠狠成人网p站| 日韩亚洲国产中文字幕欧美| 日本一区二区免费在线观看视频| 3d成人h动漫网站入口| 国产性色一区二区| 亚洲午夜视频在线观看| 寂寞少妇一区二区三区| 91色九色蝌蚪| 欧美一级二级在线观看| 国产精品久久久一本精品| 日韩中文字幕一区二区三区| 福利一区福利二区|