Refactor/new object diagram design level#126
Open
ahmedkha79 wants to merge 25 commits intouseocl:masterfrom
Open
Refactor/new object diagram design level#126ahmedkha79 wants to merge 25 commits intouseocl:masterfrom
ahmedkha79 wants to merge 25 commits intouseocl:masterfrom
Conversation
- Automatic Deletion of all unnecessary imports in use-gui with Copilot
…ty and consistency - Use diamond operator (<>) to reduce generic verbosity - Replace `size() > 0` checks with `isEmpty()` for clearer intent - Convert simple anonymous listeners to lambdas to reduce boilerplate - Remove redundant null checks before `instanceof` - Simplify ternary negation and other small readability fixes - Prepare code for follow-up refactors (extracting data structures, controllers) No behavioral changes intended; this is a mechanical cleanup to reduce cognitive load and prepare the file for safer, larger refactors.
…or clarity improvements - Fix broken Map access (use getLinkObjectToNodeEdge().get(link)) which caused compile errors and broken restore/delete flows. - Add null checks before invoking methods on edges during restore and delete to avoid NPEs when layout data is missing. - Change javaFxCall from boxed Boolean to primitive boolean and update setter for NPE safety and clarity. - Correct copyTo Javadoc param description. These are small, low-risk fixes to restore compileability and improve robustness and readability. No behavioral change expected. Co-authored-by: automated-refactor-agent <refactor@example.com>
…e initializers, use computeIfAbsent, lambdas & method refs, improve drop logging, minor readability fixes
…ion fields as final (small cleanup)
…ct map to avoid private-field access
…accesses, use List.sort, use fLog.println, lambdas and small readability fixes
…n: - Map-safety & Null-Checks - Ersetzte unsichere Map.get()-Aufrufe durch computeIfPresent / null-checks. - Entfernte doppelte containsKey/get-Kombinationen. - Listener & Event-Handling - Entfernt unbenutztes Feld/innere Klasse ShowObjectPropertiesViewMouseListener. - Vereinfacht MouseListener mit Pattern Matching (instanceof). - Data & API - Vereinheitlichte Handhabung sichtbarer/verborgener Daten via ObjectDiagramData-Accessoren. - getVisibleData/getHiddenData abgestimmt. - getDefaultLayoutFileSuffix gesetzt. - Readability & Helpers - createAction Helper eingeführt, Boilerplate reduziert. - getLinkByValue implementiert (Restore/layouter Hilfsmethode). - Analyzer & Warnings - @SuppressWarnings(unused) wo sinnvoll (z.B. isHidden Persist-Helper Version). - Weitere Konsistenz- und Null-Sicherheits-Fixes. Keine API-Breaking Änderungen; low-risk Refactorings zur Verbesserung der Lesbarkeit und Analysehygiene.
…n: - Map-safety & Null-Checks - Ersetzte unsichere Map.get()-Aufrufe durch computeIfPresent / null-checks. - Entfernte doppelte containsKey/get-Kombinationen. - Listener & Event-Handling - Entfernt unbenutztes Feld/innere Klasse ShowObjectPropertiesViewMouseListener. - Vereinfacht MouseListener mit Pattern Matching (instanceof). - Data & API - Vereinheitlichte Handhabung sichtbarer/verborgener Daten via ObjectDiagramData-Accessoren. - getVisibleData/getHiddenData abgestimmt. - getDefaultLayoutFileSuffix gesetzt. - Readability & Helpers - createAction Helper eingeführt, Boilerplate reduziert. - getLinkByValue implementiert (Restore/layouter Hilfsmethode). - Analyzer & Warnings - @SuppressWarnings(unused) wo sinnvoll (z.B. isHidden Persist-Helper Version). - Weitere Konsistenz- und Null-Sicherheits-Fixes. Keine API-Breaking Änderungen; low-risk Refactorings zur Verbesserung der Lesbarkeit und Analysehygiene.
… into refactor/NewObjectDiagram-fixes
…gram/NewObjectDiagram.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…gram/NewObjectDiagram.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…gram/NewObjectDiagram.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…gram/NewObjectDiagram.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…gram/NewObjectDiagram.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…gram/NewObjectDiagram.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…Objects.equals; suppress unused warnings
…gram/NewObjectDiagram.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…gram/NewObjectDiagram.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…gram/NewObjectDiagram.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ll-safety, defensive checks)
…ews.diagrams.objectdiagram) Presenter: NewObjectDiagramPresenter Model: ObjectDiagramModel View/Presenter contracts (INew*/IObject* interfaces) Persistence/auxiliary contracts: PlacementRepository, ContextMenuProvider, ApplicationController No-op adapters: NullPlacementRepository, NullContextMenuProvider, NullApplicationController Helper: DiagramCanvas and related small helpers Motivation: Decouple view rendering from presentation and model logic to remove bidirectional dependencies between diagram and view and to prepare an incremental refactoring towards MVP. Make future refactorings safer by introducing clear contracts and temporary Null‑Adapters so behavior remains unchanged. Behavioural note: This commit wires the new presenter/model into the existing NewObjectDiagram/NewObjectDiagramView using Null adapters — intentionally preserves existing runtime behavior. No domain logic moved yet; this is scaffolding for the follow-up steps.
Decoupled view/canvas from domain orchestration; forwarder/adapters (Null* adapters) used to keep behavior stable during migration. Added PlantUML documentation for current and target MVP architecture. Introduced/kept PlacementRepository contract for persistence hooks and ContextMenuProvider contract for menu callbacks. Kept temporary fallbacks (Null adapters / no‑op providers) so runtime behavior remains unchanged while refactoring proceeds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MVP refactor: scaffold Presenter & Model, decouple view/canvas; add PlantUML docs
Summary
Introduce an incremental MVP scaffold for the object diagram to decouple UI rendering (view/canvas) from orchestration and persistence. This PR adds Presenter and Model contracts and light scaffolding so the subsequent, low-risk migration steps can proceed in small, testable commits.
Motivation
The original NewObjectDiagram (and its view) mixed rendering, user input handling, business logic and persistence. This created a large God class, high cyclomatic complexity and bidirectional couplings that reduce testability and maintainability. The scaffold in this PR prepares a Passive-View MVP: view = UI only; presenter = orchestrator; model = state; repository = persistence.
What changed
Files included in this PR
(Committed files relevant to this PR)
Behavior & backward compatibility
Testing / QA instructions (PowerShell)
Build GUI module:
cd C:\Users\ahmed\IdeaProjects\use
mvn -pl use-gui -DskipTests compile
Smoke test (manual):
Unit tests (next phase):
Acceptance checklist for merge
Next steps (recommended incremental chunks)
Risks & mitigation
Suggested reviewers & labels
Short PR summary (for PR subject line)
MVP refactor: scaffold Presenter+Model to decouple view/canvas; add PlacementRepository and PlantUML docs
If you want, I can also: