Lemur Themer & Editor

Lemur Themer and Editor

This project consists of two projects

  • lemur-themer
    • A library to create, edit, save and load themes for Lemur.
  • lemur-themer-editor
    • A stand-alone GUI editor for lemur-themer.

The first project is where all the magic happens. The second project is simply a graphical UI to visualize your theme. You can make changes and see them instantly, save them, create new themes, etc…

The entire themes are saved in JSON format, images, icons, everything. This makes it extremely easy to share themes - and has the added benefit of not needing groovy-all (mainly concerning mobile-devices). For me personally on a Raspberry Pi 4B 4GB the themes loaded faster than the groovy alternative.

Creating Themes

The easiest way is using the Editor. Releases are available on github - as is the source-code.
Just double-click the .jar file or type:

java -jar lemur-themer-editor-0.0.1.jar

https://github.com/jayfella/lemur-themer-editor

Loading Themes

Documentation is available in the github repository, but the basic premise is just:

dependencies {
    implementation 'com.jayfella:lemur-themer:0.0.1'
}

And in the simpleInit() method:

public void simpleInit() {

    GuiGlobals.initialize();

    LemurThemer lemurThemer = new LemurThemer();
    lemurThemer.setTheme("./mytheme.lemur.json");

}

https://github.com/jayfella/lemur-themer

16 Likes

awesome work!

1 Like

Uncaught exception when I used color chooser to change the color

Uncaught exception thrown in Thread[jME3 Main,5,main]
NoSuchMethodError: javax.swing.JColorChooser.showDialog(Ljava/awt/Component;Ljava/lang/String;Ljava/awt/Color;Z)Ljava/awt/Color;

I used:
java version “1.8.0_251”
Java™ SE Runtime Environment (build 1.8.0_251-b08)
Java HotSpot™ 64-Bit Server VM (build 25.251-b08, mixed mode)

I’m not sure which operating system you’re using, but generally AdoptOpenJDK has the best compatibility across the OS line.

1 Like

If you’re on a linux distribution, be aware that most package repositories have broken the jdk into two packages:

  • A headless package (Including the core JVM, most of the standard library, and command line tools)
  • A separate desktop package that depends on the first, but adds the native interfacing to the windowing system, and java classes for the AWT/Swing system and such.

The exact phrasing may vary, but check your package manager to see what you have installed.

1 Like

I started to look into this a little and then was stopped by the lack of stack trace.

Exceptions: nearly useless without a stack trace.

2 Likes

Though it turns out that this is the rare case when the problem can be determined without the stack trace… though the location of the problem in Jay’s library cannot be easily determined for the casual looker.

Translating that showDialog error: it’s looking for showDialog(Component, String, Color, boolean)

…that method was not added until Java 9. So Jay’s library is not compatible with Java 8.

JDK 8: JColorChooser (Java Platform SE 8 )
The 9+ method Jay uses: JColorChooser (Java SE 9 & JDK 9 )

2 Likes

I tried to run it using java 11:
openjdk version “11.0.8” 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu120.04)
OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu120.04, mixed mode, sharing)

but it is not starting and throws:

19 Sep 2020 14:31:15 [ INFO | JmeSystem ] Running on jMonkeyEngine 3.3.2-stable
 * Branch: HEAD
 * Git Hash: 1a05e3f
 * Build Date: 2020-04-27
Inconsistency detected by ld.so: dl-lookup.c: 111: check_match: Assertion `version->filename == NULL || ! _dl_name_match_p (version->filename, map)' failed!

Now, that I’ve seen before. Some native code builds (the LWJGL2 package that JME provides is one) run into issues with system JDKs > 10, compiled after mid 2019 or so.

Options:

  • Use a JDK binary directly from adoptopenjdk, as @jayfella suggested above
  • Patch the editor code to use Java 8 calls only
  • Patch the build script to pull in JME’s LWJGL3 package, which doesn’t have this problem.
1 Like

Hi community, if anyone else is looking for the source to this project, @Ali_RS has it cloned here:

6 Likes

Amazing work, thanks for contribution from all beginners and non-beginners :grinning:

2 Likes

Also here:

4 Likes