From b83d6136ef97924dee21e63161f1b793743f3e5d Mon Sep 17 00:00:00 2001 From: 0121910870813 <71632604+0121910870813@users.noreply.github.com> Date: Mon, 21 Sep 2020 16:40:53 +0800 Subject: [PATCH 1/2] lianxi1.1 From ca4a3e7926f28a22dd5552c2f4685c7228b549ae Mon Sep 17 00:00:00 2001 From: 0121910870813 <71632604+0121910870813@users.noreply.github.com> Date: Mon, 21 Sep 2020 17:09:19 +0800 Subject: [PATCH 2/2] Delete Picture.java --- Picture.java | 85 ---------------------------------------------------- 1 file changed, 85 deletions(-) delete mode 100644 Picture.java diff --git a/Picture.java b/Picture.java deleted file mode 100644 index 855db14..0000000 --- a/Picture.java +++ /dev/null @@ -1,85 +0,0 @@ - -/** - * This class represents a simple picture. You can draw the picture using - * the draw method. But wait, there's more: being an electronic picture, it - * can be changed. You can set it to black-and-white display and back to - * colors (only after it's been drawn, of course). - * - * This class was written as an early example for teaching Java with BlueJ. - * - * @author Michael Kölling and David J. Barnes - * @version 1.1 (24 May 2001) - */ -public class Picture -{ - private Square wall; - private Square window; - private Triangle roof; - private Circle sun; - private Circle circle1; - private Square square1; - - /** - * Constructor for objects of class Picture - */ - public Picture() - { - // nothing to do... instance variables are automatically set to null - } - - /** - * Draw this picture. - */ - public void draw() - { - - - circle1 = new Circle(); - circle1.changeColor("blue"); - circle1.moveHorizontal(150); - circle1.moveVertical(0); - circle1.changeSize(60); - circle1.makeVisible(); - - square1=new Square(); - square1.changeColor("green"); - square1.moveHorizontal(30); - square1.moveVertical(50); - square1.makeVisible(); - } - - /** - * Change this picture to black/white display - */ - public void setBlackAndWhite() - { - if(wall != null) // only if it's painted already... - { - wall.changeColor("black"); - window.changeColor("white"); - roof.changeColor("black"); - sun.changeColor("black"); - } - } - - /** - * Change this picture to use color display - */ - public void setColor() - { - if(wall != null) // only if it's painted already... - { - wall.changeColor("red"); - window.changeColor("black"); - roof.changeColor("green"); - sun.changeColor("yellow"); - } - } - - public static void main(String[] args) { - Picture picture = new Picture(); -// picture.setBlackAndWhite(); - picture.draw();; - } - -}