This can be accomplished by right clicking the interface, expanding the add menu, and pressing the red "Operation" button. Add a getArea method of type double to the IShape interface. This will allow us to see what operations the interface has in the diagram view. Also on the toolbar, de-select the "Suppress Operations" box.This will change the previous circular shape into a rectangular shape. On the top toolbar, select the dropdown "Stereotype Display" and change the value to "None".Select the interface by left-clicking the item after it is created. From the toolbox, choose "Interface" and click somewhere on the palette.If you choose to use the "Model Explorer", the area we will be interested in is visible after expanding the "Design Model" group. You may notice using the "Model Explorer" on the right is faster to add these, but do however note that adding the classes and interfaces themselves in this toolbox (instead of using the toolbox on the left and clicking on the palette to create the object) will not create the objects in the diagram. Repeat the same process to create a class called Rectangle with private _width and _height fields of type double.Specify the data type in the properties box by typing double in "Type". Add an "Attribute" (or field) to Circle by right-clicking the object on the diagram, expanding the "Add" menu, and pressing the green "Attribute" button. Rename the class to Circle by double clicking on the name. This should create a new class with a generic name. Now to begin actually creating the diagram, from the "Toolbox" which starts by default on the left side of the screen, select the "Class" icon, and left-click somewhere on the diagram window.The program will sometimes default to using an "Analysis Model", which we are not interested in for this lab. Important! Be sure that the subtitle bar, just above the diagram palette, says "Main (Design Model)".From the "File" menu, choose "Save", and select a location to save the project. Save the project now so you do not lose any progress if some problem arises.If the box was not present, go to the "File" menu and choose "New Project".
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |