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

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

?? canvas.java

?? 現在在國外大學里最流行的java學習軟件,同時還有大量的example,在名為project的文件里.安裝好后用bluej打開peoject的例子,可以進行你想要的任何變化.同時可以了解大量的源碼
?? JAVA
字號:
import javax.swing.*;import java.awt.*;import java.util.List;import java.util.*;/** * Canvas is a class to allow for simple graphical drawing on a canvas. * This is a modification of the general purpose Canvas, specially made for * the BlueJ "shapes" example.  * * @author: Bruce Quig * @author: Michael Kolling (mik) * * @version 2006.03.30 */public class Canvas{    // Note: The implementation of this class (specifically the handling of    // shape identity and colors) is slightly more complex than necessary. This    // is done on purpose to keep the interface and instance fields of the    // shape objects in this project clean and simple for educational purposes.    private static Canvas canvasSingleton;    /**     * Factory method to get the canvas singleton object.     */    public static Canvas getCanvas()    {        if(canvasSingleton == null) {            canvasSingleton = new Canvas("BlueJ Shapes Demo", 300, 300,                                          Color.white);        }        canvasSingleton.setVisible(true);        return canvasSingleton;    }    //  ----- instance part -----    private JFrame frame;    private CanvasPane canvas;    private Graphics2D graphic;    private Color backgroundColor;    private Image canvasImage;    private List<Object> objects;    private HashMap<Object, ShapeDescription> shapes;        /**     * 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 bgColor the desired background color of the canvas     */    private 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();        objects = new ArrayList<Object>();        shapes = new HashMap<Object, ShapeDescription>();    }    /**     * 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(visible);    }    /**     * Draw a given shape onto the canvas.     * @param  referenceObject  an object to define identity for this shape     * @param  color            the color of the shape     * @param  shape            the shape object to be drawn on the canvas     */     // Note: this is a slightly backwards way of maintaining the shape     // objects. It is carefully designed to keep the visible shape interfaces     // in this project clean and simple for educational purposes.    public void draw(Object referenceObject, String color, Shape shape)    {        objects.remove(referenceObject);   // just in case it was already there        objects.add(referenceObject);      // add at the end        shapes.put(referenceObject, new ShapeDescription(shape, color));        redraw();    }     /**     * Erase a given shape's from the screen.     * @param  referenceObject  the shape object to be erased      */    public void erase(Object referenceObject)    {        objects.remove(referenceObject);   // just in case it was already there        shapes.remove(referenceObject);        redraw();    }    /**     * Set the foreground color of the Canvas.     * @param  newColor   the new color for the foreground of the Canvas      */    public void setForegroundColor(String colorString)    {        if(colorString.equals("red")) {            graphic.setColor(Color.red);        }        else if(colorString.equals("black")) {            graphic.setColor(Color.black);        }        else if(colorString.equals("blue")) {            graphic.setColor(Color.blue);        }        else if(colorString.equals("yellow")) {            graphic.setColor(Color.yellow);        }        else if(colorString.equals("green")) {            graphic.setColor(Color.green);        }        else if(colorString.equals("magenta")) {            graphic.setColor(Color.magenta);        }        else if(colorString.equals("white")) {            graphic.setColor(Color.white);        }        else {            graphic.setColor(Color.black);        }    }    /**     * Wait 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 (Exception e)        {            // ignoring exception at the moment        }    }    /**     * Redraw ell shapes currently on the Canvas.     */    private void redraw()    {        erase();        for(Object shape : objects) {            shapes.get(shape).draw(graphic);        }        canvas.repaint();    }           /**     * Erase the whole canvas. (Does not repaint.)     */    private 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);    }    /************************************************************************     * 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);        }    }        /************************************************************************     * 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 ShapeDescription    {        private Shape shape;        private String colorString;        public ShapeDescription(Shape shape, String color)        {            this.shape = shape;            colorString = color;        }        public void draw(Graphics2D graphic)        {            setForegroundColor(colorString);            graphic.fill(shape);        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久亚洲综合色一区二区三区| 夜夜精品浪潮av一区二区三区| 亚洲国产中文字幕| 色狠狠色狠狠综合| 一区二区视频免费在线观看| 色老头久久综合| 亚洲影视在线观看| 9191久久久久久久久久久| 天堂在线一区二区| 欧美伦理视频网站| 久久精品国内一区二区三区| 精品国产乱码久久| 成人毛片在线观看| 亚洲精品国产第一综合99久久 | 污片在线观看一区二区| 欧美制服丝袜第一页| 日日夜夜免费精品视频| 精品粉嫩aⅴ一区二区三区四区| 国产精品综合久久| 亚洲日本一区二区| 欧美日韩国产一二三| 精品在线一区二区| 中文字幕亚洲在| 欧美色综合网站| 蜜臂av日日欢夜夜爽一区| 国产午夜精品在线观看| 91麻豆福利精品推荐| 天堂av在线一区| 亚洲精品一区二区三区影院 | 色综合中文字幕国产 | 青青草原综合久久大伊人精品 | 久久久五月婷婷| 色哟哟在线观看一区二区三区| 亚洲国产日韩在线一区模特| 日韩欧美国产一区二区三区| 成人免费看片app下载| 一区二区欧美国产| 精品福利一二区| 欧美主播一区二区三区| 国产精品一二三区在线| 亚洲成人av电影在线| 国产欧美一区二区精品久导航| 欧美专区亚洲专区| 成人精品电影在线观看| 轻轻草成人在线| 亚洲视频免费在线| 久久久久国产精品人| 欧美欧美午夜aⅴ在线观看| 懂色av中文一区二区三区| 五月天丁香久久| 综合分类小说区另类春色亚洲小说欧美 | 日韩精品乱码av一区二区| 中文字幕欧美日本乱码一线二线| 欧美精品久久一区| 91蜜桃网址入口| 国产精品一品二品| 免费成人结看片| 亚洲一二三四久久| 国产精品第一页第二页第三页| 日韩三级电影网址| 欧美色中文字幕| 色狠狠一区二区| 99re热视频这里只精品 | 国产剧情一区二区| 日韩av一级电影| 亚洲乱码中文字幕| 国产精品久久久久7777按摩| 久久久久久久av麻豆果冻| 91麻豆精品国产综合久久久久久| 色噜噜偷拍精品综合在线| 99精品1区2区| 99在线热播精品免费| 成人国产精品免费观看动漫| 国产一区二区精品久久99| 蜜桃久久久久久| 蜜臀av性久久久久蜜臀aⅴ| 亚洲成av人在线观看| 亚洲国产一区二区a毛片| 一区二区激情视频| 一区二区视频在线| 亚洲综合成人在线视频| 亚洲精品国产高清久久伦理二区| 18成人在线观看| 最新热久久免费视频| 一区视频在线播放| 亚洲欧美激情插| 亚洲一区二区三区三| 亚洲午夜久久久| 午夜精品久久久久影视| 婷婷激情综合网| 日韩成人免费电影| 九九精品视频在线看| 国产一区在线看| 国产xxx精品视频大全| 成人免费视频网站在线观看| 91在线云播放| 欧美专区在线观看一区| 欧美日韩www| 日韩午夜小视频| 久久综合九色综合欧美就去吻| 国产亚洲综合av| 亚洲天堂久久久久久久| 亚洲国产裸拍裸体视频在线观看乱了| 香蕉乱码成人久久天堂爱免费| 日本不卡中文字幕| 狠狠色狠狠色综合日日91app| 国产成人精品亚洲777人妖| 成人一区二区三区视频| 色94色欧美sute亚洲13| 欧美肥大bbwbbw高潮| 久久免费午夜影院| 亚洲伦理在线免费看| 五月天激情小说综合| 国产一区二区三区免费播放 | 麻豆国产91在线播放| 国产老妇另类xxxxx| 成人天堂资源www在线| 欧美性猛片aaaaaaa做受| 日韩欧美黄色影院| 综合激情成人伊人| 日韩电影在线观看一区| 国产一区二区免费看| 色欧美片视频在线观看在线视频| 在线不卡的av| 国产精品毛片无遮挡高清| 亚洲成人三级小说| 国产福利一区二区三区在线视频| 在线精品视频免费观看| 久久综合一区二区| 一区二区三区加勒比av| 激情av综合网| 欧美在线三级电影| 国产日韩精品一区二区三区| 亚洲一区二区三区视频在线| 国产91高潮流白浆在线麻豆| 欧美群妇大交群中文字幕| 国产精品伦一区二区三级视频| 天天综合网 天天综合色| 成人免费看视频| 欧美大片在线观看一区二区| 一个色在线综合| 国产**成人网毛片九色 | 极品少妇xxxx精品少妇偷拍 | 午夜精品福利在线| 色综合天天天天做夜夜夜夜做| 精品久久久久久综合日本欧美| 亚洲综合999| av电影在线观看一区| 久久在线免费观看| 青青草原综合久久大伊人精品| 色欧美片视频在线观看在线视频| 久久精品视频网| 美女脱光内衣内裤视频久久影院| 在线视频国内自拍亚洲视频| 中文字幕的久久| 国产乱码精品一区二区三区忘忧草| 欧美日韩国产一二三| 一区二区三区国产精品| av福利精品导航| 国产精品视频九色porn| 国产精品2024| 久久丝袜美腿综合| 狠狠色丁香久久婷婷综| 日韩欧美成人激情| 美女脱光内衣内裤视频久久网站 | 久久精品国产精品亚洲综合| 精品视频在线视频| 亚洲国产一区二区三区| 欧美午夜理伦三级在线观看| 亚洲精品综合在线| 日本高清不卡在线观看| 亚洲理论在线观看| 在线视频你懂得一区二区三区| 亚洲色图在线播放| 91视频com| 亚洲在线观看免费| 欧美日韩免费观看一区二区三区| 亚洲午夜久久久久久久久电影院 | 久久精品一区八戒影视| 另类小说综合欧美亚洲| 欧美xfplay| 精品一区二区免费视频| 久久久久久亚洲综合影院红桃| 国产一区二区三区黄视频| 久久蜜桃av一区精品变态类天堂| 韩国女主播一区| 中文字幕+乱码+中文字幕一区| 播五月开心婷婷综合| 成人欧美一区二区三区| 91国偷自产一区二区开放时间| 亚洲一区在线观看视频| 欧美二区乱c少妇| 久久激情五月婷婷| 久久久久久久久久久99999| 高清av一区二区| 亚洲免费av在线| 91精品国产免费| 国产高清在线精品| 亚洲精品乱码久久久久久黑人| 欧美日韩的一区二区|