Java Eyes

An introduction to your
Integrated Development Environment
(IDE)

Part 4: Documenting your program's code -- Javadoc

CSSE 120
Fundamentals of Software Development I

Rose-Hulman Institute of Technology
Computer Science & Software Engineering

Winter term, 2003-2004

Learning objectives:

After completing this project, you should:
Be able to: Explain the following concepts:
  • Integrated Development Environment (IDE)
    • Why using an IDE is valuable
  • Compiling and executing a program
  • Compile-time errors and run-time errors
  • Documentation and Javadoc doc-comments
  • Version control
    • Why version control is valuable
Be able to: Do the following in our IDE (JCreator Pro and Tortoise CVS):
  • Checkout and commit a project in the CVS version-control system
  • Compile and execute a program
  • Navigate the IDE
  • Edit a program
  • Use JDK Help to learn about a class
  • Identify the apparent source of compile-time errors
  • Provide Javadoc doc-comments per the course's documentation standard
Items in red are learning objectives for this part of the project.

Instructions:

Group work

  • Continue working with your partner from JavaEyes, Part 3.
  • But switch roles so that the other person does the JCreator typing in this part.

Final report

  • When you see a question prefaced by
        Question: blah blah blah ...
    put your answer in your final report.

Time limit

  • Most students complete this exercise in 30 to 60 minutes.
  • If you find yourself spending much more time than that on this exercise, please see your instructor.

What you should do:

What you should learn:

Resources:

  1. Question: What time is it now? (Later we will ask you how long you spent on Part 4 of JavaEyes.)
  Put all answers to Question: stuff in the JavaEyesReport.txt file that you found in your docs subfolder.
  1. Checkout your JavaEyes project.
  • How to checkout a project
How to checkout a CVS project by using Tortoise CVS
  1. Open your JavaEyes project.
  • How to open a project
To open a project: Click on the .jcw (JCreator Workspace) file in the project's folder.
  1. Question: Explain why you should document your code and why you should use a disciplined method.

  2. Question: Explain what Javadoc does for you.
  • Why documenting your program's code is important
  • Why using the disciplined design method called Javadoc is important
Documenting your program's code
  1. Question: How many doc comments are in the Eye.java file of the JavaEyes project?

  2. Confirm that your answer is the same as the number of doc comments that I counted. (If not, get help as needed.)

  3. Look closely at a couple of the doc comments that are in the Eye.java file in JavaEyes, to see the basic format and what is contained within.
  • How to write Javadoc comments
How to write Javadoc comments

  1. Make the HTML documentation for JavaEyes.

    • When you make the documentation, a bunch of messages will appear in the bottom pane, most of which begin with Generating .... The last message should be "Process Completed."

  2. Show the HTML documentation for JavaEyes.

    • When you show the documentation, the HTML version of the doc comments should appear in your browser.

    If you don't see HTML that describes JavaEyes, get help now.

  • How to create HTML documentation from Javadoc comments

  • How easy it is to create HTML documentation from Javadoc comments

  • The value of HTML documentation for your program's code
The Javadoc program creates HTML files from your Javadoc comments. You can run this program from a MS-DOS Prompt but it is easier to run it from inside JCreator, as follows:

  1. To create HTML documentation from Javadoc comments, select Tools -> Make HTML Documentation.
    • If you make changes to a project's Javadoc comments, recompile the project before doing the above, since compiling saves the files.

  2. To view the HTML documentation, point your browser to the docs subfolder of the project or (more simply) just select Tools -> Show HTML Documentation.

If you lack these items in your Tools menu, then get help now to complete items 9 and 10 in the setup of JCreator Pro.

  1. Using your browser:

    1. Find the documentation for the Eye class.

    2. Find the summary of the documentation for the look method.

    3. Find the details of the documentation for the look method.

  2. Make sure that you understand how to find your way in the javadoc-generated html.

  • How to find the documentation for a given class

  • How to find the summary of the documentation for a given method

  • How to find the details of the documentation for a given method

  • To find the documentation for a given class:
    • Use the All Classes frame on the left

  • To find the summary of the documentation for a given method:
    • Click the METHOD link at the top of the page for the class, then scroll as needed

  • To find the details of the documentation for a given method:
    • Click the link to the method in the summary item

  1. At the appropriate place in the JavaEyes code, list you, your partner and the existing authors as co-authors in the @author tag of the EyeBall class.

  2. Compile the project.
    • This will save the file with the code, thus saving the changes you just made (otherwise the next step will not notice them).
    • You should routinely compile after changing your code, to be sure that your changes did not introduce errors.

  3. Re-make and re-show the HTML documentation for JavaEyes. Confirm that your newly-typed information (including the authors) now appears in the newly generated HTML.
    • You may need to use your browser's Reload button.

  • How to modify doc comments

  • How easy it is to create HTML documentation from Javadoc comments

  • The value of HTML documentation for your program's code
How to write Javadoc comments
  1. Checkin your JavaEyes project, tagging it
        Stage4
    
    spelled just like that.
  • How to checkin a project (update, add contents, commit, tag)
  • What checking out a project accomplishes
  • What checking in a project accomplishes
  • Why version control is useful
How to checkin a project (update, add contents, commit and tag) by using Tortoise CVS

Summary

  1. Question: Write (in your report, not in JCreator) a doc comment for the Capitalizer's transform method:
         String transform(String thePhrase) {
             return thePhrase.toUpperCase();
         }
    

  2. Compare your answer to my doc comment for the Capitalizer's transform method.

  3. Question: How much time did you spend on Part 4 of JavaEyes?
   
  1. Close your JavaEyes project in the proper fashion.
  • How to close a project
To close a project: It is best to leave a "clean slate" when you exit a JCreator project. To do so:
  • Window ~ Close All
  • File ~ Save Workspace
  • File ~ Close Workspace