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

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

?? springutilities.java

?? java tutotrials or beginners
?? JAVA
字號:
/* * Copyright (c) 1995 - 2008 Sun Microsystems, Inc.  All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * *   - Redistributions of source code must retain the above copyright *     notice, this list of conditions and the following disclaimer. * *   - Redistributions in binary form must reproduce the above copyright *     notice, this list of conditions and the following disclaimer in the *     documentation and/or other materials provided with the distribution. * *   - Neither the name of Sun Microsystems nor the names of its *     contributors may be used to endorse or promote products derived *     from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package layout;import javax.swing.*;import javax.swing.SpringLayout;import java.awt.*;/** * A 1.4 file that provides utility methods for * creating form- or grid-style layouts with SpringLayout. * These utilities are used by several programs, such as * SpringBox and SpringCompactGrid. */public class SpringUtilities {    /**     * A debugging utility that prints to stdout the component's     * minimum, preferred, and maximum sizes.     */    public static void printSizes(Component c) {        System.out.println("minimumSize = " + c.getMinimumSize());        System.out.println("preferredSize = " + c.getPreferredSize());        System.out.println("maximumSize = " + c.getMaximumSize());    }    /**     * Aligns the first <code>rows</code> * <code>cols</code>     * components of <code>parent</code> in     * a grid. Each component is as big as the maximum     * preferred width and height of the components.     * The parent is made just big enough to fit them all.     *     * @param rows number of rows     * @param cols number of columns     * @param initialX x location to start the grid at     * @param initialY y location to start the grid at     * @param xPad x padding between cells     * @param yPad y padding between cells     */    public static void makeGrid(Container parent,                                int rows, int cols,                                int initialX, int initialY,                                int xPad, int yPad) {        SpringLayout layout;        try {            layout = (SpringLayout)parent.getLayout();        } catch (ClassCastException exc) {            System.err.println("The first argument to makeGrid must use SpringLayout.");            return;        }        Spring xPadSpring = Spring.constant(xPad);        Spring yPadSpring = Spring.constant(yPad);        Spring initialXSpring = Spring.constant(initialX);        Spring initialYSpring = Spring.constant(initialY);        int max = rows * cols;        //Calculate Springs that are the max of the width/height so that all        //cells have the same size.        Spring maxWidthSpring = layout.getConstraints(parent.getComponent(0)).                                    getWidth();        Spring maxHeightSpring = layout.getConstraints(parent.getComponent(0)).                                    getWidth();        for (int i = 1; i < max; i++) {            SpringLayout.Constraints cons = layout.getConstraints(                                            parent.getComponent(i));            maxWidthSpring = Spring.max(maxWidthSpring, cons.getWidth());            maxHeightSpring = Spring.max(maxHeightSpring, cons.getHeight());        }        //Apply the new width/height Spring. This forces all the        //components to have the same size.        for (int i = 0; i < max; i++) {            SpringLayout.Constraints cons = layout.getConstraints(                                            parent.getComponent(i));            cons.setWidth(maxWidthSpring);            cons.setHeight(maxHeightSpring);        }        //Then adjust the x/y constraints of all the cells so that they        //are aligned in a grid.        SpringLayout.Constraints lastCons = null;        SpringLayout.Constraints lastRowCons = null;        for (int i = 0; i < max; i++) {            SpringLayout.Constraints cons = layout.getConstraints(                                                 parent.getComponent(i));            if (i % cols == 0) { //start of new row                lastRowCons = lastCons;                cons.setX(initialXSpring);            } else { //x position depends on previous component                cons.setX(Spring.sum(lastCons.getConstraint(SpringLayout.EAST),                                     xPadSpring));            }            if (i / cols == 0) { //first row                cons.setY(initialYSpring);            } else { //y position depends on previous row                cons.setY(Spring.sum(lastRowCons.getConstraint(SpringLayout.SOUTH),                                     yPadSpring));            }            lastCons = cons;        }        //Set the parent's size.        SpringLayout.Constraints pCons = layout.getConstraints(parent);        pCons.setConstraint(SpringLayout.SOUTH,                            Spring.sum(                                Spring.constant(yPad),                                lastCons.getConstraint(SpringLayout.SOUTH)));        pCons.setConstraint(SpringLayout.EAST,                            Spring.sum(                                Spring.constant(xPad),                                lastCons.getConstraint(SpringLayout.EAST)));    }    /* Used by makeCompactGrid. */    private static SpringLayout.Constraints getConstraintsForCell(                                                int row, int col,                                                Container parent,                                                int cols) {        SpringLayout layout = (SpringLayout) parent.getLayout();        Component c = parent.getComponent(row * cols + col);        return layout.getConstraints(c);    }    /**     * Aligns the first <code>rows</code> * <code>cols</code>     * components of <code>parent</code> in     * a grid. Each component in a column is as wide as the maximum     * preferred width of the components in that column;     * height is similarly determined for each row.     * The parent is made just big enough to fit them all.     *     * @param rows number of rows     * @param cols number of columns     * @param initialX x location to start the grid at     * @param initialY y location to start the grid at     * @param xPad x padding between cells     * @param yPad y padding between cells     */    public static void makeCompactGrid(Container parent,                                       int rows, int cols,                                       int initialX, int initialY,                                       int xPad, int yPad) {        SpringLayout layout;        try {            layout = (SpringLayout)parent.getLayout();        } catch (ClassCastException exc) {            System.err.println("The first argument to makeCompactGrid must use SpringLayout.");            return;        }        //Align all cells in each column and make them the same width.        Spring x = Spring.constant(initialX);        for (int c = 0; c < cols; c++) {            Spring width = Spring.constant(0);            for (int r = 0; r < rows; r++) {                width = Spring.max(width,                                   getConstraintsForCell(r, c, parent, cols).                                       getWidth());            }            for (int r = 0; r < rows; r++) {                SpringLayout.Constraints constraints =                        getConstraintsForCell(r, c, parent, cols);                constraints.setX(x);                constraints.setWidth(width);            }            x = Spring.sum(x, Spring.sum(width, Spring.constant(xPad)));        }        //Align all cells in each row and make them the same height.        Spring y = Spring.constant(initialY);        for (int r = 0; r < rows; r++) {            Spring height = Spring.constant(0);            for (int c = 0; c < cols; c++) {                height = Spring.max(height,                                    getConstraintsForCell(r, c, parent, cols).                                        getHeight());            }            for (int c = 0; c < cols; c++) {                SpringLayout.Constraints constraints =                        getConstraintsForCell(r, c, parent, cols);                constraints.setY(y);                constraints.setHeight(height);            }            y = Spring.sum(y, Spring.sum(height, Spring.constant(yPad)));        }        //Set the parent's size.        SpringLayout.Constraints pCons = layout.getConstraints(parent);        pCons.setConstraint(SpringLayout.SOUTH, y);        pCons.setConstraint(SpringLayout.EAST, x);    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人av在线一区二区三区| 国产一区中文字幕| 欧美高清一级片在线观看| 欧美xxxxxxxxx| 精品sm在线观看| 精品欧美乱码久久久久久1区2区| 欧美精品免费视频| 99国产精品久| 91激情在线视频| 欧美综合在线视频| 欧美日韩aaa| 久久女同性恋中文字幕| 26uuu久久综合| 欧美肥妇free| 久久久久久久综合日本| 国产精品国产三级国产三级人妇 | 日韩电影一二三区| 亚洲成av人片一区二区| 日韩二区三区四区| 日韩电影免费在线观看网站| 麻豆成人av在线| 成人午夜在线免费| 欧美亚男人的天堂| 精品日产卡一卡二卡麻豆| 国产精品三级在线观看| 午夜精品久久久久久久99水蜜桃| 国产丝袜欧美中文另类| 一区二区中文字幕在线| 亚洲三级电影网站| 免费成人在线网站| www.66久久| 337p亚洲精品色噜噜狠狠| 国产欧美一区二区精品忘忧草| 欧美性一区二区| 久久亚洲精华国产精华液| 亚洲日本青草视频在线怡红院| 日韩一区二区在线观看| 国产欧美一区二区三区鸳鸯浴 | 国产精品中文字幕日韩精品| 国产制服丝袜一区| 色94色欧美sute亚洲线路二| 日韩亚洲欧美一区二区三区| 中文字幕在线免费不卡| 麻豆久久一区二区| 久久综合九色综合97婷婷女人| 欧美在线观看禁18| 久久久.com| 亚洲成a天堂v人片| 丰满放荡岳乱妇91ww| 欧美三级在线播放| 中文幕一区二区三区久久蜜桃| 久久久亚洲精华液精华液精华液| 91精品国产福利在线观看| 中文文精品字幕一区二区| 日韩和欧美一区二区| 91免费版在线| 久久亚洲精品小早川怜子| 三级久久三级久久| 91麻豆蜜桃一区二区三区| 久久久久久久久久看片| 美日韩黄色大片| 欧美日韩高清一区二区不卡| 亚洲精品中文在线影院| 成人精品免费网站| 国产亚洲一本大道中文在线| 麻豆91在线观看| 91精品国产麻豆国产自产在线 | 久久综合一区二区| 天天综合色天天综合| 91福利国产成人精品照片| 中文字幕综合网| 91在线观看一区二区| 国产精品久久久久国产精品日日| 中文子幕无线码一区tr| 成人一区二区视频| 中文字幕免费不卡在线| 九九热在线视频观看这里只有精品| 国产精品资源网| 久久九九影视网| 成人ar影院免费观看视频| 亚洲国产经典视频| av色综合久久天堂av综合| 中文字幕一区视频| 91黄色小视频| 亚洲高清免费视频| 91精品国产综合久久精品| 久久精品免费观看| 久久久国产综合精品女国产盗摄| 国产精品狼人久久影院观看方式| 伊人一区二区三区| 欧美日韩午夜影院| 亚洲va韩国va欧美va| 91精品国产乱| 高清视频一区二区| 亚洲欧美激情插| 制服丝袜亚洲网站| 国产一区视频网站| 亚洲丝袜制服诱惑| 欧美一区二区三区日韩| 国产中文字幕一区| 亚洲精选在线视频| 日韩欧美国产精品一区| 国产成人自拍高清视频在线免费播放| 91亚洲精品久久久蜜桃网站| 亚洲高清不卡在线观看| 久久综合资源网| 在线观看精品一区| 美女视频黄 久久| 国产精品丝袜91| 欧美精品精品一区| 不卡影院免费观看| 日韩电影在线免费看| 久久精品在这里| 欧美日韩激情在线| 成人免费毛片a| 视频一区二区不卡| 亚洲欧美日韩国产一区二区三区| 国模冰冰炮一区二区| 亚洲精品免费在线观看| 日韩欧美国产一二三区| 91在线视频网址| 狠狠色丁香久久婷婷综合_中| 制服丝袜av成人在线看| 成人免费视频播放| 久久99精品网久久| 亚洲成精国产精品女| 国产精品久久久久久妇女6080| 国产精品一区久久久久| 亚洲综合无码一区二区| 国产网站一区二区| 制服丝袜av成人在线看| 91福利社在线观看| 成人免费视频一区| 国产成a人无v码亚洲福利| 蜜桃精品视频在线| 性欧美疯狂xxxxbbbb| 国产精品乱码一区二区三区软件| 成人开心网精品视频| 美女在线视频一区| 婷婷成人激情在线网| 一级日本不卡的影视| 日本一区二区成人| 国产亚洲短视频| 久久精品欧美一区二区三区不卡| 国产盗摄一区二区| 另类综合日韩欧美亚洲| 午夜激情综合网| 午夜视频在线观看一区二区| 一级特黄大欧美久久久| 亚洲国产视频一区| 亚洲一区二区四区蜜桃| 亚洲图片欧美综合| 亚洲成人综合在线| 日日夜夜精品视频天天综合网| 欧美精品一区二区久久婷婷| 4438x成人网最大色成网站| 欧美色图片你懂的| 在线免费观看日本欧美| 色综合婷婷久久| 欧洲在线/亚洲| 欧美日韩一区二区三区在线看| 国产在线精品国自产拍免费| 激情六月婷婷综合| 国产成人在线视频播放| 成人午夜视频免费看| 成人久久视频在线观看| 色综合久久中文字幕| 欧美色窝79yyyycom| 欧美一级午夜免费电影| 精品不卡在线视频| 久久久夜色精品亚洲| 国产精品久久99| 亚洲成国产人片在线观看| 久久99精品国产91久久来源| 成人网在线免费视频| 在线影院国内精品| 欧美精品成人一区二区三区四区| 成人毛片视频在线观看| 色综合天天综合色综合av | 国产精品久久毛片| 一区二区免费视频| 蜜臀久久99精品久久久久宅男| 国产精品短视频| 亚洲线精品一区二区三区八戒| 国产精品毛片大码女人| 亚洲另类春色校园小说| 老汉av免费一区二区三区| 国产·精品毛片| 欧美高清精品3d| 国产精品视频你懂的| 午夜精品久久久久久不卡8050| 亚洲欧美一区二区三区国产精品| 久久这里只有精品视频网| 亚洲情趣在线观看| 国产一区二区福利| 精品视频在线看| 中文子幕无线码一区tr| 美女视频黄 久久| 欧美天堂亚洲电影院在线播放| 日本高清不卡aⅴ免费网站|