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

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

?? inlineview.java

?? JAVA的一些源碼 JAVA2 STANDARD EDITION DEVELOPMENT KIT 5.0
?? JAVA
字號:
/* * @(#)InlineView.java	1.26 06/06/30 * * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */package javax.swing.text.html;import java.awt.*;import java.text.BreakIterator;import javax.swing.event.DocumentEvent;import javax.swing.text.*;/** * Displays the <dfn>inline element</dfn> styles * based upon css attributes. * * @author  Timothy Prinzing * @version 1.26 06/30/06 */public class InlineView extends LabelView {    /**     * Constructs a new view wrapped on an element.     *     * @param elem the element     */    public InlineView(Element elem) {	super(elem);	StyleSheet sheet = getStyleSheet();	attr = sheet.getViewAttributes(this);    }    /**     * Gives notification that something was inserted into      * the document in a location that this view is responsible for.     * If either parameter is <code>null</code>, behavior of this method is     * implementation dependent.     *       * @param e the change information from the associated document     * @param a the current allocation of the view     * @param f the factory to use to rebuild if the view has children     * @since 1.5     * @see View#insertUpdate     */    public void insertUpdate(DocumentEvent e, Shape a, ViewFactory f) {	super.insertUpdate(e, a, f);        longestWordSpan = -1.0f;    }    /**     * Gives notification that something was removed from the document     * in a location that this view is responsible for.     * If either parameter is <code>null</code>, behavior of this method is     * implementation dependent.      *     * @param e the change information from the associated document     * @param a the current allocation of the view     * @param f the factory to use to rebuild if the view has children     * @since 1.5     * @see View#removeUpdate     */    public void removeUpdate(DocumentEvent e, Shape a, ViewFactory f) {        super.removeUpdate(e, a, f);        longestWordSpan = -1.0f;    }    /**     * Gives notification from the document that attributes were changed     * in a location that this view is responsible for.     *     * @param e the change information from the associated document     * @param a the current allocation of the view     * @param f the factory to use to rebuild if the view has children     * @see View#changedUpdate     */    public void changedUpdate(DocumentEvent e, Shape a, ViewFactory f) {	super.changedUpdate(e, a, f);	StyleSheet sheet = getStyleSheet();	attr = sheet.getViewAttributes(this);        longestWordSpan = -1.0f;	preferenceChanged(null, true, true);    }    /**     * Fetches the attributes to use when rendering.  This is     * implemented to multiplex the attributes specified in the     * model with a StyleSheet.     */    public AttributeSet getAttributes() {	return attr;    }    /**     * Determines how attractive a break opportunity in      * this view is.  This can be used for determining which     * view is the most attractive to call <code>breakView</code>     * on in the process of formatting.  A view that represents     * text that has whitespace in it might be more attractive     * than a view that has no whitespace, for example.  The     * higher the weight, the more attractive the break.  A     * value equal to or lower than <code>BadBreakWeight</code>     * should not be considered for a break.  A value greater     * than or equal to <code>ForcedBreakWeight</code> should     * be broken.     * <p>     * This is implemented to provide the default behavior     * of returning <code>BadBreakWeight</code> unless the length     * is greater than the length of the view in which case the      * entire view represents the fragment.  Unless a view has     * been written to support breaking behavior, it is not     * attractive to try and break the view.  An example of     * a view that does support breaking is <code>LabelView</code>.     * An example of a view that uses break weight is      * <code>ParagraphView</code>.     *     * @param axis may be either View.X_AXIS or View.Y_AXIS     * @param pos the potential location of the start of the      *   broken view >= 0.  This may be useful for calculating tab     *   positions.     * @param len specifies the relative length from <em>pos</em>     *   where a potential break is desired >= 0.     * @return the weight, which should be a value between     *   ForcedBreakWeight and BadBreakWeight.     * @see LabelView     * @see ParagraphView     * @see javax.swing.text.View#BadBreakWeight     * @see javax.swing.text.View#GoodBreakWeight     * @see javax.swing.text.View#ExcellentBreakWeight     * @see javax.swing.text.View#ForcedBreakWeight     */    public int getBreakWeight(int axis, float pos, float len) {	if (nowrap) {	    return BadBreakWeight;	}	return super.getBreakWeight(axis, pos, len);    }    /**     * Tries to break this view on the given axis. Refer to     * {@link javax.swing.text.View#breakView} for a complete     * description of this method.     * <p>Behavior of this method is unspecified in case <code>axis</code>     * is neither <code>View.X_AXIS</code> nor <code>View.Y_AXIS</code>, and     * in case <code>offset</code>, <code>pos</code>, or <code>len</code>     * is null.     *        * @param axis may be either <code>View.X_AXIS</code> or     *		<code>View.Y_AXIS</code>     * @param offset the location in the document model     *   that a broken fragment would occupy >= 0.  This     *   would be the starting offset of the fragment     *   returned     * @param pos the position along the axis that the     *  broken view would occupy >= 0.  This may be useful for     *  things like tab calculations     * @param len specifies the distance along the axis     *  where a potential break is desired >= 0     * @return the fragment of the view that represents the     *  given span.     * @since 1.5      * @see javax.swing.text.View#breakView     */    public View breakView(int axis, int offset, float pos, float len) {        InlineView view = (InlineView)super.breakView(axis, offset, pos, len);        if (view != this) {            view.longestWordSpan = -1;        }        return view;    }    /**     * Fetch the span of the longest word in the view.     */    float getLongestWordSpan() {        if (longestWordSpan < 0.0f) {            longestWordSpan = calculateLongestWordSpan();        }        return longestWordSpan;     }        float calculateLongestWordSpan() {        float rv = 0f;        Document doc = getDocument();        //AbstractDocument.MultiByteProperty       final Object MultiByteProperty = "multiByte";        if (doc != null &&               Boolean.TRUE.equals(doc.getProperty(MultiByteProperty))) {            rv = calculateLongestWordSpanUseBreakIterator();        } else {            rv = calculateLongestWordSpanUseWhitespace();        }        return rv;    }    float calculateLongestWordSpanUseBreakIterator() {        float span = 0;        Document doc = getDocument();        int p0 = getStartOffset();        int p1 = getEndOffset();        if (p1 > p0) {            try {                FontMetrics metrics = getFontMetrics();                Segment segment = new Segment();                doc.getText(p0, p1 - p0, segment);                Container c = getContainer();                BreakIterator line;                if (c != null) {                    line = BreakIterator.getLineInstance(c.getLocale());                } else {                    line = BreakIterator.getLineInstance();                }                line.setText(segment);                int start = line.first();                for (int end = line.next();                     end != BreakIterator.DONE;                     start = end, end = line.next()) {                     if (end > start) {                        span = Math.max(span,                           metrics.charsWidth(segment.array, start,                                               end - start));                     }                }            } catch (BadLocationException ble) {              // If the text can't be retrieved, it can't influence the size.            }        }        return span;    }   float calculateLongestWordSpanUseWhitespace() {       float span = 0;       Document doc = getDocument();       int p0 = getStartOffset();       int p1 = getEndOffset();       if (p1 > p0) {           try {               Segment segment = new Segment();               doc.getText(p0, p1 - p0, segment);               final int CONTENT = 0;               final int SPACES = 1;               int state = CONTENT;               int start = segment.offset;               int end = start;               FontMetrics metrics = getFontMetrics();               final int lastIndex = segment.offset + segment.count - 1;               for (int i = segment.offset; i <= lastIndex; i++) {                   boolean updateSpan = false;                   if (Character.isWhitespace(segment.array[i])) {                       if (state == CONTENT) {                           //we got a word                           updateSpan = true;                           state = SPACES;                       }                   } else {                       if (state == SPACES) {                           //first non space                           start = i;                           end = start;                           state = CONTENT;                       } else {                           end = i;                       }                      //handle last word                       if (i == lastIndex) {                           updateSpan = true;                       }                   }                   if (updateSpan) {                       if (end > start) {                           span = Math.max(span,                               metrics.charsWidth(segment.array, start,                                                   end - start + 1));                        }                   }               }           } catch (BadLocationException ble) {               // If the text can't be retrieved, it can't influence the size.           }       }       return span;  }        /**     * Set the cached properties from the attributes.     */    protected void setPropertiesFromAttributes() {	super.setPropertiesFromAttributes();	AttributeSet a = getAttributes();	Object decor = a.getAttribute(CSS.Attribute.TEXT_DECORATION);	boolean u = (decor != null) ? 	  (decor.toString().indexOf("underline") >= 0) : false;	setUnderline(u);	boolean s = (decor != null) ? 	  (decor.toString().indexOf("line-through") >= 0) : false;	setStrikeThrough(s);        Object vAlign = a.getAttribute(CSS.Attribute.VERTICAL_ALIGN);	s = (vAlign != null) ? (vAlign.toString().indexOf("sup") >= 0) : false;	setSuperscript(s);	s = (vAlign != null) ? (vAlign.toString().indexOf("sub") >= 0) : false;	setSubscript(s);	Object whitespace = a.getAttribute(CSS.Attribute.WHITE_SPACE);	if ((whitespace != null) && whitespace.equals("nowrap")) {	    nowrap = true;	} else {	    nowrap = false;	}	HTMLDocument doc = (HTMLDocument)getDocument();	// fetches background color from stylesheet if specified	Color bg = doc.getBackground(a);	if (bg != null) {	    setBackground(bg);	}    }    protected StyleSheet getStyleSheet() {	HTMLDocument doc = (HTMLDocument) getDocument();	return doc.getStyleSheet();    }    private boolean nowrap;    private AttributeSet attr;    private float longestWordSpan = -1.0f;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产原创一区二区| 欧美成人精精品一区二区频| 日韩欧美一区电影| 日韩美女久久久| 国产精品自拍网站| 欧美老肥妇做.爰bbww| 久久麻豆一区二区| 免费在线看成人av| 欧美系列日韩一区| 日韩毛片高清在线播放| 国产老肥熟一区二区三区| 欧美浪妇xxxx高跟鞋交| 一区二区三区国产精品| 国产成人精品免费在线| 精品久久久久av影院| 欧美在线观看视频一区二区| 国产精品电影一区二区| 欧美aa在线视频| 欧美夫妻性生活| 欧美优质美女网站| 一区二区三区四区五区视频在线观看 | 51久久夜色精品国产麻豆| 亚洲va韩国va欧美va精品 | 亚洲四区在线观看| 色狠狠综合天天综合综合| 悠悠色在线精品| 欧美日韩一区不卡| 毛片基地黄久久久久久天堂| 亚洲柠檬福利资源导航| 97se亚洲国产综合在线| 一区二区三区在线影院| 3atv在线一区二区三区| 国产精品自拍三区| 偷拍亚洲欧洲综合| 久久噜噜亚洲综合| 色综合网站在线| 免费在线观看成人| 欧美极品xxx| 欧美日韩精品一区二区天天拍小说| 午夜精品一区二区三区免费视频 | 欧美精品18+| 久久成人久久鬼色| 国产精品色哟哟| 欧美美女视频在线观看| 国产成人av一区二区| 亚洲在线成人精品| 久久久久九九视频| 欧美日免费三级在线| 麻豆成人久久精品二区三区小说| 日韩一区二区免费电影| 91年精品国产| 亚洲va中文字幕| 国产三区在线成人av| 欧美羞羞免费网站| 不卡视频一二三四| 免费成人在线网站| 亚洲男人的天堂一区二区| 日韩精品中文字幕一区| 99精品黄色片免费大全| 美国毛片一区二区| 亚洲欧美韩国综合色| 国产精品国产成人国产三级 | 日韩一区精品字幕| 中文字幕一区免费在线观看| 日韩一区二区三区精品视频| av中文字幕一区| 九九视频精品免费| 亚洲第一搞黄网站| 亚洲人亚洲人成电影网站色| 精品精品国产高清a毛片牛牛| 91激情在线视频| 美国十次了思思久久精品导航| 精品少妇一区二区三区| av成人免费在线观看| 国产成人午夜精品影院观看视频| 日韩成人av影视| 一级日本不卡的影视| 中文字幕制服丝袜一区二区三区| 精品国精品国产| 日韩一区二区免费视频| 欧美日韩国产bt| 欧美色网一区二区| 91激情五月电影| 91麻豆精品在线观看| 成人永久看片免费视频天堂| 亚洲国产精品久久久久秋霞影院 | 国产伦精一区二区三区| 青草国产精品久久久久久| 亚洲高清不卡在线观看| 亚洲视频一区二区在线| 中文乱码免费一区二区| 国产日韩综合av| 日韩欧美久久久| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 亚洲一区国产视频| 一区二区免费视频| 亚洲一区二区四区蜜桃| 一区二区三区在线高清| 亚洲日本一区二区| 亚洲成人av中文| 日韩和欧美的一区| 天堂蜜桃一区二区三区| 亚洲猫色日本管| 亚洲影院理伦片| 日日骚欧美日韩| 日本不卡一区二区三区高清视频| 亚洲高清不卡在线| 美女高潮久久久| 国产精品99精品久久免费| 国产精品影视在线观看| 国产成人综合亚洲91猫咪| 高清不卡一二三区| a在线欧美一区| 欧美日韩另类一区| 在线免费av一区| 日韩限制级电影在线观看| 亚洲精品在线一区二区| 亚洲国产精品二十页| 日韩美女视频19| 日日摸夜夜添夜夜添精品视频 | 亚洲视频 欧洲视频| 亚洲成人综合视频| 久久99精品国产| 成人丝袜高跟foot| 91久久精品国产91性色tv| 久久久久高清精品| 一区二区三区国产精华| 蜜臀91精品一区二区三区| 丁香六月久久综合狠狠色| 91精品福利视频| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 久久久久久毛片| 中文字幕精品综合| 亚洲欧美日韩在线不卡| 日本不卡1234视频| 97se亚洲国产综合自在线观| 日韩一区二区在线观看视频播放| 欧美国产在线观看| 日韩国产精品久久| 成人av网站免费观看| 欧美日韩国产免费| 中文字幕不卡三区| 免费人成精品欧美精品| av成人免费在线观看| 欧美r级电影在线观看| 亚洲欧美日韩国产成人精品影院 | 国产成人免费xxxxxxxx| 欧美在线啊v一区| 亚洲国产精品成人综合 | 91麻豆精品国产91久久久久久久久 | 欧美一级高清片| 亚洲日本免费电影| 国产麻豆欧美日韩一区| 日韩女优电影在线观看| 亚洲黄色av一区| 丁香网亚洲国际| 欧美sm极限捆绑bd| 日日夜夜免费精品| 在线影院国内精品| 国产精品激情偷乱一区二区∴| 日韩主播视频在线| 欧美午夜片在线看| 亚洲欧洲在线观看av| 国产一区二区调教| 欧美一区二区在线观看| 亚洲一区二区三区免费视频| 国产精品中文字幕日韩精品| 久久综合九色综合欧美亚洲| 三级不卡在线观看| 欧美午夜片在线看| 亚洲免费成人av| av不卡在线观看| 国产精品久久久久久久久免费丝袜 | 制服丝袜亚洲网站| 亚洲天天做日日做天天谢日日欢| 亚洲三级免费观看| 成人的网站免费观看| 亚洲天堂免费看| 不卡在线视频中文字幕| 国产精品热久久久久夜色精品三区 | 精品三级在线看| 韩国精品主播一区二区在线观看 | 精品捆绑美女sm三区| 日本午夜精品视频在线观看| 在线播放91灌醉迷j高跟美女 | 午夜电影久久久| 精品视频免费在线| 亚洲成av人片在线观看| 在线精品亚洲一区二区不卡| 亚洲精品综合在线| 在线观看日韩高清av| 一区二区三区日本| 日韩亚洲国产中文字幕欧美| 看电影不卡的网站| 精品99一区二区| 成人精品gif动图一区| 国产精品国产三级国产aⅴ原创| 91免费版在线| 国产精品久久久久久久久免费相片| 91社区在线播放|