style(swingui): simplify Generic2DDisplay rendering#5312
style(swingui): simplify Generic2DDisplay rendering#5312
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors Generic2DDisplay’s rendering routine to make the drawing pipeline more structured and readable.
Changes:
- Extracted rendering steps into dedicated helpers (
computeNodesOnView,updateHookedNodeView,drawObstacles,drawLinks, etc.). - Reordered rendering flow to compute “on view” nodes once and reuse the result for multiple drawing phases.
- Adjusted an inline comment around the “finished simulation” node-movement warning.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5312 +/- ##
=========================================
Coverage 61.53% 61.53%
Complexity 14 14
=========================================
Files 2 2
Lines 78 78
Branches 4 4
=========================================
Hits 48 48
Misses 24 24
Partials 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Head branch was pushed to by a user without write access
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1f3122e3e1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| final Node<T> hookedNode = hooked.get(); | ||
| final P hookedCoordinates = positions.get(hookedNode); | ||
| if (hookedCoordinates == null) { | ||
| hooked.set(Optional.empty()); |
There was a problem hiding this comment.
Replace invalid Optional mutation
hooked is declared as java.util.Optional<Node<T>>, but this line calls hooked.set(...); Optional is immutable and has no set method, so this change makes alchemist-swingui fail to compile whenever this class is built. Assigning hooked = Optional.empty() (or equivalent) is required to restore a buildable state.
Useful? React with 👍 / 👎.
9dc3281 to
bf48883
Compare
8e73f0a to
7febfd6
Compare
f23769c to
23acbbc
Compare
Head branch was pushed to by a user without write access
…ingui/monitor/impl/Generic2DDisplay.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ingui/monitor/impl/Generic2DDisplay.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ingui/monitor/impl/Generic2DDisplay.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ingui/monitor/impl/Generic2DDisplay.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/AlchemistSimulator/Alchemist/sessions/4322e07a-9841-40ad-a5d1-10555384ad83 Co-authored-by: DanySK <1991673+DanySK@users.noreply.github.com>
Agent-Logs-Url: https://github.com/AlchemistSimulator/Alchemist/sessions/81d95530-b420-47ed-a40d-0b662f7526fa Co-authored-by: DanySK <1991673+DanySK@users.noreply.github.com>
6aecbcb to
205d54b
Compare
|



No description provided.