Objectives
- Translate UML class diagrams into source code
- Construct software which using an abstract class and polymorphism
- Employ aggregation and composition in the development of software
- Use javadoc to determine appropriate use of an unfamiliar class
Assignment
Shape Implementations
Your assignment is to write the Shape,
Point,
Triangle,
LabeledTriangle,
Rectangle,
LabeledRectangle,
and Circle classes.
The classes are part of an inheritance hierarchy that is shown
in the UML class diagram below. Note that the
Shape class is an abstract
class. Also, be sure that your implementation adheres to
the visibility modifiers shown in the diagram.
Place each of these classes in a package that uses your MSOE username as the name.
Implementation specific details for these classes is found in the javadoc for these classes.

ShapeCreatorApp
The ShapeCreatorApp class has
already been implemented. You will need to add the correct
import statement(s) for your
shape classes. No other changes need to be made to the
ShapeCreatorApp class.
The program makes use of the classes that you must implement to create the following:

WinPlotter
The program relies on the WinPlotter
class. Dr. Hornick wrote the WinPlotter class,
and the documentation for the class may be found
here.
You will need to download and then add the
WinPlotter.jar file to your build
path (see instructions below).
Accessing the .jar File
For this assignment, you will need to make use of the WinPlotter.jar.
In order to be able to access the WinPlotter class in the
.jar file:
- Create a libs folder in your IntelliJ project folder
- Download the WinPlotter.jar file and save it in the newly created libs folder.
- Select File -> Project Structure
- Select Modules from the Project Settings on the left
- Select the Dependencies tab on the right
- Select the + on the far right
- Select Libraries -> Java from the drop-down menu
- Select the libs folder you created above and click OK
- In the Configure Library dialog box that appears, accept the default settings: Name = libs and Level = Project Library
- Click OK to close the Project Structure window
You should now have access to the
edu.msoe.se1010.winPlotter.WinPlotter class in your project
code.
Details
- Every class in this inheritance hierarchy, except the
Shapeclass implements thedrawmethod. - The
drawmethods all take a single argument, which is a reference to theWinPlotterobject created at the beginning of themainmethod in theShapeCreatorAppclass. As a result, all shapes use the sameWinPlotterobject for drawing. - Each implementation of the
drawmethod must use methods from theWinPlotterclass to draw the desired shape. - To help you understand what you must write for each class (and how to draw each shape), read the Javadoc for the Shape-derived classes.
Just For Fun
Feel free to create your own version of the ShapeCreatorApp class that draws a picture of your own choosing. You can submit a screen shot of this as the supplemental file on the upload page.
Lab Deliverables
See Dr. Rebenitsch for instructions
Dr. Taylor's students: See below
See Prof. Ung for instructions
Acknowledgment
This laboratory assignment was developed by Dr. Mark Hornick and Dr. Chris Taylor.