File tree Expand file tree Collapse file tree
teachingkidsprogramming/recipes/completed/section08events Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -258,6 +258,7 @@ public static void setPenDown()
258258 public static void clear ()
259259 {
260260 turtle ().clear ();
261+ turtle ().getBackgroundWindow ().setTurtle (turtle ());
261262 }
262263
263264 /**
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ public CanvasPanel add(Paintable painter) {
3939 if (!this .painters .contains (painter )) {
4040 this .painters .add (painter );
4141 }
42+ this .repaint ();
4243 return this ;
4344 }
4445
Original file line number Diff line number Diff line change 11package org .teachingextensions .logo .utils .LineAndShapeUtils ;
22
33import org .teachingextensions .WindowUtils .ProgramWindow ;
4- import org .teachingextensions .WindowUtils .TurtleWindow ;
54import org .teachingextensions .logo .utils .ColorUtils .PenColors ;
65
76import javax .swing .*;
@@ -50,7 +49,7 @@ public int getRadius()
5049 */
5150 public void addTo (ProgramWindow panel )
5251 {
53- panel .add (this );
52+ panel .getCanvas (). add (this );
5453 }
5554 /**
5655 * Paints a circle
@@ -91,8 +90,4 @@ public int getY()
9190 {
9291 return this .y ;
9392 }
94-
95- public void addTo (TurtleWindow panel ) {
96- panel .getCanvas ().add (this );
97- }
9893}
Original file line number Diff line number Diff line change 1010//
1111//------------Kata Question---------------//
1212// How would you change your bubble into a unicorn when you right click on the window?
13- // Write out the steps in English
13+ // Write out the steps in English
1414// Then translate the steps into code
1515// Make sure to run after each line
1616//
@@ -48,4 +48,4 @@ public static void main(String[] args)
4848 {
4949 new SimpleBubbleKataQuestion ();
5050 }
51- }
51+ }
Original file line number Diff line number Diff line change 11package org .teachingkidsprogramming .recipes .completed .section08events ;
22
3- import java .awt .event .ActionEvent ;
4- import java .awt .event .ActionListener ;
5-
6- import javax .swing .ImageIcon ;
7- import javax .swing .JButton ;
8-
93import org .teachingextensions .logo .Tortoise ;
104import org .teachingextensions .logo .utils .ColorUtils .PenColors ;
115
6+ import javax .swing .*;
7+ import java .awt .event .ActionEvent ;
8+ import java .awt .event .ActionListener ;
9+
1210//***********************ANSWER: In Progress***************************//
1311// Need to write English comments and copy to STUDENT section //
1412//
@@ -20,6 +18,7 @@ public static void main(String[] args)
2018 }
2119 public TortoiseMaze ()
2220 {
21+ Tortoise .show ();
2322 Tortoise .setSpeed (10 );
2423 Tortoise .setPenColor (PenColors .Greens .Green );
2524 Tortoise .setPenWidth (4 );
You can’t perform that action at this time.
0 commit comments