mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
#961 Resolves issue where invoking channel actions from Swing thread causes error on JavaFX GUI thread. Removes the Start/Disable/Delete commands from the Swing menu options and replaces with a single View/Edit call to the JavaFX channel editor. Although this reduces ease/functionality, it sidesteps code complications until the main GUI can be recreated in JavaFX. (#964)
Co-authored-by: Denny <denny@denny-desktop>
This commit is contained in:
@@ -25,9 +25,10 @@ import com.jidesoft.swing.JideSplitPane;
|
||||
import io.github.dsheirer.controller.channel.Channel;
|
||||
import io.github.dsheirer.controller.channel.ChannelModel;
|
||||
import io.github.dsheirer.controller.channel.ChannelProcessingManager;
|
||||
import io.github.dsheirer.controller.channel.ChannelUtils;
|
||||
import io.github.dsheirer.dsp.filter.Window.WindowType;
|
||||
import io.github.dsheirer.dsp.filter.smoothing.SmoothingFilter.SmoothingType;
|
||||
import io.github.dsheirer.eventbus.MyEventBus;
|
||||
import io.github.dsheirer.gui.playlist.channel.ViewChannelRequest;
|
||||
import io.github.dsheirer.playlist.PlaylistManager;
|
||||
import io.github.dsheirer.properties.SystemProperties;
|
||||
import io.github.dsheirer.sample.Listener;
|
||||
@@ -635,26 +636,22 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
|
||||
|
||||
if(event.getComponent() == mOverlayPanel)
|
||||
{
|
||||
ArrayList<Channel> channels =
|
||||
mOverlayPanel.getChannelsAtFrequency(frequency);
|
||||
ArrayList<Channel> channels = mOverlayPanel.getChannelsAtFrequency(frequency);
|
||||
|
||||
JMenu channelMenu = new JMenu("Channels");
|
||||
for(Channel channel : channels)
|
||||
{
|
||||
JMenu channelMenu = ChannelUtils.getContextMenu(mChannelModel,
|
||||
mChannelProcessingManager, channel,
|
||||
SpectralDisplayPanel.this);
|
||||
|
||||
if(channelMenu != null)
|
||||
{
|
||||
contextMenu.add(channelMenu);
|
||||
}
|
||||
JMenuItem viewChannel = new JMenuItem("View/Edit: " + channel.getShortTitle());
|
||||
viewChannel.addActionListener(e -> MyEventBus.getGlobalEventBus().post(new ViewChannelRequest(channel)));
|
||||
channelMenu.add(viewChannel);
|
||||
}
|
||||
|
||||
contextMenu.add(channelMenu);
|
||||
|
||||
if(!channels.isEmpty())
|
||||
{
|
||||
contextMenu.add(new JSeparator());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user