Computer Science 120
Introduction to Programming

Fall 2011, Siena College

Arcs Demo

A working demo of Arcs will appear below. Click inside the applet to interact with it.



Arcs BlueJ Project

Click here to download a BlueJ project for Arcs.


Arcs Source Code

The Java source code for Arcs is below. Click on a file name to download it.


Arcs.java

import objectdraw.*;
import java.awt.*;

/*
 * Example Arcs
 *
 * Jim Teresco, Siena College, CSIS 120, Fall 2011
 *
 * $Id: Arcs.java 1516 2011-01-31 21:08:19Z terescoj $
 */

public class Arcs extends WindowController {

    public void begin() {

        // just draw a couple of FilledArc and FramedArc objects to
        // get an idea how to use them.

        // a red one with a start angle of 45, arc angle of 90
        new FramedArc(100, 100, 100, 100, 45, 90, canvas).setColor(Color.red);
        

        // a blue one with a start angle of 180, arc angle of 45
        new FramedArc(220, 100, 100, 100, 180, 45, canvas).setColor(Color.blue);

        // a green filled one with a start angle of 0, arc angle of 100
        new FilledArc(100, 220, 100, 100, 0, 200, canvas).setColor(Color.green);

        // a yellow one with a start angle of 60, arc angle of 300 (PacMan!)
        new FilledArc(220, 220, 100, 100, 60, 300, canvas).setColor(Color.yellow);
    }
}