From cfc9df431893697e811c5292eac8cc806424c1bd Mon Sep 17 00:00:00 2001 From: Denny Sheirer Date: Fri, 20 Nov 2026 07:23:42 -0500 Subject: [PATCH] #2723 Full JavaFX application. (#2725) * Removes the FlatLaf, JIDE, MigLayout and jiconfont-swing dependencies; the runtime image no longer includes javafx.swing. * Removes the Swing channelizer developer viewers and the Swing spectrum panel; the symbol, sync and filter debug viewers are plain JavaFX windows. * ChannelMapModel is no longer a Swing list model; removes unused Swing color menu items and models. * Removes the Swing image methods from the icon classes; icons load as JavaFX images. * Themes no longer use FlatLaf: each theme stores its palette and ThemeManager styles JavaFX only. * The channel auto-start countdown, the event and message filter editor and the alias and deadlock alerts are now JavaFX. The main window only stores split pane divider positions after the user drags a divider. * Main window converted to JavaFX, with a spectrum and waterfall display that can be hidden. * A hidden spectrum and waterfall is disposed so that it uses no processing or memory. Show or hide it from the View menu, Ctrl+Shift+S, the display settings panel or the bar shown while it is hidden. * Streaming status panel converted to JavaFX with status chips, a summary, configurable columns and a shortcut to the streaming editor. * BroadcastModel is no longer a Swing table model. * Audio panel converted to JavaFX and redesigned as a prominent playback display at the top of the main window. * Mono and stereo outputs show one display per channel with the TO alias, icon and color, the FROM radio, system/site/channel, elapsed time, a level meter and per-channel mute. The master section has mute all, volume and audio device settings. * Renames JavaFxWindowManager to WindowManager and removes its standalone launcher and the remaining Swing-era comments. Co-authored-by: denny --- build.gradle | 10 +- .../plaf/windows/WindowsLookAndFeel.java | 81 -- .../alias/action/RecurringAction.java | 39 +- .../audio/broadcast/BroadcastModel.java | 204 +---- .../audio/broadcast/BroadcastStatusPanel.java | 186 ---- .../audio/broadcast/ConfiguredBroadcast.java | 24 + .../dsheirer/audio/playback/AudioChannel.java | 66 +- .../audio/playback/AudioChannelPanel.java | 373 -------- .../audio/playback/AudioChannelsPanel.java | 98 --- .../dsheirer/audio/playback/AudioPanel.java | 305 ------- .../dsheirer/controller/ControllerPanel.java | 120 --- .../channel/AutoStartChannelModel.java | 105 --- .../channel/ChannelAutoStartFrame.java | 242 ------ .../channel/ChannelAutoStartWindow.java | 215 +++++ .../channel/map/ChannelMapModel.java | 46 +- .../channel/map/ChannelRangeModel.java | 295 ------- .../filter/design/FilterViewerLauncher.java | 6 +- .../github/dsheirer/filter/FilterEditor.java | 199 ++++- .../dsheirer/filter/FilterEditorPanel.java | 444 ---------- .../github/dsheirer/gui/ApplicationIcons.java | 46 +- .../io/github/dsheirer/gui/FxToolkit.java | 131 +++ .../io/github/dsheirer/gui/MainWindow.java | 756 +++++++++++++++++ .../java/io/github/dsheirer/gui/SDRTrunk.java | 802 +++--------------- ...xWindowManager.java => WindowManager.java} | 171 +--- .../dsheirer/gui/audio/AudioChannelView.java | 548 ++++++++++++ .../github/dsheirer/gui/audio/AudioView.java | 392 +++++++++ .../github/dsheirer/gui/audio/LevelMeter.java | 207 +++++ .../gui/broadcast/BroadcastStatusView.java | 410 +++++++++ .../gui/channelizer/ChannelizerViewer.java | 573 ------------- .../gui/channelizer/ChannelizerViewer2.java | 472 ----------- .../HeterodyneChannelizerViewer.java | 573 ------------- .../gui/channelizer/SynthesizerViewer.java | 322 ------- .../gui/control/ConstellationViewer.java | 179 ---- .../io/github/dsheirer/gui/editor/Editor.java | 148 ---- .../io/github/dsheirer/gui/map/MapPanel.java | 59 -- .../gui/nowplaying/DecodeEventView.java | 2 +- .../gui/nowplaying/HistoryControls.java | 28 +- .../gui/nowplaying/MessageActivityView.java | 2 +- .../gui/nowplaying/NowPlayingCells.java | 6 +- .../gui/nowplaying/NowPlayingPanel.java | 81 -- .../dsheirer/gui/playlist/PlaylistEditor.java | 6 +- .../playlist/PlaylistEditorApplication.java | 6 +- .../alias/AliasConfigurationEditor.java | 3 +- .../streaming/AbstractBroadcastEditor.java | 2 +- .../streaming/ViewStreamingRequest.java} | 25 +- .../AppearancePreferenceEditor.java | 4 +- .../gui/spectrum/DftSpectralDisplay.java | 11 + .../gui/spectrum/MainSpectralDisplay.java | 282 ++++++ .../spectrum/SpectralDisplayConfigPanel.java | 21 +- .../gui/spectrum/SpectralDisplayPanel.java | 190 ----- .../squelch/NoiseSquelchTestApplication.java | 2 +- .../io/github/dsheirer/gui/theme/Theme.java | 72 +- .../dsheirer/gui/theme/ThemeManager.java | 408 +-------- .../dsheirer/gui/theme/ThemedFontIcon.java | 178 ---- .../gui/viewer/symbol/SymbolViewerFX.java | 27 +- .../gui/viewer/sync/FMSyncResultsViewer.java | 27 +- .../gui/viewer/sync/SyncResultsViewer.java | 27 +- .../java/io/github/dsheirer/icon/Icon.java | 37 - .../io/github/dsheirer/icon/IconModel.java | 78 -- .../java/io/github/dsheirer/map/MapIcon.java | 67 -- .../decode/event/ActivitySummaryFrame.java | 71 -- .../decode/event/filter/EventClearButton.java | 111 --- .../event/filter/EventFilterButton.java | 103 --- .../dsheirer/monitor/DiagnosticMonitor.java | 10 +- .../dsheirer/preference/UserPreferences.java | 3 +- .../preference/javafx/JavaFxPreferences.java | 43 +- .../swing/JTableColumnWidthMonitor.java | 160 ---- .../settings/ColorSettingMenuItem.java | 69 -- .../ColorSettingResetAllMenuItem.java | 52 -- .../settings/ColorSettingResetMenuItem.java | 52 -- .../tuner/ui/TunerSpectralDisplayManager.java | 32 +- .../source/tuner/ui/TunerViewPanel.java | 49 -- .../DisableSpectrumWaterfallMenuItem.java | 55 -- .../spectrum/OverflowableBufferStream.java | 240 ------ .../dsheirer/spectrum/ShowTunerMenuItem.java | 61 -- .../dsheirer/spectrum/SpectrumPanel.java | 488 ----------- .../converter/RealDecibelConverter.java | 42 - .../io/github/dsheirer/util/ColorIcon.java | 57 -- src/main/resources/audio_panel.css | 359 ++++++++ src/main/resources/broadcast_status.css | 112 +++ .../main_window.css} | 54 +- src/main/resources/sdrtrunk_dark.css | 6 + .../playback/AudioChannelPeakLevelTest.java | 87 ++ .../dsheirer/gui/audio/AudioViewTest.java | 77 ++ .../broadcast/BroadcastStatusViewTest.java | 67 ++ 85 files changed, 4321 insertions(+), 8578 deletions(-) delete mode 100644 src/main/java/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java delete mode 100644 src/main/java/io/github/dsheirer/audio/broadcast/BroadcastStatusPanel.java delete mode 100644 src/main/java/io/github/dsheirer/audio/playback/AudioChannelPanel.java delete mode 100644 src/main/java/io/github/dsheirer/audio/playback/AudioChannelsPanel.java delete mode 100644 src/main/java/io/github/dsheirer/audio/playback/AudioPanel.java delete mode 100644 src/main/java/io/github/dsheirer/controller/ControllerPanel.java delete mode 100644 src/main/java/io/github/dsheirer/controller/channel/AutoStartChannelModel.java delete mode 100644 src/main/java/io/github/dsheirer/controller/channel/ChannelAutoStartFrame.java create mode 100644 src/main/java/io/github/dsheirer/controller/channel/ChannelAutoStartWindow.java delete mode 100644 src/main/java/io/github/dsheirer/controller/channel/map/ChannelRangeModel.java delete mode 100644 src/main/java/io/github/dsheirer/filter/FilterEditorPanel.java create mode 100644 src/main/java/io/github/dsheirer/gui/FxToolkit.java create mode 100644 src/main/java/io/github/dsheirer/gui/MainWindow.java rename src/main/java/io/github/dsheirer/gui/{JavaFxWindowManager.java => WindowManager.java} (65%) create mode 100644 src/main/java/io/github/dsheirer/gui/audio/AudioChannelView.java create mode 100644 src/main/java/io/github/dsheirer/gui/audio/AudioView.java create mode 100644 src/main/java/io/github/dsheirer/gui/audio/LevelMeter.java create mode 100644 src/main/java/io/github/dsheirer/gui/broadcast/BroadcastStatusView.java delete mode 100644 src/main/java/io/github/dsheirer/gui/channelizer/ChannelizerViewer.java delete mode 100644 src/main/java/io/github/dsheirer/gui/channelizer/ChannelizerViewer2.java delete mode 100644 src/main/java/io/github/dsheirer/gui/channelizer/HeterodyneChannelizerViewer.java delete mode 100644 src/main/java/io/github/dsheirer/gui/channelizer/SynthesizerViewer.java delete mode 100644 src/main/java/io/github/dsheirer/gui/control/ConstellationViewer.java delete mode 100644 src/main/java/io/github/dsheirer/gui/editor/Editor.java delete mode 100644 src/main/java/io/github/dsheirer/gui/map/MapPanel.java delete mode 100644 src/main/java/io/github/dsheirer/gui/nowplaying/NowPlayingPanel.java rename src/main/java/io/github/dsheirer/{util/SwingUtils.java => gui/playlist/streaming/ViewStreamingRequest.java} (67%) create mode 100644 src/main/java/io/github/dsheirer/gui/spectrum/MainSpectralDisplay.java delete mode 100644 src/main/java/io/github/dsheirer/gui/spectrum/SpectralDisplayPanel.java delete mode 100644 src/main/java/io/github/dsheirer/gui/theme/ThemedFontIcon.java delete mode 100644 src/main/java/io/github/dsheirer/module/decode/event/ActivitySummaryFrame.java delete mode 100644 src/main/java/io/github/dsheirer/module/decode/event/filter/EventClearButton.java delete mode 100644 src/main/java/io/github/dsheirer/module/decode/event/filter/EventFilterButton.java delete mode 100644 src/main/java/io/github/dsheirer/preference/swing/JTableColumnWidthMonitor.java delete mode 100644 src/main/java/io/github/dsheirer/settings/ColorSettingMenuItem.java delete mode 100644 src/main/java/io/github/dsheirer/settings/ColorSettingResetAllMenuItem.java delete mode 100644 src/main/java/io/github/dsheirer/settings/ColorSettingResetMenuItem.java delete mode 100644 src/main/java/io/github/dsheirer/source/tuner/ui/TunerViewPanel.java delete mode 100644 src/main/java/io/github/dsheirer/spectrum/DisableSpectrumWaterfallMenuItem.java delete mode 100644 src/main/java/io/github/dsheirer/spectrum/OverflowableBufferStream.java delete mode 100644 src/main/java/io/github/dsheirer/spectrum/ShowTunerMenuItem.java delete mode 100644 src/main/java/io/github/dsheirer/spectrum/SpectrumPanel.java delete mode 100644 src/main/java/io/github/dsheirer/spectrum/converter/RealDecibelConverter.java delete mode 100644 src/main/java/io/github/dsheirer/util/ColorIcon.java create mode 100644 src/main/resources/audio_panel.css create mode 100644 src/main/resources/broadcast_status.css rename src/main/{java/io/github/dsheirer/spectrum/SpectralDisplayAdjuster.java => resources/main_window.css} (51%) create mode 100644 src/test/java/io/github/dsheirer/audio/playback/AudioChannelPeakLevelTest.java create mode 100644 src/test/java/io/github/dsheirer/gui/audio/AudioViewTest.java create mode 100644 src/test/java/io/github/dsheirer/gui/broadcast/BroadcastStatusViewTest.java diff --git a/build.gradle b/build.gradle index b440b02b1..d8f29e6d2 100644 --- a/build.gradle +++ b/build.gradle @@ -145,18 +145,13 @@ dependencies { implementation 'ch.qos.logback:logback-classic:1.6.6' implementation 'ch.qos.logback:logback-core:1.6.6' implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.23.0' - implementation 'com.formdev:flatlaf:3.8' - implementation 'com.formdev:flatlaf-intellij-themes:3.8' //Not imported - Theme.java loads these themes by class name implementation 'com.github.jiconfont:jiconfont-font_awesome:4.7.0.1' implementation 'com.github.jiconfont:jiconfont-javafx:1.0.0' - implementation 'com.github.jiconfont:jiconfont-swing:1.0.1' implementation('com.github.wendykierp:JTransforms:3.2') { exclude group: 'junit' //JLargeArrays 1.7 declares junit as a compile dependency } implementation 'com.google.code.gson:gson:2.15.0' implementation 'com.google.guava:guava:33.8.0-jre' - implementation 'com.jidesoft:jide-oss:3.6.18' - implementation 'com.miglayout:miglayout-swing:11.5.2' implementation 'com.mpatric:mp3agic:0.9.1' implementation 'commons-io:commons-io:2.22.0' implementation 'io.github.dsheirer:jairspy:1.0.12.1' //Airspy tuners - GitHub release, see settings.gradle @@ -195,7 +190,6 @@ tasks.withType(JavaCompile).configureEach { */ def jvmArgsWindows = ['--add-exports=javafx.base/com.sun.javafx.event=ALL-UNNAMED', //Needed for controls-fx.jar - '--add-exports=java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED', //windows users for JIDE '--add-modules=jdk.incubator.vector', //Project Panama vector API is still in incubator '--enable-preview', //Project Panama Vector API is still in incubator '--enable-native-access=ALL-UNNAMED', //Suppress unsafe warnings for FFM API Foreign Memory calls @@ -315,9 +309,9 @@ def configure(RuntimeZipTask rt, List jvmArgs) { //jdk.incubator.vector - needed for Project Panama foreign function and vector apis //jdk.accessibility is used with assistive technologies like screen readers //java.management for JVM resource monitoring - //java.base, java.logging, java.net.http, java.prefs, javafx.controls, javafx.swing - required by sdrtrunk (jdeps) + //java.base, java.desktop, java.logging, java.net.http, java.prefs, javafx.controls - required by sdrtrunk (jdeps) rt.extension.addModules('jdk.charsets', 'jdk.crypto.ec', 'jdk.incubator.vector', 'jdk.accessibility', 'java.management', - 'java.base', 'java.logging', 'java.net.http', 'java.prefs', 'javafx.controls', 'javafx.swing') + 'java.base', 'java.desktop', 'java.logging', 'java.net.http', 'java.prefs', 'javafx.controls') //Use only the modules listed above. The runtime plugin's module auto-detection uses a bundled ASM library that //can't read Java 27 class files and logs a 'Failed to scan' error for each sdrtrunk class. The jdeps module check diff --git a/src/main/java/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java b/src/main/java/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java deleted file mode 100644 index 8603623a4..000000000 --- a/src/main/java/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * ***************************************************************************** - * Copyright (C) 2014-2026 Dennis Sheirer - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - * **************************************************************************** - */ - -package com.sun.java.swing.plaf.windows; - -import javax.swing.LookAndFeel; -import javax.swing.UIDefaults; - -/** - * No-op stub for the JDK's Windows look-and-feel. - * - *

