Java Programming Assignment

profileKhaledMaarof
Chapter11allgraphicssamples.zip

CirclePatterns/.idea/$PRODUCT_WORKSPACE_FILE$

1.8

CirclePatterns/.idea/misc.xml

CirclePatterns/.idea/modules.xml

CirclePatterns/.idea/workspace.xml

1574522721289 1574522721289

CirclePatterns/build.xml

Builds, tests, and runs the project CirclePatterns.

CirclePatterns/build/built-jar.properties

#Thu, 21 Nov 2013 22:07:38 -0500 C\:\\Users\\cherbert\\Desktop\\NetBeansProjects\\CirclePatterns=

CirclePatterns/build/classes/.netbeans_automatic_build

CirclePatterns/build/classes/.netbeans_update_resources

CirclePatterns/build/classes/circlepatterns/CirclePatterns.class

package circlepatterns;
public synchronized class CirclePatterns {
    public void CirclePatterns();
    public static void main(String[]);
}

CirclePatterns/build/classes/circlepatterns/MyCanvas.class

package circlepatterns;
synchronized class MyCanvas extends java.awt.Canvas {
    public void MyCanvas();
    public void paint(java.awt.Graphics);
}

CirclePatterns/CirclePatterns.iml

CirclePatterns/manifest.mf

Manifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build

CirclePatterns/nbproject/build-impl.xml

Must set src.dir Must set test.src.dir Must set build.dir Must set dist.dir Must set build.classes.dir Must set dist.javadoc.dir Must set build.test.classes.dir Must set build.test.results.dir Must set build.classes.excludes Must set dist.jar Must set javac.includes No tests executed. Must set JVM to use for profiling in profiler.info.jvm Must set profiler agent JVM arguments in profiler.info.jvmargs.agent Must select some files in the IDE or set javac.includes To run this application from the command line without Ant, try: java -cp "${run.classpath.with.dist.jar}" ${main.class} To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" Must select one file in the IDE or set run.class Must select one file in the IDE or set run.class Must select one file in the IDE or set debug.class Must select one file in the IDE or set debug.class Must set fix.includes This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set profile.class This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set run.class Must select some files in the IDE or set test.includes Must select one file in the IDE or set run.class Must select one file in the IDE or set applet.url Must select some files in the IDE or set javac.includes Some tests failed; see details above. Must select some files in the IDE or set test.includes Some tests failed; see details above. Must select some files in the IDE or set test.class Must select some method in the IDE or set test.method Some tests failed; see details above. Must select one file in the IDE or set test.class Must select one file in the IDE or set test.class Must select some method in the IDE or set test.method Must select one file in the IDE or set applet.url Must select one file in the IDE or set applet.url

CirclePatterns/nbproject/genfiles.properties

build.xml.data.CRC32=45ef90fa build.xml.script.CRC32=665c12be [email protected] # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=45ef90fa nbproject/build-impl.xml.script.CRC32=ff7a8039 nbproject/[email protected]

CirclePatterns/nbproject/private/private.properties

compile.on.save=true user.properties.file=C:\\Users\\cherbert\\AppData\\Roaming\\NetBeans\\7.3.1\\build.properties

CirclePatterns/nbproject/private/private.xml

file:/C:/Users/cherbert/Desktop/NetBeansProjects/CirclePatterns/src/circlepatterns/CirclePatterns.java

CirclePatterns/nbproject/project.properties

annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processor.options= annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: build.dir=build build.generated.dir=${build.dir}/generated build.generated.sources.dir=${build.dir}/generated-sources # Only compile against the classpath explicitly listed here: build.sysclasspath=ignore build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results # Uncomment to specify the preferred debugger connection transport: #debug.transport=dt_socket debug.classpath=\ ${run.classpath} debug.test.classpath=\ ${run.test.classpath} # This directory is removed when the project is cleaned: dist.dir=dist dist.jar=${dist.dir}/CirclePatterns.jar dist.javadoc.dir=${dist.dir}/javadoc excludes= includes=** jar.compress=false javac.classpath= # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false javac.processorpath=\ ${javac.classpath} javac.source=1.7 javac.target=1.7 javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir} javac.test.processorpath=\ ${javac.test.classpath} javadoc.additionalparam= javadoc.author=false javadoc.encoding=${source.encoding} javadoc.noindex=false javadoc.nonavbar=false javadoc.notree=false javadoc.private=false javadoc.splitindex=true javadoc.use=true javadoc.version=false javadoc.windowtitle= main.class=circlepatterns.CirclePatterns manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false platform.active=default_platform run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} # Space-separated list of JVM arguments used when running the project. # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. # To set system properties for unit tests define test-sys-prop.name=value: run.jvmargs= run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 src.dir=src test.src.dir=test

CirclePatterns/nbproject/project.xml

org.netbeans.modules.java.j2seproject CirclePatterns

CirclePatterns/out/production/CirclePatterns/circlepatterns/CirclePatterns.class

package circlepatterns;
public synchronized class CirclePatterns {
    public void CirclePatterns();
    public static void main(String[]);
}

CirclePatterns/out/production/CirclePatterns/circlepatterns/MyCanvas.class

package circlepatterns;
synchronized class MyCanvas extends java.awt.Canvas {
    public void MyCanvas();
    public void paint(java.awt.Graphics);
}

CirclePatterns/src/circlepatterns/CirclePatterns.java

CirclePatterns/src/circlepatterns/CirclePatterns.java

/* CirclePatterns.Java
 * Computer Science 111, Fall 2013
 * Last edited Nov. 20, 2013 by C. Herbert
 * 
 * This code demonstrates a simple example of some computer art work.  
 * It draws a pattern of circles on the screen with a time delay between drawings.
 */  

package  circlepatterns ;

import  java . awt . * ;
import  java . util . concurrent . TimeUnit ;
import  javax . swing . * ;

public   class   CirclePatterns  
{
         public   static   void  main ( String []  args )  
         {

         // create a MyCanvas object
         MyCanvas  canvas1  =   new   MyCanvas ();

         // set up a JFrame to hold the canvas
         JFrame  frame  =   new   JFrame ();
        frame . setTitle ( "Circle Patterns" );
        frame . setSize ( 500 ,   500 );
        frame . setLocation ( 100 ,   100 );
        frame . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE );

         // add the canvas to the frame as a content panel
        frame . getContentPane (). add ( canvas1 );
        frame . setVisible ( true );
     }   // end main()

}   // end class

class   MyCanvas   extends   Canvas  
{

     public   MyCanvas ()  
     {   }    // end MyCanvas() constructor

     public   void  paint ( Graphics  graphics )  
     {
   
         int  x ;            // x coordinate  to locate circle
         int  y ;            // y coordinate  to locate circle

         int  diameter ;     // width of rectangle
         int  i ;            // loop counter
         int  times ;        // number of times the program is repesated

         for   ( times  =   1 ;  times  <=   10 ;  times ++ )  
         {
             // paint the canvas black
            graphics . setColor ( Color . BLACK );
            graphics . fillRect ( 0 ,   0 ,   500 ,   500 );

         
             for   ( =   1 ;  i  <=   100 ;  i ++ )  
             {
                 // red circles
                graphics . setColor ( new   Color ( 255 ,   0 ,   0 ));
                x  =   0   +  i  *   5 ;
                y  =   0   +  i  *   5 ;
                diameter  =   10   *  i ;
                graphics . drawOval ( x ,  y ,  diameter ,  diameter );

                 // blue circles
                graphics . setColor ( new   Color ( 0 ,   0 ,   255 ));
                x  =   0   -  i  *   5 ;
                y  =   0   +  i  *   5 ;
                diameter  =   10   *  i ;
                graphics . drawOval ( x ,  y ,  diameter ,  diameter );

                 // green circles
                graphics . setColor ( new   Color ( 0 ,   255 ,   0 ));
                x  =   0   +  i  *   5 ;
                y  =   0   -  i  *   5 ;
                diameter  =   10   *  i ;
                graphics . drawOval ( x ,  y ,  diameter ,  diameter );

                 // The sleep command delays the drawing to make it more interesting
                 // It must be in try-cathc blocks for error handling (discussed in chap. 12)
                 try  
                 {
                     TimeUnit . MILLISECONDS . sleep ( 20 );
                 }   // end try
                 catch   ( Exception  e )  
                 {
                     System . out . println ( "Exception caught" );
                 }   // end catch

             }   // end for

         }   // end while
     }    // end paint()
}   // end class MyCanvas

    
    

ConcentricCircles/.idea/$PRODUCT_WORKSPACE_FILE$

1.8

ConcentricCircles/.idea/misc.xml

ConcentricCircles/.idea/modules.xml

ConcentricCircles/.idea/workspace.xml

1574522989856 1574522989856

ConcentricCircles/build.xml

Builds, tests, and runs the project ConcentricCircles.

ConcentricCircles/build/classes/.netbeans_automatic_build

ConcentricCircles/build/classes/.netbeans_update_resources

ConcentricCircles/build/classes/concentriccircles/ConcentricCircles.class

package concentriccircles;
public synchronized class ConcentricCircles {
    public void ConcentricCircles();
    public static void main(String[]);
}

ConcentricCircles/build/classes/concentriccircles/MyCanvas.class

package concentriccircles;
synchronized class MyCanvas extends java.awt.Canvas {
    public void MyCanvas();
    public void paint(java.awt.Graphics);
}

ConcentricCircles/ConcentricCircles.iml

ConcentricCircles/manifest.mf

Manifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build

ConcentricCircles/nbproject/build-impl.xml

Must set src.dir Must set test.src.dir Must set build.dir Must set dist.dir Must set build.classes.dir Must set dist.javadoc.dir Must set build.test.classes.dir Must set build.test.results.dir Must set build.classes.excludes Must set dist.jar Must set javac.includes No tests executed. Must set JVM to use for profiling in profiler.info.jvm Must set profiler agent JVM arguments in profiler.info.jvmargs.agent Must select some files in the IDE or set javac.includes To run this application from the command line without Ant, try: java -cp "${run.classpath.with.dist.jar}" ${main.class} To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" Must select one file in the IDE or set run.class Must select one file in the IDE or set run.class Must select one file in the IDE or set debug.class Must select one file in the IDE or set debug.class Must set fix.includes This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set profile.class This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set run.class Must select some files in the IDE or set test.includes Must select one file in the IDE or set run.class Must select one file in the IDE or set applet.url Must select some files in the IDE or set javac.includes Some tests failed; see details above. Must select some files in the IDE or set test.includes Some tests failed; see details above. Must select some files in the IDE or set test.class Must select some method in the IDE or set test.method Some tests failed; see details above. Must select one file in the IDE or set test.class Must select one file in the IDE or set test.class Must select some method in the IDE or set test.method Must select one file in the IDE or set applet.url Must select one file in the IDE or set applet.url

ConcentricCircles/nbproject/genfiles.properties

build.xml.data.CRC32=48a71fdd build.xml.script.CRC32=ab357ec2 [email protected] # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=48a71fdd nbproject/build-impl.xml.script.CRC32=b94aed7f nbproject/[email protected]

ConcentricCircles/nbproject/private/private.properties

compile.on.save=true user.properties.file=C:\\Users\\cherbert\\AppData\\Roaming\\NetBeans\\7.3.1\\build.properties

ConcentricCircles/nbproject/private/private.xml

file:/C:/Users/cherbert/Desktop/NetBeansProjects/ConcentricCircles/src/concentriccircles/ConcentricCircles.java

ConcentricCircles/nbproject/project.properties

annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processor.options= annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: build.dir=build build.generated.dir=${build.dir}/generated build.generated.sources.dir=${build.dir}/generated-sources # Only compile against the classpath explicitly listed here: build.sysclasspath=ignore build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results # Uncomment to specify the preferred debugger connection transport: #debug.transport=dt_socket debug.classpath=\ ${run.classpath} debug.test.classpath=\ ${run.test.classpath} # This directory is removed when the project is cleaned: dist.dir=dist dist.jar=${dist.dir}/ConcentricCircles.jar dist.javadoc.dir=${dist.dir}/javadoc excludes= includes=** jar.compress=false javac.classpath= # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false javac.processorpath=\ ${javac.classpath} javac.source=1.7 javac.target=1.7 javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir} javac.test.processorpath=\ ${javac.test.classpath} javadoc.additionalparam= javadoc.author=false javadoc.encoding=${source.encoding} javadoc.noindex=false javadoc.nonavbar=false javadoc.notree=false javadoc.private=false javadoc.splitindex=true javadoc.use=true javadoc.version=false javadoc.windowtitle= main.class=concentriccircles.ConcentricCircles manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false platform.active=default_platform run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} # Space-separated list of JVM arguments used when running the project. # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. # To set system properties for unit tests define test-sys-prop.name=value: run.jvmargs= run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 src.dir=src test.src.dir=test

ConcentricCircles/nbproject/project.xml

org.netbeans.modules.java.j2seproject ConcentricCircles

ConcentricCircles/out/production/ConcentricCircles/concentriccircles/ConcentricCircles.class

package concentriccircles;
public synchronized class ConcentricCircles {
    public void ConcentricCircles();
    public static void main(String[]);
}

ConcentricCircles/out/production/ConcentricCircles/concentriccircles/MyCanvas.class

package concentriccircles;
synchronized class MyCanvas extends java.awt.Canvas {
    public void MyCanvas();
    public void paint(java.awt.Graphics);
}

ConcentricCircles/src/concentriccircles/ConcentricCircles.java

ConcentricCircles/src/concentriccircles/ConcentricCircles.java

/* CirclePatterns.Java
 * Computer Science 111, Fall 2013
 * Last edited Nov. 20. 2013 by C. Herbert
 * 
 * This code demonstrates how to draws a pattern of concentric circles. 
 *
 * Circle are drawn inside a bounding rectangle that is actually
 * a bounding square, with the same width and height. 
 * 
 * To draw concentric cicles, , move the x and y coordinates for each suscessive circle 
 * up and to the right by a factor of k, and at the same time, increase the size 
 * of the biounding square by a factor of 2K.
 * 
 */  

package  concentriccircles ;

import  java . awt . * ;
import  java . util . concurrent . TimeUnit ;
import  javax . swing . * ;

public   class   ConcentricCircles  
{
         public   static   void  main ( String []  args )  
         {

         // create a MyCanvas object
         MyCanvas  canvas1  =   new   MyCanvas ();

         // set up a JFrame to hold the canvas
         JFrame  frame  =   new   JFrame ();
        frame . setTitle ( "Concentric Circles" );
        frame . setSize ( 500 ,   500 );
        frame . setLocation ( 100 ,   100 );
        frame . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE );

