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

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

?? selectiondemo.java

?? it contains the practical programs in our college
?? JAVA
字號:
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);            }        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
综合久久久久综合| 亚洲精品欧美专区| 久久精品人人做人人爽人人| 久久综合丝袜日本网| 99视频一区二区| 韩国成人在线视频| 国产成人在线视频网址| 99久精品国产| 欧美军同video69gay| 亚洲精品一区二区三区精华液| ww亚洲ww在线观看国产| 国产精品少妇自拍| 亚洲一区二区欧美激情| 狠狠狠色丁香婷婷综合久久五月| 国产高清亚洲一区| 欧美视频中文一区二区三区在线观看| 色国产综合视频| 久久影视一区二区| 亚洲综合色噜噜狠狠| 韩国午夜理伦三级不卡影院| 蜜桃久久精品一区二区| 国产拍揄自揄精品视频麻豆| 亚洲美女免费在线| 国产乱码精品一区二区三区五月婷| 97久久人人超碰| 欧美mv和日韩mv国产网站| 亚洲精品欧美激情| 国产精品亚洲а∨天堂免在线| 欧美亚男人的天堂| 国产精品久久久久影院| 久久99精品网久久| 欧美日韩一区二区三区高清| 国产精品精品国产色婷婷| 蜜桃视频第一区免费观看| 欧美视频三区在线播放| 中文字幕一区二区不卡| 国产成人99久久亚洲综合精品| 91精品国产欧美一区二区| 亚洲一本大道在线| 91成人在线精品| 亚洲欧美韩国综合色| 99久久婷婷国产精品综合| 久久精品无码一区二区三区| 91论坛在线播放| 国产精品欧美极品| 国产传媒久久文化传媒| 国产日韩欧美亚洲| 成人免费三级在线| 亚洲色图视频免费播放| 91在线丨porny丨国产| 亚洲图片欧美激情| 在线日韩一区二区| 午夜精品一区二区三区免费视频| 欧美色网站导航| 美美哒免费高清在线观看视频一区二区| 欧美午夜片在线看| 男男成人高潮片免费网站| 日韩欧美综合在线| 国产成人免费在线观看不卡| 中文字幕不卡的av| 欧美亚洲精品一区| 国产精品小仙女| 亚洲精品国产a| 日韩欧美另类在线| www.久久久久久久久| 亚洲成av人影院| 久久综合狠狠综合久久激情| av日韩在线网站| 五月婷婷久久丁香| 国产精品麻豆视频| 678五月天丁香亚洲综合网| 麻豆国产91在线播放| 成人免费av网站| 日韩激情中文字幕| 国产精品女主播在线观看| 777精品伊人久久久久大香线蕉| 久久99久久久欧美国产| 亚洲精品成人悠悠色影视| 日韩写真欧美这视频| 久久九九久久九九| 欧美另类高清zo欧美| 91麻豆免费在线观看| 激情偷乱视频一区二区三区| 亚洲综合丁香婷婷六月香| 久久久久成人黄色影片| 日韩午夜激情视频| 欧美中文一区二区三区| av一区二区三区在线| 国产乱码精品一品二品| 麻豆精品精品国产自在97香蕉| 一区二区三区成人| 日韩美女啊v在线免费观看| 精品国产一区二区三区久久久蜜月 | 亚洲欧美一区二区视频| 日韩欧美国产三级| 精品捆绑美女sm三区| 欧美一级片免费看| 欧美成人免费网站| 26uuu国产日韩综合| 精品国产精品一区二区夜夜嗨| 日韩一区二区精品在线观看| 日韩免费看的电影| 精品久久久久久久久久久久久久久久久 | 国产精品久久久久aaaa樱花| 久久综合九色综合97_久久久| 久久影院午夜片一区| 久久久久久久久久久久电影| 久久久综合视频| 国产精品嫩草99a| 中文成人av在线| 亚洲一区二区五区| 99久久er热在这里只有精品66| 国产麻豆日韩欧美久久| 国产成人亚洲综合色影视| 波波电影院一区二区三区| 色菇凉天天综合网| 日韩欧美第一区| 国产亚洲欧美一区在线观看| 亚洲婷婷在线视频| 丝袜亚洲另类欧美| 丰满白嫩尤物一区二区| 91国产免费看| 欧美一级理论性理论a| 国产亚洲综合性久久久影院| 中文字幕亚洲一区二区av在线| 亚洲成人久久影院| 国产91在线观看| 69精品人人人人| 国产精品久久久久毛片软件| 天天综合网 天天综合色| 国产精品影音先锋| 欧美丰满高潮xxxx喷水动漫| 欧美极品美女视频| 首页欧美精品中文字幕| 不卡一区在线观看| 国产精品日日摸夜夜摸av| 国产成人精品一区二| 免费不卡在线观看| 色av综合在线| 日本欧美一区二区在线观看| 国产成人av一区二区三区在线观看| 在线观看一区二区视频| 中文字幕 久热精品 视频在线| 日本人妖一区二区| 欧美日本不卡视频| 一区二区三区在线视频观看58 | 亚洲欧美自拍偷拍色图| 国产剧情av麻豆香蕉精品| 欧美日本精品一区二区三区| 亚洲欧美偷拍另类a∨色屁股| 国产成人综合在线播放| 26uuu精品一区二区在线观看| 男女激情视频一区| 日韩一级二级三级| 九九**精品视频免费播放| 一区二区三区在线观看欧美| 久久久久久久久蜜桃| 国产在线精品一区二区三区不卡| 日韩欧美美女一区二区三区| 日韩精品五月天| 亚洲精品一区二区三区福利| 精品亚洲国产成人av制服丝袜| 精品福利一二区| 国产成人在线免费观看| 国产精品久久久久久久久免费相片| 欧美中文字幕一区二区三区亚洲| 自拍偷拍亚洲综合| 欧美色图第一页| 激情久久五月天| 国产精品久久毛片| 欧美日韩高清在线| 国产一区二区0| 亚洲摸摸操操av| 日韩欧美国产麻豆| 国产成人无遮挡在线视频| 亚洲欧美二区三区| 日韩一区二区在线免费观看| 亚洲成人自拍一区| 成人动漫av在线| 亚洲超碰97人人做人人爱| 日韩一区二区三区四区| 成人午夜电影网站| 日韩专区一卡二卡| 国产日韩欧美亚洲| 91精品在线观看入口| 国产超碰在线一区| 中文字幕第一页久久| 国产成人精品三级| 欧美不卡视频一区| 国产乱码精品一区二区三区忘忧草 | 国产精品三级av| 日韩精品一区二区三区蜜臀| 色综合咪咪久久| 国产黄人亚洲片| 亚洲精品中文在线影院| 精品精品国产高清一毛片一天堂| 97se亚洲国产综合在线| 国内精品自线一区二区三区视频| 亚洲国产精品久久不卡毛片| 1000精品久久久久久久久|