Skip to content

Commit 8a36238

Browse files
committed
adding documentation
1 parent 832bd77 commit 8a36238

9 files changed

Lines changed: 47 additions & 16 deletions

File tree

src/org/teachingextensions/logo/ColorWheel.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public class ColorWheel
2525
private static Wheel<Color> wheel = new Wheel<Color>();
2626
/**
2727
* This method adds a color to the ColorWheel. <br/>
28-
* <b>Example:</b> {@code ColorWheel.addColor(Colors.Reds.Red);} <br/>
2928
* <b>Example:</b> {@code ColorWheel.addColor(PenColors.Reds.Red);}
3029
* @param color
3130
* the color to add to the wheel
@@ -36,7 +35,7 @@ public static void addColor(Color color)
3635
}
3736
/**
3837
* This method returns the next color of the ColorWheel. <br/>
39-
* <b>Example:</b> {@code Color penColor = ColorWheel.getNextColor();}
38+
* <b>Example:</b> {@code Color color = ColorWheel.getNextColor();}
4039
*
4140
* @return the next color of the ColorWheel
4241
*/
@@ -46,7 +45,7 @@ public static Color getNextColor()
4645
}
4746
/**
4847
* This method returns the a random color from the options on the ColorWheel. <br/>
49-
* <b>Example:</b> {@code Color penColor = ColorWheel.getNextColor();}
48+
* <b>Example:</b> {@code Color color = ColorWheel.getNextColor();}
5049
*
5150
* @return A random color from the ColorWheel
5251
*/

src/org/teachingextensions/logo/MultiTurtlePanel.java

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
import org.teachingextensions.logo.Turtle.Animals;
1818
import org.teachingextensions.windows.ProgramWindow;
1919

20+
/**
21+
* Use this window when you want to put more than one turtle on the same window
22+
*/
23+
@SuppressWarnings("serial")
2024
public class MultiTurtlePanel extends TurtlePanel
2125
{
2226
private List<Turtle> turtles;
@@ -26,11 +30,30 @@ public MultiTurtlePanel()
2630
{
2731
turtles = new ArrayList<Turtle>();
2832
}
33+
/**
34+
* Adds a turtle instance to a window
35+
* <div><b>Example:</b> {@code multiTurtlePanel.addTurtle(myTurtle)} </div>
36+
*
37+
* @param turtle
38+
* A turtle instance
39+
*/
2940
public void addTurtle(Turtle turtle)
3041
{
3142
this.turtles.add(turtle);
3243
turtle.setPanel(this);
3344
}
45+
/**
46+
* Shows a window that can hold more than one turtle
47+
* <div><b>Example:</b> {@code multiTurtlePanel.showPanel( )} </div>
48+
*
49+
*/
50+
public void showPanel()
51+
{
52+
JFrame frame = new JFrame("So Many Turtles");
53+
frame.getContentPane().add(this);
54+
ProgramWindow.createStandardFrame(frame);
55+
this.repaint();
56+
}
3457
@Override
3558
public void paint(Graphics g)
3659
{
@@ -100,13 +123,6 @@ public void setCursor(int cursor)
100123
{
101124
this.setCursor(Cursor.getPredefinedCursor(cursor));
102125
}
103-
public void showPanel()
104-
{
105-
JFrame frame = new JFrame("So Many Turtles");
106-
frame.getContentPane().add(this);
107-
ProgramWindow.createStandardFrame(frame);
108-
this.repaint();
109-
}
110126
public void ___()
111127
{
112128
// blank for the DeepDive

src/org/teachingextensions/logo/Turtle.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
public class Turtle
2121
{
2222
/**
23-
* Current types are: Turtle, Spider
23+
* Current types are: ExplodedTurtle, Turtle, Spider
2424
*/
2525
public enum Animals {
2626
ExplodedTurtle, Turtle, Spider

src/org/teachingextensions/logo/TurtlePanel.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.teachingextensions.logo.Turtle.Animals;
1515
import org.teachingextensions.windows.ProgramWindow;
1616

17+
@SuppressWarnings("serial")
1718
public class TurtlePanel extends ProgramWindow
1819
{
1920
private Turtle turtle;

src/org/teachingextensions/logo/shapes/Circle.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
import javax.swing.JPanel;
77

8-
import org.teachingextensions.logo.Colors;
98
import org.teachingextensions.logo.Paintable;
9+
import org.teachingextensions.logo.PenColors;
1010
import org.teachingextensions.windows.ProgramWindow;
1111

1212
/**
1313
* <img src="http://www2.psd100.com/ppp/2013/11/2701/Blue-circle-1127210229.png" align="left" >
14-
* The Circle allows you to draw circles on the canvas
14+
* The Circle allows you to draw circles on the window
1515
*/
1616
public class Circle implements Paintable
1717
{
@@ -62,7 +62,7 @@ public void addTo(ProgramWindow panel)
6262
@Override
6363
public void paint(Graphics2D g, JPanel caller)
6464
{
65-
Color color2 = Colors.getTransparentVersion(mainColor, percentTransparent);
65+
Color color2 = PenColors.getTransparentVersion(mainColor, percentTransparent);
6666
g.setColor(color2);
6767
g.fillOval(x - radius, y - radius, radius * 2, radius * 2);
6868
}

src/org/teachingextensions/logo/shapes/Oval.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
import javax.swing.JPanel;
77

8-
import org.teachingextensions.logo.Colors;
98
import org.teachingextensions.logo.Paintable;
9+
import org.teachingextensions.logo.PenColors;
1010
import org.teachingextensions.windows.ProgramWindow;
1111

1212
public class Oval implements Paintable
@@ -33,7 +33,7 @@ public void addTo(ProgramWindow panel)
3333
@Override
3434
public void paint(Graphics2D g, JPanel caller)
3535
{
36-
Color color2 = Colors.getTransparentVersion(mainColor, percentTransparent);
36+
Color color2 = PenColors.getTransparentVersion(mainColor, percentTransparent);
3737
g.setColor(color2);
3838
//need to incorporate radius, x, y
3939
g.drawOval(x + 320, y - 20, radius + 250, radius + 140);

src/org/teachingextensions/utils/Viewer.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99

1010
public class Viewer
1111
{
12+
/**
13+
* Uses a RTF Viewer to display the results of a model (or text)
14+
* <div><b>Example:</b> {@code viewer.displayRtfFile(text)} </div>
15+
*
16+
* @param text
17+
* A model created from a String (text)
18+
*/
1219
public static void displayRtfFile(String text)
1320
{
1421
try

src/org/teachingextensions/utils/VirtualProctor.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ public static void resetName()
4545
file.delete();
4646
}
4747
}
48+
/**
49+
* Allows you to set the displayed username in Virtual Proctor
50+
* <div><b>Example:</b> {@code virtualProctor.setName(name)} </div>
51+
*
52+
* @param name
53+
* A name that is displayed for the user in the Virtual Proctor client
54+
*/
4855
public static void setName(String name)
4956
{
5057
if (StringUtils.isEmpty(name)) { return; }

src/org/teachingextensions/windows/ProgramWindow.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* <img src="http://ftpmirror.your.org/pub/wikimedia/images/wikibooks/de/2/2c/JPanel_Add_JButton_PAGE_END.JPG" align="left" >
2222
* Program Window allows you to change the color of the background and more...
2323
*/
24+
@SuppressWarnings({"serial", "deprecation"})
2425
public class ProgramWindow extends JPanel
2526
{
2627
private ArrayList<Paintable> additional = new ArrayList<Paintable>();

0 commit comments

Comments
 (0)