Skip to content

Add Flat LAF & IntelliJ themes support capability in JMeter - #6312

Open
KingRabbid wants to merge 18 commits into
apache:masterfrom
KingRabbid:add-flatLAF
Open

Add Flat LAF & IntelliJ themes support capability in JMeter#6312
KingRabbid wants to merge 18 commits into
apache:masterfrom
KingRabbid:add-flatLAF

Conversation

@KingRabbid

@KingRabbid KingRabbid commented Jul 8, 2024

Copy link
Copy Markdown
Contributor

Description

I've introduced support for Flat LAF Themes in JMeter; Flat LAF is an open source https://www.formdev.com/flatlaf/ Java Swing library with modern look & feel, supports IntelliJ themes, HiDPI, etc (see the website).
If's compatible with JMeter codebase by default.
New parameters are defined & customizable in .properties & .xml file(s): one can adjust the JSyntaxTextArea.java theme defaults.
Few additional bugs/enhancements were also introduced in order to make the visual experience better.

For future: I would remove Darcula and DarkLaf from JMeter, doesn't make sense anymore to keep them; replace DarkLaf features/usage with FlatLAF API where possible.

Motivation and Context

Due to recent eye vision problems, I've started to need alternative themes support to use other colors; existing capability in JMeter was limited.
DarkLaf API currently in-use in JMeter seems to be non maintained (last update September 2022) and complicated to upgrade to latest version.

How Has This Been Tested?

Manually tested with various JMXs & Themes, especially with JSR223 test elements to validate the JSyntaxTextArea instances.
I've run tests on both Linux and Windows, with Java 8, 11 & 17.

Note: changes are fully compatible also with JMeter 5.x branch/version if needed.

Screenshots (if appropriate):

Screenshot 2024-07-08 160622
Screenshot 2024-07-08 160747
Screenshot 2024-07-08 161525

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.

@KingRabbid

Copy link
Copy Markdown
Contributor Author

Applied latest changes, any feedback please?

…om default blue which hides font. Fallback to default system LAFs if one read from registry doesn't exists anymore. Increment FlatLAF dependency version.
@vlsi

vlsi commented Nov 4, 2025

Copy link
Copy Markdown
Collaborator

DarkLaf API currently in-use in JMeter seems to be non maintained (last update September 2022) and complicated to upgrade to latest version.

Darklaf is not very active, however, the upgrade to the latest version was not really hard: #5715

Having multiple LaFs turned out to be hard to support. They have different quirks, and I agree if we switch to Flat LAF, we'd better drop Darklaf.

@KingRabbid , Could you elaborate a bit on Flat LAF vs Darklaf in your experience?

… fix some rsyntax issues with LAF and Zoom; smaller granularity for Zoom; uniform settings for LoggerPanel
@KingRabbid

Copy link
Copy Markdown
Contributor Author

Hi,

there's little to detail on versus:
a. FlatLAF is actively maintained and used in some major projects so with a very good chance to continue.
b. DarkLAF provides a small subset of LAFs from what is available in the FlatLAF.
c. FlatLAF allows one to define own theme and tweak via .xml settings a theme definition.
d. FlatLAF has custom libraries to work on major OS names in a more compatible manner than a generic Java Swing API.

This branch/repot contains also some few tweaks/fixes that make RSyntaxArea more compatible to LAF changes.

Comment on lines +149 to +152
//FlatLaf: https://www.formdev.com/flatlaf/native-libraries/#gradle
val flatlafVersion = "3.7.2"
api("com.formdev:flatlaf:${flatlafVersion}" )
api("com.formdev:flatlaf:${flatlafVersion}:linux-x86_64@so")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I've filed JFormDesigner/FlatLaf#1146 to request a proper platform (BOM) from FlatLaf

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wonder what this block would look like with a BOM from FlatLaf?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There would be one api(platform("com.formdev:flatlaf-bom:2.21.2")), and the rest would be without versions like api("com.formdev:flatlaf")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The idea is that

  1. We use what the ecosystem uses: jackson, junit, mockito, etc have boms for platforms. I don't mention JMeter here as I am biased here
  2. Every individual FlatLaf artifact might (should) include bom constraint as well (e.g. com.formdev:flatlaf could include contraint on flatlaf-bom). That would enable automatic version alignment in case one of the artifacts comes with a newer version (e.g. updated via transitive).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants