* Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
...
...
@@ -29,22 +29,24 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
*/
importjava.awt.*;
importjava.awt.event.*;
importjava.applet.*;
/**
* An interactive test of the Graphics.drawArc and Graphics.fillArc
* routines. Can be run either as a standalone application by
* typing "java ArcTest" or as an applet in the AppletViewer.
*/
@SuppressWarnings("serial")
publicclassArcTestextendsApplet{
ArcControlscontrols;// The controls for marking and filling arcs
ArcCanvascanvas;// The drawing area to display arcs
@Override
publicvoidinit(){
setLayout(newBorderLayout());
canvas=newArcCanvas();
...
...
@@ -52,19 +54,23 @@ public class ArcTest extends Applet {
add("South",controls=newArcControls(canvas));
}
@Override
publicvoiddestroy(){
remove(controls);
remove(canvas);
}
@Override
publicvoidstart(){
controls.setEnabled(true);
}
@Override
publicvoidstop(){
controls.setEnabled(false);
}
@Override
publicvoidprocessEvent(AWTEvente){
if(e.getID()==Event.WINDOW_DESTROY){
System.exit(0);
...
...
@@ -80,20 +86,28 @@ public class ArcTest extends Applet {
f.add("Center",arcTest);
f.setSize(300,300);
f.show();
f.setVisible(true);
}
@Override
publicStringgetAppletInfo(){
return"An interactive test of the Graphics.drawArc and \nGraphics.fillArc routines. Can be run \neither as a standalone application by typing 'java ArcTest' \nor as an applet in the AppletViewer.";
return"An interactive test of the Graphics.drawArc and \nGraphics."
+"fillArc routines. Can be run \neither as a standalone "
+"application by typing 'java ArcTest' \nor as an applet in "
+" The matches() method, however, does not \n(yet) verify "
+"the lContext and rContext parts of the rule.";
}
publicStringgetAppletInfo(){
return"Title: CLSFractal 1.1f, 27 Mar 1995 \nAuthor: Jim Graham \nA (not yet) Context Sensitive L-System production rule. \nThis class encapsulates a production rule for a Context Sensitive\n L-System \n(pred, succ, lContext, rContext). The matches() method, however, does not \n(yet) verify the lContext and rContext parts of the rule.";
}
publicString[][]getParameterInfo(){
String[][]info={
{"level","int","Maximum number of recursions. Default is 1."},
{"incremental","boolean","Whether or not to repaint between recursions. Default is true."},
{"delay","integer","Sets delay between repaints. Default is 50."},
{"startAngle","float","Sets the starting angle. Default is 0."},
{"rotAngle","float","Sets the rotation angle. Default is 45."},
{"border","integer","Width of border. Default is 2."},
{"normalizeScale","boolean","Whether or not to normalize the scaling. Default is true."},
{"pred","String","Initializes the rules for Context Sensitive L-Systems."},
{"succ","String","Initializes the rules for Context Sensitive L-Systems."},
{"lContext","String","Initializes the rules for Context Sensitive L-Systems."},
{"rContext","String","Initializes the rules for Context Sensitive L-Systems."}
};
returninfo;
}
@Override
publicString[][]getParameterInfo(){
String[][]info={
{"level","int","Maximum number of recursions. Default is 1."},
{"incremental","boolean","Whether or not to repaint between "
+"recursions. Default is true."},
{"delay","integer","Sets delay between repaints. Default is 50."},
{"startAngle","float","Sets the starting angle. Default is 0."},
{"rotAngle","float","Sets the rotation angle. Default is 45."},
{"border","integer","Width of border. Default is 2."},
{"normalizeScale","boolean","Whether or not to normalize "
+"the scaling. Default is true."},
{"pred","String",
"Initializes the rules for Context Sensitive L-Systems."},
{"succ","String",
"Initializes the rules for Context Sensitive L-Systems."},
{"lContext","String",
"Initializes the rules for Context Sensitive L-Systems."},
{"rContext","String",
"Initializes the rules for Context Sensitive L-Systems."}
};
returninfo;
}
}
/**
* A Logo turtle class designed to support Context sensitive L-Systems.