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

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

?? framesetview.java

?? JAVA的一些源碼 JAVA2 STANDARD EDITION DEVELOPMENT KIT 5.0
?? JAVA
字號:
/* * @(#)FrameSetView.java	1.20 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 java.util.*;import javax.swing.*;import javax.swing.text.*;import javax.swing.event.*;/** * Implements a FrameSetView, intended to support the HTML  * &lt;FRAMESET&gt; tag.  Supports the ROWS and COLS attributes. * * @author  Sunita Mani * *          Credit also to the hotjava browser engineers that *          worked on making the allocation of space algorithms *          conform to the HTML 4.0 standard and also be netscape *          compatible. * * @version 1.20 12/19/03 */class FrameSetView extends javax.swing.text.BoxView {    String[] children;    int[] percentChildren;    int[] absoluteChildren;    int[] relativeChildren;    int percentTotals;    int absoluteTotals;    int relativeTotals;    /**     * Constructs a FrameSetView for the given element.     *      * @param elem the element that this view is responsible for     */    public FrameSetView(Element elem, int axis) {	super(elem, axis);	children = null;    }    /**     * Parses the ROW or COL attributes and returns     * an array of strings that represent the space     * distribution.     *      */    private String[] parseRowColSpec(HTML.Attribute key) {		AttributeSet attributes = getElement().getAttributes();	String spec = "*";	if (attributes != null) {	    if (attributes.getAttribute(key) != null) {		spec = (String)attributes.getAttribute(key);	    }	}	StringTokenizer tokenizer = new StringTokenizer(spec, ",");	int nTokens = tokenizer.countTokens();	int n = getViewCount();        String[] items = new String[Math.max(nTokens, n)];	int i = 0;	for (; i < nTokens; i++) {	    items[i] = tokenizer.nextToken().trim();	    // As per the spec, 100% is the same as *	    // hence the mapping.	    //	    if (items[i].equals("100%")) {		items[i] = "*";	    }	}        // extend spec if we have more children than specified        // in ROWS or COLS attribute        for (; i < items.length; i++) {            items[i] = "*";        }	return items;    }    /**     * Initializes a number of internal state variables     * that store information about space allocation     * for the frames contained within the frameset.     */    private void init() {	if (getAxis() == View.Y_AXIS) {	    children = parseRowColSpec(HTML.Attribute.ROWS);	} else {	    children = parseRowColSpec(HTML.Attribute.COLS);	}	percentChildren = new int[children.length];	relativeChildren = new int[children.length];	absoluteChildren = new int[children.length];	for (int i = 0; i < children.length; i++) {	    percentChildren[i] = -1;	    relativeChildren[i] = -1;	    absoluteChildren[i] = -1;	    if (children[i].endsWith("*")) {		if (children[i].length() > 1) {		    relativeChildren[i] =			Integer.parseInt(children[i].substring(			    0, children[i].length()-1));		    relativeTotals += relativeChildren[i];		} else {		    relativeChildren[i] = 1;		    relativeTotals += 1;		}	    } else if (children[i].indexOf('%') != -1) {		percentChildren[i] = parseDigits(children[i]);		percentTotals += percentChildren[i];	    } else {		absoluteChildren[i] = Integer.parseInt(children[i]);	    }	}	if (percentTotals > 100) {	    for (int i = 0; i < percentChildren.length; i++) {		if (percentChildren[i] > 0) {		    percentChildren[i] = 			(percentChildren[i] * 100) / percentTotals;		}	    }	    percentTotals = 100;	}    }    /**     * Perform layout for the major axis of the box (i.e. 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 major axis.     *     * @param targetSpan the total span given to the view, which     *  whould be used to layout the children     * @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 layoutMajorAxis(int targetSpan, int axis, int[] offsets, 				   int[] spans) {	if (children == null) {	    init();	}	SizeRequirements.calculateTiledPositions(targetSpan, null, 						 getChildRequests(targetSpan,								  axis),						 offsets, spans);    }    protected SizeRequirements[] getChildRequests(int targetSpan, int axis) {	int span[] = new int[children.length];	spread(targetSpan, span);	int n = getViewCount();	SizeRequirements[] reqs = new SizeRequirements[n];	for (int i = 0, sIndex = 0; i < n; i++) {	    View v = getView(i);	    if ((v instanceof FrameView) || (v instanceof FrameSetView)) {		reqs[i] = new SizeRequirements((int) v.getMinimumSpan(axis),					       span[sIndex], 					       (int) v.getMaximumSpan(axis),					       0.5f);                sIndex++;	    } else {		int min = (int) v.getMinimumSpan(axis);		int pref = (int) v.getPreferredSpan(axis);		int max = (int) v.getMaximumSpan(axis);		float a = v.getAlignment(axis);		reqs[i] = new SizeRequirements(min, pref, max, a);	    }	}	return reqs;    }    /**     * This method is responsible for returning in span[] the      * span for each child view along the major axis.  it     * computes this based on the information that extracted     * from the value of the ROW/COL attribute.     */    private void spread(int targetSpan, int span[]) {	if (targetSpan == 0) {	    return;	}	int tempSpace = 0;	int remainingSpace = targetSpan;		// allocate the absolute's first, they have	// precedence	//	for (int i = 0; i < span.length; i++) {	    if (absoluteChildren[i] > 0) {		span[i] = absoluteChildren[i];		remainingSpace -= span[i];	    }	}		// then deal with percents.	//	tempSpace = remainingSpace;	for (int i = 0; i < span.length; i++) {	    if (percentChildren[i] > 0 && tempSpace > 0) {		span[i] = (percentChildren[i] * tempSpace) / 100;		remainingSpace -= span[i];	    } else if (percentChildren[i] > 0 && tempSpace <= 0) {		span[i] = targetSpan / span.length;		remainingSpace -= span[i];	    }	}	// allocate remainingSpace to relative	if (remainingSpace > 0 && relativeTotals > 0) {	    for (int i = 0; i < span.length; i++) {		if (relativeChildren[i] > 0) {		    span[i] = (remainingSpace *				relativeChildren[i]) / relativeTotals;		}	    }	} else if (remainingSpace > 0) {	    // There are no relative columns and the space has been	    // under- or overallocated.  In this case, turn all the 	    // percentage and pixel specified columns to percentage 	    // columns based on the ratio of their pixel count to the	    // total "virtual" size. (In the case of percentage columns,	    // the pixel count would equal the specified percentage	    // of the screen size.      	    // This action is in accordance with the HTML	    // 4.0 spec (see section 8.3, the end of the discussion of	    // the FRAMESET tag).  The precedence of percentage and pixel	    // specified columns is unclear (spec seems to indicate that	    // they share priority, however, unspecified what happens when	    // overallocation occurs.)	    	    // addendum is that we behave similiar to netscape in that specified	    // widths have precedance over percentage widths...    	    float vTotal = (float)(targetSpan - remainingSpace);	    float[] tempPercents = new float[span.length];	    remainingSpace = targetSpan;	    for (int i = 0; i < span.length; i++) {	    	// ok we know what our total space is, and we know how large each	    	// column should be relative to each other... therefore we can use	    	// that relative information to deduce their percentages of a whole	    	// and then scale them appropriately for the correct size	    	tempPercents[i] = ((float)span[i] / vTotal) * 100.00f;	        span[i] = (int) ( ((float)targetSpan * tempPercents[i]) / 100.00f);		remainingSpace -= span[i];	    }	       	    // this is for just in case there is something left over.. if there is we just	    // add it one pixel at a time to the frames in order.. We shouldn't really ever get	    // here and if we do it shouldn't be with more than 1 pixel, maybe two.	    int i = 0;	    while (remainingSpace != 0) {	    	if (remainingSpace < 0) {	    	    span[i++]--;	    	    remainingSpace++;	    	}	    	else {	    	    span[i++]++;	    	    remainingSpace--;	    	}	    		    	// just in case there are more pixels than frames...should never happen..	    	if (i == span.length)i = 0;	    }  	}    }    /*     * Users have been known to type things like "%25" and "25 %".  Deal     * with it.     */    private int parseDigits(String mixedStr) {	int result = 0;	for (int i = 0; i < mixedStr.length(); i++) {	    char ch = mixedStr.charAt(i);	    if (Character.isDigit(ch)) {		result = (result * 10) + Character.digit(ch, 10);	    }	}	return result;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲男人的天堂一区二区| 日韩欧美国产电影| 中文字幕欧美日本乱码一线二线| 日韩av电影免费观看高清完整版在线观看| 欧美在线观看视频一区二区| 亚洲一二三区视频在线观看| 欧美性生活久久| 亚洲国产成人av| 欧美一区二区三区在线看| 国产成人精品网址| 中文字幕巨乱亚洲| 91浏览器在线视频| 国产精品女主播av| 国产一区二区三区电影在线观看| 大陆成人av片| 中文字幕一区免费在线观看| 一本到三区不卡视频| 亚洲与欧洲av电影| 一区二区三区毛片| 久久不见久久见中文字幕免费| 国产mv日韩mv欧美| 亚洲精品一线二线三线| 国产成人精品三级| 亚洲蜜桃精久久久久久久| 欧美色图免费看| 久久超级碰视频| 国产精品久久久久一区二区三区共| 一本一道综合狠狠老| 爽好多水快深点欧美视频| 精品日产卡一卡二卡麻豆| 成人在线视频首页| 亚洲国产成人tv| 久久久久久久久久久久久久久99| 播五月开心婷婷综合| 亚洲bdsm女犯bdsm网站| 久久久精品国产99久久精品芒果| 色综合久久综合| 久久精品99国产精品日本| 亚洲福利一二三区| 久久综合九色综合97_久久久| www.亚洲免费av| 日韩不卡手机在线v区| 中文字幕免费不卡在线| 欧美高清性hdvideosex| 丰满白嫩尤物一区二区| 亚洲超丰满肉感bbw| 国产精品三级在线观看| 91精品蜜臀在线一区尤物| 99久久精品免费看| 激情成人综合网| 亚洲成人tv网| 国产精品国产自产拍高清av| 欧美成人精品高清在线播放| 一本一本大道香蕉久在线精品| 久久成人免费电影| 亚洲国产裸拍裸体视频在线观看乱了 | 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 亚洲一区国产视频| 欧美大胆人体bbbb| 欧美吻胸吃奶大尺度电影 | 中文字幕一区二区三区在线观看 | 亚洲亚洲人成综合网络| 久久精品一区蜜桃臀影院| 欧美理论片在线| 一本色道久久综合狠狠躁的推荐| 国产精一品亚洲二区在线视频| 日日夜夜精品免费视频| 亚洲精品日产精品乱码不卡| 国产欧美日韩在线视频| 久久久亚洲国产美女国产盗摄| 91精品国产一区二区三区香蕉| 91福利视频网站| jvid福利写真一区二区三区| 国产精品99久久久久久久女警| 久久99蜜桃精品| 日本中文字幕一区二区视频| 天堂va蜜桃一区二区三区漫画版| 一区二区三区中文字幕精品精品| 综合欧美一区二区三区| 欧美激情一区二区三区不卡 | 高清国产一区二区| 国产尤物一区二区| 国产一区欧美日韩| 国产美女视频91| 国产一区二区三区久久久| 国产真实乱偷精品视频免| 麻豆精品一区二区三区| 久久国产生活片100| 另类小说欧美激情| 久久精品999| 国产91精品免费| 播五月开心婷婷综合| 91美女视频网站| 欧美日韩中文精品| 日韩欧美中文字幕精品| 欧美zozozo| 中文字幕欧美区| 亚洲丝袜制服诱惑| 亚洲综合在线视频| 日本在线播放一区二区三区| 麻豆91免费看| 成人免费视频免费观看| av网站免费线看精品| 欧美午夜在线观看| 欧美一级片在线看| 国产亚洲视频系列| 亚洲视频一区在线| 石原莉奈在线亚洲二区| 久久精品久久精品| 丰满放荡岳乱妇91ww| 97se狠狠狠综合亚洲狠狠| 欧美日韩精品三区| 日韩精品在线一区二区| 欧美经典一区二区| 亚洲国产中文字幕在线视频综合| 日韩精品电影一区亚洲| 韩国在线一区二区| 日本高清不卡视频| 日韩欧美第一区| 中文字幕一区二区不卡| 日韩电影网1区2区| 国产福利91精品一区二区三区| 欧美色中文字幕| 久久久久国产精品人| 亚洲女同ⅹxx女同tv| 日本美女一区二区三区| 岛国一区二区在线观看| 欧美日韩精品欧美日韩精品一综合| 精品日韩一区二区| 亚洲精品乱码久久久久久日本蜜臀| 婷婷六月综合网| 国产成人av一区二区三区在线观看| 欧美视频一区二区| 日韩欧美一区二区三区在线| 国产精品九色蝌蚪自拍| 麻豆精品一区二区综合av| 欧美一级日韩不卡播放免费| 国产精品短视频| 国产一区二区91| 欧美日韩一区二区电影| 国产精品精品国产色婷婷| 日本不卡视频一二三区| 91色视频在线| 久久伊人蜜桃av一区二区| 亚洲国产精品久久艾草纯爱| 成人黄色小视频| 久久久久久久久久久久电影| 日韩精品一区第一页| 91色porny在线视频| 国产日韩精品一区二区三区在线| 日韩和欧美的一区| 欧美艳星brazzers| 亚洲日本免费电影| 国产精品中文字幕一区二区三区| 678五月天丁香亚洲综合网| 亚洲精品乱码久久久久久黑人| 国产在线一区观看| 日韩亚洲欧美一区二区三区| 亚洲一区精品在线| 欧美性xxxxxx少妇| 亚洲综合色成人| 91精品91久久久中77777| 中文字幕一区二区三区av| 国内精品嫩模私拍在线| 日韩精品资源二区在线| 免费观看日韩av| 51久久夜色精品国产麻豆| 天天色天天爱天天射综合| 色av一区二区| 依依成人综合视频| 欧美丝袜自拍制服另类| ㊣最新国产の精品bt伙计久久| 国产成人综合在线观看| 国产亚洲欧美在线| 成人免费三级在线| 国产精品久久午夜夜伦鲁鲁| 不卡的电视剧免费网站有什么| 国产精品久久三区| 色综合久久精品| 亚洲成人中文在线| 欧美一卡二卡在线| 久久99精品一区二区三区三区| 精品久久久久久最新网址| 色综合天天综合在线视频| 国产精品不卡在线| 欧美亚洲高清一区二区三区不卡| 亚洲精品视频在线| 91精品免费在线| 韩国女主播一区| 国产精品免费看片| 在线一区二区三区四区五区| 一区二区三区美女视频| 欧美二区在线观看| 另类小说图片综合网| 国产精品日韩成人| 在线观看日韩毛片| 午夜精品久久久久久久久| 欧美一二三四在线| 国产白丝精品91爽爽久久| 一区二区三区高清不卡|