Skip to content

style(swingui): simplify Generic2DDisplay rendering#5312

Open
DanySK wants to merge 7 commits intomasterfrom
style/swingui/simplifygeneric2ddisplayre
Open

style(swingui): simplify Generic2DDisplay rendering#5312
DanySK wants to merge 7 commits intomasterfrom
style/swingui/simplifygeneric2ddisplayre

Conversation

@DanySK
Copy link
Copy Markdown
Member

@DanySK DanySK commented Apr 28, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 28, 2026 13:29
@DanySK DanySK enabled auto-merge (squash) April 28, 2026 13:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.53%. Comparing base (93a9f5b) to head (205d54b).
⚠️ Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

auto-merge was automatically disabled April 28, 2026 16:33

Head branch was pushed to by a user without write access

@DanySK DanySK enabled auto-merge (squash) April 28, 2026 16:39
@DanySK
Copy link
Copy Markdown
Member Author

DanySK commented Apr 28, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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());
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply feedback from #5312 (comment)

@DanySK DanySK force-pushed the style/swingui/simplifygeneric2ddisplayre branch 10 times, most recently from 9dc3281 to bf48883 Compare April 29, 2026 08:47
@DanySK DanySK force-pushed the style/swingui/simplifygeneric2ddisplayre branch 4 times, most recently from 8e73f0a to 7febfd6 Compare April 30, 2026 04:19
@DanySK DanySK force-pushed the style/swingui/simplifygeneric2ddisplayre branch 4 times, most recently from f23769c to 23acbbc Compare April 30, 2026 09:16
auto-merge was automatically disabled April 30, 2026 09:30

Head branch was pushed to by a user without write access

DanySK and others added 7 commits April 30, 2026 13:12
…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>
@DanySK DanySK force-pushed the style/swingui/simplifygeneric2ddisplayre branch from 6aecbcb to 205d54b Compare April 30, 2026 11:12
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants