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

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

?? tableview.java

?? java jdk 1.4的源碼
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
/* * @(#)TableView.java	1.32 03/01/23 * * Copyright 2003 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.util.BitSet;import java.util.Vector;import javax.swing.SizeRequirements;import javax.swing.event.DocumentEvent;import javax.swing.text.*;/** * HTML table view.   *  * @author  Timothy Prinzing * @version 1.32 01/23/03 * @see     View *//*public*/ class TableView extends BoxView implements ViewFactory {    /**     * Constructs a TableView for the given element.     *     * @param elem the element that this view is responsible for     */    public TableView(Element elem) {	super(elem, View.Y_AXIS);	rows = new Vector();	gridValid = false;	captionIndex = -1;        totalColumnRequirements = new SizeRequirements();    }    /**     * Creates a new table row.     *     * @param elem an element     * @return the row     */    protected RowView createTableRow(Element elem) {	// PENDING(prinz) need to add support for some of the other	// elements, but for now just ignore anything that is not	// a TR.	Object o = elem.getAttributes().getAttribute(StyleConstants.NameAttribute);	if (o == HTML.Tag.TR) {	    return new RowView(elem);	}	return null;    }    /**     * The number of columns in the table.     */    public int getColumnCount() {	return columnSpans.length;    }    /**     * Fetches the span (width) of the given column.       * This is used by the nested cells to query the      * sizes of grid locations outside of themselves.     */    public int getColumnSpan(int col) {	if (col < columnSpans.length) {	    return columnSpans[col];	}	return 0;    }    /**     * The number of rows in the table.     */    public int getRowCount() {	return rows.size();    }    /**     * Fetch the span of multiple rows.  This includes     * the border area.     */    public int getMultiRowSpan(int row0, int row1) {	RowView rv0 = getRow(row0);	RowView rv1 = getRow(row1);	if ((rv0 != null) && (rv1 != null)) {	    int index0 = rv0.viewIndex;	    int index1 = rv1.viewIndex;	    int span = getOffset(Y_AXIS, index1) - getOffset(Y_AXIS, index0) + 		getSpan(Y_AXIS, index1);	    return span;	}	return 0;    }    /**     * Fetches the span (height) of the given row.     */    public int getRowSpan(int row) {	RowView rv = getRow(row);	if (rv != null) {	    return getSpan(Y_AXIS, rv.viewIndex);	}	return 0;    }    RowView getRow(int row) {	if (row < rows.size()) {	    return (RowView) rows.elementAt(row);	}	return null;    }    protected View getViewAtPoint(int x, int y, Rectangle alloc) {	int n = getViewCount();	View v = null;	Rectangle allocation = new Rectangle();	for (int i = 0; i < n; i++) {	    allocation.setBounds(alloc);	    childAllocation(i, allocation);	    v = getView(i);	    if (v instanceof RowView) {		v = ((RowView)v).findViewAtPoint(x, y, allocation);		if (v != null) {		    alloc.setBounds(allocation);		    return v;		}	    }	}        return super.getViewAtPoint(x, y, alloc);    }    /**     * Determines the number of columns occupied by     * the table cell represented by given element.     */    protected int getColumnsOccupied(View v) {	AttributeSet a = v.getElement().getAttributes();        if (a.isDefined(HTML.Attribute.COLSPAN)) {            String s = (String) a.getAttribute(HTML.Attribute.COLSPAN);            if (s != null) {                try {                    return Integer.parseInt(s);                } catch (NumberFormatException nfe) {                    // fall through to one column                }            }        }	return 1;    }    /**     * Determines the number of rows occupied by     * the table cell represented by given element.     */    protected int getRowsOccupied(View v) {	AttributeSet a = v.getElement().getAttributes();        if (a.isDefined(HTML.Attribute.ROWSPAN)) {            String s = (String) a.getAttribute(HTML.Attribute.ROWSPAN);            if (s != null) {                try {                    return Integer.parseInt(s);                } catch (NumberFormatException nfe) {                    // fall through to one row                }            }        }	return 1;    }    protected void invalidateGrid() {	gridValid = false;    }    protected StyleSheet getStyleSheet() {	HTMLDocument doc = (HTMLDocument) getDocument();	return doc.getStyleSheet();    }    /**     * Update the insets, which contain the caption if there     * is a caption.     */    void updateInsets() {	short top = (short) painter.getInset(TOP, this);	short bottom = (short) painter.getInset(BOTTOM, this);	if (captionIndex != -1) {	    View caption = getView(captionIndex);	    short h = (short) caption.getPreferredSpan(Y_AXIS);	    AttributeSet a = caption.getAttributes();	    Object align = a.getAttribute(CSS.Attribute.CAPTION_SIDE);	    if ((align != null) && (align.equals("bottom"))) {		bottom += h;	    } else {		top += h;	    }	}	setInsets(top, (short) painter.getInset(LEFT, this), 		  bottom, (short) painter.getInset(RIGHT, this));    }    /**     * Update any cached values that come from attributes.     */    protected void setPropertiesFromAttributes() {	StyleSheet sheet = getStyleSheet();	attr = sheet.getViewAttributes(this);	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));/*	    CSS.LengthValue lv = (CSS.LengthValue) 		attr.getAttribute(CSS.Attribute.BORDER_SPACING);	    if (lv != null) {		cellSpacing = (int) lv.getValue();	    } else {		cellSpacing = 0;	    }	    */	}    }    /**     * Fill in the grid locations that are placeholders     * for multi-column, multi-row, and missing grid     * locations.     */    void updateGrid() {	if (! gridValid) {	    relativeCells = false;	    multiRowCells = false;	    // determine which views are table rows and clear out	    // grid points marked filled.	    captionIndex = -1;	    rows.removeAllElements();	    int n = getViewCount();	    for (int i = 0; i < n; i++) {		View v = getView(i);		if (v instanceof RowView) {		    rows.addElement(v);		    RowView rv = (RowView) v;		    rv.clearFilledColumns();		    rv.rowIndex = rows.size() - 1;		    rv.viewIndex = i;		} else {		    Object o = v.getElement().getAttributes().getAttribute(StyleConstants.NameAttribute);		    if (o instanceof HTML.Tag) {			HTML.Tag kind = (HTML.Tag) o;			if (kind == HTML.Tag.CAPTION) {			    captionIndex = i;			}		    }		}	    }	    int maxColumns = 0;	    int nrows = rows.size();	    for (int row = 0; row < nrows; row++) {		RowView rv = getRow(row);		int col = 0;		for (int cell = 0; cell < rv.getViewCount(); cell++, col++) {		    View cv = rv.getView(cell);		    if (! relativeCells) {			AttributeSet a = cv.getAttributes();			CSS.LengthValue lv = (CSS.LengthValue) 			    a.getAttribute(CSS.Attribute.WIDTH);			if ((lv != null) && (lv.isPercentage())) {			    relativeCells = true;			}		    }		    // advance to a free column		    for (; rv.isFilled(col); col++);		    int rowSpan = getRowsOccupied(cv);		    if (rowSpan > 1) {			multiRowCells = true;		    }		    int colSpan = getColumnsOccupied(cv);		    if ((colSpan > 1) || (rowSpan > 1)) {			// fill in the overflow entries for this cell			int rowLimit = row + rowSpan;			int colLimit = col + colSpan;			for (int i = row; i < rowLimit; i++) {			    for (int j = col; j < colLimit; j++) {				if (i != row || j != col) {				    addFill(i, j);				}			    }			}			if (colSpan > 1) {			    col += colSpan - 1;			}		    }		}		maxColumns = Math.max(maxColumns, col);	    }	    // setup the column layout/requirements	    columnSpans = new int[maxColumns];	    columnOffsets = new int[maxColumns];	    columnRequirements = new SizeRequirements[maxColumns];	    for (int i = 0; i < maxColumns; i++) {		columnRequirements[i] = new SizeRequirements();                columnRequirements[i].maximum = Integer.MAX_VALUE;	    }	    gridValid = true;	}    }    /**     * Mark a grid location as filled in for a cells overflow.     */    void addFill(int row, int col) {	RowView rv = getRow(row);	if (rv != null) {	    rv.fillColumn(col);	}    }    /**     * Layout the columns to fit within the given target span.     *     * @param targetSpan the given span for total of all the table     *  columns     * @param reqs the requirements desired for each column.  This     *  is the column maximum of the cells minimum, preferred, and     *  maximum requested span     * @param spans the return value of how much to allocated to     *  each column     * @param offsets the return value of the offset from the     *  origin for each column     * @return the offset from the origin and the span for each column      *  in the offsets and spans parameters     */    protected void layoutColumns(int targetSpan, int[] offsets, int[] spans, 				 SizeRequirements[] reqs) {	colIterator.setLayoutArrays(offsets, spans, targetSpan);	CSS.calculateTiledLayout(colIterator, targetSpan);    }    /**     * Calculate the requirements for each column.  The calculation     * is done as two passes over the table.  The table cells that     * occupy a single column are scanned first to determine the     * maximum of minimum, preferred, and maximum spans along the     * give axis.  Table cells that span multiple columns are excluded     * from the first pass.  A second pass is made to determine if     * the cells that span multiple columns are satisfied.  If the     * column requirements are not satisified, the needs of the      * multi-column cell is mixed into the existing column requirements.     * The calculation of the multi-column distribution is based upon     * the proportions of the existing column requirements and taking     * into consideration any constraining maximums.     */    void calculateColumnRequirements(int axis) {	// pass 1 - single column cells	boolean hasMultiColumn = false;	int nrows = getRowCount();	for (int i = 0; i < nrows; i++) {	    RowView row = getRow(i);	    int col = 0;	    int ncells = row.getViewCount();	    for (int cell = 0; cell < ncells; cell++, col++) {		View cv = row.getView(cell);		for (; row.isFilled(col); col++); // advance to a free column		int rowSpan = getRowsOccupied(cv);		int colSpan = getColumnsOccupied(cv);		if (colSpan == 1) {		    checkSingleColumnCell(axis, col, cv);		} else {		    hasMultiColumn = true;		    col += colSpan - 1;		}	    }	}	// pass 2 - multi-column cells	if (hasMultiColumn) {	    for (int i = 0; i < nrows; i++) {		RowView row = getRow(i);		int col = 0;		int ncells = row.getViewCount();		for (int cell = 0; cell < ncells; cell++, col++) {		    View cv = row.getView(cell);		    for (; row.isFilled(col); col++); // advance to a free column		    int colSpan = getColumnsOccupied(cv);		    if (colSpan > 1) {			checkMultiColumnCell(axis, col, colSpan, cv);			col += colSpan - 1;		    }		}	    }	}    }    /**     * check the requirements of a table cell that spans a single column.     */    void checkSingleColumnCell(int axis, int col, View v) {	SizeRequirements req = columnRequirements[col];	req.minimum = Math.max((int) v.getMinimumSpan(axis), req.minimum);	req.preferred = Math.max((int) v.getPreferredSpan(axis), req.preferred);    }    /**     * check the requirements of a table cell that spans multiple     * columns.     */    void checkMultiColumnCell(int axis, int col, int ncols, View v) {	// calculate the totals	long min = 0;	long pref = 0;	long max = 0;	for (int i = 0; i < ncols; i++) {	    SizeRequirements req = columnRequirements[col + i];	    min += req.minimum;	    pref += req.preferred;	    max += req.maximum;	}	// check if the minimum size needs adjustment.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜臀a∨国产成人精品| 1024国产精品| 日韩一级片在线播放| 欧美色电影在线| 91精品福利视频| 在线观看不卡视频| 色综合天天综合给合国产| 99综合电影在线视频| 大尺度一区二区| 99免费精品在线| 色香蕉成人二区免费| 94-欧美-setu| 欧美三级资源在线| 欧美日韩一级二级| 日韩区在线观看| xfplay精品久久| 欧美国产综合色视频| 国产精品不卡视频| 亚洲最新视频在线观看| 亚洲福利视频一区| 日本不卡123| 国产精品一区二区你懂的| www.亚洲精品| 欧美日韩精品一区视频| 91精品国产综合久久久久久漫画 | 欧美日韩免费一区二区三区| 欧美亚洲自拍偷拍| 日韩欧美成人一区| 国产精品女人毛片| 亚洲成在线观看| 国产呦萝稀缺另类资源| 99亚偷拍自图区亚洲| 欧美日韩不卡在线| 亚洲国产精品传媒在线观看| 亚洲影院免费观看| 国产真实乱偷精品视频免| 99精品1区2区| 精品欧美一区二区久久| 亚洲色欲色欲www| 秋霞电影网一区二区| 处破女av一区二区| 欧美一区二区观看视频| 国产精品第13页| 久久福利资源站| 91在线观看视频| 久久这里都是精品| 亚洲成人精品在线观看| 国产69精品久久久久毛片 | 久久精品国产精品亚洲综合| 粉嫩在线一区二区三区视频| 欧美久久久久久蜜桃| 国产精品你懂的在线欣赏| 麻豆国产一区二区| 91国偷自产一区二区三区观看| 欧美mv和日韩mv国产网站| 一区二区成人在线| 成人三级在线视频| 精品久久久久久亚洲综合网 | 国产成人免费视频网站 | 国产日产欧美一区| 蜜臂av日日欢夜夜爽一区| 在线精品视频免费观看| 国产精品国产馆在线真实露脸 | 一区二区三区免费网站| 懂色av一区二区三区免费看| 欧美久久久影院| 午夜精品免费在线观看| 欧美亚洲日本国产| 亚洲欧美国产高清| 91老师片黄在线观看| 中文字幕一区在线| 99久久777色| 亚洲欧美一区二区在线观看| 国产东北露脸精品视频| 国产农村妇女毛片精品久久麻豆 | av在线综合网| 一色桃子久久精品亚洲| av网站一区二区三区| 亚洲视频在线观看三级| eeuss影院一区二区三区| 国产精品毛片大码女人| 懂色av中文一区二区三区| 久久精品亚洲国产奇米99| 精品亚洲成av人在线观看| 91精品欧美久久久久久动漫 | 欧美一级日韩免费不卡| 亚洲午夜一区二区| 欧美性受xxxx| 一区二区三区四区乱视频| 床上的激情91.| 国产精品热久久久久夜色精品三区| 麻豆91精品视频| 欧美成人一区二区| 久久99久久久久久久久久久| 欧美日韩在线播放三区| 亚洲日本乱码在线观看| 欧美在线观看视频一区二区| 一区二区三区电影在线播| 91在线精品秘密一区二区| 中文字幕一区二区三区在线观看| 成人午夜精品在线| 国产欧美精品区一区二区三区| 国产a级毛片一区| 久久精品一区二区| 91麻豆国产精品久久| 一区二区三区欧美| 日韩一区二区电影| 国内久久精品视频| 国产精品嫩草影院com| 日本欧洲一区二区| 中文av一区二区| 色综合久久久久网| 天天色天天爱天天射综合| 日韩三级视频中文字幕| 国产另类ts人妖一区二区| 欧美国产禁国产网站cc| 亚洲午夜电影网| 亚洲va国产va欧美va观看| 日韩视频一区二区三区在线播放| 成人av免费在线播放| 亚洲一区二区视频在线| 91麻豆精品国产91久久久| 久久黄色级2电影| 亚洲色图丝袜美腿| 精品国产一区二区在线观看| 成人avav在线| 国产一区二区三区四| 亚洲女厕所小便bbb| 91精品国产91久久综合桃花| 精品综合久久久久久8888| 日本一区二区三区四区在线视频| 欧美色视频在线观看| 国产精品影视天天线| 一区二区三区中文字幕精品精品| 精品日产卡一卡二卡麻豆| 91女厕偷拍女厕偷拍高清| 日韩成人一区二区| 亚洲午夜一二三区视频| 久久久精品免费免费| 欧美日韩亚洲综合在线| 岛国一区二区三区| 日本欧美一区二区三区| 亚洲已满18点击进入久久| 国产色产综合色产在线视频| 欧美视频一二三区| av一区二区三区黑人| 久久成人精品无人区| 亚洲国产一区二区在线播放| 夜夜精品浪潮av一区二区三区| 久久精品一区蜜桃臀影院| 欧美一区二区精品在线| 在线观看视频91| 成人网页在线观看| 99久久综合国产精品| 国产一区二区久久| 男人的天堂久久精品| 亚洲图片欧美综合| 亚洲三级小视频| 久久久精品tv| 中文字幕av资源一区| 久久久久久免费网| 欧美成人官网二区| 日韩欧美一卡二卡| 91麻豆成人久久精品二区三区| av色综合久久天堂av综合| 国产91在线|亚洲| 国内欧美视频一区二区| 国模冰冰炮一区二区| 另类成人小视频在线| 亚洲va天堂va国产va久| 亚洲国产精品久久人人爱| 亚洲最新视频在线观看| 亚洲最新视频在线播放| 亚洲尤物视频在线| 一区二区在线观看免费| 亚洲九九爱视频| 亚洲精品视频自拍| 亚洲国产精品精华液ab| 国产精品视频你懂的| 亚洲日本在线天堂| 亚洲精品亚洲人成人网| 亚洲美女淫视频| 亚洲图片自拍偷拍| 免费高清在线视频一区·| 久久精品国产精品青草| 久久精品国产久精国产爱| 国产一区二区三区久久悠悠色av| 精品伊人久久久久7777人| 国产综合色在线| av一二三不卡影片| 欧美日韩一二三| 久久久久综合网| 日韩毛片一二三区| 午夜伦欧美伦电影理论片| 蜜桃一区二区三区四区| 国产美女精品人人做人人爽| 国产成人av电影在线观看| 欧美丰满少妇xxxxx高潮对白| 欧美成人三级电影在线| 国产精品亲子乱子伦xxxx裸|