home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-02-03 | 1.4 KB | 46 lines |
- import java.awt.BorderLayout;
- import java.applet.Applet;
-
- public class AnimSpiroDemo extends Applet {
-
- public String[][] getParameterInfo() {
- String[][] info = {
- // name, type, description
- {"mouseUpStopsAnimation", "boolean", "If this parameter is specified, the animation stops when clicked on."},
- {"I", "integer", "The number of lines in the animated spirograph."}
- };
- return info;
- }
-
- public String getAppletInfo() {
- return "AnimSpiroDemo\nApplet for demonstrating the AnimSpiro class\nWritten by Jos van den Oever.";
- }
-
- public static void main(String args[]) {
- toFrame();
- }
-
- public void init() {
- boolean mouseUpStopsAnimation = (getParameter("mouseUpStopsAnimation") != null);
- int I = 100;
- try {
- I = Integer.parseInt(getParameter("I"));
- } catch(NumberFormatException e) {
- }
- setLayout(new BorderLayout());
-
- SpiroAnim sa = new SpiroAnim(I, mouseUpStopsAnimation);
- add("Center",sa);
- }
-
- private static void toFrame() {
- NormFrame f = new NormFrame("AnimSpiro");
- f.setSize(200,200);
- f.setLayout(new BorderLayout());
- SpiroAnim sa = new SpiroAnim(true);
- f.add("Center",sa);
- f.show();
- sa.start();
- }
- }
-