Your instructor will assign one or more of the following problems. Submit all appropriate files for grading, including code files, screen captures, supplemental files (e.g., image files), and text files.

  1. Add a GUI controller panel to your encapsulated Processing sketch from homework 8a. You can choose the aspects of your sketch that the panel controls, but you should have at least two control widgets (e.g., two buttons or a button and a text field).

  2. Add a GUI controller panel to the image processor from Lab/Homework 5a (Chimp). You can choose the aspects of your sketch that the panel controls, but you should have at least two control widgets (e.g., two buttons or a button and a text field).

  3. Implement an HSB color chooser such as the one shown here.

    simple HSB color chooser

    You should start by building a simple Processing application that sets its background to the HSB values (you can find a discussion of HSB color). You should then encapsulate your Processing application inside of a Java GUI application.

  4. Extend the Expanding figure example in the text to include the simple button-based controller shown here.

    a simple expanding figure GUI controller

    When pressed, the “Restart” button should start automatically start the default circle growing in the middle of the screen. The “Clear” button should clear the output panel with a white background.

  5. Create an animation controller such as the one shown here.

    a simple expanding figure GUI controller

    Base your application on the Processing-based animation controller from Lab 6.

    This assignment requires that you load filenames in Java, which requires a different approach from loading them in Processing. You can use the following methods:

    private URI getPath(String relativePath) throws URISyntaxException {
    	return AnimationSimplePanel.class.getResource(relativePath).toURI();
    }
    	
    private String[] getImageFilenames(URI path) {
    	File file = new File(path);
    	if (file.isDirectory()) {
    		FilenameFilter filter = new FilenameFilter() {
    			public boolean accept(File dir, String name) {
    				return !name.startsWith(".");
    			}
    		};
    		String names[] = file.list(filter);
    		return names;
    	} else {
    		return null;
    	}
    }
    

    which allow you go load your image files using the following code segement:

    URI path = getPath("relativePathToImageFiles"); 
    String[] filenames = getImageFilenames(path);