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

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

?? hruleview.java

?? JAVA的一些源碼 JAVA2 STANDARD EDITION DEVELOPMENT KIT 5.0
?? JAVA
字號:
/* * @(#)HRuleView.java	1.32 03/12/19 * * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */package javax.swing.text.html;import java.awt.*;import javax.swing.event.DocumentEvent;import javax.swing.text.*;import java.util.Enumeration;import java.lang.Integer;/** * A view implementation to display an html horizontal * rule. * * @author  Timothy Prinzing * @author  Sara Swanson * @version 1.32 12/19/03 */class HRuleView extends View  {    /**     * Creates a new view that represents an &lt;hr&gt; element.     *     * @param elem the element to create a view for     */    public HRuleView(Element elem) {	super(elem);	setPropertiesFromAttributes();    }    /**     * Update any cached values that come from attributes.     */    protected void setPropertiesFromAttributes() {	StyleSheet sheet = ((HTMLDocument)getDocument()).getStyleSheet();	AttributeSet eAttr = getElement().getAttributes();	attr = sheet.getViewAttributes(this);	alignment = StyleConstants.ALIGN_CENTER;	size = 0;	noshade = null;	widthValue = null;	if (attr != null) {            // getAlignment() returns ALIGN_LEFT by default, and HR should            // use ALIGN_CENTER by default, so we check if the alignment            // attribute is actually defined            if (attr.getAttribute(StyleConstants.Alignment) != null) {            alignment = StyleConstants.getAlignment(attr);            }	    noshade = (String)eAttr.getAttribute(HTML.Attribute.NOSHADE);	    Object value = eAttr.getAttribute(HTML.Attribute.SIZE);	    if (value != null && (value instanceof String))		size = Integer.parseInt((String)value);	    value = attr.getAttribute(CSS.Attribute.WIDTH);	    if (value != null && (value instanceof CSS.LengthValue)) {		widthValue = (CSS.LengthValue)value;	    }	    topMargin = getLength(CSS.Attribute.MARGIN_TOP, attr);	    bottomMargin = getLength(CSS.Attribute.MARGIN_BOTTOM, attr);	    leftMargin = getLength(CSS.Attribute.MARGIN_LEFT, attr);	    rightMargin = getLength(CSS.Attribute.MARGIN_RIGHT, attr);	}	else {	    topMargin = bottomMargin = leftMargin = rightMargin = 0;	}        size = Math.max(2, size);    }    // This will be removed and centralized at some point, need to unify this    // and avoid private classes.    private float getLength(CSS.Attribute key, AttributeSet a) {	CSS.LengthValue lv = (CSS.LengthValue) a.getAttribute(key);	float len = (lv != null) ? lv.getValue() : 0;	return len;    }    // --- View methods ---------------------------------------------    /**     * Paints the view.     *     * @param g the graphics context     * @param a the allocation region for the view     * @see View#paint     */    public void paint(Graphics g, Shape a) {	Rectangle alloc = (a instanceof Rectangle) ? (Rectangle)a :                          a.getBounds();	int x = 0;	int y = alloc.y + SPACE_ABOVE + (int)topMargin;	int width = alloc.width - (int)(leftMargin + rightMargin);	if (widthValue != null) {	    width = (int)widthValue.getValue((float)width);	}	int height = alloc.height - (SPACE_ABOVE + SPACE_BELOW +				     (int)topMargin + (int)bottomMargin); 	if (size > 0)		height = size;	// Align the rule horizontally.        switch (alignment) {        case StyleConstants.ALIGN_CENTER:            x = alloc.x + (alloc.width / 2) - (width / 2);	    break;        case StyleConstants.ALIGN_RIGHT:            x = alloc.x + alloc.width - width - (int)rightMargin;	    break;        case StyleConstants.ALIGN_LEFT:        default:            x = alloc.x + (int)leftMargin;	    break;        }	// Paint either a shaded rule or a solid line.	if (noshade != null) {            g.setColor(Color.black);	    g.fillRect(x, y, width, height);        }	else {            Color bg = getContainer().getBackground();            Color bottom, top;            if (bg == null || bg.equals(Color.white)) {                top = Color.darkGray;                bottom = Color.lightGray;            }            else {                top = Color.darkGray;                bottom = Color.white;            }            g.setColor(bottom);            g.drawLine(x + width - 1, y, x + width - 1, y + height - 1);            g.drawLine(x, y + height - 1, x + width - 1, y + height - 1);            g.setColor(top);            g.drawLine(x, y, x + width - 1, y);            g.drawLine(x, y, x, y + height - 1);        }    }    /**     * Calculates the desired shape of the rule... this is     * basically the preferred size of the border.     *     * @param axis may be either X_AXIS or Y_AXIS     * @return the desired span     * @see View#getPreferredSpan     */    public float getPreferredSpan(int axis) {	switch (axis) {	case View.X_AXIS:	    return 1;	case View.Y_AXIS:	    if (size > 0) {	        return size + SPACE_ABOVE + SPACE_BELOW + topMargin +		    bottomMargin;	    } else {		if (noshade != null) {		    return 2 + SPACE_ABOVE + SPACE_BELOW + topMargin +			bottomMargin;		} else {		    return SPACE_ABOVE + SPACE_BELOW + topMargin +bottomMargin;		}	    }	default:	    throw new IllegalArgumentException("Invalid axis: " + axis);	}    }    /**     * Gets the resize weight for the axis.     * The rule is: rigid vertically and flexible horizontally.     *     * @param axis may be either X_AXIS or Y_AXIS     * @return the weight     */    public int getResizeWeight(int axis) {	if (axis == View.X_AXIS) {		return 1;	} else if (axis == View.Y_AXIS) {		return 0;	} else {	    return 0;	}    }    /**     * Determines how attractive a break opportunity in      * this view is.  This is implemented to request a forced break.     *     * @param axis may be either View.X_AXIS or View.Y_AXIS     * @param pos the potential location of the start of the      *   broken view (greater than or equal to zero).     *   This may be useful for calculating tab     *   positions.     * @param len specifies the relative length from <em>pos</em>     *   where a potential break is desired. The value must be greater     *   than or equal to zero.     * @return the weight, which should be a value between     *   ForcedBreakWeight and BadBreakWeight.     */    public int getBreakWeight(int axis, float pos, float len) {	if (axis == X_AXIS) {	    return ForcedBreakWeight;	}	return BadBreakWeight;    }    public View breakView(int axis, int offset, float pos, float len) {	return null;    }    /**     * Provides a mapping from the document model coordinate space     * to the coordinate space of the view mapped to it.     *     * @param pos the position to convert     * @param a the allocated region to render into     * @return the bounding box of the given position     * @exception BadLocationException  if the given position does not     * represent a valid location in the associated document     * @see View#modelToView     */    public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException {	int p0 = getStartOffset();	int p1 = getEndOffset();	if ((pos >= p0) && (pos <= p1)) {	    Rectangle r = a.getBounds();	    if (pos == p1) {		r.x += r.width;	    }	    r.width = 0;	    return r;	}	return null;    }    /**     * Provides a mapping from the view coordinate space to the logical     * coordinate space of the model.     *     * @param x the X coordinate     * @param y the Y coordinate     * @param a the allocated region to render into     * @return the location within the model that best represents the     *  given point of view     * @see View#viewToModel     */    public int viewToModel(float x, float y, Shape a, Position.Bias[] bias) {	Rectangle alloc = (Rectangle) a;	if (x < alloc.x + (alloc.width / 2)) {	    bias[0] = Position.Bias.Forward;	    return getStartOffset();	}	bias[0] = Position.Bias.Backward;	return getEndOffset();    }    /**     * 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;    }    public void changedUpdate(DocumentEvent changes, Shape a, ViewFactory f) {	super.changedUpdate(changes, a, f);	int pos = changes.getOffset();	if (pos <= getStartOffset() && (pos + changes.getLength()) >=	    getEndOffset()) {	    setPropertiesFromAttributes();	}    }    // --- variables ------------------------------------------------    private float topMargin;    private float bottomMargin;    private float leftMargin;    private float rightMargin;    private int alignment = StyleConstants.ALIGN_CENTER;    private String noshade = null;    private int size = 0;    private CSS.LengthValue widthValue;    private static final int SPACE_ABOVE = 3;    private static final int SPACE_BELOW = 3;    /** View Attributes. */    private AttributeSet attr;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩精品专区| 人妖欧美一区二区| 91浏览器打开| 国产不卡在线一区| 久久精品国产精品青草| 亚洲国产精品一区二区www在线| 久久精品一二三| 久久久久99精品一区| 久久久蜜桃精品| 婷婷国产v国产偷v亚洲高清| 日本亚洲三级在线| 日韩经典一区二区| 亚洲va在线va天堂| 奇米一区二区三区| 91猫先生在线| 欧美激情一区在线| √…a在线天堂一区| 国产欧美日韩中文久久| 国产精品天干天干在观线| 国产精品久久久久久久久果冻传媒| 国产精品夫妻自拍| 国产精品一级黄| 粉嫩aⅴ一区二区三区四区五区| 91精品国产综合久久精品app| 国产成人av一区二区三区在线观看| 国产成人精品网址| 精品国产乱码久久久久久夜甘婷婷 | 国产精品久久久久国产精品日日| 美女视频第一区二区三区免费观看网站| 国产自产v一区二区三区c| 蜜臀精品久久久久久蜜臀| 欧美性大战久久久久久久蜜臀| 欧美伊人久久大香线蕉综合69| 综合av第一页| 久久精品久久精品| 精品久久久影院| 亚洲丝袜自拍清纯另类| 99在线精品免费| 制服.丝袜.亚洲.中文.综合| 婷婷夜色潮精品综合在线| 欧美日韩1234| 美女视频免费一区| 精品捆绑美女sm三区| 精品综合免费视频观看| 色综合久久久久久久久| 777久久久精品| 青青草成人在线观看| 欧美成人精品二区三区99精品| 久热成人在线视频| 国产三级久久久| 99re热视频这里只精品| 日韩欧美一级二级三级| 中文字幕一区二区在线观看 | 久久天天做天天爱综合色| 亚洲精品久久久久久国产精华液| 日本强好片久久久久久aaa| 在线综合亚洲欧美在线视频| 美女网站一区二区| 欧美国产欧美综合| 欧美三级电影一区| 中文字幕一区二区三区蜜月| 99精品欧美一区二区三区小说| 亚洲九九爱视频| 91精品中文字幕一区二区三区| 久久国产精品99久久人人澡| 国产欧美日韩亚州综合 | 5858s免费视频成人| 国产在线一区观看| 樱花影视一区二区| 日韩精品中午字幕| 色妹子一区二区| 欧美一级一级性生活免费录像| 久久99久久99精品免视看婷婷| 欧美激情资源网| 在线播放欧美女士性生活| 一区二区三区蜜桃| 一本久久综合亚洲鲁鲁五月天 | 欧美福利电影网| 国产乱人伦偷精品视频不卡| 亚洲精品中文字幕在线观看| 精品日韩在线一区| 色诱亚洲精品久久久久久| 国内成+人亚洲+欧美+综合在线| 亚洲一二三四区| 日本道免费精品一区二区三区| 久久国产精品第一页| 午夜精品视频一区| 亚洲欧洲美洲综合色网| 精品国产乱码久久久久久牛牛 | 久久精品无码一区二区三区| 欧美视频一区二| 高清不卡在线观看| 美女久久久精品| 五月婷婷久久综合| 亚洲裸体xxx| 日本高清不卡视频| 成人禁用看黄a在线| 日韩美女久久久| 久久天天做天天爱综合色| 欧美日韩精品一区二区三区蜜桃| av在线一区二区| 成人精品亚洲人成在线| 亚洲美女屁股眼交| 久久先锋影音av| 欧美成人官网二区| 日韩手机在线导航| jizz一区二区| 岛国一区二区三区| 国产精品一区二区久激情瑜伽 | 成人avav影音| 成人影视亚洲图片在线| 国产精品夜夜爽| 国产一区二区三区高清播放| 中文字幕一区二区三| 中文字幕高清不卡| 国产日产欧美一区| 国产欧美日本一区视频| 久久精品夜色噜噜亚洲aⅴ| 久久久美女艺术照精彩视频福利播放| 精品国一区二区三区| 亚洲精品在线免费播放| 国产亚洲成年网址在线观看| 久久综合国产精品| 久久午夜免费电影| 国产日韩欧美精品综合| 久久久欧美精品sm网站| 欧美激情一区在线观看| 综合色中文字幕| 一个色综合av| 奇米亚洲午夜久久精品| 韩国中文字幕2020精品| 国产经典欧美精品| eeuss影院一区二区三区| 91在线国内视频| 欧洲亚洲精品在线| 成人精品视频一区二区三区| 成人免费毛片高清视频| 91影院在线观看| 欧美三级在线看| 欧美v亚洲v综合ⅴ国产v| 国产精品网曝门| 亚洲一二三四区不卡| 九九在线精品视频| 成人av在线网| 欧美精品一二三区| 精品国内二区三区| 国产精品久久国产精麻豆99网站| 亚洲男人的天堂av| 日韩vs国产vs欧美| 国产白丝网站精品污在线入口| 色天使久久综合网天天| 日韩精品一区二区三区视频在线观看 | 国产精品久久久久久一区二区三区| 亚洲人成网站在线| 久久av老司机精品网站导航| 99久久精品国产导航| 欧美一级日韩不卡播放免费| 中文在线资源观看网站视频免费不卡| 亚洲综合免费观看高清完整版| 麻豆精品国产传媒mv男同| av影院午夜一区| 日韩精品一区二区在线| 亚洲男人的天堂av| 国产成人免费在线| 欧美一区二区在线播放| 国产精品美女久久久久aⅴ国产馆| 天天av天天翘天天综合网色鬼国产| 黄页视频在线91| 欧美日韩激情一区二区| 国产欧美一区二区精品性色超碰| 亚洲国产wwwccc36天堂| 粉嫩欧美一区二区三区高清影视 | 久久久久国产精品厨房| 日韩激情视频在线观看| 一本色道久久综合亚洲91| 国产视频在线观看一区二区三区 | 国产成人亚洲综合a∨婷婷图片| 4438x亚洲最大成人网| 一区二区在线观看免费| 高清视频一区二区| 亚洲精品在线免费播放| 美女脱光内衣内裤视频久久网站| 在线亚洲高清视频| 亚洲色图第一区| av成人动漫在线观看| 亚洲国产精品ⅴa在线观看| 激情文学综合丁香| 精品久久久久av影院| 日本不卡123| 91精品国产综合久久蜜臀| 亚洲一级在线观看| 欧美中文字幕一区二区三区亚洲| 亚洲色图丝袜美腿| 97精品国产97久久久久久久久久久久| 国产偷国产偷精品高清尤物| 国产一区在线看| 国产日产欧产精品推荐色| 国产精品系列在线观看| 欧美国产精品一区| 不卡一区在线观看|