You are not logged in.

#1 2020-04-03 09:57:54

DevCharly
Member
Registered: 2020-04-02
Posts: 2

JOSM: Use FlatLaf dark and light look and feels?

Hello,

I'm the author of the FlatLaf look and feel and wanted to ask whether
the JOSM community is interested in using FlatLaf in JOSM.

FlatLaf is a new modern open-source L&F that looks similar to Darcula/IntelliJ
themes you maybe know from IntelliJ IDEA. It comes with dark and light themes,
supports 3rd party IntelliJ themes, scales on HiDPI displays, runs on all
platforms (Windows, Linux and macOS), uses Mac platform specific key bindings on
macOS and is easy to integrate into existing Swing applications.

While FlatLaf is still young, there are already a lot of applications using it.
Most prominent is NetBeans 11.3.

Here are some screenshots of JOSM running with FlatLaf:

Snag-276259f8.png

Snag-27628415.png

Snag-27625a08.png

Snag-276283c7.png

Snag-276283f6.png

Snag-27625a36.png

If there is interest in using FlatLaf in JOSM, I'm willing to integrate it,
fix FlatLaf related issues and submit SVN patches.

JOSM with FlafLaf Dark requires some minor color adjustments where hardcoded
colors are used in JOSM UI components.

Here is the patch used to create the screenshots:

Index: ivy.xml
===================================================================
--- ivy.xml	(revision 16222)
+++ ivy.xml	(working copy)
@@ -26,6 +26,7 @@
         <dependency org="org.tukaani" name="xz" rev="1.8" conf="api->default"/>
         <dependency org="com.drewnoakes" name="metadata-extractor" rev="2.13.0" conf="api->default"/>
         <dependency org="ch.poole" name="OpeningHoursParser" rev="0.21.1" conf="api->default"/>
+        <dependency org="com.formdev" name="flatlaf" rev="0.29" conf="api->default"/>
         <!-- sources->sources -->
         <dependency org="org.openstreetmap.jmapviewer" name="jmapviewer" rev="2.13" conf="sources->sources"/>
         <dependency org="javax.json" name="javax.json-api" rev="1.1.4" conf="sources->sources"/>
@@ -36,5 +37,6 @@
         <dependency org="org.tukaani" name="xz" rev="1.8" conf="sources->sources"/>
         <dependency org="com.drewnoakes" name="metadata-extractor" rev="2.13.0" conf="sources->sources"/>
         <dependency org="ch.poole" name="OpeningHoursParser" rev="0.21.1" conf="sources->sources"/>
+        <dependency org="com.formdev" name="flatlaf" rev="0.29" conf="sources->sources"/>
     </dependencies>
 </ivy-module>
Index: src/org/openstreetmap/josm/gui/MainApplication.java
===================================================================
--- src/org/openstreetmap/josm/gui/MainApplication.java	(revision 16222)
+++ src/org/openstreetmap/josm/gui/MainApplication.java	(working copy)
@@ -164,6 +164,9 @@
 import org.openstreetmap.josm.tools.bugreport.BugReportSender;
 import org.xml.sax.SAXException;
 
+import com.formdev.flatlaf.FlatDarkLaf;
+import com.formdev.flatlaf.FlatLightLaf;
+
 /**
  * Main window class application.
  *
@@ -1048,6 +1051,9 @@
     }
 
     static void setupUIManager() {
+        UIManager.installLookAndFeel("FlatLaf Light", FlatLightLaf.class.getName());
+        UIManager.installLookAndFeel("FlatLaf Dark", FlatDarkLaf.class.getName());
+
         String defaultlaf = PlatformManager.getPlatform().getDefaultStyle();
         String laf = LafPreference.LAF.get();
         try {

Thanks,
Karl

Offline

#2 2020-04-03 11:38:24

RicoElectrico
Member
From: Trójmiasto
Registered: 2012-07-01
Posts: 1,431

Re: JOSM: Use FlatLaf dark and light look and feels?

Nice smile You should file a ticket on josm.openstreetmap.de - there you can find more attention from both users and developers smile

Last edited by RicoElectrico (2020-04-03 12:07:34)

Offline

#3 2020-04-03 14:02:43

DevCharly
Member
Registered: 2020-04-02
Posts: 2

Re: JOSM: Use FlatLaf dark and light look and feels?

RicoElectrico wrote:

Nice smile You should file a ticket on josm.openstreetmap.de - there you can find more attention from both users and developers smile

Thanks. Crossposted here: https://josm.openstreetmap.de/ticket/19027

Offline

#4 2020-04-03 14:16:59

PHerison
Member
From: Rhein-Main
Registered: 2008-04-04
Posts: 1,571

Re: JOSM: Use FlatLaf dark and light look and feels?

Like it smile

Offline

Board footer

Powered by FluxBB