亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
日韩一级视频免费观看在线| 欧美综合欧美视频| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 国内精品国产成人国产三级粉色| 不卡视频在线看| 久久亚洲一区二区三区明星换脸| 日韩精品91亚洲二区在线观看| av中文字幕不卡| 美女任你摸久久| 欧美一级午夜免费电影| 亚洲成av人影院| 欧美在线看片a免费观看| 亚洲精品美国一| 91丝袜美女网| 亚洲情趣在线观看| 国产精品一二一区| 国产激情偷乱视频一区二区三区| 久久蜜臀中文字幕| 国产精品白丝jk白祙喷水网站| 亚洲一区视频在线| 欧美日韩精品免费| 日本欧美一区二区三区乱码| 午夜激情一区二区| 国产一区二区导航在线播放| 国产日韩欧美精品综合| 国产成人啪免费观看软件| 日本不卡123| 久久婷婷国产综合精品青草| 91麻豆精品久久久久蜜臀| 久久精品理论片| 国产亚洲福利社区一区| 99精品一区二区| 亚洲成人免费av| 亚洲欧美成aⅴ人在线观看| 国产女人18水真多18精品一级做| 日韩视频不卡中文| 欧美高清视频一二三区| 中文字幕第一区二区| 99国产精品一区| 波多野结衣中文一区| av网站免费线看精品| 夜夜揉揉日日人人青青一国产精品| 欧美自拍偷拍一区| 日本福利一区二区| 欧美日韩视频在线第一区 | 国产综合一区二区| 久久国产日韩欧美精品| 日本欧美一区二区| 免费不卡在线观看| 奇米777欧美一区二区| 美女视频黄 久久| 激情六月婷婷久久| 国产成人av电影在线播放| 亚洲精品高清视频在线观看| 亚洲免费伊人电影| 亚洲一区二区视频在线观看| 午夜婷婷国产麻豆精品| 日韩av中文字幕一区二区三区| 日韩精品专区在线影院观看| av资源网一区| 色噜噜夜夜夜综合网| 精品污污网站免费看| 91精品国产91久久综合桃花| 精品久久久久久久久久久久久久久| 99re6这里只有精品视频在线观看| 99国产精品久久久久久久久久久| 日韩精品最新网址| 精品国产免费人成在线观看| 欧美日韩另类一区| 欧美电影免费观看高清完整版在线观看 | 懂色av一区二区夜夜嗨| av亚洲精华国产精华精华| 欧美性xxxxxxxx| 懂色av中文字幕一区二区三区| 91在线国产观看| 欧美日韩电影在线播放| 久久夜色精品一区| 中文字幕中文字幕一区二区 | 成人毛片在线观看| 久久av中文字幕片| 成人动漫一区二区在线| 欧美视频一二三区| 亚洲精品一区二区三区蜜桃下载 | 日韩一区二区视频| 久久久久国产精品麻豆ai换脸 | 午夜a成v人精品| 国产精品白丝jk黑袜喷水| 在线亚洲人成电影网站色www| 欧美一区日韩一区| 国产精品福利影院| 奇米精品一区二区三区四区| 91麻豆国产自产在线观看| 国产欧美视频一区二区三区| 欧美蜜桃一区二区三区| 色88888久久久久久影院按摩| 91精品国产色综合久久ai换脸| 中文字幕欧美日韩一区| 天天av天天翘天天综合网色鬼国产| 国产成人在线观看免费网站| 欧美日韩中文另类| 国产精品国产三级国产aⅴ入口 | 亚洲欧美激情小说另类| 久久66热偷产精品| 日本强好片久久久久久aaa| 国产91精品欧美| 91精品国产日韩91久久久久久| 亚洲色图一区二区三区| 亚洲免费在线观看| 国产精品一区二区三区乱码| 欧美精品少妇一区二区三区| 国产精品久久久爽爽爽麻豆色哟哟 | 精品视频资源站| 亚洲欧美日韩综合aⅴ视频| 国产一区二区精品久久| 91精品一区二区三区久久久久久 | 91精品国产一区二区人妖| 国产蜜臀av在线一区二区三区| 国产一区二区三区香蕉| 欧美丰满少妇xxxxx高潮对白 | 欧美一区二区三区小说| 亚洲综合激情另类小说区| 成人在线视频一区| 久久免费电影网| 韩国v欧美v日本v亚洲v| 欧美一级在线免费| 香蕉久久一区二区不卡无毒影院| 91蝌蚪porny九色| 国产精品久久久久国产精品日日| 激情综合网最新| 精品国产伦理网| 精品写真视频在线观看| 日韩午夜激情免费电影| 日本一不卡视频| 国产揄拍国内精品对白| 欧美成人性福生活免费看| 免费成人av资源网| 欧美岛国在线观看| 激情欧美一区二区| 久久网站热最新地址| 国产精品一区二区三区乱码| 久久免费国产精品| 大尺度一区二区| 国产成人精品aa毛片| 欧洲一区二区三区免费视频| 亚洲免费伊人电影| 在线观看av不卡| 七七婷婷婷婷精品国产| 欧美成人伊人久久综合网| 久久成人av少妇免费| 2020国产精品久久精品美国| 国产麻豆成人精品| 国产午夜亚洲精品羞羞网站| 成人免费视频播放| 久久精品欧美一区二区三区不卡| 国产一区二区网址| 亚洲国产高清aⅴ视频| 91麻豆视频网站| 亚洲高清中文字幕| 国产成人自拍在线| 亚洲欧美电影院| 欧美日韩高清一区二区不卡| 26uuu色噜噜精品一区二区| 国产成a人无v码亚洲福利| 亚洲欧美综合网| 国产真实乱偷精品视频免| 国产亚洲欧美日韩俺去了| 成人黄页在线观看| 一区二区三区久久久| 欧美一区二区视频在线观看2020| 美女视频一区二区三区| 国产电影一区二区三区| 欧美色精品在线视频| 麻豆精品久久精品色综合| 国产目拍亚洲精品99久久精品| 99精品欧美一区二区三区小说| 亚洲成人av在线电影| 精品电影一区二区| 色综合久久中文字幕| 久久久久久久电影| 色综合视频在线观看| 日本aⅴ亚洲精品中文乱码| 久久久久国产精品麻豆| 日本韩国一区二区| 久国产精品韩国三级视频| 中文子幕无线码一区tr| 欧美三级日韩在线| 国产福利电影一区二区三区| 亚洲成av人片在线| 国产日产欧美一区| 欧美酷刑日本凌虐凌虐| 高潮精品一区videoshd| 欧美岛国在线观看| 在线一区二区三区四区五区 | 亚洲制服欧美中文字幕中文字幕| 91精品国产91久久久久久一区二区 | 视频一区二区国产| 日本高清成人免费播放| 六月婷婷色综合| 亚洲一区二区免费视频| 国产校园另类小说区|