         // add the canvas to the frame as a content panel
        frame . getContentPane (). add ( canvas1 );
        frame . setVisible ( true );
     }   // end main()

}   // end class

class   MyCanvas   extends   Canvas  
{

     public   MyCanvas ()  
     {   }    // end MyCanvas() constructor

     public   void  paint ( Graphics  graphics )  
     {
        

         int  x ;    // x coordinate  to locate circle
         int  y ;    // y coordinate  to locate circle

         int  diameter ;    // width of rectangle
         int  i ;   // loop counter

       
             // paint the canvas black
            graphics . setColor ( Color . BLACK );
            graphics . fillRect ( 0 ,   0 ,   500 ,   500 );

         
             for   ( =   0 ;  i  <   50 ;  i ++ )   {
                 // red circles
                graphics . setColor ( new   Color ( 255 ,   128 ,   255 ));
                x  =   250    -  i  *   8 ;
                y  =   250   -  i  *   8 ;
                diameter  =   16   *  i ;
                graphics . drawOval ( x ,  y ,  diameter ,  diameter );
           
                 // The sleep command delays the drawing to make it more interesting
                 // It must be in try-cathc blocks for error handling (discussed in chap. 12)
                 try  
                 {
                     TimeUnit . MILLISECONDS . sleep ( 20 );
                 }   // end try
                 catch   ( Exception  e )  
                 {
                     System . out . println ( "Exception caught" );
                 }   // end catch

            
            
             }   // end for

            
            
            
            
        }    // end paint()
}   // end class MyCanvas

    
    

CosineRose/.idea/$PRODUCT_WORKSPACE_FILE$

1.8

CosineRose/.idea/libraries/CosineRose.xml

CosineRose/.idea/misc.xml

CosineRose/.idea/modules.xml

CosineRose/.idea/workspace.xml

1574523136540 1574523136540

CosineRose/build.xml

Builds, tests, and runs the project CosineRose.

CosineRose/build/built-jar.properties

#Fri, 22 Nov 2013 06:45:45 -0500 C\:\\Users\\cherbert\\Desktop\\NetBeansProjects\\CosineRose=

CosineRose/build/classes/.netbeans_automatic_build

CosineRose/build/classes/.netbeans_update_resources

CosineRose/build/classes/cosinerose/CosineRose.class

package cosinerose;
public synchronized class CosineRose {
    public void CosineRose();
    public static void main(String[]);
}

CosineRose/build/classes/cosinerose/CosineRose.rs

CosineRose/build/classes/cosinerose/RoseCanvas.class

package cosinerose;
synchronized class RoseCanvas extends java.awt.Canvas {
    double x1;
    double y1;
    double x2;
    double y2;
    double value;
    int xAdjust;
    int yAdjust;
    double factor;
    String messageString;
    String inputString;
    String title;
    public void RoseCanvas();
    public void inputFactor();
    public void paint(java.awt.Graphics);
}

CosineRose/CosineRose.iml

CosineRose/dist/CosineRose.jar

META-INF/MANIFEST.MF

Manifest-Version: 1.0 Ant-Version: Apache Ant 1.8.4 Created-By: 1.7.0_25-b16 (Oracle Corporation) Class-Path: X-COMMENT: Main-Class will be added automatically by build Main-Class: cosinerose.CosineRose

cosinerose/CosineRose.class

package cosinerose;
public synchronized class CosineRose {
    public void CosineRose();
    public static void main(String[]);
}

cosinerose/RoseCanvas.class

package cosinerose;
synchronized class RoseCanvas extends java.awt.Canvas {
    double x1;
    double y1;
    double x2;
    double y2;
    double value;
    int xAdjust;
    int yAdjust;
    double factor;
    String messageString;
    String inputString;
    String title;
    public void RoseCanvas();
    public void inputFactor();
    public void paint(java.awt.Graphics);
}

CosineRose/dist/README.TXT

======================== BUILD OUTPUT DESCRIPTION ======================== When you build an Java application project that has a main class, the IDE automatically copies all of the JAR files on the projects classpath to your projects dist/lib folder. The IDE also adds each of the JAR files to the Class-Path element in the application JAR files manifest file (MANIFEST.MF). To run the project from the command line, go to the dist folder and type the following: java -jar "CosineRose.jar" To distribute this project, zip up the dist folder (including the lib folder) and distribute the ZIP file. Notes: * If two JAR files on the project classpath have the same name, only the first JAR file is copied to the lib folder. * Only JAR files are copied to the lib folder. If the classpath contains other types of files or folders, these files (folders) are not copied. * If a library on the projects classpath also has a Class-Path element specified in the manifest,the content of the Class-Path element has to be on the projects runtime path. * To set a main class in a standard Java project, right-click the project node in the Projects window and choose Properties. Then click Run and enter the class name in the Main Class field. Alternatively, you can manually type the class name in the manifest Main-Class element.

CosineRose/manifest.mf

Manifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build

CosineRose/nbproject/build-impl.xml

Must set src.dir Must set test.src.dir Must set build.dir Must set dist.dir Must set build.classes.dir Must set dist.javadoc.dir Must set build.test.classes.dir Must set build.test.results.dir Must set build.classes.excludes Must set dist.jar Must set javac.includes No tests executed. Must set JVM to use for profiling in profiler.info.jvm Must set profiler agent JVM arguments in profiler.info.jvmargs.agent Must select some files in the IDE or set javac.includes To run this application from the command line without Ant, try: java -cp "${run.classpath.with.dist.jar}" ${main.class} To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" Must select one file in the IDE or set run.class Must select one file in the IDE or set run.class Must select one file in the IDE or set debug.class Must select one file in the IDE or set debug.class Must set fix.includes This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set profile.class This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set run.class Must select some files in the IDE or set test.includes Must select one file in the IDE or set run.class Must select one file in the IDE or set applet.url Must select some files in the IDE or set javac.includes Some tests failed; see details above. Must select some files in the IDE or set test.includes Some tests failed; see details above. Must select some files in the IDE or set test.class Must select some method in the IDE or set test.method Some tests failed; see details above. Must select one file in the IDE or set test.class Must select one file in the IDE or set test.class Must select some method in the IDE or set test.method Must select one file in the IDE or set applet.url Must select one file in the IDE or set applet.url

CosineRose/nbproject/genfiles.properties

build.xml.data.CRC32=246366d1 build.xml.script.CRC32=0c5c294a [email protected] # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=246366d1 nbproject/build-impl.xml.script.CRC32=20eeafbd nbproject/[email protected]

CosineRose/nbproject/private/private.properties

compile.on.save=true user.properties.file=C:\\Users\\cherbert\\AppData\\Roaming\\NetBeans\\7.3.1\\build.properties

CosineRose/nbproject/private/private.xml

file:/C:/Users/cherbert/Desktop/NetBeansProjects/CosineRose/src/cosinerose/CosineRose.java

CosineRose/nbproject/project.properties

annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processor.options= annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: build.dir=build build.generated.dir=${build.dir}/generated build.generated.sources.dir=${build.dir}/generated-sources # Only compile against the classpath explicitly listed here: build.sysclasspath=ignore build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results # Uncomment to specify the preferred debugger connection transport: #debug.transport=dt_socket debug.classpath=\ ${run.classpath} debug.test.classpath=\ ${run.test.classpath} # This directory is removed when the project is cleaned: dist.dir=dist dist.jar=${dist.dir}/CosineRose.jar dist.javadoc.dir=${dist.dir}/javadoc excludes= includes=** jar.compress=false javac.classpath= # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false javac.processorpath=\ ${javac.classpath} javac.source=1.7 javac.target=1.7 javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir} javac.test.processorpath=\ ${javac.test.classpath} javadoc.additionalparam= javadoc.author=false javadoc.encoding=${source.encoding} javadoc.noindex=false javadoc.nonavbar=false javadoc.notree=false javadoc.private=false javadoc.splitindex=true javadoc.use=true javadoc.version=false javadoc.windowtitle= main.class=cosinerose.CosineRose manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false platform.active=default_platform run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} # Space-separated list of JVM arguments used when running the project. # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. # To set system properties for unit tests define test-sys-prop.name=value: run.jvmargs= run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 src.dir=src test.src.dir=test

CosineRose/nbproject/project.xml

org.netbeans.modules.java.j2seproject CosineRose

CosineRose/out/production/CosineRose/cosinerose/CosineRose.class

package cosinerose;
public synchronized class CosineRose {
    public void CosineRose();
    public static void main(String[]);
}

CosineRose/out/production/CosineRose/cosinerose/RoseCanvas.class

package cosinerose;
synchronized class RoseCanvas extends java.awt.Canvas {
    double x1;
    double y1;
    double x2;
    double y2;
    double value;
    int xAdjust;
    int yAdjust;
    double factor;
    String messageString;
    String inputString;
    String title;
    public void RoseCanvas();
    public void inputFactor();
    public void paint(java.awt.Graphics);
}

CosineRose/src/cosinerose/CosineRose.java

CosineRose/src/cosinerose/CosineRose.java


/* CosineRose.Java
 * Computer Science 111, Fall 2013
 * Last edited Nov. 20, 2013 by C. Herbert
 * 
 * This code demonstrates how to draw a cosine rose in aJFrame 
 * using Java Graphics class objects.
 * 
 * It lets the user input a factor that will alter the image
 */
package  cosinerose ;

import  java . awt . * ;
import  java . util . concurrent . TimeUnit ;
import  javax . swing . * ;

public   class   CosineRose  
{

     public   static   void  main ( String []  args )  
     {

         // create a RoseCanvas object
         RoseCanvas  canvas1  =   new   RoseCanvas ();

         // set up a JFrame to hold the canvas
         JFrame  frame  =   new   JFrame ();
        frame . setTitle ( "Cosine Rose" );
        frame . setSize ( 500 ,   500 );
        frame . setLocation ( 200 ,   200 );
        frame . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE );

         // get the factor for cosine rose in camvas1 from the user
        canvas1 . inputFactor ();

         // add the canvas to the frame as a content panel
        frame . getContentPane (). add ( canvas1 );
        frame . setVisible ( true );
     }   // end main()
}   // end class

class   RoseCanvas   extends   Canvas  
{

     double  x1 ;        // x coordinate for point 1
     double  y1 ;        // y coordinate for point 1
     double  x2 ;        // x coordinate for point 2
     double  y2 ;        // y coordinate for point 2
     double  value ;     // value of the function to be graphed
     int  xAdjust  =   250 ;    // these two factor are used to adjust the position 
     int  yAdjust  =   250 ;    // of the graph on the canvas
     double  factor ;        // the "factor" allowxthe user to alter the image.
    
     String  messageString ;     // a string for prompt in the input message box
     String  inputString ;       // a String to capture the input 
    
     String  title ;     // title for the canvas

     // // RoseCanvas() constructor
     public   RoseCanvas ()   {
     }

     // method to get a facotr for the cosine rose from the user
     public   void  inputFactor ()   {
         // ask the user to enter a factor that will alter the image
        messageString  =   "This program will draw a cosine rose.\n"
                 +   "Please enter a factor for the equation.\n"
                 +   "(Integers work best.)" ;

        inputString  =   JOptionPane . showInputDialog ( messageString );
        factor  =   Double . parseDouble ( inputString );
     }

     public   void  paint ( Graphics  graphics )  
     {
         double  i ;         // a loop counter
    
         // Put a title on the Canvas
        graphics . setColor ( Color . RED );
        graphics . setFont ( new   Font ( "Arial" ,   Font . PLAIN ,   18 ));
        title  =   "Cosine Rose      r = COS("   +  factor  +   " x \u03B8)" ;
        graphics . drawString ( title ,   85 ,   30 );

         // set drawing color back to black
        graphics . setColor ( Color . BLACK );

         // set x to 0; calculate 100 * the sine for the first x value; 

        x1  =   200.0   *   Math . cos ( factor  *   Math . toRadians ( 0 ))   *   Math . sin ( Math . toRadians ( 0 ));
        y1  =   200.0   *   Math . cos ( factor  *   Math . toRadians ( 0 ))   *   Math . cos ( Math . toRadians ( 0 ));

         // go through 360 degrees
         for   ( =   0.0 ;  i  <=   360.0 ;  i ++ )   {
             // calculate the x and y coordinates for each degree
             // 200 is aan offeste for where to draw the curve

            x2  =   200.0   *   Math . cos ( factor  *   Math . toRadians ( i ))   *   Math . sin ( Math . toRadians ( i ));
            y2  =   200.0   *   Math . cos ( factor  *   Math . toRadians ( i ))   *   Math . cos ( Math . toRadians ( i ));

             // The sleep command delays the drawing to make it more interesting
             // It must be in try-cathc blocks for error handling (discussed in chap. 12)
             try  
             {
                 TimeUnit . MILLISECONDS . sleep ( 10 );
             }   catch   ( Exception  e )  
             {
                 System . out . println ( "Exception caught" );
             }

             // draw a line from (x1,y1) to (x2,y2)
             // xadjust and yasjust position the graph
             // the subtraction for y is because of inverted  cartesian coordinates
            graphics . drawLine ( xAdjust  +   ( int )  x1 ,  yAdjust  -   ( int )  y1 ,  xAdjust  +   ( int )  x2 ,  yAdjust  -   ( int )  y2 );

             // update new first point (x1, y1) to be old second point(x2, y2)
            x1  =  x2 ;
            y1  =  y2 ;
         }   // end for  

     }    // end paint()
}   // end class MyCanvas

drawDemo/.idea/$PRODUCT_WORKSPACE_FILE$

1.8

drawDemo/.idea/misc.xml

drawDemo/.idea/modules.xml

drawDemo/.idea/workspace.xml

1574523198671 1574523198671

drawDemo/build.xml

Builds, tests, and runs the project drawDemo.

drawDemo/build/built-jar.properties

#Sat, 20 Jun 2015 15:10:11 -0400 C\:\\Users\\Chuck\\Documents\\NetBeansProjects\\drawDemo=

drawDemo/build/classes/.netbeans_automatic_build

drawDemo/build/classes/.netbeans_update_resources

drawDemo/build/classes/drawdemo/DrawDemo.class

package drawdemo;
public synchronized class DrawDemo {
    public void DrawDemo();
    public static void main(String[]);
}

drawDemo/build/classes/drawdemo/MyCanvas.class

package drawdemo;
synchronized class MyCanvas extends java.awt.Canvas {
    public void MyCanvas();
    public void paint(java.awt.Graphics);
}

