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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? stylesheet.java

?? JAVA的一些源碼 JAVA2 STANDARD EDITION DEVELOPMENT KIT 5.0
?? JAVA
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
/* * @(#)StyleSheet.java	1.85 04/09/14 * * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */package javax.swing.text.html;import com.sun.java.swing.SwingUtilities2;import java.util.*;import java.awt.*;import java.io.*;import java.net.*;import javax.swing.Icon;import javax.swing.ImageIcon;import javax.swing.border.*;import javax.swing.event.ChangeListener;import javax.swing.text.*;/** * Support for defining the visual characteristics of * HTML views being rendered.  The StyleSheet is used to * translate the HTML model into visual characteristics. * This enables views to be customized by a look-and-feel, * multiple views over the same model can be rendered * differently, etc.  This can be thought of as a CSS * rule repository.  The key for CSS attributes is an * object of type CSS.Attribute.  The type of the value * is up to the StyleSheet implementation, but the * <code>toString</code> method is required * to return a string representation of CSS value. * <p> * The primary entry point for HTML View implementations * to get their attributes is the  * <a href="#getViewAttributes">getViewAttributes</a> * method.  This should be implemented to establish the * desired policy used to associate attributes with the view. * Each HTMLEditorKit (i.e. and therefore each associated * JEditorPane) can have its own StyleSheet, but by default one * sheet will be shared by all of the HTMLEditorKit instances. * HTMLDocument instance can also have a StyleSheet, which * holds the document-specific CSS specifications. * <p> * In order for Views to store less state and therefore be * more lightweight, the StyleSheet can act as a factory for * painters that handle some of the rendering tasks.  This allows * implementations to determine what they want to cache * and have the sharing potentially at the level that a * selector is common to multiple views.  Since the StyleSheet * may be used by views over multiple documents and typically * the HTML attributes don't effect the selector being used, * the potential for sharing is significant. * <p> * The rules are stored as named styles, and other information * is stored to translate the context of an element to a  * rule quickly.  The following code fragment will display * the named styles, and therefore the CSS rules contained. * <code><pre> * &nbsp;  * &nbsp; import java.util.*; * &nbsp; import javax.swing.text.*; * &nbsp; import javax.swing.text.html.*; * &nbsp;  * &nbsp; public class ShowStyles { * &nbsp;  * &nbsp;     public static void main(String[] args) { * &nbsp; 	HTMLEditorKit kit = new HTMLEditorKit(); * &nbsp; 	HTMLDocument doc = (HTMLDocument) kit.createDefaultDocument(); * &nbsp; 	StyleSheet styles = doc.getStyleSheet(); * &nbsp; 	 * &nbsp; 	Enumeration rules = styles.getStyleNames(); * &nbsp; 	while (rules.hasMoreElements()) { * &nbsp; 	    String name = (String) rules.nextElement(); * &nbsp; 	    Style rule = styles.getStyle(name); * &nbsp; 	    System.out.println(rule.toString()); * &nbsp; 	} * &nbsp; 	System.exit(0); * &nbsp;     } * &nbsp; } * &nbsp;  * </pre></code> * <p> * The semantics for when a CSS style should overide visual attributes * defined by an element are not well defined. For example, the html * <code>&lt;body bgcolor=red&gt;</code> makes the body have a red * background. But if the html file also contains the CSS rule * <code>body { background: blue }</code> it becomes less clear as to * what color the background of the body should be. The current * implemention gives visual attributes defined in the element the * highest precedence, that is they are always checked before any styles. * Therefore, in the previous example the background would have a * red color as the body element defines the background color to be red. * <p> * As already mentioned this supports CSS. We don't support the full CSS * spec. Refer to the javadoc of the CSS class to see what properties * we support. The two major CSS parsing related * concepts we do not currently * support are pseudo selectors, such as <code>A:link { color: red }</code>, * and the <code>important</code> modifier. * <p> * <font color="red">Note: This implementation is currently * incomplete.  It can be replaced with alternative implementations * that are complete.  Future versions of this class will provide * better CSS support.</font> * * @author  Timothy Prinzing * @author  Sunita Mani * @author  Sara Swanson * @author  Jill Nakata * @version 1.85 09/14/04 */public class StyleSheet extends StyleContext {    // As the javadoc states, this class maintains a mapping between    // a CSS selector (such as p.bar) and a Style.    // This consists of a number of parts:    // . Each selector is broken down into its constituent simple selectors,    //   and stored in an inverted graph, for example:    //     p { color: red } ol p { font-size: 10pt } ul p { font-size: 12pt }    //   results in the graph:    //          root    //           |    //           p    //          / \    //         ol ul    //   each node (an instance of SelectorMapping) has an associated    //   specificity and potentially a Style.    // . Every rule that is asked for (either by way of getRule(String) or    //   getRule(HTML.Tag, Element)) results in a unique instance of    //   ResolvedStyle. ResolvedStyles contain the AttributeSets from the    //   SelectorMapping.    // . When a new rule is created it is inserted into the graph, and    //   the AttributeSets of each ResolvedStyles are updated appropriately.    // . This class creates special AttributeSets, LargeConversionSet and    //   SmallConversionSet, that maintain a mapping between StyleConstants    //   and CSS so that developers that wish to use the StyleConstants    //   methods can do so.    // . When one of the AttributeSets is mutated by way of a    //   StyleConstants key, all the associated CSS keys are removed. This is    //   done so that the two representations don't get out of sync. For    //   example, if the developer adds StyleConsants.BOLD, FALSE to an    //   AttributeSet that contains HTML.Tag.B, the HTML.Tag.B entry will    //   be removed.    /**     * Construct a StyleSheet     */    public StyleSheet() {	super();	selectorMapping = new SelectorMapping(0);	resolvedStyles = new Hashtable();	if (css == null) {	    css = new CSS();	}    }    /**     * Fetches the style to use to render the given type     * of HTML tag.  The element given is representing     * the tag and can be used to determine the nesting     * for situations where the attributes will differ     * if nesting inside of elements.     *     * @param t the type to translate to visual attributes     * @param e the element representing the tag; the element     *  can be used to determine the nesting for situations where     *  the attributes will differ if nested inside of other     *  elements     * @return the set of CSS attributes to use to render     *  the tag     */    public Style getRule(HTML.Tag t, Element e) {        SearchBuffer sb = SearchBuffer.obtainSearchBuffer();        try {            // Build an array of all the parent elements.            Vector searchContext = sb.getVector();            for (Element p = e; p != null; p = p.getParentElement()) {                searchContext.addElement(p);            }            // Build a fully qualified selector.            int              n = searchContext.size();            StringBuffer     cacheLookup = sb.getStringBuffer();            AttributeSet     attr;            String           eName;            Object           name;            // >= 1 as the HTML.Tag for the 0th element is passed in.            for (int counter = n - 1; counter >= 1; counter--) {                e = (Element)searchContext.elementAt(counter);                attr = e.getAttributes();                name = attr.getAttribute(StyleConstants.NameAttribute);		eName = name.toString();                cacheLookup.append(eName);                if (attr != null) {                    if (attr.isDefined(HTML.Attribute.ID)) {                        cacheLookup.append('#');                        cacheLookup.append(attr.getAttribute					   (HTML.Attribute.ID));                    }                    else if (attr.isDefined(HTML.Attribute.CLASS)) {                        cacheLookup.append('.');                        cacheLookup.append(attr.getAttribute					   (HTML.Attribute.CLASS));                    }                }                cacheLookup.append(' ');            }            cacheLookup.append(t.toString());	    e = (Element)searchContext.elementAt(0);	    attr = e.getAttributes();	    if (e.isLeaf()) {		// For leafs, we use the second tier attributes.		Object testAttr = attr.getAttribute(t);		if (testAttr instanceof AttributeSet) {		    attr = (AttributeSet)testAttr;		}		else {		    attr = null;		}	    }            if (attr != null) {                if (attr.isDefined(HTML.Attribute.ID)) {                    cacheLookup.append('#');                    cacheLookup.append(attr.getAttribute(HTML.Attribute.ID));                }                else if (attr.isDefined(HTML.Attribute.CLASS)) {                    cacheLookup.append('.');                    cacheLookup.append(attr.getAttribute				       (HTML.Attribute.CLASS));                }            }            Style style = getResolvedStyle(cacheLookup.toString(),					   searchContext, t);	    return style;        }        finally {            SearchBuffer.releaseSearchBuffer(sb);        }    }    /**     * Fetches the rule that best matches the selector given     * in string form. Where <code>selector</code> is a space separated     * String of the element names. For example, <code>selector</code>     * might be 'html body tr td''<p>     * The attributes of the returned Style will change     * as rules are added and removed. That is if you to ask for a rule     * with a selector "table p" and a new rule was added with a selector     * of "p" the returned Style would include the new attributes from     * the rule "p".     */    public Style getRule(String selector) {	selector = cleanSelectorString(selector);	if (selector != null) {	    Style style = getResolvedStyle(selector);	    return style;	}	return null;    }    /**     * Adds a set of rules to the sheet.  The rules are expected to     * be in valid CSS format.  Typically this would be called as     * a result of parsing a &lt;style&gt; tag.     */    public void addRule(String rule) {	if (rule != null) {            //tweaks to control display properties            //see BasicEditorPaneUI            final String baseUnitsDisable = "BASE_SIZE_DISABLE";            final String baseUnits = "BASE_SIZE ";            final String w3cLengthUnitsEnable = "W3C_LENGTH_UNITS_ENABLE";            final String w3cLengthUnitsDisable = "W3C_LENGTH_UNITS_DISABLE";            if (rule == baseUnitsDisable) {                sizeMap = sizeMapDefault;            } else if (rule.startsWith(baseUnits)) {                rebaseSizeMap(Integer.                              parseInt(rule.substring(baseUnits.length())));            } else if (rule == w3cLengthUnitsEnable) {                w3cLengthUnits = true;            } else if (rule == w3cLengthUnitsDisable) {                w3cLengthUnits = false;            } else {                CssParser parser = new CssParser();                try {                    parser.parse(getBase(), new StringReader(rule), false, false);                } catch (IOException ioe) { }            }	}    }    /**     * Translates a CSS declaration to an AttributeSet that represents     * the CSS declaration.  Typically this would be called as a     * result of encountering an HTML style attribute.     */    public AttributeSet getDeclaration(String decl) {	if (decl == null) {	    return SimpleAttributeSet.EMPTY;	}	CssParser parser = new CssParser();	return parser.parseDeclaration(decl);    }    /**     * Loads a set of rules that have been specified in terms of     * CSS1 grammar.  If there are collisions with existing rules,     * the newly specified rule will win.     *     * @param in the stream to read the CSS grammar from     * @param ref the reference URL.  This value represents the     *  location of the stream and may be null.  All relative     *  URLs specified in the stream will be based upon this     *  parameter.     */    public void loadRules(Reader in, URL ref) throws IOException {	CssParser parser = new CssParser();	parser.parse(ref, in, false, false);    }    /**     * Fetches a set of attributes to use in the view for     * displaying.  This is basically a set of attributes that     * can be used for View.getAttributes.     */    public AttributeSet getViewAttributes(View v) {	return new ViewAttributeSet(v);    }    /**     * Removes a named style previously added to the document.     *     * @param nm  the name of the style to remove     */    public void removeStyle(String nm) {	Style       aStyle = getStyle(nm);	if (aStyle != null) {	    String selector = cleanSelectorString(nm);	    String[] selectors = getSimpleSelectors(selector);	    synchronized(this) {		SelectorMapping mapping = getRootSelectorMapping();		for (int i = selectors.length - 1; i >= 0; i--) {		    mapping = mapping.getChildSelectorMapping(selectors[i],                                                              true);		}		Style rule = mapping.getStyle();		if (rule != null) {		    mapping.setStyle(null);		    if (resolvedStyles.size() > 0) {			Enumeration values = resolvedStyles.elements();			while (values.hasMoreElements()) {			    ResolvedStyle style = (ResolvedStyle)values.				                    nextElement();			    style.removeStyle(rule);			}		    }		}	    }	}	super.removeStyle(nm);    }    /**     * Adds the rules from the StyleSheet <code>ss</code> to those of     * the receiver. <code>ss's</code> rules will override the rules of     * any previously added style sheets. An added StyleSheet will never     * override the rules of the receiving style sheet.     *     * @since 1.3     */    public void addStyleSheet(StyleSheet ss) {	synchronized(this) {	    if (linkedStyleSheets == null) {		linkedStyleSheets = new Vector();	    }	    if (!linkedStyleSheets.contains(ss)) {                int index = 0;                if (ss instanceof javax.swing.plaf.UIResource                    && linkedStyleSheets.size() > 1) {                    index = linkedStyleSheets.size() - 1;                }		linkedStyleSheets.insertElementAt(ss, index);		linkStyleSheetAt(ss, index);	    }	}    }    /**     * Removes the StyleSheet <code>ss</code> from those of the receiver.     *     * @since 1.3

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
性做久久久久久| 3d动漫精品啪啪| 成人国产一区二区三区精品| 国精产品一区一区三区mba视频| 日本女优在线视频一区二区 | 天堂va蜜桃一区二区三区漫画版| 洋洋av久久久久久久一区| 一区二区三区四区激情| 亚洲一区二区精品视频| 日韩高清电影一区| 美女www一区二区| 国产呦萝稀缺另类资源| 国产精品18久久久| 99久久精品情趣| 色呦呦网站一区| 欧美系列亚洲系列| 日韩视频一区在线观看| 久久久久久亚洲综合影院红桃| 国产午夜久久久久| 亚洲欧美日韩成人高清在线一区| 一区二区三区蜜桃| 日本欧美一区二区三区乱码| 激情小说亚洲一区| av在线免费不卡| 欧美日韩精品欧美日韩精品 | 中文字幕一区二区日韩精品绯色| 中文字幕免费一区| 亚洲靠逼com| 首页欧美精品中文字幕| 国产一区二区h| av一区二区三区黑人| 欧美日韩黄色一区二区| 久久亚洲捆绑美女| 亚洲欧洲日韩一区二区三区| 亚洲激情在线播放| 久久99蜜桃精品| 99精品视频在线播放观看| 欧美久久一区二区| 国产日韩欧美精品综合| 亚洲最新在线观看| 国产在线播精品第三| 色美美综合视频| 精品福利一区二区三区| 亚洲精品国久久99热| 久久精品国产久精国产爱| 成人性生交大片免费| 欧美人体做爰大胆视频| 国产欧美日韩麻豆91| 亚洲国产毛片aaaaa无费看| 精品无人码麻豆乱码1区2区| 色视频成人在线观看免| 欧美sm美女调教| 亚洲黄色在线视频| 国产中文字幕一区| 欧美日韩黄视频| 国产精品高清亚洲| 日本亚洲免费观看| 色乱码一区二区三区88 | 免费在线观看不卡| 91视频国产观看| xfplay精品久久| 亚洲一区av在线| 成人性生交大片免费看视频在线| 9191成人精品久久| 亚洲免费视频中文字幕| 国产麻豆午夜三级精品| 欧美日韩黄视频| 日韩一区在线免费观看| 国产专区欧美精品| 在线电影欧美成精品| 亚洲欧美视频在线观看| 国产尤物一区二区| 日韩一区二区三区四区| 亚洲国产日产av| 99精品国产99久久久久久白柏| 精品久久久久一区| 五月天一区二区三区| 91国内精品野花午夜精品| 国产精品福利在线播放| 九九视频精品免费| 91麻豆精品国产自产在线观看一区| 亚洲精品日日夜夜| gogogo免费视频观看亚洲一| 国产亚洲欧美日韩俺去了| 免费在线一区观看| 欧美二区三区91| 亚洲一区在线观看免费 | 亚洲三级久久久| 国产成人综合在线观看| 精品少妇一区二区三区视频免付费| 五月天激情综合| 欧美人牲a欧美精品| 亚洲国产视频直播| 欧美日韩另类国产亚洲欧美一级| 一区二区三区中文在线观看| 一本到一区二区三区| 亚洲视频一区在线观看| 91色乱码一区二区三区| 亚洲欧美中日韩| 91在线观看高清| 亚洲天堂中文字幕| 91麻豆免费观看| 亚洲激情五月婷婷| 欧美三级在线播放| 亚洲国产精品尤物yw在线观看| 欧美在线一区二区三区| 亚洲成a人在线观看| 欧美日韩1区2区| 日韩精品欧美精品| 日韩欧美高清dvd碟片| 久久99精品视频| 久久老女人爱爱| 福利91精品一区二区三区| 国产欧美一区二区精品秋霞影院| 成人永久aaa| 亚洲视频一区二区在线观看| 在线观看av不卡| 丝袜美腿亚洲一区| 精品久久久久香蕉网| 国产成人精品免费在线| 国产精品成人免费在线| 色综合天天在线| 亚洲成a人v欧美综合天堂下载| 91精品婷婷国产综合久久竹菊| 麻豆精品视频在线观看免费| 久久久久九九视频| 91小视频免费看| 亚洲va韩国va欧美va精品| 欧美xxxxxxxx| av一二三不卡影片| 亚洲国产精品自拍| 欧美va在线播放| 99re视频精品| 午夜久久电影网| 久久精品一级爱片| 一本久久a久久精品亚洲| 日韩电影在线观看电影| 久久精品人人做人人综合| 色综合激情五月| 免费视频最近日韩| 国产精品久久久久久久久搜平片 | 久久久久久电影| 色乱码一区二区三区88| 久久精品国产网站| 自拍偷自拍亚洲精品播放| 91精品国产一区二区三区香蕉| 国产成人av一区二区三区在线 | 国产成人免费在线视频| 亚洲一区二区3| 久久久久国产精品麻豆ai换脸| 色香蕉成人二区免费| 久久精品72免费观看| 亚洲欧美另类久久久精品| 日韩一级高清毛片| 色综合中文综合网| 国产精品久久久久久久久果冻传媒| 在线视频中文字幕一区二区| 久久黄色级2电影| 一区二区在线看| 久久综合九色综合97婷婷| 色婷婷香蕉在线一区二区| 国产一区二区三区美女| 亚洲不卡一区二区三区| 中文字幕av资源一区| 日韩一区国产二区欧美三区| 91麻豆蜜桃一区二区三区| 精品一区在线看| 亚洲成人777| 亚洲色欲色欲www| 欧美精品一区二区三区蜜臀 | 国产精品久99| 精品久久久久久久人人人人传媒| 91福利国产成人精品照片| 国产成人精品免费| 久久99精品国产.久久久久| 亚洲制服丝袜av| 最新不卡av在线| 国产欧美日韩激情| 日韩精品一区二区三区视频| 欧美私模裸体表演在线观看| 波多野结衣中文字幕一区二区三区| 蜜桃av一区二区三区| 亚洲电影视频在线| 亚洲图片激情小说| 国产日产亚洲精品系列| 26uuu色噜噜精品一区二区| 欧美剧在线免费观看网站| 色视频欧美一区二区三区| 99精品热视频| 成人a级免费电影| 成人免费高清在线观看| 国产精品一区二区不卡| 国产一区二区三区观看| 狠狠网亚洲精品| 蜜臀99久久精品久久久久久软件| 婷婷综合另类小说色区| 亚洲成人中文在线| 亚洲r级在线视频| 亚洲va国产天堂va久久en| 亚洲一区二区三区四区中文字幕|