Lab 4
Get started now
## 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](lab4doc/index.html) for these classes. <figure>[![UML Class Diagram](shapes.png)](shapes.png)</figure> Please note that the class named `Lab3` in the above diagram should be named `ShapeCreatorApp`. ### 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: <figure>[![Shapes](lab4.png)](lab4.png)</figure> ### WinPlotter The program relies on the [WinPlotter](WinPlotter.jar) class. Dr. Hornick wrote the `WinPlotter` class, and the documentation for the class may be found [here](WinPlotter.htm). 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](WinPlotter.jar). In order to be able to access the `WinPlotter` class in the `.jar` file: 1. Create a **libs** folder in your IntelliJ project folder 1. Download the [WinPlotter.jar](WinPlotter.jar) file and save it in the newly created **libs** folder. 1. Select **File -> Project Structure** 1. Select **Modules** from the **Project Settings** on the left 1. Select the **Dependencies** tab on the right 1. Select the <kbd>+</kbd> on the far right 1. Select **Libraries -> Java** from the drop-down menu 1. Select the **libs** folder you created above and click **OK** 1. In the **Configure Library** dialog box that appears, accept the default settings: **Name = libs** and **Level = Project Library** 1. 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 `Shape` class implements the `draw` method. * The `draw` methods all take a single argument, which is a reference to the `WinPlotter` object created at the beginning of the `main` method in the `ShapeCreatorApp` class. As a result, all shapes use the same `WinPlotter` object for drawing. * Each implementation of the `draw` method must use methods from the `WinPlotter` class 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](lab4doc/index.html). ### 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 your professor's instructions for details on submission guidelines > and due dates. > * Dr. Taylor's students: See below > * All other students should refer to Blackboard > > If you have any questions, consult your instructor. ## Acknowledgment This laboratory assignment was developed by [Dr. Mark Hornick]( and [Dr. Chris Taylor](taylor/).

Wednesday, 20-Dec-2017 10:11:13 CST