Skip to content

Commit 77c7fa8

Browse files
committed
added Documentation for Turtle / Tortoise
1 parent 59a8d33 commit 77c7fa8

4 files changed

Lines changed: 23 additions & 9 deletions

File tree

src/org/teachingextensions/logo/MultiTurtlePanel.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ public synchronized Animals getAnimal()
114114
}
115115
return animal;
116116
}
117+
/**
118+
* Sets the Animal
119+
* <div><b>Example:</b> {@code multiTurtlePanel.setAnimal(animal)} </div>
120+
*
121+
* @see Animals
122+
*/
117123
public synchronized void setAnimal(Animals animal)
118124
{
119125
this.animal = animal;

src/org/teachingextensions/logo/PenColors.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,6 +1532,11 @@ private static int increase(int amount, int increaseBy)
15321532
{
15331533
return Math.min(255, amount + increaseBy);
15341534
}
1535+
/**
1536+
* Gets a random pen color
1537+
* <div><b>Example:</b> {@code penColors.getRandomColor( )} </div>
1538+
*
1539+
*/
15351540
public static Color getRandomColor()
15361541
{
15371542
return new Color(RANDOM.nextInt(255), RANDOM.nextInt(255), RANDOM.nextInt(255));

src/org/teachingextensions/logo/Tortoise.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
/**
99
* <img src="https://lh5.googleusercontent.com/-B3Q59gpYW8o/T4tA2k_TYUI/AAAAAAAAAjo/WiqdoXjbkb0/s65/Tortoise.png" align="left" >
10-
* The Tortoise allows you to draw lines and shapes by moving it around on the canvas
10+
* The Tortoise allows you to draw lines and shapes by moving it around on the window
1111
*/
1212
public class Tortoise
1313
{
@@ -42,11 +42,11 @@ public static int getSpeed()
4242
}
4343
/**
4444
* Sets the color drawn by the Tortoise. <br/>
45-
* <div><b>Example:</b> {@code Tortoise.setPenColor(Colors.Reds.Red)}</div>
45+
* <div><b>Example:</b> {@code Tortoise.setPenColor(PenColors.Reds.Red)}</div>
4646
*
4747
* @param color
4848
* the color of the pen
49-
* @see Colors
49+
* @see PenColors
5050
*/
5151
public static void setPenColor(Color color)
5252
{
@@ -178,26 +178,24 @@ public static double getAngle()
178178
* Changes the type of animal you are using. <br/>
179179
* <div><b>Example:</b> {@code Tortoise.setAnimal(Animals.Spider);}</div>
180180
*
181-
* @return the angle in degrees of the Tortoise
182181
* @see Animals
183182
*/
184183
public static void setAnimal(Animals animal)
185184
{
186185
turtle().setAnimal(animal);
187186
}
188187
/**
189-
* Changes the type of animal you are using. <br/>
190-
* <div><b>Example:</b> {@code Tortoise.setAnimal(Animals.Spider);}</div>
188+
* Blows up your turtle! <br/>
189+
* <div><b>Example:</b> {@code Tortoise.explode(Animals.ExplodedTurtle);}</div>
191190
*
192-
* @return the angle in degrees of the Tortoise
193191
* @see Animals
194192
*/
195193
public static void explode()
196194
{
197195
turtle().setAnimal(Animals.ExplodedTurtle);
198196
}
199197
/**
200-
* Makes it so the tortoise will not draw a line of color out of it's butt. <br/>
198+
* Makes it so the tortoise will not draw a line of color out of its butt. <br/>
201199
* <b>Example:</b> {@code Tortoise.penUp()}
202200
*/
203201
public static void penUp()
@@ -221,7 +219,7 @@ public static void clear()
221219
turtle().clear();
222220
}
223221
/**
224-
* Hides the tortoise, you will still see the pen markings it made before and after it hid. <br/>
222+
* Hides the tortoise, you will still see the pen markings it made before and after it's hidden. <br/>
225223
* <b>Example:</b> {@code Tortoise.hide()}
226224
*/
227225
public static void hide()

src/org/teachingextensions/logo/Turtle.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
import com.spun.util.persistence.Saver;
1818
import com.spun.util.persistence.SavingException;
1919

20+
/**
21+
* <img src="https://lh5.googleusercontent.com/-B3Q59gpYW8o/T4tA2k_TYUI/AAAAAAAAAjo/WiqdoXjbkb0/s65/Tortoise.png" align="left" >
22+
* The Turtle allows you to draw lines and shapes by moving it around on the window, and you can put more than one turtle on the same window...
23+
*/
2024
public class Turtle
2125
{
2226
/**
@@ -77,6 +81,7 @@ public Double save(Double save) throws SavingException
7781
private boolean penDown = true;
7882
private boolean hidden;
7983
private Animals animal;
84+
//
8085
public BufferedImage getImage()
8186
{
8287
BufferedImage image = ComponentApprovalWriter.drawComponent(getPanel());

0 commit comments

Comments
 (0)