/**
 * A driver that can be used to test the classes in the
 * screen play application.
 */
public class MyWonderfulProfessor
{
    /**
     * The entry point of the application
     *
     * @param args  The command line arguments (which are ignored)
     */
    public static void main(String[] args)
    {
       Screenplay         mwp;
       Set                office, outside;       

       // Construct the Screenplay
       mwp     = new Screenplay("My Wonderful Professor");

       // Construct the two Set objects that are needed
       office  = new Set("JMU office",           Location.INTERIOR);
       outside = new Set("The CS/ISAT building", Location.EXTERIOR);
       
       
       // Add elements to the Screenplay
       mwp.add(Transition.FADE_IN);

       mwp.add(new SceneDescription(office, TimeOfDay.DAY));

       mwp.add(new Dialogue("Fred",
                            false, 
                            true, 
                            "", 
                            Voicing.NORMAL,
                            "I wonder if you can help me.  My program is "+
                            "practically working. All I have to do is"));

       mwp.add(new Dialogue("Prof. Harbern",
                            "Of course I can help, that's what "+
                            "I'm here for."));

       mwp.add(new Dialogue("Prof. Harbern",
                            false,
                            false,
                            "to offscreen",
                            Voicing.NORMAL,
                            "Bob, please hold all of my calls.  I need "+
                            "to focus my attention on Fred."));
       
       mwp.add(new Dialogue("Bob",
                            false,
                            false,
                            "",
                            Voicing.OFF_SCREEN,
                            "Of course, Prof. Harbern."));
       
       mwp.add(new Dialogue("Fred",
                            true,
                            true,
                            "",
                            Voicing.NORMAL,
                            "All I have to do is fix 4 or 5 methods in one "+
                            "class and write 7 other classes and the driver. "+
                            "Of course..."));

       mwp.add(new StageDirection("Prof. Harbern walks around the desk "+
                                  "to look at Fred's laptop.  The look on "+
                                  "Prof. Harbern's face can only be "+
                                  "described as nurturing."));

       mwp.add(new Dialogue("Prof. Harbern", 
                            "You're right, you are practically done.  "+
                            "Why don't you compile and execute what you "+
                            "have so I can see what's going on."));
       
       mwp.add(new Dialogue("Fred",
                            true,
                            false,
                            "",
                            Voicing.NORMAL,
                            "Nothing compiles yet, but that's because "+
                            "Java is all messed up.  It keeps telling me "+
                            "that there is a problem with my cymbal or "+
                            "bass drum or something.  And, I'm not even "+
                            "using any cymbals or drums."));
       
       mwp.add(new Dialogue("Prof. Harbern", 
                            false,
                            true,
                            "",
                            Voicing.NORMAL,
                            "Java often makes mistakes about percussion "+
                            "instruments.  Let's see..."));
       
       mwp.add(new StageDirection("Prof. Harbern compiles Fred's code."));
       
       mwp.add(new Dialogue("Prof. Harbern", 
                            true,
                            false,
                            "",
                            Voicing.NORMAL,
                            "Well, it's good that you've only written 9 "+
                            "lines of code so far.  If you had written more "+
                            "it would make it much more difficult to find "+
                            "the problems.  In this case, "+
                            "Java's telling you that you have an "+
                            "unidentified symbol."));

       mwp.add(new Dialogue("FRED",
                            false,
                            false,
                            "sounding stressed",
                            Voicing.NORMAL,
                            "That's what I tried to tell the lab assistant, "+
                            "but she wouldn't listen."));
       
       mwp.add(new Dialogue("Prof. Harbern", 
                            "You sound a little stressed Fred.  "+
                            "Let's take a walk."));
       
       mwp.add(Transition.CUT_TO);

       mwp.add(new SceneDescription(outside, TimeOfDay.EVENING));

       mwp.add(new Dialogue("FRED",
                            false,
                            false,
                            "sounding relaxed",
                            Voicing.NORMAL,
                            "Dude, it's good to get out of that building.  "+
                            "I've been in the lab for almost 20 minutes."));
       
       mwp.add(new Dialogue("Prof. Harbern", 
                            "Since you're so close and this is such a "+
                            "small problem, I don't see any reason for "+
                            "you to bother with 'SUBMIT'.  I'll just "+
                            "give you a 100.  Nice job!"));

       mwp.add(new Dialogue("Narrator",
                            false,
                            false,
                            "",
                            Voicing.VOICE_OVER,
                            "Fred, happy that he had been treated "+
                            "fairly, went home to watch TV.  "));

       mwp.add(Transition.DISSOLVE_TO);

       mwp.add(new SceneDescription(office, TimeOfDay.EVENING));

       mwp.add(new Dialogue("Prof. Harbern", 
                            "I have a great job.  It's so rewarding to "+
                            "work with students who really want to learn.  "+
                            "And what could be better than knowing that "+
                            "they'll earn more than I do within a few "+
                            "years.  Life is good!"));

       mwp.add(Transition.FADE_OUT);


       // Print the Screenplay
       System.out.printf("\n\nScreenplay\n");
       System.out.printf("----------\n");
       System.out.printf(mwp.format());
       

       // Print a Set summary
       System.out.printf("\n\nSet Summary\n");
       System.out.printf("-----------\n");
       System.out.printf("%d sets need to be constructed.\n\n", 
                         Set.getNumberOfSets());
    }
}
