How eileen0904/uml_editor works
Project Type & Purpose
• It follows a simple MVC-style separation with GUI (View), interaction logic (Mode/Controller), object creation (Factory), and domain objects (Model).
File Structure
• src/View: UI components (Frame, Panel, Canvas, Main)
• src/Menu: top-level menus, menu items, grouping/ungrouping
• src/Buttons: toolbar buttons corresponding to actions (oval, rect, line types, select)
• src/Mode: “controller” classes implementing behavior per tool/mode (e.g. OvalMode, SelectMode)
• bin: compiled output
• .vscode: VS Code settings for source/bin mapping
README
• Confirms standard Java project layout: src → source, bin → compiled classes
• No additional services or external integrations
Main Components & Their Relationships
a. UI Layer (View & Menu & Buttons)
• Main Frame hosts MenuBar, ToolBar (Buttons), and Canvas.
• Canvas renders Model objects and forwards mouse/input events.
b. Controller/Interaction Layer (Mode)
• A Mode class active at runtime handles input on Canvas and delegates to Factory.
• Switching tool buttons or menu items swaps the current Mode.
c. Factory Layer
• LineFactory and ObjectFactory classes implement LineInterface/ObjectInterface.
• Mode classes call the appropriate Factory to instantiate Model objects.
d. Model Layer (Objects)
• A set of abstract classes (ShapeAbstract, LineAbstract, ObjectAbstract) with concrete subclasses (Oval, Rect, Association, Composition, Generalization).
e. External Technology
• Java SE GUI toolkit (Swing or AWT), run in VS Code.
Architectural Patterns
• MVC (View, Controller (Mode), Model)
• Factory Method or Abstract Factory for object/line creation
• Strategy pattern for Mode behaviors
• Composite pattern for grouping (CompositeObject)