drawDemo/build/test/classes/drawdemo/DrawDemo.class

package drawdemo;
public synchronized class DrawDemo {
    public void DrawDemo();
    public static void main(String[]);
}

drawDemo/build/test/classes/drawdemo/MyCanvas.class

package drawdemo;
synchronized class MyCanvas extends java.awt.Canvas {
    public void MyCanvas();
    public void paint(java.awt.Graphics);
}

drawDemo/drawDemo.iml

drawDemo/logo.jpg

drawDemo/manifest.mf

Manifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build

drawDemo/master-application.jnlp

<jnlp spec="1.0+" codebase="${jnlp.codebase}" href="launch.jnlp"> <information> <title>${APPLICATION.TITLE}</title> <vendor>${APPLICATION.VENDOR}</vendor> <homepage href="${APPLICATION.HOMEPAGE}"/> <description>${APPLICATION.DESC}</description> <description kind="short">${APPLICATION.DESC.SHORT}</description> <!--${JNLP.ICONS}--> <!--${JNLP.OFFLINE.ALLOWED}--> </information> <!--${JNLP.UPDATE}--> <!--${JNLP.SECURITY}--> <resources> <!--${JNLP.RESOURCES.RUNTIME}--> <!--${JNLP.RESOURCES.MAIN.JAR}--> <!--${JNLP.RESOURCES.JARS}--> <!--${JNLP.RESOURCES.EXTENSIONS}--> </resources> <application-desc main-class="${jnlp.main.class}"> <!--${JNLP.APPLICATION.ARGS}--> </application-desc> </jnlp>

drawDemo/nbproject/build-impl.xml

Must set src.dir Must set test.src.dir Must set build.dir Must set dist.dir Must set build.classes.dir Must set dist.javadoc.dir Must set build.test.classes.dir Must set build.test.results.dir Must set build.classes.excludes Must set dist.jar Must set javac.includes No tests executed. Must set JVM to use for profiling in profiler.info.jvm Must set profiler agent JVM arguments in profiler.info.jvmargs.agent Must select some files in the IDE or set javac.includes To run this application from the command line without Ant, try: java -cp "${run.classpath.with.dist.jar}" ${main.class} To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" Must select one file in the IDE or set run.class Must select one file in the IDE or set run.class Must select one file in the IDE or set debug.class Must select one file in the IDE or set debug.class Must set fix.includes This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set profile.class This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set run.class Must select some files in the IDE or set test.includes Must select one file in the IDE or set run.class Must select one file in the IDE or set applet.url Must select some files in the IDE or set javac.includes Some tests failed; see details above. Must select some files in the IDE or set test.includes Some tests failed; see details above. Must select some files in the IDE or set test.class Must select some method in the IDE or set test.method Some tests failed; see details above. Must select one file in the IDE or set test.class Must select one file in the IDE or set test.class Must select some method in the IDE or set test.method Must select one file in the IDE or set applet.url Must select one file in the IDE or set applet.url

drawDemo/nbproject/configs/JWS_generated.properties

$label=Web Start $target.debug=jws-debug $target.run=jws-run compile.on.save.unsupported.javawebstart=true

drawDemo/nbproject/genfiles.properties

build.xml.data.CRC32=2fa960bb build.xml.script.CRC32=fc53a618 [email protected] # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=2fa960bb nbproject/build-impl.xml.script.CRC32=ba1a5535 nbproject/[email protected]

drawDemo/nbproject/jnlp-impl.xml

To run this application from the command line without Ant, try: javaws "${jnlp.file.resolved}"

drawDemo/nbproject/jnlp-impl_backup.xml

To run this application from the command line without Ant, try: javaws "${jnlp.file.resolved}"

drawDemo/nbproject/private/config.properties

drawDemo/nbproject/private/private.properties

compile.on.save=true user.properties.file=C:\\Users\\cherbert\\AppData\\Roaming\\NetBeans\\7.3.1\\build.properties

drawDemo/nbproject/private/private.xml

file:/C:/Users/cherbert/Desktop/NetBeansProjects/drawDemo/src/drawdemo/DrawDemo.java

drawDemo/nbproject/project.properties

annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processor.options= annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: build.dir=build build.generated.dir=${build.dir}/generated build.generated.sources.dir=${build.dir}/generated-sources # Only compile against the classpath explicitly listed here: build.sysclasspath=ignore build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results # Uncomment to specify the preferred debugger connection transport: #debug.transport=dt_socket debug.classpath=\ ${run.classpath} debug.test.classpath=\ ${run.test.classpath} # This directory is removed when the project is cleaned: dist.dir=dist dist.jar=${dist.dir}/drawDemo.jar dist.javadoc.dir=${dist.dir}/javadoc excludes= includes=** jar.compress=false javac.classpath= # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false javac.processorpath=\ ${javac.classpath} javac.source=1.7 javac.target=1.7 javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir} javac.test.processorpath=\ ${javac.test.classpath} javadoc.additionalparam= javadoc.author=false javadoc.encoding=${source.encoding} javadoc.noindex=false javadoc.nonavbar=false javadoc.notree=false javadoc.private=false javadoc.splitindex=true javadoc.use=true javadoc.version=false javadoc.windowtitle= main.class=drawdemo.DrawDemo manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false platform.active=default_platform run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} # Space-separated list of JVM arguments used when running the project. # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. # To set system properties for unit tests define test-sys-prop.name=value: run.jvmargs= run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 src.dir=src test.src.dir=test

drawDemo/nbproject/project.xml

org.netbeans.modules.java.j2seproject drawDemo

drawDemo/out/production/drawDemo/drawdemo/DrawDemo.class

package drawdemo;
public synchronized class DrawDemo {
    public void DrawDemo();
    public static void main(String[]);
}

drawDemo/out/production/drawDemo/drawdemo/MyCanvas.class

package drawdemo;
synchronized class MyCanvas extends java.awt.Canvas {
    public void MyCanvas();
    public void paint(java.awt.Graphics);
}

drawDemo/preview-application.html

Test page for launching the application via JNLP

drawDemo/src/drawdemo/DrawDemo.java

drawDemo/src/drawdemo/DrawDemo.java

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package  drawdemo ;

import  java . awt . * ;
import  javax . swing . * ;

public   class   DrawDemo   {

     public   static   void  main ( String []  args )   {

         // create a MyCanvas object
         MyCanvas  canvas1  =   new   MyCanvas ();

         // set up a JFrame tpo hold the canvas
         JFrame  frame  =   new   JFrame ();
        frame . setTitle ( "Using Common Graphics Class Methods" );
        frame . setSize ( 512 , 546 );
        frame . setLocation ( 100 ,   100 );
        frame . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE );

         // add the canvas to the frame as a content panel
        frame . getContentPane (). add ( canvas1 );
        frame . setVisible ( true );

     }   // end main()
}   // end class ThreeRectangles

class   MyCanvas   extends   Canvas   {

     public   MyCanvas ()   {
     }    // end MyCanvas() constructor

     public   void  paint ( Graphics  graphics )   {
    
        graphics . drawRect ( 20 ,   20 ,   100 ,   200 );
        graphics . drawOval ( 140 ,   20 ,   100 ,   100 );
        graphics . drawRoundRect ( 260 ,   20 ,   100 ,   200 ,   20 ,   20 );
        graphics . drawArc ( 340 ,   20 ,   100 ,   100 ,   0 ,   90 );
        graphics . drawLine ( 20 ,   240 ,   400 ,   280 );
                
         // draw a gray square as a shadow under a red squareoutlined in black
         // draw a gray squareto be used as a shadow, offset down and right 5 pixels
        graphics . setColor ( new   Color ( 160 , 160 , 160 ));
        graphics . fillRect ( 25 ,   305 ,   100 ,   100 );

         // put the red square over the gray shadow
        graphics . setColor ( Color . red );
        graphics . fillRect ( 20 ,   300 ,   100 ,   100 );

         // out line the filled red square with a black square
        graphics . setColor ( Color . black );
        graphics . drawRect ( 20 ,   300 ,   100 ,   100 );

        graphics . setColor ( Color . green );
        graphics . fillOval ( 140 ,   300 ,   100 ,   200 );
        
        graphics . setColor ( Color . blue );
        graphics . fillRoundRect ( 260 ,   300 ,   100 ,   200 ,   60 ,   60 );
        
        graphics . setColor ( new   Color ( 128 , 0 , 128 ));
        graphics . fillArc ( 340 ,   340 ,   100 ,   100 ,   0 ,   90 );
        
         // draw a parallelogram
         int  n  =   4 ;
         int []  x  =   { 20 ,   100 ,   140 ,   60 };
         int []  y  =   { 420 ,   420 ,   480 ,   480 };
        graphics . drawPolygon ( x ,  y ,  n );

         // draw some text
        graphics . setColor ( Color . black );
        graphics . setFont ( new   Font ( "Times New Roman" ,   Font . BOLD ,   12 ));
        graphics . drawString ( "Draw Text" ,   390 ,   150 );

         // add a logo to the canvas
         Image  logo  =   new   ImageIcon ( "logo.jpg" ). getImage ();
        graphics . drawImage ( logo ,   390 ,   440 ,   null );

     }    // end paint()
}   // end class MyCanvas

drawDemo/test/DrawDemo.java

drawDemo/test/DrawDemo.java

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package  drawdemo ;

import  java . awt . * ;
import  javax . swing . * ;

public   class   DrawDemo   {

     public   static   void  main ( String []  args )   {

         // create a MyCanvas object
         MyCanvas  canvas1  =   new   MyCanvas ();

         // set up a JFrame to hold the canvas
         JFrame  frame  =   new   JFrame ();
        frame . setTitle ( "Using Common Graphics Class Methods" );
        frame . setSize ( 512 , 546 );
        frame . setLocation ( 100 ,   100 );
        frame . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE );

         // add the canvas to the frame as a content panel
        frame . getContentPane (). add ( canvas1 );
        frame . setVisible ( true );

     }   // end main()
}   // end class ThreeRectangles

class   MyCanvas   extends   Canvas   {

     public   MyCanvas ()   {
     }    // end MyCanvas() constructor

     public   void  paint ( Graphics  graphics )   {
    
        graphics . drawRect ( 20 ,   20 ,   100 ,   200 );
        graphics . drawOval ( 140 ,   20 ,   100 ,   100 );
        graphics . drawRoundRect ( 260 ,   20 ,   100 ,   200 ,   20 ,   20 );
        graphics . drawArc ( 340 ,   20 ,   100 ,   100 ,   0 ,   90 );
        graphics . drawLine ( 20 ,   240 ,   400 ,   280 );
                
         // draw a gray square as a shadow under a red squareoutlined in black
         // draw a gray squareto be used as a shadow, offset down and right 5 pixels
        graphics . setColor ( new   Color ( 160 , 160 , 160 ));
        graphics . fillRect ( 25 ,   305 ,   100 ,   100 );

         // put the red square over the gray shadow
        graphics . setColor ( Color . red );
        graphics . fillRect ( 20 ,   300 ,   100 ,   100 );

         // out line the filled red square with a black square
        graphics . setColor ( Color . black );
        graphics . drawRect ( 20 ,   300 ,   100 ,   100 );

        graphics . setColor ( Color . green );
        graphics . fillOval ( 140 ,   300 ,   100 ,   200 );
        
        graphics . setColor ( Color . blue );
        graphics . fillRoundRect ( 260 ,   300 ,   100 ,   200 ,   60 ,   60 );
        
        graphics . setColor ( new   Color ( 128 , 0 , 128 ));
        graphics . fillArc ( 340 ,   340 ,   100 ,   100 ,   0 ,   90 );
        
         // draw a parallelogram
         int  n  =   4 ;
         int []  x  =   { 20 ,   100 ,   140 ,   60 };
         int []  y  =   { 420 ,   420 ,   480 ,   480 };
        graphics . drawPolygon ( x ,  y ,  n );

         // draw some text
        graphics . setColor ( Color . black );
        graphics . setFont ( new   Font ( "Times New Roman" ,   Font . BOLD ,   12 ));
        graphics . drawString ( "Draw Text" ,   390 ,   150 );

         // add a logo to the canvas
         Image  logo  =   new   ImageIcon ( "logo.jpg" ). getImage ();
        graphics . drawImage ( logo ,   390 ,   440 ,   null );

     }    // end paint()
}   // end class MyCanvas

GettingCloser/.idea/$PRODUCT_WORKSPACE_FILE$

1.8

GettingCloser/.idea/misc.xml

GettingCloser/.idea/modules.xml

GettingCloser/.idea/workspace.xml

1574562376408 1574562376408

GettingCloser/GettingCloser.iml

GettingCloser/out/production/gettingCloser/gettingCloser/GettingCloser.class

package gettingCloser;
public synchronized class GettingCloser {
    public void GettingCloser();
    public static void main(String[]);
}

GettingCloser/out/production/gettingCloser/gettingCloser/MyCanvas.class

package gettingCloser;
synchronized class MyCanvas extends java.awt.Canvas {
    public void MyCanvas();
    public void paint(java.awt.Graphics);
}

GettingCloser/src/GettingCloser/GettingCloser.java

GettingCloser/src/GettingCloser/GettingCloser.java

/* gettingCloser.Java
 * Computer Science 111, Fall 2013
 * Last edited Nov. 23, 2019 by C. Herbert
 *
 * This code demonstrates a simplew example of some computer art work.
 * It draws random ovals on top od each other.  Do they appear to be getting closer?
 */

package  gettingCloser ;
import  java . awt . * ;
import  java . util . concurrent . TimeUnit ;
import  javax . swing . * ;

public   class   GettingCloser   {

         public   static   void  main ( String []  args )
         {

             // create a MyCanvas object
             MyCanvas  canvas1  =   new   MyCanvas ();

             // set up a JFrame to hold the canvas
             JFrame  frame  =   new   JFrame ();
            frame . setTitle ( "Random rectangles" );
            frame . setSize ( 500 ,   500 );
            frame . setLocation ( 100 ,   100 );
            frame . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE );

