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 ## Resources * [ShapeCreatorApp](ShapeCreatorApp.java) * [Shape Family Documentation](lab4doc/index.html) * [WinPlotterFX JAR file](WinPlotterFX.jar) * [WinPlotterFX Documentation](WinPlotterFX.htm) ## 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> ### ShapeCreatorApp The [ShapeCreatorApp](ShapeCreatorApp.java) 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>[![Results](lab4.png)](lab4.png)</figure> ### WinPlotterFX The program relies on the [WinPlotterFX](WinPlotterFX.jar) class. Prof. Jones wrote the `WinPlotterFX` class, and the documentation for the class may be found [here](WinPlotterFX.htm). You will need to download and then add the `WinPlotterFX.jar` file to your build path (see instructions below). ### Accessing the .jar File For this assignment, you will need to make use of the [WinPlotterFX.jar](WinPlotterFX.jar). In order to be able to access the `WinPlotterFX` class in the `.jar` file: 1. Create a **libs** folder in your IntelliJ project folder 1. Download the [WinPlotterFX.jar](WinPlotterFX.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.winplotterfx.WinPlotterFX` 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 `WinPlotterFX` object created at the beginning of the `main` method in the `ShapeCreatorApp` class. As a result, all shapes use the same `WinPlotterFX` object for drawing. * Each implementation of the `draw` method must use methods from the `WinPlotterFX` 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](ShapeCreatorApp.java) 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](http://faculty-web.msoe.edu/hornick/), [Dr. Chris Taylor](taylor/) and Prof. Sean Jones.

Thursday, 13-Dec-2018 14:43:57 EST