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

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

?? blockview.java

?? JAVA的一些源碼 JAVA2 STANDARD EDITION DEVELOPMENT KIT 5.0
?? JAVA
字號:
/* * @(#)BlockView.java	1.36 04/03/05 * * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */package javax.swing.text.html;import java.util.Enumeration;import java.awt.*;import javax.swing.SizeRequirements;import javax.swing.border.*;import javax.swing.event.DocumentEvent;import javax.swing.text.*;/** * A view implementation to display a block (as a box) * with CSS specifications. * * @author  Timothy Prinzing * @version 1.36 03/05/04 */public class BlockView extends BoxView  {    /**     * Creates a new view that represents an     * html box.  This can be used for a number     * of elements.     *     * @param elem the element to create a view for     * @param axis either View.X_AXIS or View.Y_AXIS     */    public BlockView(Element elem, int axis) {	super(elem, axis);    }    /**     * Establishes the parent view for this view.  This is     * guaranteed to be called before any other methods if the     * parent view is functioning properly.     * <p>      * This is implemented     * to forward to the superclass as well as call the     * {@link #setPropertiesFromAttributes()}     * method to set the paragraph properties from the css     * attributes.  The call is made at this time to ensure     * the ability to resolve upward through the parents      * view attributes.     *     * @param parent the new parent, or null if the view is     *  being removed from a parent it was previously added     *  to     */    public void setParent(View parent) {	super.setParent(parent);        if (parent != null) {            setPropertiesFromAttributes();        }    }    /**     * Calculate the requirements of the block along the major     * axis (i.e. the axis along with it tiles).  This is implemented     * to provide the superclass behavior and then adjust it if the      * CSS width or height attribute is specified and applicable to     * the axis.     */    protected SizeRequirements calculateMajorAxisRequirements(int axis, SizeRequirements r) {	if (r == null) {	    r = new SizeRequirements();	}	if (! spanSetFromAttributes(axis, r, cssWidth, cssHeight)) {	    r = super.calculateMajorAxisRequirements(axis, r);	}        else {            // Offset by the margins so that pref/min/max return the            // right value.            SizeRequirements parentR = super.calculateMajorAxisRequirements(                                      axis, null);            int margin = (axis == X_AXIS) ? getLeftInset() + getRightInset() :                                            getTopInset() + getBottomInset();            r.minimum -= margin;            r.preferred -= margin;            r.maximum -= margin;            constrainSize(axis, r, parentR);        }	return r;    }    /**     * Calculate the requirements of the block along the minor     * axis (i.e. the axis orthoginal to the axis along with it tiles).       * This is implemented     * to provide the superclass behavior and then adjust it if the      * CSS width or height attribute is specified and applicable to     * the axis.     */    protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements r) {	if (r == null) {	    r = new SizeRequirements();	}	if (! spanSetFromAttributes(axis, r, cssWidth, cssHeight)) {	    /*	     * The requirements were not directly specified by attributes, so	     * compute the aggregate of the requirements of the children.  The	     * children that have a percentage value specified will be treated 	     * as completely stretchable since that child is not limited in any	     * way.	     */ /*	    int min = 0;	    long pref = 0;	    int max = 0;	    int n = getViewCount();	    for (int i = 0; i < n; i++) {		View v = getView(i);		min = Math.max((int) v.getMinimumSpan(axis), min);		pref = Math.max((int) v.getPreferredSpan(axis), pref);		if (		max = Math.max((int) v.getMaximumSpan(axis), max);	    }	    r.preferred = (int) pref;	    r.minimum = min;	    r.maximum = max;	    */	    r = super.calculateMinorAxisRequirements(axis, r);	}        else {            // Offset by the margins so that pref/min/max return the            // right value.            SizeRequirements parentR = super.calculateMinorAxisRequirements(                                      axis, null);            int margin = (axis == X_AXIS) ? getLeftInset() + getRightInset() :                                            getTopInset() + getBottomInset();            r.minimum -= margin;            r.preferred -= margin;            r.maximum -= margin;            constrainSize(axis, r, parentR);        }	/*	 * Set the alignment based upon the CSS properties if it is	 * specified.  For X_AXIS this would be text-align, for 	 * Y_AXIS this would be vertical-align.	 */	if (axis == X_AXIS) {	    Object o = getAttributes().getAttribute(CSS.Attribute.TEXT_ALIGN);	    if (o != null) {		String align = o.toString();		if (align.equals("center")) {		    r.alignment = 0.5f;		} else if (align.equals("right")) {		    r.alignment = 1.0f;		} else {		    r.alignment = 0.0f;		}	    }	}	// Y_AXIS TBD	return r;    }    boolean isPercentage(int axis, AttributeSet a) {	if (axis == X_AXIS) {	    if (cssWidth != null) {		return cssWidth.isPercentage();	    }	} else {	    if (cssHeight != null) {		return cssHeight.isPercentage();	    }	}	return false;    }	        /**     * Adjust the given requirements to the CSS width or height if     * it is specified along the applicable axis.  Return true if the     * size is exactly specified, false if the span is not specified      * in an attribute or the size specified is a percentage.     */    static boolean spanSetFromAttributes(int axis, SizeRequirements r,                                         CSS.LengthValue cssWidth,                                         CSS.LengthValue cssHeight) {	if (axis == X_AXIS) {	    if ((cssWidth != null) && (! cssWidth.isPercentage())) {		r.minimum = r.preferred = r.maximum = (int) cssWidth.getValue();		return true;	    }	} else {	    if ((cssHeight != null) && (! cssHeight.isPercentage())) {		r.minimum = r.preferred = r.maximum = (int) cssHeight.getValue();		return true;	    }	}	return false;    }    /**     * Perform layout for the minor axis of the box (i.e. the     * axis orthoginal to the axis that it represents).  The results      * of the layout should be placed in the given arrays which represent      * the allocations to the children along the minor axis.     *     * @param targetSpan the total span given to the view, which     *  whould be used to layout the childre.     * @param axis the axis being layed out     * @param offsets the offsets from the origin of the view for     *  each of the child views; this is a return value and is     *  filled in by the implementation of this method     * @param spans the span of each child view; this is a return     *  value and is filled in by the implementation of this method     * @return the offset and span for each child view in the     *  offsets and spans parameters     */    protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans) {	int n = getViewCount();	Object key = (axis == X_AXIS) ? CSS.Attribute.WIDTH : CSS.Attribute.HEIGHT;	for (int i = 0; i < n; i++) {	    View v = getView(i);	    int min = (int) v.getMinimumSpan(axis);	    int max;	    // check for percentage span	    AttributeSet a = v.getAttributes();	    CSS.LengthValue lv = (CSS.LengthValue) a.getAttribute(key);	    if ((lv != null) && lv.isPercentage()) {		// bound the span to the percentage specified		min = Math.max((int) lv.getValue(targetSpan), min);		max = min;	    } else {                max = (int)v.getMaximumSpan(axis);	    }	    // assign the offset and span for the child	    if (max < targetSpan) {		// can't make the child this wide, align it		float align = v.getAlignment(axis);		offsets[i] = (int) ((targetSpan - max) * align);		spans[i] = max;	    } else {		// make it the target width, or as small as it can get.		offsets[i] = 0;		spans[i] = Math.max(min, targetSpan);	    }	}    }    /**     * Renders using the given rendering surface and area on that     * surface.  This is implemented to delegate to the css box     * painter to paint the border and background prior to the     * interior.     *     * @param g the rendering surface to use     * @param allocation the allocated region to render into     * @see View#paint     */    public void paint(Graphics g, Shape allocation) {	Rectangle a = (Rectangle) allocation;	painter.paint(g, a.x, a.y, a.width, a.height, this);	super.paint(g, a);    }    /**     * Fetches the attributes to use when rendering.  This is     * implemented to multiplex the attributes specified in the     * model with a StyleSheet.     */    public AttributeSet getAttributes() {	if (attr == null) {	    StyleSheet sheet = getStyleSheet();	    attr = sheet.getViewAttributes(this);	}	return attr;    }    /**     * Gets the resize weight.     *     * @param axis may be either X_AXIS or Y_AXIS     * @return the weight     * @exception IllegalArgumentException for an invalid axis     */    public int getResizeWeight(int axis) {	switch (axis) {	case View.X_AXIS:	    return 1;	case View.Y_AXIS:	    return 0;	default:	    throw new IllegalArgumentException("Invalid axis: " + axis);	}    }    /**     * Gets the alignment.     *     * @param axis may be either X_AXIS or Y_AXIS     * @return the alignment     */    public float getAlignment(int axis) {	switch (axis) {	case View.X_AXIS:	    return 0;	case View.Y_AXIS:	    if (getViewCount() == 0) {		return 0;	    }	    float span = getPreferredSpan(View.Y_AXIS);	    View v = getView(0);	    float above = v.getPreferredSpan(View.Y_AXIS);	    float a = (((int)span) != 0) ? (above * v.getAlignment(View.Y_AXIS)) / span: 0;	    return a;	default:	    throw new IllegalArgumentException("Invalid axis: " + axis);	}    }    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();	}    }    /**     * Determines the preferred span for this view along an     * axis.     *     * @param axis may be either <code>View.X_AXIS</code>     *		 or <code>View.Y_AXIS</code>     * @return   the span the view would like to be rendered into >= 0;     *           typically the view is told to render into the span     *           that is returned, although there is no guarantee;      *           the parent may choose to resize or break the view     * @exception IllegalArgumentException for an invalid axis type     */    public float getPreferredSpan(int axis) {	return super.getPreferredSpan(axis);    }    /**     * Determines the minimum span for this view along an     * axis.     *     * @param axis may be either <code>View.X_AXIS</code>     *		 or <code>View.Y_AXIS</code>     * @return  the span the view would like to be rendered into >= 0;     *           typically the view is told to render into the span     *           that is returned, although there is no guarantee;       *           the parent may choose to resize or break the view     * @exception IllegalArgumentException for an invalid axis type     */    public float getMinimumSpan(int axis) {	return super.getMinimumSpan(axis);    }    /**     * Determines the maximum span for this view along an     * axis.     *     * @param axis may be either <code>View.X_AXIS</code>     *		 or <code>View.Y_AXIS</code>     * @return   the span the view would like to be rendered into >= 0;     *           typically the view is told to render into the span     *           that is returned, although there is no guarantee;       *           the parent may choose to resize or break the view     * @exception IllegalArgumentException for an invalid axis type     */    public float getMaximumSpan(int axis) {	return super.getMaximumSpan(axis);    }    /**     * Update any cached values that come from attributes.     */    protected void setPropertiesFromAttributes() {	// update attributes	StyleSheet sheet = getStyleSheet();	attr = sheet.getViewAttributes(this);	// Reset the painter	painter = sheet.getBoxPainter(attr);	if (attr != null) {	    setInsets((short) painter.getInset(TOP, this),		      (short) painter.getInset(LEFT, this),		      (short) painter.getInset(BOTTOM, this),		      (short) painter.getInset(RIGHT, this));	}	// Get the width/height	cssWidth = (CSS.LengthValue) attr.getAttribute(CSS.Attribute.WIDTH);	cssHeight = (CSS.LengthValue) attr.getAttribute(CSS.Attribute.HEIGHT);    }    protected StyleSheet getStyleSheet() {	HTMLDocument doc = (HTMLDocument) getDocument();	return doc.getStyleSheet();    }    /**     * Constrains <code>want</code> to fit in the minimum size specified     * by <code>min</code>.     */    private void constrainSize(int axis, SizeRequirements want,                               SizeRequirements min) {        if (min.minimum > want.minimum) {            want.minimum = want.preferred = min.minimum;            want.maximum = Math.max(want.maximum, min.maximum);        }    }    private AttributeSet attr;    private StyleSheet.BoxPainter painter;    private CSS.LengthValue cssWidth;    private CSS.LengthValue cssHeight;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区成人在线观看| 色老头久久综合| 一本大道久久a久久综合婷婷| 欧美日韩精品一区二区三区四区| 国产亚洲精品超碰| 日韩国产在线观看| 日本久久一区二区| 国产日本欧美一区二区| 美女国产一区二区三区| 欧美日韩在线观看一区二区| **欧美大码日韩| 国产suv精品一区二区6| 欧美一区二区三级| 视频一区二区三区入口| 在线免费av一区| 国产精品久久久久久久久图文区| 国产原创一区二区| 日韩欧美一级特黄在线播放| 日韩高清不卡一区二区| 欧美熟乱第一页| 亚洲综合精品久久| 色噜噜狠狠一区二区三区果冻| 中文字幕日韩欧美一区二区三区| 国产高清视频一区| 久久精品夜色噜噜亚洲a∨| 麻豆成人久久精品二区三区红 | 亚洲一区二区三区精品在线| 成人av网站免费观看| 国产精品入口麻豆原神| 国产98色在线|日韩| 久久精品视频一区| 国产剧情一区在线| 日本一区二区动态图| 成人av电影免费在线播放| 国产欧美中文在线| 成人午夜视频在线观看| 国产精品对白交换视频 | 韩国欧美一区二区| 337p日本欧洲亚洲大胆色噜噜| 精品在线免费视频| 久久先锋影音av| 成人h动漫精品| 亚洲欧美乱综合| 欧美另类videos死尸| 日韩高清电影一区| 久久久久久**毛片大全| 国产成人av网站| 一区在线中文字幕| 欧美卡1卡2卡| 韩国三级在线一区| 最新国产の精品合集bt伙计| 欧美亚洲免费在线一区| 美腿丝袜在线亚洲一区| 日本一区二区视频在线观看| 91香蕉视频黄| 天堂一区二区在线免费观看| 久久只精品国产| 99re66热这里只有精品3直播| 亚洲国产精品久久久男人的天堂| 日韩欧美一级特黄在线播放| av午夜一区麻豆| 日韩精品一区第一页| 久久精品日产第一区二区三区高清版| 99re热视频这里只精品| 免费av网站大全久久| 欧美激情中文字幕一区二区| 欧美亚洲综合一区| 国产激情视频一区二区在线观看| 亚洲精品视频一区二区| 精品福利在线导航| 在线观看亚洲精品视频| 国产在线精品国自产拍免费| 亚洲国产综合人成综合网站| 久久久国产午夜精品| 欧美日韩aaaaaa| 成人avav影音| 久久精品国产久精国产| 一区二区三区波多野结衣在线观看| 欧美成人一区二区三区在线观看 | 亚洲青青青在线视频| 欧美一区二区三区啪啪| 色狠狠色噜噜噜综合网| 国产成人av电影在线| 日本一区中文字幕| 亚洲人吸女人奶水| 久久精品夜色噜噜亚洲a∨| 91精品视频网| 91小视频在线免费看| 国产91精品久久久久久久网曝门| 日韩av一区二区三区| 亚洲免费观看在线视频| 国产精品五月天| 久久精品一区二区| 欧美大胆一级视频| 欧美日韩二区三区| 91久久国产最好的精华液| 成人中文字幕在线| 国产精品一区二区在线看| 久国产精品韩国三级视频| 亚洲成av人片| 亚洲韩国一区二区三区| 亚洲激情在线激情| 亚洲激情综合网| 亚洲精品视频免费观看| 中文字幕亚洲视频| 国产精品成人免费精品自在线观看 | 亚洲精品一区二区精华| 日韩一区二区在线观看视频播放| 欧美色中文字幕| 在线免费观看日本欧美| 色综合一个色综合| 一本久久a久久精品亚洲| av影院午夜一区| 91美女视频网站| 色哟哟亚洲精品| 欧美色倩网站大全免费| 欧美日韩视频在线一区二区 | 91老师国产黑色丝袜在线| 色婷婷av一区| 欧美喷潮久久久xxxxx| 欧美日韩一区二区电影| 91精品国产日韩91久久久久久| 69成人精品免费视频| 日韩午夜电影av| 久久久欧美精品sm网站| 国产精品不卡在线| 一区二区三区av电影| 天天av天天翘天天综合网色鬼国产| 日本成人中文字幕在线视频| 精品一区二区免费看| 国产91富婆露脸刺激对白| 不卡的av电影在线观看| 欧美网站一区二区| 欧美成人一区二区| 国产精品传媒视频| 亚洲成人免费视| 韩国视频一区二区| 一本色道亚洲精品aⅴ| 91超碰这里只有精品国产| 欧美va在线播放| 中文字幕在线免费不卡| 午夜精品久久久久久久99樱桃| 久久精品国产99久久6| 成人av网站在线| 欧美精品一二三| 欧美高清在线精品一区| 性感美女极品91精品| 国产精品18久久久| 欧洲视频一区二区| 欧美成人女星排行榜| 国产精品成人一区二区三区夜夜夜| 亚洲福利电影网| 成人中文字幕电影| 制服丝袜亚洲播放| 亚洲欧洲日产国码二区| 久久99久久久久| 91捆绑美女网站| 久久综合中文字幕| 亚洲国产成人av| 成人视屏免费看| 日韩区在线观看| 一区二区三区加勒比av| 国产一区二区三区美女| 欧美日韩精品一二三区| 1区2区3区欧美| 精品影院一区二区久久久| 91视频国产观看| 久久精品免费在线观看| 日本不卡一区二区三区高清视频| 成人白浆超碰人人人人| 亚洲精品一区二区三区99| 偷拍一区二区三区| 日本道免费精品一区二区三区| 久久精品网站免费观看| 美女一区二区三区| 欧美精品久久一区二区三区| 亚洲免费大片在线观看| 国产99久久久国产精品潘金 | 亚洲电影一区二区三区| 92国产精品观看| 国产精品久久精品日日| 国产伦精品一区二区三区视频青涩| 在线播放/欧美激情| 亚洲成人av电影| 欧美私模裸体表演在线观看| 一区二区三区在线观看网站| 99久久亚洲一区二区三区青草| 久久天天做天天爱综合色| 蜜臀精品一区二区三区在线观看| 欧美三电影在线| 亚洲成人动漫av| 欧美日韩一级二级三级| 亚洲第一综合色| 欧美日韩一区二区欧美激情| 亚洲va国产va欧美va观看| 欧美三级日韩三级国产三级| 香蕉久久夜色精品国产使用方法 | 国产精品欧美精品| 不卡视频在线看| 中文字幕在线不卡视频|