#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:
Denny Sheirer
2020-10-16 06:38:05 -04:00
committed by GitHub
parent 61c4e13c3e
commit 5117e6cbe8
4 changed files with 77 additions and 151 deletions

View File

@@ -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());
}
}
/**