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

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

?? canvas.java

?? 現在在國外大學里最流行的java學習軟件,同時還有大量的example,在名為project的文件里.安裝好后用bluej打開peoject的例子,可以進行你想要的任何變化.同時可以了解大量的源碼
?? JAVA
字號:
import javax.swing.*;import java.awt.*;import java.awt.geom.*;/** * Class Canvas - a class to allow for simple graphical  * drawing on a canvas. *  * @author Michael Kolling (mik) * @author Bruce Quig * * @version 2006.03.30 */public class Canvas{    private JFrame frame;    private CanvasPane canvas;    private Graphics2D graphic;    private Color backgroundColor;    private Image canvasImage;    /**     * Create a Canvas with default height, width and background color      * (300, 300, white).     * @param title  title to appear in Canvas Frame          */    public Canvas(String title)    {        this(title, 300, 300, Color.white);            }    /**     * Create a Canvas with default background color (white).     * @param title  title to appear in Canvas Frame     * @param width  the desired width for the canvas     * @param height  the desired height for the canvas     */    public Canvas(String title, int width, int height)    {        this(title, width, height, Color.white);    }    /**     * Create a Canvas.     * @param title  title to appear in Canvas Frame     * @param width  the desired width for the canvas     * @param height  the desired height for the canvas     * @param bgClour  the desired background color of the canvas     */    public Canvas(String title, int width, int height, Color bgColor)    {        frame = new JFrame();        canvas = new CanvasPane();        frame.setContentPane(canvas);        frame.setTitle(title);        canvas.setPreferredSize(new Dimension(width, height));        backgroundColor = bgColor;        frame.pack();    }    /**     * Set the canvas visibility and brings canvas to the front of screen     * when made visible. This method can also be used to bring an already     * visible canvas to the front of other windows.     * @param visible  boolean value representing the desired visibility of     * the canvas (true or false)      */    public void setVisible(boolean visible)    {        if(graphic == null) {            // first time: instantiate the offscreen image and fill it with            // the background color            Dimension size = canvas.getSize();            canvasImage = canvas.createImage(size.width, size.height);            graphic = (Graphics2D)canvasImage.getGraphics();            graphic.setColor(backgroundColor);            graphic.fillRect(0, 0, size.width, size.height);            graphic.setColor(Color.black);        }        frame.setVisible(true);    }    /**     * Provide information on visibility of the Canvas.     * @return  true if canvas is visible, false otherwise     */    public boolean isVisible()    {        return frame.isVisible();    }    /**     * Draw the outline of a given shape onto the canvas.     * @param  shape  the shape object to be drawn on the canvas     */    public void draw(Shape shape)    {        graphic.draw(shape);        canvas.repaint();    }     /**     * Fill the internal dimensions of a given shape with the current      * foreground color of the canvas.     * @param  shape  the shape object to be filled      */    public void fill(Shape shape)    {        graphic.fill(shape);        canvas.repaint();    }    /**     * Fill the internal dimensions of the given circle with the current      * foreground color of the canvas.     */    public void fillCircle(int xPos, int yPos, int diameter)    {        Ellipse2D.Double circle = new Ellipse2D.Double(xPos, yPos, diameter, diameter);        fill(circle);    }    /**     * Fill the internal dimensions of the given rectangle with the current      * foreground color of the canvas. This is a convenience method. A similar      * effect can be achieved with the "fill" method.     */    public void fillRectangle(int xPos, int yPos, int width, int height)    {        fill(new Rectangle(xPos, yPos, width, height));    }    /**     * Erase the whole canvas.     */    public void erase()    {        Color original = graphic.getColor();        graphic.setColor(backgroundColor);        Dimension size = canvas.getSize();        graphic.fill(new Rectangle(0, 0, size.width, size.height));        graphic.setColor(original);        canvas.repaint();    }    /**     * Erase the internal dimensions of the given circle. This is a      * convenience method. A similar effect can be achieved with     * the "erase" method.     */    public void eraseCircle(int xPos, int yPos, int diameter)    {        Ellipse2D.Double circle = new Ellipse2D.Double(xPos, yPos, diameter, diameter);        erase(circle);    }    /**     * Erase the internal dimensions of the given rectangle. This is a      * convenience method. A similar effect can be achieved with     * the "erase" method.     */    public void eraseRectangle(int xPos, int yPos, int width, int height)    {        erase(new Rectangle(xPos, yPos, width, height));    }    /**     * Erase a given shape's interior on the screen.     * @param  shape  the shape object to be erased      */    public void erase(Shape shape)    {        Color original = graphic.getColor();        graphic.setColor(backgroundColor);        graphic.fill(shape);              // erase by filling background color        graphic.setColor(original);        canvas.repaint();    }    /**     * Erases a given shape's outline on the screen.     * @param  shape  the shape object to be erased      */    public void eraseOutline(Shape shape)    {        Color original = graphic.getColor();        graphic.setColor(backgroundColor);        graphic.draw(shape);  // erase by drawing background color        graphic.setColor(original);        canvas.repaint();    }    /**     * Draws an image onto the canvas.     * @param  image   the Image object to be displayed      * @param  x       x co-ordinate for Image placement      * @param  y       y co-ordinate for Image placement      * @return  returns boolean value representing whether the image was      *          completely loaded      */    public boolean drawImage(Image image, int x, int y)    {        boolean result = graphic.drawImage(image, x, y, null);        canvas.repaint();        return result;    }    /**     * Draws a String on the Canvas.     * @param  text   the String to be displayed      * @param  x      x co-ordinate for text placement      * @param  y      y co-ordinate for text placement     */    public void drawString(String text, int x, int y)    {        graphic.drawString(text, x, y);           canvas.repaint();    }    /**     * Erases a String on the Canvas.     * @param  text     the String to be displayed      * @param  x        x co-ordinate for text placement      * @param  y        y co-ordinate for text placement     */    public void eraseString(String text, int x, int y)    {        Color original = graphic.getColor();        graphic.setColor(backgroundColor);        graphic.drawString(text, x, y);           graphic.setColor(original);        canvas.repaint();    }    /**     * Draws a line on the Canvas.     * @param  x1   x co-ordinate of start of line      * @param  y1   y co-ordinate of start of line      * @param  x2   x co-ordinate of end of line      * @param  y2   y co-ordinate of end of line      */    public void drawLine(int x1, int y1, int x2, int y2)    {        graphic.drawLine(x1, y1, x2, y2);           canvas.repaint();    }    /**     * Sets the foreground color of the Canvas.     * @param  newColor   the new color for the foreground of the Canvas      */    public void setForegroundColor(Color newColor)    {        graphic.setColor(newColor);    }    /**     * Returns the current color of the foreground.     * @return   the color of the foreground of the Canvas      */    public Color getForegroundColor()    {        return graphic.getColor();    }    /**     * Sets the background color of the Canvas.     * @param  newColor   the new color for the background of the Canvas      */    public void setBackgroundColor(Color newColor)    {        backgroundColor = newColor;           graphic.setBackground(newColor);    }    /**     * Returns the current color of the background     * @return   the color of the background of the Canvas      */    public Color getBackgroundColor()    {        return backgroundColor;    }    /**     * changes the current Font used on the Canvas     * @param  newFont   new font to be used for String output     */    public void setFont(Font newFont)    {        graphic.setFont(newFont);    }    /**     * Returns the current font of the canvas.     * @return     the font currently in use     **/    public Font getFont()    {        return graphic.getFont();    }    /**     * Sets the size of the canvas.     * @param  width    new width      * @param  height   new height      */    public void setSize(int width, int height)    {        canvas.setPreferredSize(new Dimension(width, height));        Image oldImage = canvasImage;        canvasImage = canvas.createImage(width, height);        graphic = (Graphics2D)canvasImage.getGraphics();        graphic.drawImage(oldImage, 0, 0, null);        frame.pack();    }    /**     * Returns the size of the canvas.     * @return     The current dimension of the canvas     */    public Dimension getSize()    {        return canvas.getSize();    }    /**     * Waits for a specified number of milliseconds before finishing.     * This provides an easy way to specify a small delay which can be     * used when producing animations.     * @param  milliseconds  the number      */    public void wait(int milliseconds)    {        try        {            Thread.sleep(milliseconds);        }         catch (InterruptedException e)        {            // ignoring exception at the moment        }    }    /************************************************************************     * Inner class CanvasPane - the actual canvas component contained in the     * Canvas frame. This is essentially a JPanel with added capability to     * refresh the image drawn on it.     */    private class CanvasPane extends JPanel    {        public void paint(Graphics g)        {            g.drawImage(canvasImage, 0, 0, null);        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人app下载| 欧美日韩性生活| 国产真实乱子伦精品视频| 国产曰批免费观看久久久| 高清国产一区二区三区| 欧美亚一区二区| www久久久久| 亚洲美女免费视频| 激情文学综合网| 色欧美日韩亚洲| 久久综合色婷婷| 亚洲一区二区美女| 韩国av一区二区三区在线观看| 成人不卡免费av| 91精品国产黑色紧身裤美女| 国产精品素人视频| 久久精品国产亚洲a| 一本久道久久综合中文字幕| 欧美日本在线观看| 国产精品第一页第二页第三页| 无吗不卡中文字幕| av午夜精品一区二区三区| 337p亚洲精品色噜噜狠狠| 国产精品免费看片| 极品瑜伽女神91| 欧美色窝79yyyycom| 国产精品黄色在线观看| 亚洲午夜精品网| caoporm超碰国产精品| 日韩一卡二卡三卡| 亚洲国产另类av| 94-欧美-setu| 中文子幕无线码一区tr| 久久激情五月婷婷| 欧美日韩成人在线一区| 一区二区三区欧美日韩| 成人动漫一区二区在线| 国产亚洲精品aa午夜观看| 日本欧美肥老太交大片| 欧洲国内综合视频| 亚洲免费看黄网站| 成人白浆超碰人人人人| 欧美国产一区在线| 国产伦精一区二区三区| 精品日韩在线观看| 日本不卡123| 在线播放视频一区| 午夜精品aaa| 欧美老年两性高潮| 午夜精品久久久久久久久久| 欧美日韩三级视频| 亚洲第一狼人社区| 69av一区二区三区| 蜜桃精品视频在线观看| 日韩午夜精品视频| 精品一区二区三区在线观看国产| 日韩欧美激情一区| 狠狠v欧美v日韩v亚洲ⅴ| 精品对白一区国产伦| 免费人成黄页网站在线一区二区| 91精品欧美久久久久久动漫| 日韩中文字幕不卡| 欧美xxxx在线观看| 免费在线观看一区| 国产欧美日韩三区| 99久久精品一区| 国产精品久久久久影院亚瑟 | 久久久久九九视频| 国产精品综合在线视频| 欧美国产一区视频在线观看| 色老头久久综合| 无码av中文一区二区三区桃花岛| 日韩欧美国产三级| 韩国精品一区二区| 亚洲图片欧美激情| 欧美片网站yy| 国产一区二区三区在线看麻豆| 国产清纯美女被跳蛋高潮一区二区久久w| 久久国产三级精品| 中文字幕一区在线| 欧美男人的天堂一二区| 久久91精品国产91久久小草| 国产亚洲一区二区在线观看| 97精品电影院| 麻豆国产欧美一区二区三区| 欧美国产乱子伦| 欧美视频一区在线| 国产成人精品免费网站| 亚洲午夜激情网页| 欧美激情在线观看视频免费| 欧美在线免费视屏| 国产在线国偷精品免费看| 亚洲美女在线一区| 欧美精品一区二区三区视频| 日本韩国精品在线| 国产在线国偷精品免费看| 日韩av在线发布| 亚洲一线二线三线视频| 中文字幕一区二区三区四区不卡| 久久久久久夜精品精品免费| 欧美一区二区三区不卡| 欧美在线免费观看亚洲| 91美女片黄在线观看91美女| 懂色av一区二区夜夜嗨| 国产精品99久久久久久有的能看| 日本成人在线一区| 午夜精品久久久久久久蜜桃app| 一区二区三区精品在线| 自拍偷拍国产精品| 亚洲美女少妇撒尿| 一区二区三区日韩精品| 亚洲精品国产无天堂网2021| 一区二区在线观看免费| 亚洲精品自拍动漫在线| 亚洲男人的天堂一区二区 | 国产成人精品午夜视频免费| 精品一区二区av| 国产一区91精品张津瑜| 国产精品系列在线播放| 丁香婷婷综合网| av色综合久久天堂av综合| 一本到不卡免费一区二区| 99v久久综合狠狠综合久久| 色噜噜久久综合| 精品视频123区在线观看| 欧美亚洲综合色| 在线播放亚洲一区| 精品久久久久久久人人人人传媒 | 亚洲国产精品一区二区久久恐怖片 | 欧洲精品在线观看| 欧美乱妇15p| 精品久久五月天| 国产精品久久久爽爽爽麻豆色哟哟| 国产精品黄色在线观看| 亚洲一区二区三区美女| 美女视频免费一区| 国产成人av影院| 欧美专区日韩专区| 日韩欧美激情在线| 国产精品短视频| 日韩中文字幕一区二区三区| 极品尤物av久久免费看| yourporn久久国产精品| 欧美性猛交xxxx乱大交退制版| 日韩美一区二区三区| 中文字幕在线不卡一区二区三区| 亚洲国产视频a| 国产乱色国产精品免费视频| 色婷婷综合五月| 精品国精品国产| 亚洲免费色视频| 韩国午夜理伦三级不卡影院| 91丨九色丨蝌蚪富婆spa| 欧美日韩国产一级片| 国产婷婷色一区二区三区在线| 亚洲国产精品精华液网站| 国产综合色视频| 欧美三级视频在线观看| 国产欧美一二三区| 丝袜美腿亚洲色图| www.亚洲在线| 精品国产乱码久久久久久蜜臀| 亚洲欧洲国产专区| 韩日精品视频一区| 7777精品伊人久久久大香线蕉完整版 | 热久久免费视频| av成人动漫在线观看| 日韩欧美一级精品久久| 亚洲欧美电影院| 国产乱子伦一区二区三区国色天香| 欧洲另类一二三四区| 国产欧美日韩另类视频免费观看| 天堂蜜桃91精品| 色国产精品一区在线观看| 久久久影视传媒| 免费日韩伦理电影| 欧美色中文字幕| 亚洲女人****多毛耸耸8| 国产高清无密码一区二区三区| 在线不卡一区二区| 亚洲一本大道在线| 一本久道中文字幕精品亚洲嫩| 久久精品日产第一区二区三区高清版| 亚洲成人免费视| 欧美午夜在线一二页| 亚洲欧美另类图片小说| 成人av集中营| 久久久久久久综合色一本| 麻豆freexxxx性91精品| 国产精品国产三级国产aⅴ原创 | aaa亚洲精品一二三区| 精品国产sm最大网站| 日本不卡一二三区黄网| 欧美影院午夜播放| 一区二区成人在线视频| 91麻豆123| 一区二区三区欧美| 欧美日韩高清在线| 天堂精品中文字幕在线| 欧美一区二区在线看|