* 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
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* modification, are permitted provided that the following conditions
...
@@ -29,22 +29,24 @@
...
@@ -29,22 +29,24 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
*/
/*
*/
importjava.awt.*;
importjava.awt.*;
importjava.awt.event.*;
importjava.awt.event.*;
importjava.applet.*;
importjava.applet.*;
/**
/**
* An interactive test of the Graphics.drawArc and Graphics.fillArc
* An interactive test of the Graphics.drawArc and Graphics.fillArc
* routines. Can be run either as a standalone application by
* routines. Can be run either as a standalone application by
* typing "java ArcTest" or as an applet in the AppletViewer.
* typing "java ArcTest" or as an applet in the AppletViewer.
*/
*/
@SuppressWarnings("serial")
publicclassArcTestextendsApplet{
publicclassArcTestextendsApplet{
ArcControlscontrols;// The controls for marking and filling arcs
ArcControlscontrols;// The controls for marking and filling arcs
ArcCanvascanvas;// The drawing area to display arcs
ArcCanvascanvas;// The drawing area to display arcs
@Override
publicvoidinit(){
publicvoidinit(){
setLayout(newBorderLayout());
setLayout(newBorderLayout());
canvas=newArcCanvas();
canvas=newArcCanvas();
...
@@ -52,19 +54,23 @@ public class ArcTest extends Applet {
...
@@ -52,19 +54,23 @@ public class ArcTest extends Applet {
add("South",controls=newArcControls(canvas));
add("South",controls=newArcControls(canvas));
}
}
@Override
publicvoiddestroy(){
publicvoiddestroy(){
remove(controls);
remove(controls);
remove(canvas);
remove(canvas);
}
}
@Override
publicvoidstart(){
publicvoidstart(){
controls.setEnabled(true);
controls.setEnabled(true);
}
}
@Override
publicvoidstop(){
publicvoidstop(){
controls.setEnabled(false);
controls.setEnabled(false);
}
}
@Override
publicvoidprocessEvent(AWTEvente){
publicvoidprocessEvent(AWTEvente){
if(e.getID()==Event.WINDOW_DESTROY){
if(e.getID()==Event.WINDOW_DESTROY){
System.exit(0);
System.exit(0);
...
@@ -80,20 +86,28 @@ public class ArcTest extends Applet {
...
@@ -80,20 +86,28 @@ public class ArcTest extends Applet {
f.add("Center",arcTest);
f.add("Center",arcTest);
f.setSize(300,300);
f.setSize(300,300);
f.show();
f.setVisible(true);
}
}
@Override
publicStringgetAppletInfo(){
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 "