PThemeTool - Theme Edit Tool

Hi folks,

Here’s a new tool for PDE to edit themes.

The idea came about because I had some free time over the past two weekends, and I was really frustrated with having to manually edit the theme.txt file for Processing themes.
So, I thought it would be useful to have an editing tool, with which you can instantly test your changes.

Here is the first beta version of this tool…

I’ve tested it on Windows and Linux from version 4.2 onwards, which is also the minimum requirement. The tool checks and will not run on versions below that.
It would be great if a few more people could test it and report any bugs or suggest improvements.
I’d also be interested to see if it runs smoothly on a Mac, as Mac sometimes yield unexpected results. :slight_smile:

The documentation for the tool is currently limited due to time constraints.

So, here are some key points:

  • Upon launching the tool via the Tools menu, it backs up the current theme.txt. If no theme.txt exists, it creates one from the current theme settings.
  • When the Test button is clicked, it applies the settings from the table to the theme.txt file and reloads the theme.
  • The Revert button restores the settings from the backed-up theme.txt file made at the start.
  • While I’m not 100% satisfied with the file approach, it was the easiest method given that Processing made the theme settings private in the code.
  • Currently, there is no state check on the Close button. If you close, you’re accepting the current theme.txt file.
  • If you click on a label column cell for the code coloring (names with .token.) at the top of the table, it displays the affected keywords of the current mode, if any.

The tool is currently available in a beta phase at PThemeTool.

example_s

Thanks and Cheers,
— mnse

6 Likes

Hi again,

After extensive work, numerous improvements, and refactoring, I’m pleased to announce that now a full-fledged release version is available.
Notably, a major pain point I had about the Beta version has been fixed:
Previously, changes were made via a file interface through theme.txt.
Thanks to an open Java Reflection API configuration - which was disabled by default since Java 9+ - this workaround is no longer necessary.
Consequently, all modifications can be made inline, without the need for the previous Test button.
This button has been replaced by a Save button, allowing you to save your changes to the theme.txt file if desired.
With the Revert button, you can undo all changes made since opening the panel.
Exceptions apply if the theme.txt file in the filesystem was altered or if another theme was subsequently saved to the file using the processings Theme Selector Tool.

To download and instructions are available either through github repository or github pages

example-1.0.0

TODO

  • make it available via Contribution Manager within PDE…
  • add further documentation
6 Likes