|
| 1 | +# UML Manager (CLI & GUI) |
| 2 | +This **UML Manager** is an application that allows users to create and manage class definitions, fields, methods, parameters, and relationships between classes. |
| 3 | +It provides a simple way to review and model class structures and their associations with each other. You can run it either in **GUI mode** or **CLI mode**. |
| 4 | + |
| 5 | +## How to Run the Program |
| 6 | + |
| 7 | +### 1. Make sure you have Java installed |
| 8 | +You need Java installed on your computer. If you are not sure, open a terminal and type: |
| 9 | + |
| 10 | +`java -version` |
| 11 | + |
| 12 | +If you see a version number, Java is installed. If not, you will need to install Java first. |
| 13 | + |
| 14 | +--- |
| 15 | + |
| 16 | +### 2. Download and unzip the application |
| 17 | +- Click the "`Sprint4`" on the **Releases** section |
| 18 | +- Click on the "`Sprint4.Zip`" to start your download |
| 19 | +- Once you have downloaded, Extract(Unzip) the file |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +### 3. Open the Terminal or Command Prompt |
| 24 | +**OPTION 1** |
| 25 | +- **Windows:** |
| 26 | + 1. After you've unzipped, click on that folder, inside there will be a file called "target". Right click it (Make sure the file is selected), and press "`Open in Terminal`" |
| 27 | + |
| 28 | + That will open the file in the terminal directory where it lives in. |
| 29 | + |
| 30 | +**OPTION 2** |
| 31 | +- **Windows:** |
| 32 | + 1. Press `Win + R`, type `cmd`, and press Enter. |
| 33 | +- **Mac/Linux:** |
| 34 | + Open your terminal application. |
| 35 | + |
| 36 | +Navigate to the folder where you unzipped the files: |
| 37 | + |
| 38 | +`cd path/to/unzipped/folder` |
| 39 | + |
| 40 | +Example: |
| 41 | + |
| 42 | +`cd /Users/alexr/Downloads/UMLManager` |
| 43 | + |
| 44 | +--- |
| 45 | + |
| 46 | +### 4. Run the Program |
| 47 | + |
| 48 | +There are two ways to run the program currently. |
| 49 | + |
| 50 | +- **GUI Mode (default):** |
| 51 | + |
| 52 | + In your terminal, copy and paste this -> `java -jar 404App-1.0-SNAPSHOT-jar-with-dependencies.jar` on the command line. |
| 53 | + |
| 54 | + This will start the GUI |
| 55 | + |
| 56 | +- **CLI Mode:** |
| 57 | + |
| 58 | + In your terminal, copy and past this -> `java -jar 404App-1.0-SNAPSHOT-jar-with-dependencies.jar --cli` on the command line. |
| 59 | + |
| 60 | + This will start the CLI |
| 61 | + |
| 62 | +### 5. What You Should See |
| 63 | + |
| 64 | +- **CLI Mode:** |
| 65 | + |
| 66 | +<img width="700" height="292" alt="image" src="https://github.com/user-attachments/assets/654a9686-c2b7-4d96-b021-303ee90ed0f3" /> |
| 67 | + |
| 68 | + |
| 69 | +- **GUI Mode:** |
| 70 | +<img width="500" height="782" alt="image" src="https://github.com/user-attachments/assets/0c33a157-5585-406e-ab22-0458a4ee91a7" /> |
| 71 | + |
| 72 | +--- |
| 73 | + |
| 74 | +## How To Use |
| 75 | + |
| 76 | +### - CLI |
| 77 | + |
| 78 | +1. The CLI is very self explanitory, when you type 'help' in the command line you'll see all avalable commands |
| 79 | + |
| 80 | + <img width="800" height="1013" alt="image" src="https://github.com/user-attachments/assets/cc8db91f-1275-4bac-b740-28875575673c" /> |
| 81 | + |
| 82 | +2. When you begin, you'll have to add a class first (These commands are case sensitive so be sure to look at how they are formatted). |
| 83 | + Youll be prompted to type the class name |
| 84 | + |
| 85 | +<img width="1917" height="73" alt="image" src="https://github.com/user-attachments/assets/528e3cca-c004-48cd-bb22-1dd42e4e2131" /> |
| 86 | + |
| 87 | +3. Once that is complete you are free to add parameters, methods, fields, and relationships |
| 88 | + |
| 89 | +<img width="1900" height="543" alt="image" src="https://github.com/user-attachments/assets/dbf36493-9ceb-438d-b953-1b6ab6b4ffb9" /> |
| 90 | + |
| 91 | +4. To add a relationship, you will need two classes minimum, I mean, thats the whole point ;). |
| 92 | + You will pe prompted to add a 'Source Class' and a 'Target Class' and the type of relationship. |
| 93 | + |
| 94 | + <img width="1918" height="231" alt="image" src="https://github.com/user-attachments/assets/09e974a6-fad7-4296-baf4-c6eebeb783fb" /> |
| 95 | + |
| 96 | +*Note: you might find that you'll get a '?' on the 'Relationship added' line, that simply means your terminal does not use UTF-8 ecoding unfortunately* |
| 97 | + |
| 98 | +5. To see the Classes you have listed simply type listClasses on the command line. |
| 99 | + |
| 100 | + |
| 101 | +<img width="1918" height="303" alt="image" src="https://github.com/user-attachments/assets/346ca0ef-9c22-40ee-b9a2-ba77e04cb4a1" /> |
| 102 | + |
| 103 | +6. To make typing more simple and efficient we also have autoimplementation, for example if you want to add a relationship you can begin |
| 104 | + to type 'addR-' and then press [TAB] to autocomplete the rest, you can do this for fields, methods, CLI command, and parameter names! |
| 105 | + |
| 106 | + |
| 107 | +<img width="1918" height="66" alt="image" src="https://github.com/user-attachments/assets/2443a3ab-fcf8-4cda-a6c2-92a9fdf532db" /> |
| 108 | + |
| 109 | +--- |
| 110 | + |
| 111 | +## Available Commands for CLI |
| 112 | + |
| 113 | +### Project / Save Commands |
| 114 | +- `new` |
| 115 | + |
| 116 | + Clears the current project and starts a new blank project. |
| 117 | + |
| 118 | +- `load` |
| 119 | + Loads a previously saved project from a JSON file. |
| 120 | + |
| 121 | +- `save` |
| 122 | + Saves the current project to the last used save path. If no save exists, prompts for a filename. |
| 123 | + |
| 124 | +- `saveAs` |
| 125 | + Prompts for a filename and saves the current project under that name. |
| 126 | + |
| 127 | +--- |
| 128 | + |
| 129 | +### Class Commands |
| 130 | +- `addClass` |
| 131 | + Creates a new class. |
| 132 | + |
| 133 | +- `deleteClass` |
| 134 | + Deletes an existing class. |
| 135 | + |
| 136 | +- `renameClass` |
| 137 | + Renames a class. |
| 138 | + |
| 139 | +- `listClasses` |
| 140 | + Displays all current classes. |
| 141 | + |
| 142 | +- `listClass` |
| 143 | + Displays the provided class. |
| 144 | + |
| 145 | +--- |
| 146 | + |
| 147 | +### Field Commands |
| 148 | +- `addField` |
| 149 | + Adds a new field to a class. |
| 150 | + |
| 151 | +- `deleteField` |
| 152 | + Removes a field from a class. |
| 153 | + |
| 154 | +- `renameField` |
| 155 | + Renames a field inside a class. |
| 156 | + |
| 157 | +--- |
| 158 | + |
| 159 | +### Method Commands |
| 160 | +- `addMethod` |
| 161 | + Adds a new method to a class with optional parameters. |
| 162 | + |
| 163 | +- `deleteMethod` |
| 164 | + Removes a method and all associated data by name from the target class. |
| 165 | + |
| 166 | +- `renameMethod` |
| 167 | + Renames a method in a class. |
| 168 | + |
| 169 | +--- |
| 170 | + |
| 171 | +### Parameter Commands |
| 172 | +- `addParameter` |
| 173 | + Adds a parameter to a method. |
| 174 | + |
| 175 | +- `deleteParameter` |
| 176 | + Removes a parameter from a method. |
| 177 | + |
| 178 | +- `renameParameter` |
| 179 | + |
| 180 | + Renames a parameter from a method. |
| 181 | + |
| 182 | +--- |
| 183 | + |
| 184 | +### Relationship Commands |
| 185 | +- `addRelationship` |
| 186 | + Creates a relationship between two classes. |
| 187 | + `<Type>` can be: `REALIZATION`, `AGGREGATION`, `COMPOSITION`, `GENERALIZATION`. |
| 188 | + |
| 189 | +- `deleteRelationship` |
| 190 | + Removes all relationships involving a given class. |
| 191 | + |
| 192 | +- `listRelationships` |
| 193 | + Lists all relationships created. |
| 194 | + |
| 195 | +--- |
| 196 | + |
| 197 | +### System Commands |
| 198 | +- `help` |
| 199 | + Displays a list of all available commands. |
| 200 | + |
| 201 | +- `exit` |
| 202 | + Closes the application. |
| 203 | + |
| 204 | +--- |
| 205 | + |
| 206 | +### - GUI |
| 207 | + |
| 208 | +1. To create a default class you can go to the menu section, click on 'Class' and then you can add a new class along with many more options |
| 209 | + |
| 210 | +<img width="600" height="817" alt="image" src="https://github.com/user-attachments/assets/c8e2fb3d-39ef-468b-97df-b3a6b29d00f3" /> |
| 211 | + |
| 212 | +2. You can click on the 'Expand Clas List' which will show all classes which have been created and if they have been added to the scene |
| 213 | + |
| 214 | +<img width="600" height="812" alt="image" src="https://github.com/user-attachments/assets/8228db0e-c511-4097-adf6-7e8cc544043d" /> |
| 215 | + |
| 216 | +3. You can double click on the default class name to rename such class |
| 217 | + |
| 218 | +<img width="600" height="813" alt="image" src="https://github.com/user-attachments/assets/d00b1eac-365f-4b3b-b3d1-f34a1f806ce4" /> |
| 219 | + |
| 220 | +4. You can right click on the class box to add, create, and rename such class |
| 221 | + |
| 222 | +<img width="600" height="817" alt="image" src="https://github.com/user-attachments/assets/4f34ed21-8e67-4cf1-825a-ddeb66188161" /> |
| 223 | + |
| 224 | +5. To add a relationship go to the menu bar, and select 'Relations' -> 'add Relation'. You will be prompted to add a source class and target class |
| 225 | +<img width="600" height="815" alt="image" src="https://github.com/user-attachments/assets/f9868386-fe43-4209-b769-851bb44e3b9a" /> |
| 226 | +<img width="600" height="816" alt="image" src="https://github.com/user-attachments/assets/8fd688e6-e0d5-48ed-83fc-b0dd826f214b" /> |
| 227 | + |
| 228 | + 5a. You will be prompted to add a relationship type using a drop down, select which ever. |
| 229 | + |
| 230 | +<img width="600" height="810" alt="image" src="https://github.com/user-attachments/assets/62bb9d10-3cd3-4041-8fe6-985cb0a1edcf" /> |
| 231 | + |
| 232 | + 5b. The final result will look something like this. |
| 233 | + |
| 234 | +<img width="600" height="812" alt="image" src="https://github.com/user-attachments/assets/6f87f24c-ac4e-4d04-869e-a0ce348c3729" /> |
| 235 | + |
| 236 | +6. You can choose to save, save as 'filename', load, create new, and exit the program in the file menu button. With saving your project, it will direct you to your file explorer where you can export a photo and/or save your project. |
| 237 | + |
| 238 | +<img width="600" height="820" alt="image" src="https://github.com/user-attachments/assets/a7ad8c7e-7a27-43d0-9d34-836ea1d24932" /> |
| 239 | + |
| 240 | +7. An important feature that we have recently implemented is the ability to undo and/or redo. By clicking the "UndoRedo" button on the menu bar you can undo something that you previously did as well as redo that action! |
| 241 | + |
| 242 | + <img width="600" height="812" alt="image" src="https://github.com/user-attachments/assets/af2cf92b-9985-4a5d-ba18-915c7270a33c" /> |
| 243 | + |
| 244 | +--- |
0 commit comments