             // add the canvas to the frame as a content panel
            frame . getContentPane (). add ( canvas1 );
            frame . setVisible ( true );
         }   // end main()

     }   // end class

     class   MyCanvas   extends   Canvas
     {

         public   MyCanvas ()
         {   }    // end MyCanvas() constructor

         public   void  paint ( Graphics  graphics )
         {

             int  r ;    // red Color factor
             int  g ;    // green Color factor
             int  b ;    // blue Color factor

             int  x ;    // x coordinate  to locate rectangle
             int  y ;    // y coordinate  to locate rectangle

             int  width ;    // width of rectangle
             int  height ;    // height of rectangle
             int  i ;   // loop counter

             // paint the canvas black
            graphics . setColor ( Color . BLACK );
            graphics . fillRect ( 0 ,   0 ,   500 ,   500 );

             for ( i = 1 ;   i <= 1000 ;  i ++ )
             {
                 // randomly generate and set a color
                r  =   ( int )   ( Math . random ()   *   256 );
                g  =   ( int )   ( Math . random ()   *   256 );
                b  =   ( int )   ( Math . random ()   *   256 );
                graphics . setColor ( new   Color ( r ,  g ,  b ));

                 // randomly generate and draw an oval
                x  =   ( int )   ( Math . random ()   *   500 );
                y  =   ( int )   ( Math . random ()   *   500 );
                width  =   ( int )   ( Math . random ()   *   250 );
                height  =   ( int )   ( Math . random ()   *   250 );
                graphics . fillOval ( x ,  y ,  width ,  height );

                 // The sleep command delays the drawing to make it more interesting
                 // It must be in try-cathc blocks for error handling (discussed in chap. 12)
                 try
                 {
                     TimeUnit . MILLISECONDS . sleep ( 20 );
                 }
                 catch   ( Exception  e )
                 {
                     System . out . println ( "Exception caught" );
                 }




             }

         }    // end paint()
     }   // end class MyCanvas



Histogram/.idea/$PRODUCT_WORKSPACE_FILE$

1.8

Histogram/.idea/misc.xml

Histogram/.idea/modules.xml

Histogram/.idea/workspace.xml

1574523259255 1574523259255

Histogram/build.xml

Builds, tests, and runs the project Histogram.

Histogram/build/built-jar.properties

#Fri, 22 Nov 2013 09:17:35 -0500 C\:\\Users\\cherbert\\Desktop\\NetBeansProjects\\Histogram=

Histogram/build/classes/.netbeans_automatic_build

Histogram/build/classes/.netbeans_update_resources

Histogram/build/classes/histogram/Histogram.class

package histogram;
public synchronized class Histogram {
    public void Histogram();
    public static void main(String[]);
}

Histogram/build/classes/histogram/Histogram.rs

Histogram/build/classes/histogram/MyCanvas.class

package histogram;
synchronized class MyCanvas extends java.awt.Canvas {
    public void MyCanvas();
    public void paint(java.awt.Graphics);
}

Histogram/CSCI.JPG

Histogram/Histogram.iml

Histogram/logo.jpg

Histogram/manifest.mf

Manifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build

Histogram/nbproject/build-impl.xml

Must set src.dir Must set test.src.dir Must set build.dir Must set dist.dir Must set build.classes.dir Must set dist.javadoc.dir Must set build.test.classes.dir Must set build.test.results.dir Must set build.classes.excludes Must set dist.jar Must set javac.includes No tests executed. Must set JVM to use for profiling in profiler.info.jvm Must set profiler agent JVM arguments in profiler.info.jvmargs.agent Must select some files in the IDE or set javac.includes To run this application from the command line without Ant, try: java -cp "${run.classpath.with.dist.jar}" ${main.class} To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" Must select one file in the IDE or set run.class Must select one file in the IDE or set run.class Must select one file in the IDE or set debug.class Must select one file in the IDE or set debug.class Must set fix.includes This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set profile.class This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set run.class Must select some files in the IDE or set test.includes Must select one file in the IDE or set run.class Must select one file in the IDE or set applet.url Must select some files in the IDE or set javac.includes Some tests failed; see details above. Must select some files in the IDE or set test.includes Some tests failed; see details above. Must select some files in the IDE or set test.class Must select some method in the IDE or set test.method Some tests failed; see details above. Must select one file in the IDE or set test.class Must select one file in the IDE or set test.class Must select some method in the IDE or set test.method Must select one file in the IDE or set applet.url Must select one file in the IDE or set applet.url

Histogram/nbproject/genfiles.properties

build.xml.data.CRC32=dc3100a3 build.xml.script.CRC32=a08e0b33 [email protected] # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=dc3100a3 nbproject/build-impl.xml.script.CRC32=fee95aa2 nbproject/[email protected]

Histogram/nbproject/private/private.properties

compile.on.save=true user.properties.file=C:\\Users\\cherbert\\AppData\\Roaming\\NetBeans\\7.3.1\\build.properties

Histogram/nbproject/private/private.xml

file:/C:/Users/cherbert/Desktop/NetBeansProjects/Histogram/src/histogram/Histogram.java

Histogram/nbproject/project.properties

annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processor.options= annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: build.dir=build build.generated.dir=${build.dir}/generated build.generated.sources.dir=${build.dir}/generated-sources # Only compile against the classpath explicitly listed here: build.sysclasspath=ignore build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results # Uncomment to specify the preferred debugger connection transport: #debug.transport=dt_socket debug.classpath=\ ${run.classpath} debug.test.classpath=\ ${run.test.classpath} # This directory is removed when the project is cleaned: dist.dir=dist dist.jar=${dist.dir}/Histogram.jar dist.javadoc.dir=${dist.dir}/javadoc excludes= includes=** jar.compress=false javac.classpath= # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false javac.processorpath=\ ${javac.classpath} javac.source=1.7 javac.target=1.7 javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir} javac.test.processorpath=\ ${javac.test.classpath} javadoc.additionalparam= javadoc.author=false javadoc.encoding=${source.encoding} javadoc.noindex=false javadoc.nonavbar=false javadoc.notree=false javadoc.private=false javadoc.splitindex=true javadoc.use=true javadoc.version=false javadoc.windowtitle= main.class=histogram.Histogram manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false platform.active=default_platform run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} # Space-separated list of JVM arguments used when running the project. # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. # To set system properties for unit tests define test-sys-prop.name=value: run.jvmargs= run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 src.dir=src test.src.dir=test

Histogram/nbproject/project.xml

org.netbeans.modules.java.j2seproject Histogram

Histogram/out/production/Histogram/histogram/Histogram.class

package histogram;
public synchronized class Histogram {
    public void Histogram();
    public static void main(String[]);
}

Histogram/out/production/Histogram/histogram/MyCanvas.class

package histogram;
synchronized class MyCanvas extends java.awt.Canvas {
    public void MyCanvas();
    public void paint(java.awt.Graphics);
}

Histogram/src/histogram/Histogram.java

Histogram/src/histogram/Histogram.java

/* Histogram.Java
 * Computer Science 111, Fall 2013
 * Last edited Nov. 20, 2013 by C. Herbert
 * 
 * This code demonstrates how to draw a histogram in aJFrame 
 * using Java Graphics class objects.
 * 
 * With a little work, it could be transformed into a general-purpose
 * program to read data and labels from a data file then create a  hsitogram 
 * based on the data.
 * 
 * When analyzing this code, remember, the screen uses inverted Cartesian coordinates.
 */
package  histogram ;

import  java . awt . * ;
import  javax . swing . * ;

public   class   Histogram  
{

     public   static   void  main ( String []  args )  
     {

         // create a MyCanvas object
         MyCanvas  canvas1  =   new   MyCanvas ();

         // set up a JFrame to hold the canvas
         JFrame  frame  =   new   JFrame ();
        frame . setTitle ( "Enrollment Histogram" );
        frame . setSize ( 300 ,   280 );
        frame . setLocation ( 100 ,   100 );
        frame . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE );

         // add the canvas to the frame as a content panel
        frame . getContentPane (). add ( canvas1 );
        frame . setVisible ( true );
        
        
         // add the canvas to the frame as a content panel
        frame . getContentPane (). add ( canvas1 );
        frame . setVisible ( true );

     }   // end main()
}   // end class

class   MyCanvas   extends   Canvas  
{

     public   MyCanvas ()  
     {   }    // end MyCanvas() constructor

     public   void  paint ( Graphics  graphics )  
     {
         int  i ;    // a loop counter
         int  x ;   // x coordinate for drawing
         int  y ;   // y coordinate for drawing

         /* parallel arrays of data -- This could also be done as an object with 
         * enrollment and year properties.  With more than two properties, 
         * objects are probably better.  The data could be read in from a file.
         */
         int []  enrollment  =   { 106 ,   105 ,   142 ,   324 };   // array of enrollment figures
         String []  year  =   { "2010" ,   "2011" ,   "2012" ,   "2013" };    // array of years for labels

         // paint the canvas white
        graphics . setColor ( Color . white );
        graphics . fillRect ( 0 ,   0 ,   300 ,   280 );

         // add a logo to the canvas
         Image  logo  =   new   ImageIcon ( "logo.jpg" ). getImage ();
        graphics . drawImage ( logo ,   5 ,   5 ,   null );

         // draw chart title
        graphics . setColor ( Color . black );
        graphics . setFont ( new   Font ( "Times New Roman" ,   Font . BOLD ,   16 ));
        graphics . drawString ( "Course Enrollment" ,   85 ,   30 );

         // draw  horizintal lines and unit labels
        graphics . setFont ( new   Font ( "Arial" ,   Font . PLAIN ,   12 ));
        graphics . setColor ( Color . gray );
         for   ( =   0 ;  i  <=   7 ;  i ++ )   {
             // lines and labels every 20 units from 200 up 
            y  =   200   -   ( 20   *  i );   // caculate y coordinate for each line  

             // draw each line across
            graphics . drawLine ( 50 ,  y ,   250 ,  y );
             // place label for each line; +5 adjustment to align labels and lines
            graphics . drawString ( Integer . toString ( *   50 ),   20 ,  y  +   5 );

         }   // end for

         // draw vertical lines on left and right of chart
        graphics . drawLine ( 50 ,   200 ,   50 ,   60 );
        graphics . drawLine ( 250 ,   200 ,   250 ,   60 );

         // draw data bars and place year labels
        graphics . setColor ( new   Color ( 128 ,   0 ,   0 ));
         for   ( =   1 ;  i  <=   4 ;  i ++ )   {
            x  =   40   +   ( 40   *  i );                     // space bars 40 pixels apart   
            y  =   ( enrollment [ -   1 ]   *   140 )   /   350 ;     // caculate height of bar based on data
            graphics . fillRect ( x ,   200   -  y ,   20 ,  y );     // draw bars 

             // put year under each bar, 20 pixels below bar, x-5 to align labels and bars 
            graphics . drawString ( year [ -   1 ],  x  -   5 ,   220 );

         }   // end for

     }    // end paint()
}   // end class MyCanvas

PieChart/.idea/$PRODUCT_WORKSPACE_FILE$

1.8

PieChart/.idea/misc.xml

PieChart/.idea/modules.xml

PieChart/.idea/workspace.xml

1574523326984 1574523326984

PieChart/build.xml

Builds, tests, and runs the project PieChart.

PieChart/build/classes/.netbeans_automatic_build

PieChart/build/classes/.netbeans_update_resources

PieChart/build/classes/piechart/PieChart.class

package piechart;
public synchronized class PieChart {
    public void PieChart();
    public static void main(String[]) throws Exception;
}

PieChart/build/classes/piechart/PieChartCanvas.class

package piechart;
synchronized class PieChartCanvas extends java.awt.Canvas {
    String title;
    int count;
    double sum;
    String[] sliceLabel;
    double[] sliceValue;
    java.awt.Color[] sliceColor;
    public void PieChartCanvas();
    public void ReadChartdata() throws Exception;
    public void paint(java.awt.Graphics);
}

PieChart/manifest.mf

Manifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build

PieChart/nbproject/build-impl.xml

Must set src.dir Must set test.src.dir Must set build.dir Must set dist.dir Must set build.classes.dir Must set dist.javadoc.dir Must set build.test.classes.dir Must set build.test.results.dir Must set build.classes.excludes Must set dist.jar Must set javac.includes No tests executed. Must set JVM to use for profiling in profiler.info.jvm Must set profiler agent JVM arguments in profiler.info.jvmargs.agent Must select some files in the IDE or set javac.includes To run this application from the command line without Ant, try: java -cp "${run.classpath.with.dist.jar}" ${main.class} To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" Must select one file in the IDE or set run.class Must select one file in the IDE or set run.class Must select one file in the IDE or set debug.class Must select one file in the IDE or set debug.class Must set fix.includes This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set profile.class This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set run.class Must select some files in the IDE or set test.includes Must select one file in the IDE or set run.class Must select one file in the IDE or set applet.url Must select some files in the IDE or set javac.includes Some tests failed; see details above. Must select some files in the IDE or set test.includes Some tests failed; see details above. Must select some files in the IDE or set test.class Must select some method in the IDE or set test.method Some tests failed; see details above. Must select one file in the IDE or set test.class Must select one file in the IDE or set test.class Must select some method in the IDE or set test.method Must select one file in the IDE or set applet.url Must select one file in the IDE or set applet.url

PieChart/nbproject/genfiles.properties

build.xml.data.CRC32=1c9e1903 build.xml.script.CRC32=0a1b5f57 [email protected] # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=1c9e1903 nbproject/build-impl.xml.script.CRC32=3701ff6e nbproject/[email protected]

PieChart/nbproject/private/private.properties

compile.on.save=true user.properties.file=C:\\Users\\cherbert\\AppData\\Roaming\\NetBeans\\7.3.1\\build.properties

PieChart/nbproject/private/private.xml

file:/C:/Users/cherbert/Desktop/NetBeansProjects/PieChart/src/piechart/PieChart.java

PieChart/nbproject/project.properties

annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processor.options= annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: build.dir=build build.generated.dir=${build.dir}/generated build.generated.sources.dir=${build.dir}/generated-sources # Only compile against the classpath explicitly listed here: build.sysclasspath=ignore build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results # Uncomment to specify the preferred debugger connection transport: #debug.transport=dt_socket debug.classpath=\ ${run.classpath} debug.test.classpath=\ ${run.test.classpath} # This directory is removed when the project is cleaned: dist.dir=dist dist.jar=${dist.dir}/PieChart.jar dist.javadoc.dir=${dist.dir}/javadoc excludes= includes=** jar.compress=false javac.classpath= # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false javac.processorpath=\ ${javac.classpath} javac.source=1.7 javac.target=1.7 javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir} javac.test.processorpath=\ ${javac.test.classpath} javadoc.additionalparam= javadoc.author=false javadoc.encoding=${source.encoding} javadoc.noindex=false javadoc.nonavbar=false javadoc.notree=false javadoc.private=false javadoc.splitindex=true javadoc.use=true javadoc.version=false javadoc.windowtitle= main.class=piechart.PieChart manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false platform.active=default_platform run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} # Space-separated list of JVM arguments used when running the project. # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. # To set system properties for unit tests define test-sys-prop.name=value: run.jvmargs= run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 src.dir=src test.src.dir=test

PieChart/nbproject/project.xml

org.netbeans.modules.java.j2seproject PieChart

PieChart/out/production/PieChart/piechart/PieChart.class

package piechart;
public synchronized class PieChart {
    public void PieChart();
    public static void main(String[]) throws Exception;
}

PieChart/out/production/PieChart/piechart/PieChartCanvas.class

package piechart;
synchronized class PieChartCanvas extends java.awt.Canvas {
    String title;
    int count;
    double sum;
    String[] sliceLabel;
    double[] sliceValue;
    java.awt.Color[] sliceColor;
    public void PieChartCanvas();
    public void ReadChartdata() throws Exception;
    public void paint(java.awt.Graphics);
}

PieChart/PieChart.iml

PieChart/PieChartData.txt

Dubious Election of 1824 Andrew Jackson 151271 John Quincy Adams 113122 William Harris Crawford 40856 Henry Clay 47531 Others 13053

PieChart/src/piechart/PieChart.java

PieChart/src/piechart/PieChart.java

/* PieChart.Java
 * Computer Science 111, Fall 2013
 * Last edited Nov. 20, 2013 by C. Herbert
 * 
 * This code demonstrates how to draw a pie chart in aJFrame 
 * using Java Graphics class objects.
 * 
 * The chart can handle up to 8 integer values, read in from a data file.  
 * This code reads a local data file named "PieData.txt"
 * The first line inthe file contains the title of the chart.
 * Follwing that, there should be a line with a label, followed by a line with 
 * the data that matches that label.
 * 
 * The colors of the chart are harcooded into the program.
 * When analyzing this code, remember, the screen uses inverted Cartesian coordinates.
 */
package  piechart ;

import  java . awt . * ;
import  java . util . * ;
import  javax . swing . * ;

public   class   PieChart   {

     public   static   void  main ( String []  args )   throws   Exception
     {
         // create a PieChartCanvas object named canvas1
         PieChartCanvas  canvas1  =   new   PieChartCanvas ();

         // read data into variables for the canvas1 object 
        canvas1 . ReadChartdata ();

         // set up a JFrame to hold the canvas
         JFrame  frame  =   new   JFrame ();
        frame . setTitle ( "Bedroom Window by Wharton Reed Dickinson"   );
        frame . setSize ( 500 ,   400 );
        frame . setLocation ( 100 ,   100 );
        frame . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE );

         // add the canvas to the frame as a content panel
        frame . getContentPane (). add ( canvas1 );
        frame . setVisible ( true );     
        
     }   // end main()
}   // end PieChart
    
class   PieChartCanvas   extends   Canvas  
{
     String  title ;                             // chart title
     int  count ;                                // number of slices
     double  sum ;                                  // sum of the values in the chart
     String []  sliceLabel  =   new   String [ 10 ];     // array of labels for the chart
     double   []  sliceValue =   new   double   [ 10 ];            // array of values for the chart

     // array of colors for each slice 
     Color []  sliceColor  =   { Color . RED ,   Color . BLUE ,   Color . GREEN ,   Color . MAGENTA ,
         Color . ORANGE ,   Color . GRAY ,   Color . CYAN ,   Color . PINK };

     public   PieChartCanvas ()  
     {   }    // end MyCanvas() constructor

     public   void   ReadChartdata () throws   Exception  
     {
       // Create a Scanner named infile to read the input stream from the file
         Scanner  infile  =   new   Scanner ( new  java . io . File ( "PieChartData.txt" ));

         // read title
        title   =  infile . nextLine ();
         System . out . println ( title );
         // initialize count and sum
        sum  =   0.0 ;
        count  =   0 ;
        
         // read data for each slice
         while   ( infile . hasNextLine ())
         {
            
            sliceLabel [ count ]   =  infile . nextLine ();
            sliceValue [ count ]   =   Double . parseDouble ( infile . nextLine ());
             System . out . println ( sliceValue [ count ]);

             // update count and sum
            sum  =  sum  +  sliceValue [ count ];
            count ++ ;
         }   // end while (infile.hasNext())

     }    // end ReadChartdata()

     public   void  paint ( Graphics  graphics )  
     {
         int  i ;        // a loop counter
         int  start  =   0 ;    // the starting angle for each pie chart slice
         double  size ;         // the size of the arc for each slice (in degrees)
        
         int  x  =   10 ;        // x coordinate of the bounding square for the pie's circle
         int  y  =   40 ;        // y coordinate of the bounding square for the pie's circle
         int  side  =   200 ;     // side of the bounding square for the pie's circle 
                
         // draw title
        graphics . setFont ( new   Font ( "Cambria" ,   Font . BOLD ,   18 ));
        graphics . drawString ( title ,   130 ,   24 );

         // set a smaller font for the legend in the following loop
        graphics . setFont ( new   Font ( "Arial" ,   Font . BOLD ,   12 ));
        
         // loop to draw pie chart and legend
         for (  i  =   0 ;  i  <  count ;  i ++ )
         {
        
             // calculate size of slice
            size  =  sliceValue [ i ] / sum  *   360.0   ;
             // set the color for arc 
            graphics . setColor ( sliceColor [ i ]);

             // draw slice
            graphics . fillArc ( x ,  y ,  side ,  side ,  start ,   ( int )   Math . round ( size ));
             System . out . println ( size );
            
             // draw the square in the legend for this slice 
            graphics . fillRect ( 240 ,   40 + 40 * i ,   15 ,   15 );
        
             // identify the color with label and value the legend 
            graphics . setColor ( Color . BLACK );
            graphics . drawString ( sliceLabel [ i ],   265 ,   50 + 40 * i );         
            graphics . drawString (   Integer . toString (( int ) sliceValue [ i ]),   425 ,   50 + 40 * i );         
            
            
             // calculate the value of start for the next slice
            start  =  start  +   ( int ) Math . round ( size )   ;             
         }
        
        
        
     }    // end paint()
}   // end class MyCanvas



RandomCards/.idea/$PRODUCT_WORKSPACE_FILE$

1.8

RandomCards/.idea/misc.xml

RandomCards/.idea/modules.xml

RandomCards/.idea/workspace.xml

1574533557925 1574533557925

RandomCards/build.xml

Builds, tests, and runs the project RandomCards.

RandomCards/build/classes/.netbeans_automatic_build

RandomCards/build/classes/.netbeans_update_resources

RandomCards/build/classes/randomcards/MyCanvas.class

package randomcards;
synchronized class MyCanvas extends java.awt.Canvas {
    public void MyCanvas();
    public void paint(java.awt.Graphics);
}

RandomCards/build/classes/randomcards/RandomCards.class

package randomcards;
public synchronized class RandomCards {
    public void RandomCards();
    public static void main(String[]);
}

RandomCards/cards/1.png

RandomCards/cards/10.png

RandomCards/cards/11.png

RandomCards/cards/12.png

RandomCards/cards/13.png

RandomCards/cards/14.png

RandomCards/cards/15.png

RandomCards/cards/16.png

RandomCards/cards/17.png

RandomCards/cards/18.png

RandomCards/cards/19.png

RandomCards/cards/2.png

RandomCards/cards/20.png

RandomCards/cards/21.png

RandomCards/cards/22.png

RandomCards/cards/23.png

RandomCards/cards/24.png

RandomCards/cards/25.png

RandomCards/cards/26.png

RandomCards/cards/27.png

RandomCards/cards/28.png

RandomCards/cards/29.png

RandomCards/cards/3.png

RandomCards/cards/30.png

RandomCards/cards/31.png

RandomCards/cards/32.png

RandomCards/cards/33.png

RandomCards/cards/34.png

RandomCards/cards/35.png

RandomCards/cards/36.png

RandomCards/cards/37.png

RandomCards/cards/38.png

RandomCards/cards/39.png

RandomCards/cards/4.png

RandomCards/cards/40.png

RandomCards/cards/41.png

RandomCards/cards/42.png

RandomCards/cards/43.png

RandomCards/cards/44.png

RandomCards/cards/45.png

RandomCards/cards/46.png

RandomCards/cards/47.png

RandomCards/cards/48.png

RandomCards/cards/49.png

RandomCards/cards/5.png

RandomCards/cards/50.png

RandomCards/cards/51.png

RandomCards/cards/52.png

RandomCards/cards/53.png

RandomCards/cards/54.png

RandomCards/cards/6.png

RandomCards/cards/7.png

RandomCards/cards/8.png

RandomCards/cards/9.png

RandomCards/cards/b1fh.png

RandomCards/cards/b1fv.png

RandomCards/cards/b2fh.png

RandomCards/cards/b2fv.png

RandomCards/cards/Thumbs.db

RandomCards/manifest.mf

Manifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build

RandomCards/nbproject/build-impl.xml

Must set src.dir Must set test.src.dir Must set build.dir Must set dist.dir Must set build.classes.dir Must set dist.javadoc.dir Must set build.test.classes.dir Must set build.test.results.dir Must set build.classes.excludes Must set dist.jar Must set javac.includes No tests executed. Must set JVM to use for profiling in profiler.info.jvm Must set profiler agent JVM arguments in profiler.info.jvmargs.agent Must select some files in the IDE or set javac.includes To run this application from the command line without Ant, try: java -cp "${run.classpath.with.dist.jar}" ${main.class} To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" Must select one file in the IDE or set run.class Must select one file in the IDE or set run.class Must select one file in the IDE or set debug.class Must select one file in the IDE or set debug.class Must set fix.includes This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set profile.class This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set run.class Must select some files in the IDE or set test.includes Must select one file in the IDE or set run.class Must select one file in the IDE or set applet.url Must select some files in the IDE or set javac.includes Some tests failed; see details above. Must select some files in the IDE or set test.includes Some tests failed; see details above. Must select some files in the IDE or set test.class Must select some method in the IDE or set test.method Some tests failed; see details above. Must select one file in the IDE or set test.class Must select one file in the IDE or set test.class Must select some method in the IDE or set test.method Must select one file in the IDE or set applet.url Must select one file in the IDE or set applet.url

RandomCards/nbproject/genfiles.properties

build.xml.data.CRC32=c3ceb0dd build.xml.script.CRC32=aaf1f873 [email protected] # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=c3ceb0dd nbproject/build-impl.xml.script.CRC32=d471aafb nbproject/[email protected]

RandomCards/nbproject/private/private.properties

compile.on.save=true user.properties.file=C:\\Users\\cherbert\\AppData\\Roaming\\NetBeans\\7.3.1\\build.properties

RandomCards/nbproject/private/private.xml

file:/C:/Users/cherbert/Desktop/NetBeansProjects/RandomCards/src/randomcards/RandomCards.java

RandomCards/nbproject/project.properties

annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processor.options= annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: build.dir=build build.generated.dir=${build.dir}/generated build.generated.sources.dir=${build.dir}/generated-sources # Only compile against the classpath explicitly listed here: build.sysclasspath=ignore build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results # Uncomment to specify the preferred debugger connection transport: #debug.transport=dt_socket debug.classpath=\ ${run.classpath} debug.test.classpath=\ ${run.test.classpath} # This directory is removed when the project is cleaned: dist.dir=dist dist.jar=${dist.dir}/RandomCards.jar dist.javadoc.dir=${dist.dir}/javadoc excludes= includes=** jar.compress=false javac.classpath= # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false javac.processorpath=\ ${javac.classpath} javac.source=1.7 javac.target=1.7 javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir} javac.test.processorpath=\ ${javac.test.classpath} javadoc.additionalparam= javadoc.author=false javadoc.encoding=${source.encoding} javadoc.noindex=false javadoc.nonavbar=false javadoc.notree=false javadoc.private=false javadoc.splitindex=true javadoc.use=true javadoc.version=false javadoc.windowtitle= main.class=randomcards.RandomCards manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false platform.active=default_platform run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} # Space-separated list of JVM arguments used when running the project. # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. # To set system properties for unit tests define test-sys-prop.name=value: run.jvmargs= run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 src.dir=src test.src.dir=test

RandomCards/nbproject/project.xml

org.netbeans.modules.java.j2seproject RandomCards

RandomCards/out/production/RandomCards/randomcards/MyCanvas.class

package randomcards;
synchronized class MyCanvas extends java.awt.Canvas {
    public void MyCanvas();
    public void paint(java.awt.Graphics);
}

RandomCards/out/production/RandomCards/randomcards/RandomCards.class

package randomcards;
public synchronized class RandomCards {
    public void RandomCards();
    public static void main(String[]);
}

RandomCards/RandomCards.iml

RandomCards/src/randomcards/RandomCards.java

RandomCards/src/randomcards/RandomCards.java

/* RandomCards.Java
 * Computer Science 111, Fall 2013
 *  Last edited Nov. 20, 2013 by C. Herbert
 *
 * This code demonstrates a simple example of some computer art work.
 * It randomly picks a playing cared and displays it 100 times in random locations.
 * The process is repeated 10 times
 *
 */
package  randomcards ;

import  java . awt . * ;
import  java . util . concurrent . TimeUnit ;
import  javax . swing . * ;

public   class   RandomCards   {
     public   static   void  main ( String []  args )   {

         // create a MyCanvas object
         MyCanvas  canvas1  =   new   MyCanvas ();

         // set up a JFrame to hold the canvas
         JFrame  frame  =   new   JFrame ();
        frame . setTitle ( "Random rectangles" );
        frame . setSize ( 500 ,   500 );
        frame . setLocation ( 100 ,   100 );
        frame . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE );

         // add the canvas to the frame as a content panel
        frame . getContentPane (). add ( canvas1 );
        frame . setVisible ( true );
     }   // end main()

}   // end class

class   MyCanvas   extends   Canvas   {

     public   MyCanvas ()   {
     }    // end MyCanvas() constructor

