亚洲欧美第一页_禁久久精品乱码_粉嫩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 components;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一区二区三区免费野_久草精品视频
日韩美女视频一区二区在线观看| 国产成人aaaa| 国产色综合一区| 日韩视频一区二区三区在线播放| 成人激情免费视频| 青青青伊人色综合久久| 亚洲午夜久久久久| 亚洲色图制服诱惑 | 日本电影亚洲天堂一区| 国产在线看一区| 日本欧美肥老太交大片| 一区二区成人在线观看| 中文字幕av不卡| 2024国产精品| 欧美日本精品一区二区三区| 在线观看成人免费视频| 不卡区在线中文字幕| 高清不卡在线观看| 丁香激情综合五月| 不卡电影一区二区三区| 丁香婷婷综合色啪| 成人三级伦理片| 91丨porny丨国产入口| 丁香婷婷综合五月| 91毛片在线观看| 在线观看亚洲精品| 91精品一区二区三区在线观看| 欧美一级视频精品观看| 久久精品男人天堂av| 国产精品毛片久久久久久| 亚洲欧美日韩国产一区二区三区| 亚洲另类春色国产| 久久不见久久见中文字幕免费| 精品一区二区免费| 99久久99久久免费精品蜜臀| 欧美最新大片在线看| 4438亚洲最大| 中文字幕一区二区三区不卡 | 国产精品视频看| 性欧美疯狂xxxxbbbb| 国产米奇在线777精品观看| 99久久99久久免费精品蜜臀| 欧美日本一道本| 综合久久一区二区三区| 日本成人中文字幕| 99久久久久久| 欧美大片一区二区三区| 亚洲欧美日韩国产手机在线| 久久99精品一区二区三区三区| 国产精一区二区三区| 91精品国模一区二区三区| 国产精品入口麻豆原神| 久久99久久精品欧美| 欧美三级电影网站| 中文字幕乱码一区二区免费| 日韩精品色哟哟| 欧美主播一区二区三区美女| 国产精品沙发午睡系列990531| 麻豆精品久久久| 91精品国产一区二区三区香蕉 | 久久9热精品视频| 欧美三级蜜桃2在线观看| 一区二区三区国产精华| 91小视频在线| 欧美电影免费观看高清完整版| 国产精品国产三级国产aⅴ原创| 蜜桃视频第一区免费观看| 欧美日韩国产小视频| 亚洲国产精品一区二区尤物区| 99国产精品99久久久久久| 国产精品毛片高清在线完整版| 国产精品亚洲第一| 国产精品电影一区二区三区| www.日韩av| 伊人婷婷欧美激情| 欧美日韩视频在线第一区| 亚洲成a人片在线不卡一二三区| 色偷偷成人一区二区三区91| 伊人婷婷欧美激情| 日韩午夜中文字幕| 国产精品综合网| 国产精品女主播在线观看| 91在线看国产| 日韩激情av在线| 精品国产一区二区三区久久影院| 精品一区二区三区免费播放| 国产亚洲综合av| 色综合天天性综合| 亚洲午夜国产一区99re久久| 欧美精品v国产精品v日韩精品| 久久福利资源站| 一区免费观看视频| 精品视频在线免费观看| 国内欧美视频一区二区| 中文字幕亚洲欧美在线不卡| 欧美美女视频在线观看| 国产1区2区3区精品美女| 五月天激情综合网| 国产精品免费久久久久| 欧美高清视频一二三区| av网站一区二区三区| 日韩精品乱码免费| 自拍偷拍国产精品| 精品久久久久久最新网址| 在线观看日韩精品| av毛片久久久久**hd| 九九精品一区二区| 亚洲国产成人av网| 中文字幕一区二区三区蜜月| 久久久久久久久蜜桃| 欧美日本精品一区二区三区| 91免费版pro下载短视频| 国产伦理精品不卡| 久久国产欧美日韩精品| 日韩福利电影在线| 97精品久久久久中文字幕 | 日韩毛片在线免费观看| 日韩精品一区在线观看| 欧美三日本三级三级在线播放| k8久久久一区二区三区| 国产盗摄女厕一区二区三区| 精品亚洲免费视频| 精品亚洲免费视频| 国产一区二区在线看| 黑人精品欧美一区二区蜜桃| 美女一区二区在线观看| 久久精品国产亚洲a| 麻豆91精品视频| 国产一区二区在线观看视频| 国产精品综合视频| 成人黄色在线看| 色婷婷久久99综合精品jk白丝| 日本黄色一区二区| 欧美日韩三级一区二区| 欧美日韩国产电影| 久久久精品影视| 国产精品久久久久久久午夜片| 国产精品激情偷乱一区二区∴| 亚洲日本在线观看| 亚洲成a人片在线观看中文| 久久se这里有精品| 成人涩涩免费视频| 在线观看av不卡| 久久久久久99久久久精品网站| 亚洲欧美日韩电影| 丝瓜av网站精品一区二区| 国产一区二区毛片| 91啦中文在线观看| 精品国产一区二区三区久久影院| 国产精品天干天干在线综合| 亚洲国产综合色| 国产福利视频一区二区三区| 欧美性大战xxxxx久久久| 精品国产网站在线观看| 亚洲综合小说图片| 不卡的av电影| 欧美一区二区三区白人| 国产精品剧情在线亚洲| 麻豆国产精品官网| 欧美无乱码久久久免费午夜一区| 久久奇米777| 精品在线视频一区| 欧美日韩国产大片| 亚洲永久精品大片| www.亚洲免费av| 中文字幕精品一区二区三区精品| 视频在线在亚洲| 欧美色图12p| 夜夜嗨av一区二区三区四季av| 成人性生交大片免费看在线播放 | 亚洲免费观看高清完整版在线| 久久99精品久久久久久国产越南| 欧美伦理电影网| 午夜久久福利影院| 欧美伦理视频网站| 日产国产高清一区二区三区| 欧美三级韩国三级日本三斤| 亚洲午夜精品在线| 8x8x8国产精品| 五月婷婷综合网| 欧美成人性福生活免费看| 蜜臀av亚洲一区中文字幕| 欧美mv日韩mv| 国产麻豆精品在线观看| 国产喂奶挤奶一区二区三区| 不卡在线视频中文字幕| 国产精品久久网站| 91国偷自产一区二区三区观看| 亚洲综合另类小说| 欧美精品乱码久久久久久按摩| 日韩精品每日更新| 亚洲国产高清在线| 在线精品视频免费观看| 精品亚洲成a人| 亚洲欧美一区二区三区久本道91| 欧美午夜不卡视频| 麻豆成人免费电影| 中文字幕亚洲视频| 日韩欧美一级二级三级| av不卡在线播放|