- UML Editor
- IDE: IntelliJ IDEA
- Java JDK 17.0.1
- GUI Library: Java Swing
- SonarLint Plugin - Code quality and security analysis tool
- Maven - Dependency Management
- Figma - UI and components design
- Documentation
- Generate JavaDoc - IntelliJ IDEA Tool
- Deploy - Publish Javadoc - GitHub Action
- Select
- Association
- Generalization
- Composition
- Class
- Use Case
- Create basic object: Class, UseCase
- Select/Unselect/Move a single basic object: Class, UseCase
- Create UMLConnectionLine: AssociationLine, CompositionLine, GeneralizationLine
- Change Object Name
- Select/Unselect/Move connection line
- Select/Unselect a UMLGroup of objects
- Group/UpGroup
- Select and Move BaseUMLObject (include Group)
- Delete UMLObject
You can just download π v1.0 and run the jar file.
mvn clean package
java -jar target/uml-editor-1.0-jar-with-dependencies.jar
Tip
Generated by UML class diagrams
- Improve code quality. More OO.
- Documentations: Java API Docs, README.md
.
|
+---assets
+---docs
+---src
| +---main
| | +---java
| | | \---com
| | | \---xxrjun
| | | | UMLEditorApplication.java
| | | |
| | | +---components
| | | | | Canvas.java
| | | | | MenuBar.java
| | | | | ToolPanel.java
| | | | |
| | | | \---uml
| | | | | UMLGroup.java
| | | | | UMLObject.java
| | | | | UMLPort.java
| | | | |
| | | | +---basics
| | | | | ClassBasicObject.java
| | | | | UMLBasicObject.java
| | | | | UseCaseBasicObject.java
| | | | |
| | | | \---connectionlines
| | | | AssociationLine.java
| | | | CompositionLine.java
| | | | GeneralizationLine.java
| | | | UMLConnectionLine.java
| | | |
| | | +---enums
| | | | EditFunctionTypes.java
| | | | ToolButtonConfig.java
| | | | UMLObjectTypes.java
| | | |
| | | +---factories
| | | | UMLObjectFactory.java
| | | |
| | | \---modes
| | | CreateBasicUMLObject.java
| | | CreateUMLConnectionLine.java
| | | Select.java
| | | UMLFactory.java
| | | UMLMode.java
| | |
| | \---resources
| | \---images
...
- Click Tool Button
- Mode
- Create UMLObject
- Create UMLConnectionLine
- Create UMLBasicObject
- Select
- If selection is UMLObjects
- can Move (UMLConnectionLine movement are not supported yet.)
- If selection is UMLBasicObject
- can change itβs ObjectName
- If selection is an Area including several UMLObjects
- can Group
- If selection is an UMLGroup
- can UnGroup
- If selection is UMLObjects
- Create UMLObject
- Canvas Repaint
graph TD
A[Initialize UML Editor] --> B{Button Clicked}
B -->|Select| C[Set Select Mode]
B -->|Association| D[Set Association Mode]
B -->|Generalization| E[Set Generalization Mode]
B -->|Composition| F[Set Composition Mode]
B -->|Class| G[Set Class Creation Mode]
B -->|Use Case| H[Set Use Case Creation Mode]
C --> I{Mouse Event on Canvas}
D --> I
E --> I
F --> I
G --> I
H --> I
I -->|Left Click on Object| J[Select/Unselect Object]
I -->|Left Click on Canvas| K[Unselect All Objects]
I -->|Left Press on Object| L[Start Line Creation]
I -->|Mouse Drag| M[Update Line Endpoint]
I -->|Left Release on Object| N[Create Connection Line]
I -->|Left Press on Object| O[Start Object Movement]
I -->|Mouse Drag| P[Move Object]
I -->|Left Release| Q[Update Object Position]
J --> R{Edit Menu}
K --> R
R -->|Group Selected| S[Merge Selected Objects]
R -->|Ungroup Selected| T[Decompose Composite Object]
R -->|Change Object Name| U[Open Name Change Window]
U -->|OK with New Name| V[Update Object Name]
U -->|Cancel| W[Close Window]
V --> W
W --> I
sequenceDiagram
participant User
participant Button
participant Canvas
User->>Button: Click button
Button-->>User: Change button color to black
User->>Canvas: Move cursor to (x,y) and press left mouse button
Canvas-->>Canvas: Draw a blank object at (x,y)
User->>Canvas: Repeat creating same object
alt User press another button
User->>Button: Click another button
Button-->>User: Change to the mode of clicked button
end
sequenceDiagram
participant User
participant Object1
participant Object2
participant Canvas
User->>Object1: Press left mouse button within boundary
User->>Canvas: Drag mouse
User->>Object2: Release mouse button within boundary
Canvas-->>Canvas: Create connection line between Object1 and Object2
Canvas-->>Canvas: Draw arrow at Object2 based on line type
alt Press point not on object
User->>Canvas: Press, drag and release not on any object
Canvas-->>Canvas: Do nothing
else Release point not on object
User->>Canvas: Release mouse not on any object
Canvas-->>Canvas: Do not create connection line
end
sequenceDiagram
participant User
participant Object
participant Canvas
User->>Object: Click on object
Object-->>Canvas: Deselect any other selected objects
Object-->>Object: Display 4 connection ports
alt Click on empty area
User->>Canvas: Click on coordinates without object
Canvas-->>Canvas: Deselect any selected objects
end
sequenceDiagram
participant User
participant EditMenu
participant SelectedObjects
User->>EditMenu: Select "Group" option
EditMenu->>SelectedObjects: Merge into one composite object
sequenceDiagram
participant User
participant EditMenu
participant CompositeObject
User->>EditMenu: Select "Ungroup" option
EditMenu->>CompositeObject: Decompose one layer
sequenceDiagram
participant User
participant Object
participant Canvas
User->>Object: Press left mouse button
User->>Canvas: Drag mouse to (x,y)
User->>Canvas: Release mouse button
Canvas->>Object: Move object to (x,y)
Canvas-->>Canvas: Redraw connected lines
sequenceDiagram
participant User
participant EditMenu
participant Object
participant NameWindow
User->>Object: Select object
User->>EditMenu: Select "Change Object Name"
EditMenu-->>NameWindow: Open window with text area and OK/Cancel
User->>NameWindow: Enter new name, press OK
NameWindow-->>Object: Change object name
NameWindow-->>NameWindow: Close window
- Requirement - Use Case Format
- Java Design Pattern
- Package javax.swing
- Java Swing Tutorial
- The Javaβ’ Tutorials | Creating a GUI With Swing
Tip
Code similarity is checked by using MOSS. Result: http://moss.stanford.edu/results/1/9411843636512/