     public   void  paint ( Graphics  graphics )   {


         int  x ;                // x coordinate  to locate card
         int  y ;                // y coordinate  to locate card

         int  card ;             // number of a playing card
         String  fileString ;    // holds name of card file

         int  i ;                // loop counter
         int  times ;        // number of times the program is repeated

         // paint the canvas black
        graphics . setColor ( Color . BLACK );
        graphics . fillRect ( 0 ,   0 ,   500 ,   500 );

         for   ( times  =   1 ;  times  <=   100 ;  times ++ )   {
             // randomly generate a card array of cards images    i= 0 to 51
            card  =   ( int )   ( Math . random ()   *   52 );

             //display it 50 times
             for   ( =   0 ;  i  <   50 ;  i ++ )   {

                 // randomly generate a location  (0 to 400) top-left corner of card
                x  =   ( int )   ( Math . random ()   *   400 );
                y  =   ( int )   ( Math . random ()   *   400 );

                 // display the card
                fileString  =   "cards/"   +  card  +   ".png" ;
                 Image  logo  =   new   ImageIcon ( fileString ). getImage ();
                graphics . drawImage ( logo ,  x ,  y ,   null );

                 // The sleep command delays the drawing to make it more interesting
                 // It must be in try-cathc blocks for error handling (discussed in chap. 12)
                 try   {
                     TimeUnit . MILLISECONDS . sleep ( 50 );
                 }   // end try
                 catch   ( Exception  e )   {
                     System . out . println ( "Exception caught" );
                 }   //end catch


             }   // end for

         }   //end while
     }    // end paint()
}   // end class MyCanvas

RandomCircles/.idea/$PRODUCT_WORKSPACE_FILE$

1.8

RandomCircles/.idea/misc.xml

RandomCircles/.idea/modules.xml

RandomCircles/.idea/workspace.xml

1574561311032 1574561311032

RandomCircles/build.xml

Builds, tests, and runs the project RandomRectangles.

RandomCircles/build/built-jar.properties

#Thu, 21 Nov 2013 21:33:29 -0500 C\:\\Users\\cherbert\\Desktop\\NetBeansProjects\\RandomRectangles=

RandomCircles/build/classes/.netbeans_automatic_build

RandomCircles/build/classes/.netbeans_update_resources

RandomCircles/build/classes/randomrectangles/MyCanvas.class

package randomrectangles;
synchronized class MyCanvas extends java.awt.Canvas {
    public void MyCanvas();
    public void paint(java.awt.Graphics);
}

RandomCircles/build/classes/randomrectangles/RandomRectangles.class

package randomrectangles;
public synchronized class RandomRectangles {
    public void RandomRectangles();
    public static void main(String[]);
}

RandomCircles/manifest.mf

Manifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build

RandomCircles/nbproject/build-impl.xml

Must set src.dir Must set test.src.dir Must set build.dir Must set dist.dir Must set build.classes.dir Must set dist.javadoc.dir Must set build.test.classes.dir Must set build.test.results.dir Must set build.classes.excludes Must set dist.jar Must set javac.includes No tests executed. Must set JVM to use for profiling in profiler.info.jvm Must set profiler agent JVM arguments in profiler.info.jvmargs.agent Must select some files in the IDE or set javac.includes To run this application from the command line without Ant, try: java -cp "${run.classpath.with.dist.jar}" ${main.class} To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" Must select one file in the IDE or set run.class Must select one file in the IDE or set run.class Must select one file in the IDE or set debug.class Must select one file in the IDE or set debug.class Must set fix.includes This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set profile.class This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set run.class Must select some files in the IDE or set test.includes Must select one file in the IDE or set run.class Must select one file in the IDE or set applet.url Must select some files in the IDE or set javac.includes Some tests failed; see details above. Must select some files in the IDE or set test.includes Some tests failed; see details above. Must select some files in the IDE or set test.class Must select some method in the IDE or set test.method Some tests failed; see details above. Must select one file in the IDE or set test.class Must select one file in the IDE or set test.class Must select some method in the IDE or set test.method Must select one file in the IDE or set applet.url Must select one file in the IDE or set applet.url

RandomCircles/nbproject/genfiles.properties

build.xml.data.CRC32=70d75736 build.xml.script.CRC32=5db2fb24 [email protected] # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=70d75736 nbproject/build-impl.xml.script.CRC32=3fc3005f nbproject/[email protected]

RandomCircles/nbproject/private/private.properties

compile.on.save=true user.properties.file=C:\\Users\\cherbert\\AppData\\Roaming\\NetBeans\\7.3.1\\build.properties

RandomCircles/nbproject/private/private.xml

file:/C:/Users/cherbert/Desktop/NetBeansProjects/RandomRectangles/src/randomrectangles/RandomRectangles.java

RandomCircles/nbproject/project.properties

annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processor.options= annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: build.dir=build build.generated.dir=${build.dir}/generated build.generated.sources.dir=${build.dir}/generated-sources # Only compile against the classpath explicitly listed here: build.sysclasspath=ignore build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results # Uncomment to specify the preferred debugger connection transport: #debug.transport=dt_socket debug.classpath=\ ${run.classpath} debug.test.classpath=\ ${run.test.classpath} # This directory is removed when the project is cleaned: dist.dir=dist dist.jar=${dist.dir}/RandomRectangles.jar dist.javadoc.dir=${dist.dir}/javadoc excludes= includes=** jar.compress=false javac.classpath= # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false javac.processorpath=\ ${javac.classpath} javac.source=1.7 javac.target=1.7 javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir} javac.test.processorpath=\ ${javac.test.classpath} javadoc.additionalparam= javadoc.author=false javadoc.encoding=${source.encoding} javadoc.noindex=false javadoc.nonavbar=false javadoc.notree=false javadoc.private=false javadoc.splitindex=true javadoc.use=true javadoc.version=false javadoc.windowtitle= main.class=randomrectangles.RandomRectangles manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false platform.active=default_platform run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} # Space-separated list of JVM arguments used when running the project. # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. # To set system properties for unit tests define test-sys-prop.name=value: run.jvmargs= run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 src.dir=src test.src.dir=test

RandomCircles/nbproject/project.xml

org.netbeans.modules.java.j2seproject RandomRectangles

RandomCircles/out/production/RandomRectangles/randomrectangles/MyCanvas.class

package randomrectangles;
synchronized class MyCanvas extends java.awt.Canvas {
    public void MyCanvas();
    public void paint(java.awt.Graphics);
}

RandomCircles/out/production/RandomRectangles/randomrectangles/RandomRectangles.class

package randomrectangles;
public synchronized class RandomRectangles {
    public void RandomRectangles();
    public static void main(String[]);
}

RandomCircles/RandomRectangles.iml

RandomCircles/src/randomrectangles/RandomRectangles.java

RandomCircles/src/randomrectangles/RandomRectangles.java

/* RandomRectangles.Java
 * Computer Science 111, Fall 2013
 * Last edited Nov. 20, 2013 by C. Herbert
 *  
 * This code demonstrates a simplew example of some computer art work.  
 * It draws 100 random rectangles on the screen with a time delay between drawings.
 * 
 */  
package  randomrectangles ;

import  java . awt . * ;
import  java . util . concurrent . TimeUnit ;
import  javax . swing . * ;

public   class   RandomRectangles
{
         public   static   void  main ( String []  args )  
         {

         // create a MyCanvas object
         MyCanvas  canvas1  =   new   MyCanvas ();

         // set up a JFrame to hold the canvas
         JFrame  frame  =   new   JFrame ();
        frame . setTitle ( "Random rectangles" );
        frame . setSize ( 500 ,   500 );
        frame . setLocation ( 100 ,   100 );
        frame . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE );

         // add the canvas to the frame as a content panel
        frame . getContentPane (). add ( canvas1 );
        frame . setVisible ( true );
     }   // end main()

}   // end class

class   MyCanvas   extends   Canvas  
{

     public   MyCanvas ()  
     {   }    // end MyCanvas() constructor

     public   void  paint ( Graphics  graphics )  
     {
        
         int  r ;    // red Color factor
         int  g ;    // green Color factor
         int  b ;    // blue Color factor

         int  x ;    // x coordinate  to locate rectangle
         int  y ;    // y coordinate  to locate rectangle
        
         int  width ;    // width of rectangle
         int  height ;    // height of rectangle
         int  i ;   // loop counter
        
         // paint the canvas black
        graphics . setColor ( Color . BLACK );
        graphics . fillRect ( 0 ,   0 ,   500 ,   500 );
        
         for ( i = 1 ;   i <= 100 ;  i ++ )
         {         
             // randomly generate and set a color
            r  =   ( int )   ( Math . random ()   *   256 );
            g  =   ( int )   ( Math . random ()   *   256 );
            b  =   ( int )   ( Math . random ()   *   256 );
            graphics . setColor ( new   Color ( r ,  g ,  b ));

             // randomly generate and draw a rectangle
            x  =   ( int )   ( Math . random ()   *   500 );
            y  =   ( int )   ( Math . random ()   *   500 );
            width  =   ( int )   ( Math . random ()   *   250 );
            height  =   ( int )   ( Math . random ()   *   250 );
            graphics . drawRoundRect ( x ,  y ,  width ,  height ,   20 ,   20 );

             // The sleep command delays the drawing to make it more interesting
             // It must be in try-catch blocks for error handling (discussed in chap. 12)
             try  
             {
                 TimeUnit . MILLISECONDS . sleep ( 20 );
             }  
             catch   ( Exception  e )  
             {
                 System . out . println ( "Exception caught" );
             }


   
        
         }
        
     }    // end paint()
}   // end class MyCanvas

RandomRectangles/.idea/$PRODUCT_WORKSPACE_FILE$

1.8

RandomRectangles/.idea/misc.xml

RandomRectangles/.idea/modules.xml

RandomRectangles/.idea/workspace.xml

1574561311032 1574561311032

RandomRectangles/build.xml

Builds, tests, and runs the project RandomRectangles.

RandomRectangles/build/built-jar.properties

#Thu, 21 Nov 2013 21:33:29 -0500 C\:\\Users\\cherbert\\Desktop\\NetBeansProjects\\RandomRectangles=

RandomRectangles/build/classes/.netbeans_automatic_build

RandomRectangles/build/classes/.netbeans_update_resources

RandomRectangles/build/classes/randomrectangles/MyCanvas.class

package randomrectangles;
synchronized class MyCanvas extends java.awt.Canvas {
    public void MyCanvas();
    public void paint(java.awt.Graphics);
}

RandomRectangles/build/classes/randomrectangles/RandomRectangles.class

package randomrectangles;
public synchronized class RandomRectangles {
    public void RandomRectangles();
    public static void main(String[]);
}

RandomRectangles/manifest.mf

Manifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build

RandomRectangles/nbproject/build-impl.xml

Must set src.dir Must set test.src.dir Must set build.dir Must set dist.dir Must set build.classes.dir Must set dist.javadoc.dir Must set build.test.classes.dir Must set build.test.results.dir Must set build.classes.excludes Must set dist.jar Must set javac.includes No tests executed. Must set JVM to use for profiling in profiler.info.jvm Must set profiler agent JVM arguments in profiler.info.jvmargs.agent Must select some files in the IDE or set javac.includes To run this application from the command line without Ant, try: java -cp "${run.classpath.with.dist.jar}" ${main.class} To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" Must select one file in the IDE or set run.class Must select one file in the IDE or set run.class Must select one file in the IDE or set debug.class Must select one file in the IDE or set debug.class Must set fix.includes This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set profile.class This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set run.class Must select some files in the IDE or set test.includes Must select one file in the IDE or set run.class Must select one file in the IDE or set applet.url Must select some files in the IDE or set javac.includes Some tests failed; see details above. Must select some files in the IDE or set test.includes Some tests failed; see details above. Must select some files in the IDE or set test.class Must select some method in the IDE or set test.method Some tests failed; see details above. Must select one file in the IDE or set test.class Must select one file in the IDE or set test.class Must select some method in the IDE or set test.method Must select one file in the IDE or set applet.url Must select one file in the IDE or set applet.url

RandomRectangles/nbproject/genfiles.properties

build.xml.data.CRC32=70d75736 build.xml.script.CRC32=5db2fb24 [email protected] # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=70d75736 nbproject/build-impl.xml.script.CRC32=3fc3005f nbproject/[email protected]

RandomRectangles/nbproject/private/private.properties

compile.on.save=true user.properties.file=C:\\Users\\cherbert\\AppData\\Roaming\\NetBeans\\7.3.1\\build.properties

RandomRectangles/nbproject/private/private.xml

file:/C:/Users/cherbert/Desktop/NetBeansProjects/RandomRectangles/src/randomrectangles/RandomRectangles.java

RandomRectangles/nbproject/project.properties

annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processor.options= annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: build.dir=build build.generated.dir=${build.dir}/generated build.generated.sources.dir=${build.dir}/generated-sources # Only compile against the classpath explicitly listed here: build.sysclasspath=ignore build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results # Uncomment to specify the preferred debugger connection transport: #debug.transport=dt_socket debug.classpath=\ ${run.classpath} debug.test.classpath=\ ${run.test.classpath} # This directory is removed when the project is cleaned: dist.dir=dist dist.jar=${dist.dir}/RandomRectangles.jar dist.javadoc.dir=${dist.dir}/javadoc excludes= includes=** jar.compress=false javac.classpath= # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false javac.processorpath=\ ${javac.classpath} javac.source=1.7 javac.target=1.7 javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir} javac.test.processorpath=\ ${javac.test.classpath} javadoc.additionalparam= javadoc.author=false javadoc.encoding=${source.encoding} javadoc.noindex=false javadoc.nonavbar=false javadoc.notree=false javadoc.private=false javadoc.splitindex=true javadoc.use=true javadoc.version=false javadoc.windowtitle= main.class=randomrectangles.RandomRectangles manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false platform.active=default_platform run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} # Space-separated list of JVM arguments used when running the project. # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. # To set system properties for unit tests define test-sys-prop.name=value: run.jvmargs= run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 src.dir=src test.src.dir=test

RandomRectangles/nbproject/project.xml

org.netbeans.modules.java.j2seproject RandomRectangles

RandomRectangles/out/production/RandomRectangles/randomrectangles/MyCanvas.class

package randomrectangles;
synchronized class MyCanvas extends java.awt.Canvas {
    public void MyCanvas();
    public void paint(java.awt.Graphics);
}

RandomRectangles/out/production/RandomRectangles/randomrectangles/RandomRectangles.class

package randomrectangles;
public synchronized class RandomRectangles {
    public void RandomRectangles();
    public static void main(String[]);
}

RandomRectangles/RandomRectangles.iml

RandomRectangles/src/randomrectangles/RandomRectangles.java

RandomRectangles/src/randomrectangles/RandomRectangles.java

/* RandomRectangles.Java
 * Computer Science 111, Fall 2013
 * Last edited Nov. 20, 2013 by C. Herbert
 *  
 * This code demonstrates a simplew example of some computer art work.  
 * It draws 100 random rectangles on the screen with a time delay between drawings.
 * 
 */  
package  randomrectangles ;

import  java . awt . * ;
import  java . util . concurrent . TimeUnit ;
import  javax . swing . * ;