JIDE 3.6.18's {@code LookAndFeelFactory} contains compile-time - * {@code instanceof com.sun.java.swing.plaf.windows.WindowsLookAndFeel} checks throughout its - * dispatch logic. On Linux and macOS JDK builds that class is genuinely absent from - * {@code java.desktop}, so the JVM throws {@link NoClassDefFoundError} the first time JIDE's - * dispatch code executes the {@code instanceof} bytecode. That happens during - * {@link com.jidesoft.swing.JideSplitPane#updateUI()} on every LAF change. - * - *

This stub lives in the classpath so the class reference resolves on non-Windows JDKs. - * On Windows JDK builds the real {@code WindowsLookAndFeel} is loaded from the - * {@code java.desktop} module via the boot class loader and shadows this class. - * - *

The stub reports itself as not native and not supported - JIDE never instantiates this - * class, it only uses it for {@code instanceof} comparisons against the active LAF. Since - * sdrtrunk never installs this LAF, the {@code instanceof} check always returns false and - * JIDE proceeds to its next branch. - */ -public class WindowsLookAndFeel extends LookAndFeel -{ - @Override - public String getName() - { - return "Windows (stub)"; - } - - @Override - public String getID() - { - return "WindowsStub"; - } - - @Override - public String getDescription() - { - return "Compatibility stub for JIDE's instanceof checks on non-Windows JDKs."; - } - - @Override - public boolean isNativeLookAndFeel() - { - return false; - } - - @Override - public boolean isSupportedLookAndFeel() - { - return false; - } - - @Override - public UIDefaults getDefaults() - { - return new UIDefaults(); - } -} diff --git a/src/main/java/io/github/dsheirer/alias/action/RecurringAction.java b/src/main/java/io/github/dsheirer/alias/action/RecurringAction.java index 7a5391e97..c48318224 100644 --- a/src/main/java/io/github/dsheirer/alias/action/RecurringAction.java +++ b/src/main/java/io/github/dsheirer/alias/action/RecurringAction.java @@ -19,14 +19,16 @@ package io.github.dsheirer.alias.action; +import io.github.dsheirer.gui.FxToolkit; +import javafx.application.Platform; +import javafx.scene.control.Alert; + import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.alias.Alias; import io.github.dsheirer.message.IMessage; import io.github.dsheirer.util.ThreadPool; -import javax.swing.*; -import java.awt.*; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; @@ -62,23 +64,28 @@ public abstract class RecurringAction extends AliasAction mPerpetualAction = ThreadPool.SCHEDULED.scheduleAtFixedRate( new PerformActionTask(alias, message), 0, mPeriod, TimeUnit.SECONDS); - StringBuilder sb = new StringBuilder(); - sb.append("

Alias ["); - sb.append(alias.getName()); - sb.append("] is active in message ["); - sb.append(message.toString()); - sb.append("]
"); - - final String text = sb.toString(); - - EventQueue.invokeLater(() -> { - JOptionPane.showMessageDialog(null, text, - "Alias Alert", JOptionPane.INFORMATION_MESSAGE); + String text = "Alias [" + alias.getName() + "] is active in message [" + message + "]"; + Runnable dismissed = () -> { dismiss(false); - ThreadPool.SCHEDULED.schedule(new ResetTask(), 15, TimeUnit.SECONDS); - }); + }; + + if(FxToolkit.isStarted()) + { + //The action repeats until the user closes the alert + Platform.runLater(() -> { + Alert alert = new Alert(Alert.AlertType.INFORMATION, text); + alert.setTitle("Alias Alert"); + alert.setHeaderText(null); + alert.setOnHidden(event -> dismissed.run()); + alert.show(); + }); + } + else + { + dismissed.run(); + } break; default: } diff --git a/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastModel.java b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastModel.java index 9100d2657..ed798a6f6 100644 --- a/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastModel.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastModel.java @@ -46,9 +46,8 @@ import javafx.collections.ObservableList; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.swing.table.AbstractTableModel; -public class BroadcastModel extends AbstractTableModel implements Listener +public class BroadcastModel implements Listener { private final static Logger mLog = LoggerFactory.getLogger(BroadcastModel.class); @@ -57,18 +56,6 @@ public class BroadcastModel extends AbstractTableModel implements Listener