Radiance 4.5.0 and what’s next
It gives me great pleasure to announce the seventh major release of Radiance. Let’s get to what’s been fixed, and what’s been added. First, I’m going to use emojis to mark different parts of it like this:
💔 marks an incompatible API / binary change
🎁 marks new features
🔧 marks bug fixes and general improvements
Dependencies for core libraries
- Gradle from 7.1 to 7.2
- Kotlin from 1.5.10 to 1.5.31
- Kotlin coroutines from 1.5.0 to 1.5.2
Neon
- 💔 Rename
ResizableIcon
toNeonIcon
- 🎁 Implement color filtering on Neon icons
Substance
- 💔 Remove
ComponentStateFacet.EDITABLE
that was not used anywhere in the UI delegates - 🔧 Fix inconsistent rollover logic on table cells
Flamingo
- 🎁💔 Add reference to the ribbon as a parameter to all
OnShowContextualMenuListener
methods - 🎁💔 Align icon theming across all Flamingo components
- 🔧 Fix layout of command buttons in
TILE
layout under RTL - 🔧 Fix visuals of horizontal command button strips under RTL
- 🔧 Fix layout of anchored command buttons under RTL
- 🔧 Fix layout of command button popup content under RTL
- 🔧 Fix issues with updating ribbon gallery content
Photon
General
As with the earlier release 4.0.0, this release has mostly been focused on stabilizing and improving the overall API surface of the various Radiance modules. As always, I’d love for you to take this Radiance release for a spin. Click here to get the instructions on how to add Radiance to your builds. And don’t forget that all of the modules require Java 9 to build and run.
And now for the next big thing or two.
I will take the next two weeks to fix any bugs or regressions that are reported on the 4.5.0 release. On the week of October 18th, all Radiance modules are going to undergo a major refactoring. While Radiance unified all of the Swing projects that I’ve been working on since around 2004, this unification was rather superficial. It made it easier to have inter-module dependencies. It made it easier to write documentation. It made it easier to schedule coordinated releases. But it didn’t make it easier to see what Radiance is.
In the last year or so I kept on asking myself the same questions over and over again.
If I started with these libraries today, will they still be using these disjointed codenames (Neon, Trident, Substance, Flamingo, not to talk about Torch, Apollo, Zodiac, Meteor, Ember, Plasma, Spyglass, Beacon, etc)? For somebody who wants to deep dive into the implementation details, are there places that are internally inconsistent? For an app developer who wants to get the most out of these libraries, does Radiance provide an externally approachable and consistent set of APIs?
The first step I’m taking to answer at least some of these questions is moving away from the codenames, and renaming everything based on the functional boundaries. And by everything I mean everything – modules, classes, methods, fields, variables, etc. It’s going to be a huge breaking change. But it’s something that I feel is way overdue for a project of this complexity. More specifically:
org.pushingpixels.trident
->org.pushingpixels.radiance.animation
org.pushingpixels.neon
->org.pushingpixels.radiance.common
org.pushingpixels.substance
->org.pushingpixels.radiance.theming
org.pushingpixels.flamingo
->org.pushingpixels.radiance.component
org.pushingpixels.substance.extras
->org.pushingpixels.radiance.theming.extras
org.pushingpixels.ember
->org.pushingpixels.radiance.theming.ktx
org.pushingpixels.meteor
->org.pushingpixels.radiance.swing.ktx
org.pushingpixels.plasma
->org.pushingpixels.radiance.component.ktx
org.pushingpixels.torch
->org.pushingpixels.radiance.animation.ktx
org.pushingpixels.tools.apollo
->org.pushingpixels.radiance.tools.schemeeditor
org.pushingpixels.tools.beacon
->org.pushingpixels.radiance.tools.themingdebugger
org.pushingpixels.tools.hyperion
->org.pushingpixels.radiance.tools.shapereditor
org.pushingpixels.tools.ignite
->org.pushingpixels.radiance.tools.svgtranscoder.gradle
org.pushingpixels.tools.lightbeam
->org.pushingpixels.radiance.tools.lafbenchmark
org.pushingpixels.tools.photon
->org.pushingpixels.radiance.tools.svgtranscoder
org.pushingpixels.tools.zodiac
->org.pushingpixels.radiance.tools.screenshot
Classes that used codenames, such as SubstanceLookAndFeel
, TridentConfig
etc will be renamed to follow the functionality of the matching API sub-surface. For example:
SubstanceCortex
->RadianceLafCortex
TridentCortex
->RadianceAnimationCortex
SubstanceButtonUI
->RadianceButtonUI
This first round of refactoring will be the next Radiance release. It will not move classes between modules. It will not add or remove modules, classes or methods. Migrating from 4.5 to 5.0 will require a lot of import refactoring, and some amount of refactoring – wherever you are calling Radiance APIs in your code. Once 5.0 is out, the next release will have follow-up refactorings for cleaning up places that have not aged well.
What’s the other big thing that I alluded to earlier? I want to provide support for consistent application of custom visuals across all supported Swing components. In Substance, this is done with painters. Due to a complicated nature of some of these painters, pretty much since the very beginning Substance has been using cached off-screen bitmaps to maintain a good performance footprint. The very first time a component needs to be rendered in a certain visual state, Substance renders those visuals to an offscreen bitmap. Next time, if we already have a cached bitmap that matches the current state, we reuse it by rendering that bitmap on the screen.
While this model has served Substance (and, by extension, the Flamingo components) rather well, it has started to show significant cracks over the last few years. You can see more information in this bug tracker on the underlying issues, but the gist of it is rather simple – screens with fractional DPI settings (125% or 150%, for example) do not play well with rendering offscreen bitmaps. The end result is that rendering a hairline (one-pixel wide) element can be fuzzy, distorted, or not there at all on the screen.
It is going to be a long road, and it might mean that it might take longer than usual to get the next Radiance release out the door. My current goal is that by the end of it, Radiance does not use any offscreen bitmaps for any of its rendering, and that everything is rendered directly onto the passed graphics object. Lightbeam will certainly come in handy all through that process. Wait, excuse me, Lightbeam will be no more in a couple weeks. It’s going to be Radiance LAF Benchmark instead.