public   class   RandomRectangles
{
         public   static   void  main ( String []  args )  
         {

         // create a MyCanvas object
         MyCanvas  canvas1  =   new   MyCanvas ();

         // set up a JFrame to hold the canvas
         JFrame  frame  =   new   JFrame ();
        frame . setTitle ( "Random rectangles" );
        frame . setSize ( 500 ,   500 );
        frame . setLocation ( 100 ,   100 );
        frame . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE );

         // add the canvas to the frame as a content panel
        frame . getContentPane (). add ( canvas1 );
        frame . setVisible ( true );
     }   // end main()

}   // end class

class   MyCanvas   extends   Canvas  
{

     public   MyCanvas ()  
     {   }    // end MyCanvas() constructor

     public   void  paint ( Graphics  graphics )  
     {
        
         int  r ;    // red Color factor
         int  g ;    // green Color factor
         int  b ;    // blue Color factor

         int  x ;    // x coordinate  to locate rectangle
         int  y ;    // y coordinate  to locate rectangle
        
         int  width ;    // width of rectangle
         int  height ;    // height of rectangle
         int  i ;   // loop counter
        
         // paint the canvas black
        graphics . setColor ( Color . BLACK );
        graphics . fillRect ( 0 ,   0 ,   500 ,   500 );
        
         for ( i = 1 ;   i <= 100 ;  i ++ )
         {         
             // randomly generate and set a color
            r  =   ( int )   ( Math . random ()   *   256 );
            g  =   ( int )   ( Math . random ()   *   256 );
            b  =   ( int )   ( Math . random ()   *   256 );
            graphics . setColor ( new   Color ( r ,  g ,  b ));

             // randomly generate and draw a rectangle
            x  =   ( int )   ( Math . random ()   *   500 );
            y  =   ( int )   ( Math . random ()   *   500 );
            width  =   ( int )   ( Math . random ()   *   250 );
            height  =   ( int )   ( Math . random ()   *   250 );
            graphics . drawRoundRect ( x ,  y ,  width ,  height ,   20 ,   20 );

             // The sleep command delays the drawing to make it more interesting
             // It must be in try-cathc blocks for error handling (discussed in chap. 12)
             try  
             {
                 TimeUnit . MILLISECONDS . sleep ( 20 );
             }  
             catch   ( Exception  e )  
             {
                 System . out . println ( "Exception caught" );
             }


   
        
         }
        
     }    // end paint()
}   // end class MyCanvas

RandomRoses/.idea/$PRODUCT_WORKSPACE_FILE$

1.8

RandomRoses/.idea/libraries/RandomRoses.xml

RandomRoses/.idea/misc.xml

RandomRoses/.idea/modules.xml

RandomRoses/.idea/workspace.xml

1574562497405 1574562497405

RandomRoses/build.xml

Builds, tests, and runs the project RandomRoses.

RandomRoses/build/built-jar.properties

#Fri, 22 Nov 2013 09:12:16 -0500 C\:\\Users\\cherbert\\Desktop\\NetBeansProjects\\RandomRoses=

RandomRoses/build/classes/.netbeans_automatic_build

RandomRoses/build/classes/.netbeans_update_resources

RandomRoses/build/classes/randomroses/RandomRoses.class

package randomroses;
public synchronized class RandomRoses {
    public void RandomRoses();
    public static void main(String[]);
}

RandomRoses/build/classes/randomroses/RoseCanvas.class

package randomroses;
synchronized class RoseCanvas extends java.awt.Canvas {
    double x1;
    double y1;
    double x2;
    double y2;
    double value;
    int xAdjust;
    int yAdjust;
    double factor;
    String messageString;
    String inputString;
    String title;
    public void RoseCanvas();
    public void paint(java.awt.Graphics);
}

RandomRoses/dist/RandomRoses.jar

META-INF/MANIFEST.MF

Manifest-Version: 1.0 Ant-Version: Apache Ant 1.8.4 Created-By: 1.7.0_25-b16 (Oracle Corporation) Class-Path: X-COMMENT: Main-Class will be added automatically by build Main-Class: randomroses.RandomRoses

randomroses/RandomRoses.class

package randomroses;
public synchronized class RandomRoses {
    public void RandomRoses();
    public static void main(String[]);
}

randomroses/RoseCanvas.class

package randomroses;
synchronized class RoseCanvas extends java.awt.Canvas {
    double x1;
    double y1;
    double x2;
    double y2;
    double value;
    int xAdjust;
    int yAdjust;
    double factor;
    String messageString;
    String inputString;
    String title;
    public void RoseCanvas();
    public void paint(java.awt.Graphics);
}

RandomRoses/dist/README.TXT

======================== BUILD OUTPUT DESCRIPTION ======================== When you build an Java application project that has a main class, the IDE automatically copies all of the JAR files on the projects classpath to your projects dist/lib folder. The IDE also adds each of the JAR files to the Class-Path element in the application JAR files manifest file (MANIFEST.MF). To run the project from the command line, go to the dist folder and type the following: java -jar "RandomRoses.jar" To distribute this project, zip up the dist folder (including the lib folder) and distribute the ZIP file. Notes: * If two JAR files on the project classpath have the same name, only the first JAR file is copied to the lib folder. * Only JAR files are copied to the lib folder. If the classpath contains other types of files or folders, these files (folders) are not copied. * If a library on the projects classpath also has a Class-Path element specified in the manifest,the content of the Class-Path element has to be on the projects runtime path. * To set a main class in a standard Java project, right-click the project node in the Projects window and choose Properties. Then click Run and enter the class name in the Main Class field. Alternatively, you can manually type the class name in the manifest Main-Class element.

RandomRoses/manifest.mf

Manifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build

RandomRoses/nbproject/build-impl.xml

Must set src.dir Must set test.src.dir Must set build.dir Must set dist.dir Must set build.classes.dir Must set dist.javadoc.dir Must set build.test.classes.dir Must set build.test.results.dir Must set build.classes.excludes Must set dist.jar Must set javac.includes No tests executed. Must set JVM to use for profiling in profiler.info.jvm Must set profiler agent JVM arguments in profiler.info.jvmargs.agent Must select some files in the IDE or set javac.includes To run this application from the command line without Ant, try: java -cp "${run.classpath.with.dist.jar}" ${main.class} To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" Must select one file in the IDE or set run.class Must select one file in the IDE or set run.class Must select one file in the IDE or set debug.class Must select one file in the IDE or set debug.class Must set fix.includes This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set profile.class This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set run.class Must select some files in the IDE or set test.includes Must select one file in the IDE or set run.class Must select one file in the IDE or set applet.url Must select some files in the IDE or set javac.includes Some tests failed; see details above. Must select some files in the IDE or set test.includes Some tests failed; see details above. Must select some files in the IDE or set test.class Must select some method in the IDE or set test.method Some tests failed; see details above. Must select one file in the IDE or set test.class Must select one file in the IDE or set test.class Must select some method in the IDE or set test.method Must select one file in the IDE or set applet.url Must select one file in the IDE or set applet.url

RandomRoses/nbproject/genfiles.properties

build.xml.data.CRC32=52f38985 build.xml.script.CRC32=dc31ab1b [email protected] # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=52f38985 nbproject/build-impl.xml.script.CRC32=b963e43f nbproject/[email protected]

RandomRoses/nbproject/private/private.properties

compile.on.save=true user.properties.file=C:\\Users\\cherbert\\AppData\\Roaming\\NetBeans\\7.3.1\\build.properties

RandomRoses/nbproject/private/private.xml

file:/C:/Users/cherbert/Desktop/NetBeansProjects/RandomRoses/src/randomroses/RandomRoses.java

RandomRoses/nbproject/project.properties

annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processor.options= annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: build.dir=build build.generated.dir=${build.dir}/generated build.generated.sources.dir=${build.dir}/generated-sources # Only compile against the classpath explicitly listed here: build.sysclasspath=ignore build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results # Uncomment to specify the preferred debugger connection transport: #debug.transport=dt_socket debug.classpath=\ ${run.classpath} debug.test.classpath=\ ${run.test.classpath} # This directory is removed when the project is cleaned: dist.dir=dist dist.jar=${dist.dir}/RandomRoses.jar dist.javadoc.dir=${dist.dir}/javadoc excludes= includes=** jar.compress=false javac.classpath= # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false javac.processorpath=\ ${javac.classpath} javac.source=1.7 javac.target=1.7 javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir} javac.test.processorpath=\ ${javac.test.classpath} javadoc.additionalparam= javadoc.author=false javadoc.encoding=${source.encoding} javadoc.noindex=false javadoc.nonavbar=false javadoc.notree=false javadoc.private=false javadoc.splitindex=true javadoc.use=true javadoc.version=false javadoc.windowtitle= main.class=randomroses.RandomRoses manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false platform.active=default_platform run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} # Space-separated list of JVM arguments used when running the project. # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. # To set system properties for unit tests define test-sys-prop.name=value: run.jvmargs= run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 src.dir=src test.src.dir=test

RandomRoses/nbproject/project.xml

org.netbeans.modules.java.j2seproject RandomRoses

RandomRoses/out/production/RandomRoses/randomroses/RandomRoses.class

package randomroses;
public synchronized class RandomRoses {
    public void RandomRoses();
    public static void main(String[]);
}

RandomRoses/out/production/RandomRoses/randomroses/RoseCanvas.class

package randomroses;
synchronized class RoseCanvas extends java.awt.Canvas {
    double x1;
    double y1;
    double x2;
    double y2;
    double value;
    int xAdjust;
    int yAdjust;
    double factor;
    String messageString;
    String inputString;
    String title;
    public void RoseCanvas();
    public void paint(java.awt.Graphics);
}

RandomRoses/RandomRoses.iml

RandomRoses/src/randomroses/RandomRoses.java

RandomRoses/src/randomroses/RandomRoses.java

/* CosineRose.Java
 * Computer Science 111, Fall 2013
 * Last edited Nov. 20, 2013 by C. Herbert

 * This code draws 100 random cosine roses in aJFrame 
 * using Java Graphics class objects.
 * 
  */
package  randomroses ;

import  java . awt . * ;
import  java . util . concurrent . TimeUnit ;
import  javax . swing . * ;

public   class   RandomRoses  
{

     public   static   void  main ( String []  args )  
     {

         // create a RoseCanvas object
         RoseCanvas  canvas1  =   new   RoseCanvas ();

         // set up a JFrame to hold the canvas
         JFrame  frame  =   new   JFrame ();
        frame . setTitle ( "Random Cosine Roses" );
        frame . setSize ( 500 ,   500 );
        frame . setLocation ( 200 ,   200 );
        frame . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE );


         // add the canvas to the frame as a content panel
        frame . getContentPane (). add ( canvas1 );
        frame . setVisible ( true );
     }   // end main()
}   // end class

class   RoseCanvas   extends   Canvas  
{

     double  x1 ;        // x coordinate for point 1
     double  y1 ;        // y coordinate for point 1
     double  x2 ;        // x coordinate for point 2
     double  y2 ;        // y coordinate for point 2
     double  value ;     // value of the function to be graphed
     int  xAdjust  =   250 ;    // these two factor are used to adjust the position 
     int  yAdjust  =   250 ;    // of the graph on the canvas
     double  factor ;        // the "factor" allowxthe user to alter the image.
     String  messageString ;     // a string for prompt in the input message box
     String  inputString ;       // a String to capture the input 
     String  title ;     // title for the canvas

     // // RoseCanvas() constructor
     public   RoseCanvas ()  
     {    }

     public   void  paint ( Graphics  graphics )  
     {
         double  i ;         // a loop counter
         int  r ;    // red Color factor
         int  g ;    // green Color factor
         int  b ;    // blue Color factor
         int  times ;        // number of times the program is repesated

         for   ( times  =   1 ;  times  <=   100 ;  times ++ )  
         {
                  // paint the canvas black
            graphics . setColor ( Color . BLACK );
            graphics . fillRect ( 0 ,   0 ,   500 ,   500 );

            factor  =   ( int )   ( Math . random ()   *   20 );

             // randomly generate and set a color
            r  =   ( int )   ( Math . random ()   *   256 );
            g  =   ( int )   ( Math . random ()   *   256 );
            b  =   ( int )   ( Math . random ()   *   256 );
            graphics . setColor ( new   Color ( r ,  g ,  b ));

             // set x to 0; calculate 100 * the sine for the first x value; 

            x1  =   200.0   *   Math . cos ( factor  *   Math . toRadians ( 0 ))   *   Math . sin ( Math . toRadians ( 0 ));
            y1  =   200.0   *   Math . cos ( factor  *   Math . toRadians ( 0 ))   *   Math . cos ( Math . toRadians ( 0 ));

             // go through 360 degrees
             for   ( =   0.0 ;  i  <=   360.0 ;  i ++ )  
             {
                 // calculate the x and y coordinates for each degree
                 // 200 is aan offeste for where to draw the curve

                x2  =   200.0   *   Math . cos ( factor  *   Math . toRadians ( i ))   *   Math . sin ( Math . toRadians ( i ));
                y2  =   200.0   *   Math . cos ( factor  *   Math . toRadians ( i ))   *   Math . cos ( Math . toRadians ( i ));

                 // The sleep command delays the drawing to make it more interesting
                 // It must be in try-cathc blocks for error handling (discussed in chap. 12)
                 try  
                 {
                     TimeUnit . MILLISECONDS . sleep ( 10 );
                 }  
                 catch   ( Exception  e )  
                 {
                     System . out . println ( "Exception caught" );
                 }

                 // draw a line from (x1,y1) to (x2,y2)
                 // xadjust and yasjust position the graph
                 // the subtraction for y is because of inverted  cartesian coordinates
                graphics . drawLine ( xAdjust  +   ( int )  x1 ,  yAdjust  -   ( int )  y1 ,  xAdjust  +   ( int )  x2 ,  yAdjust  -   ( int )  y2 );

                 // update new first point (x1, y1) to be old second point(x2, y2)
                x1  =  x2 ;
                y1  =  y2 ;

             }   // end for  
         }   //end while
    
     }    // end paint()
}   // end class MyCanvas

SineCurve/.idea/$PRODUCT_WORKSPACE_FILE$

1.8

SineCurve/.idea/misc.xml

SineCurve/.idea/modules.xml

SineCurve/.idea/workspace.xml

1574562809890 1574562809890

SineCurve/build.xml

Builds, tests, and runs the project SineCurve.

SineCurve/build/built-jar.properties

