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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? selectiondemo.java

?? java tutotrials or beginners
?? JAVA
字號(hào):
/* * 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 painting;/*  * SelectionDemo.java requires one other file: *   images/starfield.gif */import javax.swing.BoxLayout;import javax.swing.ImageIcon;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.event.MouseInputAdapter;import java.awt.*;import java.awt.event.MouseEvent;/*  * This displays an image.  When the user drags within * the image, this program displays a rectangle and a string * indicating the bounds of the rectangle. */public class SelectionDemo {    JLabel label;    static String starFile = "images/starfield.gif";        private void buildUI(Container container, ImageIcon image) {        container.setLayout(new BoxLayout(container,                                          BoxLayout.PAGE_AXIS));                                                  SelectionArea area = new SelectionArea(image, this);        container.add(area);        label = new JLabel("Drag within the image.");        label.setLabelFor(area);        container.add(label);        //Align the left edges of the components.        area.setAlignmentX(Component.LEFT_ALIGNMENT);        label.setAlignmentX(Component.LEFT_ALIGNMENT); //redundant    }    public void updateLabel(Rectangle rect) {        int width = rect.width;        int height = rect.height;        //Make the coordinates look OK if a dimension is 0.        if (width == 0) {            width = 1;        }        if (height == 0) {            height = 1;        }        label.setText("Rectangle goes from ("                      + rect.x + ", " + rect.y + ") to ("                      + (rect.x + width - 1) + ", "                      + (rect.y + height - 1) + ").");    }    /** Returns an ImageIcon, or null if the path was invalid. */    protected static ImageIcon createImageIcon(String path) {        java.net.URL imgURL = SelectionDemo.class.getResource(path);        if (imgURL != null) {            return new ImageIcon(imgURL);        } else {            System.err.println("Couldn't find file: " + path);            return null;        }    }    /**     * Create the GUI and show it.  For thread safety,      * this method should be invoked from the      * event-dispatching thread.     */    private static void createAndShowGUI() {        //Create and set up the window.        JFrame frame = new JFrame("SelectionDemo");        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);        //Set up the content pane.        SelectionDemo controller = new SelectionDemo();        controller.buildUI(frame.getContentPane(),                           createImageIcon(starFile));        //Display the window.        frame.pack();        frame.setVisible(true);    }    public static void main(String[] args) {        //Schedule a job for the event-dispatching thread:        //creating and showing this application's GUI.        javax.swing.SwingUtilities.invokeLater(new Runnable() {            public void run() {                createAndShowGUI();             }        });    }        private class SelectionArea extends JLabel {        Rectangle currentRect = null;        Rectangle rectToDraw = null;        Rectangle previousRectDrawn = new Rectangle();        SelectionDemo controller;            public SelectionArea(ImageIcon image, SelectionDemo controller) {            super(image); //This component displays an image.            this.controller = controller;            setOpaque(true);            setMinimumSize(new Dimension(10,10)); //don't hog space                MyListener myListener = new MyListener();            addMouseListener(myListener);            addMouseMotionListener(myListener);        }            private class MyListener extends MouseInputAdapter {            public void mousePressed(MouseEvent e) {                int x = e.getX();                int y = e.getY();                currentRect = new Rectangle(x, y, 0, 0);                updateDrawableRect(getWidth(), getHeight());                repaint();            }                public void mouseDragged(MouseEvent e) {                updateSize(e);            }                public void mouseReleased(MouseEvent e) {                updateSize(e);            }                /*              * Update the size of the current rectangle             * and call repaint.  Because currentRect             * always has the same origin, translate it             * if the width or height is negative.             *              * For efficiency (though             * that isn't an issue for this program),             * specify the painting region using arguments             * to the repaint() call.             *              */            void updateSize(MouseEvent e) {                int x = e.getX();                int y = e.getY();                currentRect.setSize(x - currentRect.x,                                    y - currentRect.y);                updateDrawableRect(getWidth(), getHeight());                Rectangle totalRepaint = rectToDraw.union(previousRectDrawn);                repaint(totalRepaint.x, totalRepaint.y,                        totalRepaint.width, totalRepaint.height);            }        }            protected void paintComponent(Graphics g) {            super.paintComponent(g); //paints the background and image                //If currentRect exists, paint a box on top.            if (currentRect != null) {                //Draw a rectangle on top of the image.                g.setXORMode(Color.white); //Color of line varies                                           //depending on image colors                g.drawRect(rectToDraw.x, rectToDraw.y,                            rectToDraw.width - 1, rectToDraw.height - 1);                    controller.updateLabel(rectToDraw);            }        }            private void updateDrawableRect(int compWidth, int compHeight) {            int x = currentRect.x;            int y = currentRect.y;            int width = currentRect.width;            int height = currentRect.height;                //Make the width and height positive, if necessary.            if (width < 0) {                width = 0 - width;                x = x - width + 1;                 if (x < 0) {                    width += x;                     x = 0;                }            }            if (height < 0) {                height = 0 - height;                y = y - height + 1;                 if (y < 0) {                    height += y;                     y = 0;                }            }                //The rectangle shouldn't extend past the drawing area.            if ((x + width) > compWidth) {                width = compWidth - x;            }            if ((y + height) > compHeight) {                height = compHeight - y;            }                      //Update rectToDraw after saving old value.            if (rectToDraw != null) {                previousRectDrawn.setBounds(                            rectToDraw.x, rectToDraw.y,                             rectToDraw.width, rectToDraw.height);                rectToDraw.setBounds(x, y, width, height);            } else {                rectToDraw = new Rectangle(x, y, width, height);            }        }    }}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜桃一区二区三区在线观看| 国产伦理精品不卡| 精品久久久久久久久久久久包黑料| 懂色av噜噜一区二区三区av| 亚洲国产成人精品视频| 久久精品一区蜜桃臀影院| 欧美探花视频资源| 成人黄色片在线观看| 日本一不卡视频| 亚洲精品伦理在线| 久久久精品影视| 欧美日韩成人综合| 99精品久久免费看蜜臀剧情介绍| 美女视频黄久久| 亚洲图片欧美视频| 成人欧美一区二区三区1314| www成人在线观看| 欧美精品日韩精品| www.一区二区| 国产一区 二区 三区一级| 日韩精品一区第一页| 亚洲激情自拍偷拍| 国产精品成人网| 国产视频亚洲色图| 久久一夜天堂av一区二区三区| 欧美一级一级性生活免费录像| 日本韩国一区二区三区视频| eeuss鲁片一区二区三区 | 日韩亚洲国产中文字幕欧美| 色94色欧美sute亚洲线路一ni| 成人美女视频在线观看18| 国产精品主播直播| 国产一区二区免费视频| 狠狠色丁香久久婷婷综合_中| 免费成人在线网站| 三级一区在线视频先锋| 亚洲bt欧美bt精品777| 亚洲午夜视频在线| 亚洲一级二级三级| 亚洲国产欧美日韩另类综合| 一级日本不卡的影视| 一区二区三区四区av| 亚洲精品欧美激情| 亚洲一区二区三区自拍| 午夜精品久久久久久久| 丝袜美腿亚洲综合| 日本欧美久久久久免费播放网| 日韩av电影一区| 美女视频黄 久久| 国产精一区二区三区| 国产成人自拍网| 顶级嫩模精品视频在线看| 成人a级免费电影| 97超碰欧美中文字幕| 在线观看亚洲专区| 欧美日本乱大交xxxxx| 7777精品伊人久久久大香线蕉超级流畅| 欧美日韩一区二区三区在线看| 欧美精品亚洲一区二区在线播放| 日韩一级大片在线观看| 国产日韩综合av| 国产精品麻豆视频| 一区二区不卡在线视频 午夜欧美不卡在| 亚洲国产欧美在线| 激情久久五月天| youjizz国产精品| 91精品1区2区| 欧美一级搡bbbb搡bbbb| 久久精品一区八戒影视| 亚洲视频1区2区| 天天免费综合色| 国产一区二区精品久久99| 97久久人人超碰| 这里只有精品视频在线观看| 亚洲精品一区二区三区福利| 国产精品嫩草影院com| 亚洲午夜激情网站| 精品一区二区精品| 色欧美片视频在线观看 | 欧美在线观看视频在线| 欧美一级片在线观看| 国产欧美一区二区三区在线老狼| 亚洲精品日韩一| 国产一区二区三区免费播放| 日本韩国欧美在线| 久久久久久久久伊人| 伊人一区二区三区| 激情久久五月天| 欧美日韩一区二区在线视频| 欧美激情中文字幕| 亚洲成人免费av| 成人国产一区二区三区精品| 欧美日韩激情一区二区三区| 国产精品私人自拍| 日本亚洲视频在线| 日本高清无吗v一区| 26uuu国产日韩综合| 亚洲一区二区三区三| 国产成人免费网站| 91麻豆精品国产综合久久久久久 | 欧美三级中文字幕在线观看| 国产网红主播福利一区二区| 日韩在线播放一区二区| 99久久久无码国产精品| 精品国产免费一区二区三区香蕉 | 亚洲人成影院在线观看| 精品亚洲欧美一区| 欧美一区二区女人| 亚洲自拍另类综合| 成人激情综合网站| 精品福利在线导航| 青青草国产成人99久久| 欧美在线观看你懂的| 中文字幕亚洲在| 成熟亚洲日本毛茸茸凸凹| 日韩精品资源二区在线| 亚洲va欧美va人人爽| 在线观看91视频| 亚洲最大成人综合| 96av麻豆蜜桃一区二区| 国产亚洲综合av| 精品一区二区三区久久| 91精品国产综合久久福利软件 | 欧美午夜精品一区| 亚洲婷婷综合久久一本伊一区| 国产福利一区在线观看| 精品福利一二区| 久久国产精品72免费观看| 欧美一卡二卡三卡四卡| 日韩电影一二三区| 91精品婷婷国产综合久久竹菊| 亚洲国产精品久久人人爱蜜臀| 在线中文字幕一区二区| 亚洲另类色综合网站| 91色婷婷久久久久合中文| 国产精品乱码久久久久久| 成人激情免费电影网址| 国产精品卡一卡二卡三| 白白色 亚洲乱淫| 亚洲欧洲日韩综合一区二区| www.激情成人| 亚洲精选一二三| 欧美影院精品一区| 亚洲二区视频在线| 欧美高清视频不卡网| 日韩电影免费在线观看网站| 欧美大白屁股肥臀xxxxxx| 韩国v欧美v亚洲v日本v| 久久久精品蜜桃| 粗大黑人巨茎大战欧美成人| 亚洲欧美日韩在线不卡| 91黄色免费版| 亚洲成av人片观看| 日韩欧美色综合网站| 国产精品一区二区久久不卡| 国产精品色哟哟| 色94色欧美sute亚洲线路一ni| 午夜视黄欧洲亚洲| 久久奇米777| 99久精品国产| 午夜伦欧美伦电影理论片| 精品福利二区三区| 成人精品一区二区三区四区| 亚洲日本va午夜在线影院| 欧美午夜精品一区| 国产一区二区三区免费看| 中文字幕日韩一区| 欧美美女一区二区| 国产专区综合网| 亚洲精选在线视频| 精品国产一区久久| 99精品久久只有精品| 日本午夜精品视频在线观看| 国产日产精品一区| 欧美日韩一区高清| 国产精品一卡二卡在线观看| 亚洲三级免费观看| 精品免费99久久| 色系网站成人免费| 精品一区二区三区香蕉蜜桃 | 国产精品传媒在线| 欧美一卡二卡三卡| 99在线精品一区二区三区| 午夜私人影院久久久久| 久久久精品免费网站| 欧美酷刑日本凌虐凌虐| av福利精品导航| 日韩av电影免费观看高清完整版 | 久久精品欧美一区二区三区麻豆| 日本韩国欧美在线| 国产精品一区二区黑丝| 午夜精品福利视频网站| 中文字幕在线观看一区| 日韩欧美中文字幕精品| 色综合久久久久久久久久久| 国内精品视频666| 午夜精品免费在线观看| 综合激情成人伊人| 国产日韩精品一区二区三区| 日韩一区二区三区四区|