File tree Expand file tree Collapse file tree
src/main/java/org/teachingextensions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,6 +38,13 @@ public ProgramWindow(String title)
3838 getFrame ().getContentPane ().add (this );
3939 ProgramWindow .createStandardFrame (getFrame ());
4040 }
41+ /**
42+ * Adds a button instance to a window
43+ * <p><b>Example:</b> {@code programWindow.addButton(myButton)}</p>
44+ *
45+ * @param button
46+ * A button instance
47+ */
4148 public void addButton (JButton button )
4249 {
4350 this .add (button );
@@ -76,14 +83,35 @@ public void removePaintable()
7683 additional .clear ();
7784 repaint ();
7885 }
86+ /**
87+ * Adds a right mouse click listener instance to a window
88+ * <p><b>Example:</b> {@code programWindow.addMouseRightClickListener(myRightClickListener)}</p>
89+ *
90+ * @param listener
91+ * A listener instance
92+ */
7993 public void addMouseRightClickListener (MouseRightClickListener listener )
8094 {
8195 addMouseListener (new RightClickMouseAdapter (listener ));
8296 }
97+ /**
98+ * Adds a left mouse click listener instance to a window
99+ * <p><b>Example:</b> {@code programWindow.addMouseLeftClickListener(myLeftClickListener)}</p>
100+ *
101+ * @param listener
102+ * A listener instance
103+ */
83104 public void addMouseLeftClickListener (MouseLeftClickListener listener )
84105 {
85106 addMouseListener (new LeftClickMouseAdapter (listener ));
86107 }
108+ /**
109+ * Adds a background image to a window
110+ * <p><b>Example:</b> {@code programWindow.setBackgroundImage("http://www.coolpicture.com/sunshine.jpg")}</p>
111+ *
112+ * @param URL
113+ * A URL path to an image
114+ */
87115 public void setBackgroundImage (String url )
88116 {
89117 addPaintable (new ImageBackground (url ));
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ public static void setPenWidth(Number width)
9797 * Gives you access to the window the
9898 * Tortoise is moving on so you can do things like change it's color. <br>
9999 * <b>Example:</b> {@code TurtlePanel panel = Tortoise.getBackgroundWindow()}
100- * @return the window that the Tortoise is moving on
100+ * @return the (program) window that the Tortoise is moving on
101101 */
102102 public static TurtlePanel getBackgroundWindow ()
103103 {
You can’t perform that action at this time.
0 commit comments