#Fri, 22 Nov 2013 08:08:23 -0500 C\:\\Users\\cherbert\\Desktop\\NetBeansProjects\\SineCurve=

SineCurve/build/classes/.netbeans_automatic_build

SineCurve/build/classes/.netbeans_update_resources

SineCurve/build/classes/objects$SineCurve.class

public synchronized class objects$SineCurve {
    public void objects$SineCurve(objects);
    public static void main(String[]);
}

SineCurve/build/classes/sinecurve/MyCanvas.class

package sinecurve;
synchronized class MyCanvas extends java.awt.Canvas {
    public void MyCanvas();
    public void paint(java.awt.Graphics);
}

SineCurve/build/classes/sinecurve/SineCurve.class

package sinecurve;
public synchronized class SineCurve {
    public void SineCurve();
    public static void main(String[]);
}

SineCurve/manifest.mf

Manifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build

SineCurve/nbproject/build-impl.xml

Must set src.dir Must set test.src.dir Must set build.dir Must set dist.dir Must set build.classes.dir Must set dist.javadoc.dir Must set build.test.classes.dir Must set build.test.results.dir Must set build.classes.excludes Must set dist.jar Must set javac.includes No tests executed. Must set JVM to use for profiling in profiler.info.jvm Must set profiler agent JVM arguments in profiler.info.jvmargs.agent Must select some files in the IDE or set javac.includes To run this application from the command line without Ant, try: java -cp "${run.classpath.with.dist.jar}" ${main.class} To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" Must select one file in the IDE or set run.class Must select one file in the IDE or set run.class Must select one file in the IDE or set debug.class Must select one file in the IDE or set debug.class Must set fix.includes This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set profile.class This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set run.class Must select some files in the IDE or set test.includes Must select one file in the IDE or set run.class Must select one file in the IDE or set applet.url Must select some files in the IDE or set javac.includes Some tests failed; see details above. Must select some files in the IDE or set test.includes Some tests failed; see details above. Must select some files in the IDE or set test.class Must select some method in the IDE or set test.method Some tests failed; see details above. Must select one file in the IDE or set test.class Must select one file in the IDE or set test.class Must select some method in the IDE or set test.method Must select one file in the IDE or set applet.url Must select one file in the IDE or set applet.url

SineCurve/nbproject/genfiles.properties

build.xml.data.CRC32=171396c5 build.xml.script.CRC32=208f7f65 [email protected] # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=171396c5 nbproject/build-impl.xml.script.CRC32=bc615b20 nbproject/[email protected]

SineCurve/nbproject/private/private.properties

compile.on.save=true user.properties.file=C:\\Users\\cherbert\\AppData\\Roaming\\NetBeans\\7.3.1\\build.properties

SineCurve/nbproject/private/private.xml

file:/C:/Users/cherbert/Desktop/NetBeansProjects/SineCurve/src/sinecurve/SineCurve.java

SineCurve/nbproject/project.properties

annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processor.options= annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: build.dir=build build.generated.dir=${build.dir}/generated build.generated.sources.dir=${build.dir}/generated-sources # Only compile against the classpath explicitly listed here: build.sysclasspath=ignore build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results # Uncomment to specify the preferred debugger connection transport: #debug.transport=dt_socket debug.classpath=\ ${run.classpath} debug.test.classpath=\ ${run.test.classpath} # This directory is removed when the project is cleaned: dist.dir=dist dist.jar=${dist.dir}/SineCurve.jar dist.javadoc.dir=${dist.dir}/javadoc excludes= includes=** jar.compress=false javac.classpath= # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false javac.processorpath=\ ${javac.classpath} javac.source=1.7 javac.target=1.7 javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir} javac.test.processorpath=\ ${javac.test.classpath} javadoc.additionalparam= javadoc.author=false javadoc.encoding=${source.encoding} javadoc.noindex=false javadoc.nonavbar=false javadoc.notree=false javadoc.private=false javadoc.splitindex=true javadoc.use=true javadoc.version=false javadoc.windowtitle= main.class=sinecurve.SineCurve manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false platform.active=default_platform run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} # Space-separated list of JVM arguments used when running the project. # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. # To set system properties for unit tests define test-sys-prop.name=value: run.jvmargs= run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 src.dir=src test.src.dir=test

SineCurve/nbproject/project.xml

org.netbeans.modules.java.j2seproject SineCurve

SineCurve/out/production/SineCurve/sinecurve/MyCanvas.class

package sinecurve;
synchronized class MyCanvas extends java.awt.Canvas {
    public void MyCanvas();
    public void paint(java.awt.Graphics);
}

SineCurve/out/production/SineCurve/sinecurve/SineCurve.class

package sinecurve;
public synchronized class SineCurve {
    public void SineCurve();
    public static void main(String[]);
}

SineCurve/SineCurve.iml

SineCurve/src/sinecurve/SineCurve.java

SineCurve/src/sinecurve/SineCurve.java

/* SineCurve.Java
 * Computer Science 111, Fall 2013
 * 
 * This code demonstrates a simplew example of some computer art work.  
 * It plots asign curve on the screen with a time delay to slow the plotting.
 */  

package  sinecurve ;

import  java . awt . * ;
import  java . util . concurrent . TimeUnit ;
import  javax . swing . * ;

public   class   SineCurve
{
         public   static   void  main ( String []  args )  
         {

         // create a MyCanvas object
         MyCanvas  canvas1  =   new   MyCanvas ();

         // set up a JFrame to hold the canvas
         JFrame  frame  =   new   JFrame ();
        frame . setTitle ( "Sine curve   0 to 360 degrees" );
        frame . setSize ( 500 ,   400 );
        frame . setLocation ( 100 ,   100 );
        frame . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE );

         // add the canvas to the frame as a content panel
        frame . getContentPane (). add ( canvas1 );
        frame . setVisible ( true );
     }   // end main()

}   // end class

class   MyCanvas   extends   Canvas  
{

     public   MyCanvas ()  
     {   }    // end MyCanvas() constructor

     public   void  paint ( Graphics  graphics )  
     {
         double  x1 ;        // x coordinate for point 1
         double  y1 ;        // y coordinate for point 1
        
         double  x2 ;        // x coordinate for point 2
         double  y2 ;        // y coordinate for point 2

         int  xAdjust  =   50 ;      // these two factor are used to adjust the position 
         int  yAdjust  =   200 ;      // of the graph on the canvas
        
         // paint the canvas white
        graphics . setColor ( Color . WHITE );
        graphics . fillRect ( 0 ,   0 ,   500 ,   500 );

         // draw a base line 
        graphics . setColor ( Color . BLACK );
        graphics . drawLine ( 20 ,   200 ,   450 ,   200 );

         // add a few labels
        graphics . setFont ( new   Font ( "Arial" ,   Font . PLAIN ,   12 ));
        graphics . drawString ( "0" ,   48 ,   220 );
        graphics . drawString ( "180" ,   220 ,   220 );
        graphics . drawString ( "360" ,   400 ,   220 );

         // put titles on the Canvas
        graphics . setColor ( Color . BLUE );
        graphics . setFont ( new   Font ( "Arial" ,   Font . BOLD ,   18 ));
        graphics . drawString ( "Sine Curve" ,   200 ,   50 );
        graphics . setFont ( new   Font ( "Arial" ,   Font . BOLD ,   14 ));
        graphics . drawString ( "0 to 360 Degrees" ,   190 ,   70 );
        
         // draw the curve
         // set x1 to 0; calculate 100 * the sine for the first x value; 
        x1  =   0 ;
        y1  =    100.0   *   Math . sin (   Math . toRadians ( x1 )   );
        
         // go through 360 degrees
         for ( x2  = 0.0 ;  x2  <= 360.0 ;  x2 ++ )
         {
             // calculate the 100 * y coordinate for each vlaue of x 
             // 200 is an offeste for where to draw the curve
            y2  =   100.0   *   Math . sin (   Math . toRadians ( x2 )   );
           
             // draw a line from (x1,y1) to (x2,y2)
             // xadjust and yasjust position the graph
             // the subtraction for y is because of inverted  cartesian coordinates
            graphics . drawLine ( xAdjust  + ( int ) x1 ,  yAdjust  - ( int ) y1 ,  xAdjust  + ( int ) x2 ,  yAdjust - ( int ) y2 );
        
            // update the next (x1,y1) to be the previous (x2,y2)
           x1 =  x2 ;
           y1 = y2 ;
// The sleep command delays the drawing to make it more interesting
             // It must be in try-cathc blocks for error handling (discussed in chap. 12)
             try
             {
                 TimeUnit . MILLISECONDS . sleep ( 20 );
             }
             catch   ( Exception  e )
             {
                 System . out . println ( "Exception caught" );
             }



         }   // end for  
     
     }    // end paint()
}   // end class MyCanvas

ThreeRectangles/build.xml

Builds, tests, and runs the project ThreeRectangles.

ThreeRectangles/build/classes/.netbeans_automatic_build

ThreeRectangles/build/classes/.netbeans_update_resources

ThreeRectangles/build/classes/threerectangles/MyCanvas.class

package threerectangles;
synchronized class MyCanvas extends java.awt.Canvas {
    public void MyCanvas();
    public void paint(java.awt.Graphics);
}

ThreeRectangles/build/classes/threerectangles/ThreeRectangles.class

package threerectangles;
public synchronized class ThreeRectangles {
    public void ThreeRectangles();
    public static void main(String[]);
}

ThreeRectangles/manifest.mf

Manifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build

ThreeRectangles/nbproject/build-impl.xml

Must set src.dir Must set test.src.dir Must set build.dir Must set dist.dir Must set build.classes.dir Must set dist.javadoc.dir Must set build.test.classes.dir Must set build.test.results.dir Must set build.classes.excludes Must set dist.jar Must set javac.includes No tests executed. Must set JVM to use for profiling in profiler.info.jvm Must set profiler agent JVM arguments in profiler.info.jvmargs.agent Must select some files in the IDE or set javac.includes To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" Must select one file in the IDE or set run.class Must select one file in the IDE or set run.class Must select one file in the IDE or set debug.class Must select one file in the IDE or set debug.class Must set fix.includes This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set profile.class This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set run.class Must select some files in the IDE or set test.includes Must select one file in the IDE or set run.class Must select one file in the IDE or set applet.url Must select some files in the IDE or set javac.includes Some tests failed; see details above. Must select some files in the IDE or set test.includes Some tests failed; see details above. Must select some files in the IDE or set test.class Must select some method in the IDE or set test.method Some tests failed; see details above. Must select one file in the IDE or set test.class Must select one file in the IDE or set test.class Must select some method in the IDE or set test.method Must select one file in the IDE or set applet.url Must select one file in the IDE or set applet.url

ThreeRectangles/nbproject/genfiles.properties

build.xml.data.CRC32=3fdcaddf build.xml.script.CRC32=f44c2bcc [email protected] # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=3fdcaddf nbproject/build-impl.xml.script.CRC32=6ea6aca9 nbproject/[email protected]

ThreeRectangles/nbproject/private/private.properties

compile.on.save=true user.properties.file=C:\\Users\\user\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties

ThreeRectangles/nbproject/private/private.xml

file:/C:/Users/user/Documents/NetBeansProjects/ThreeRectangles/src/threerectangles/ThreeRectangles.java

ThreeRectangles/nbproject/project.properties

annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processor.options= annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: build.dir=build build.generated.dir=${build.dir}/generated build.generated.sources.dir=${build.dir}/generated-sources # Only compile against the classpath explicitly listed here: build.sysclasspath=ignore build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results # Uncomment to specify the preferred debugger connection transport: #debug.transport=dt_socket debug.classpath=\ ${run.classpath} debug.test.classpath=\ ${run.test.classpath} # This directory is removed when the project is cleaned: dist.dir=dist dist.jar=${dist.dir}/ThreeRectangles.jar dist.javadoc.dir=${dist.dir}/javadoc excludes= includes=** jar.compress=false javac.classpath= # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false javac.processorpath=\ ${javac.classpath} javac.source=1.7 javac.target=1.7 javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir} javac.test.processorpath=\ ${javac.test.classpath} javadoc.additionalparam= javadoc.author=false javadoc.encoding=${source.encoding} javadoc.noindex=false javadoc.nonavbar=false javadoc.notree=false javadoc.private=false javadoc.splitindex=true javadoc.use=true javadoc.version=false javadoc.windowtitle= main.class=threerectangles.ThreeRectangles manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false platform.active=default_platform run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} # Space-separated list of JVM arguments used when running the project. # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. # To set system properties for unit tests define test-sys-prop.name=value: run.jvmargs= run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 src.dir=src test.src.dir=test

ThreeRectangles/nbproject/project.xml

org.netbeans.modules.java.j2seproject ThreeRectangles

ThreeRectangles/src/threerectangles/ThreeRectangles.java

ThreeRectangles/src/threerectangles/ThreeRectangles.java

/* ThreeRectangles.java
 * last edited Nov. 15, 2013 by C.Herbert
 * 
 * This code demonstrates the creation of a canvas subclass for drawing
 * by overriding the paint method() in the subclass.
 * 
 * The main() method displays the canvas with our graphihcs in a JFrame.
 * 
  * The paint() method draws three rectangles on MyCanvas objects. The rectangles 
 * increase in size. The center rectangle is filled.

 */
package  threerectangles ;
import  java . awt . * ;
import  javax . swing . * ;

public   class   ThreeRectangles   {

     public   static   void  main ( String []  args )  
     {
        
         // create a MyCanvas object
         MyCanvas  canvas1  =   new   MyCanvas ();
        
         // set up a JFrame tpo hold the canvas
         JFrame  frame  =   new   JFrame ();
        frame . setTitle ( "Three Rectangles" );
        frame . setSize ( 300 ,   300 );
        frame . setLocation ( 200 ,   200 );
        frame . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE );
    
         // add the canvas to the frame as a content panel
        frame . getContentPane (). add ( canvas1 );
        frame . setVisible ( true );
    
     }   // end main()
  
}   // end class ThreeRectangles


class   MyCanvas   extends   Canvas  
{
     public   MyCanvas ()  
     {
     }    // end MyCanvas() constructor
 
     public   void  paint ( Graphics  graphics )  
     {
        graphics . setColor ( Color . red );
        graphics . drawRect ( 10 ,   10 ,   110 ,   110 );
        
        graphics . setColor ( Color . green );
        graphics . fillRect ( 35 ,   35 ,   135 ,   135 );
        
        graphics . setColor ( Color . blue );
        graphics . drawRect ( 60 ,   60 ,   160 ,   160 );
     }    // end paint()

}   // end class MyCanvas