Resolves issue with including icons in gradle build product. Updates

all icon handling code to use absolute path for bundled icons.
This commit is contained in:
Denny
2017-12-26 07:13:15 -05:00
parent 42aec490bd
commit 3d9044802e
61 changed files with 211 additions and 108 deletions

View File

@@ -29,10 +29,19 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.sound.sampled.FloatControl;
import javax.swing.*;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JSlider;
import javax.swing.SwingUtilities;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.Color;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
@@ -44,10 +53,8 @@ public class AudioPanel extends JPanel implements Listener<AudioEvent>
private static final Logger mLog = LoggerFactory.getLogger(AudioPanel.class);
private static ImageIcon MUTED_ICON = IconManager.getScaledIcon(
new ImageIcon("images/audio_muted.png"), 20);
private static ImageIcon UNMUTED_ICON = IconManager.getScaledIcon(
new ImageIcon("images/audio_unmuted.png"), 20);
private static ImageIcon MUTED_ICON = IconManager.getScaledIcon("/images/audio_muted.png", 20);
private static ImageIcon UNMUTED_ICON = IconManager.getScaledIcon("/images/audio_unmuted.png", 20);
private IconManager mIconManager;
private SettingsManager mSettingsManager;

View File

@@ -29,7 +29,7 @@ import io.github.dsheirer.util.ThreadPool;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.swing.*;
import javax.swing.ImageIcon;
import javax.swing.table.AbstractTableModel;
import java.io.IOException;
import java.nio.file.DirectoryStream;
@@ -519,7 +519,7 @@ public class BroadcastModel extends AbstractTableModel implements Listener<Audio
if(iconPath != null && mIconManager != null)
{
return mIconManager.getScaledIcon(new ImageIcon(iconPath), 14);
return mIconManager.getScaledIcon(iconPath, 14);
}
break;
case COLUMN_STREAM_NAME:

View File

@@ -27,7 +27,12 @@ import net.miginfocom.swing.MigLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.swing.*;
import javax.swing.JButton;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.event.ActionEvent;
@@ -227,7 +232,7 @@ public class BroadcastPanel extends JPanel implements ActionListener, ListSelect
public AddBroadcastConfigurationItem(BroadcastServerType type)
{
super(type.toString(), mIconManager.getScaledIcon(new ImageIcon(type.getIconPath()), 14));
super(type.toString(), mIconManager.getScaledIcon(type.getIconPath(), 14));
mBroadcastServerType = type;

View File

@@ -20,11 +20,11 @@ package io.github.dsheirer.audio.broadcast;
public enum BroadcastServerType
{
BROADCASTIFY("Broadcastify", "images/broadcastify.png"), //Icecast Server 2.3.2
ICECAST_HTTP("Icecast 2 (v2.4+)", "images/icecast.png"),
ICECAST_TCP("Icecast (v2.3)", "images/icecast.png"),
SHOUTCAST_V1("Shoutcast v1.x", "images/shoutcast.png"),
SHOUTCAST_V2("Shoutcast v2.x", "images/shoutcast.png"),
BROADCASTIFY("Broadcastify", "/images/broadcastify.png"), //Icecast Server 2.3.2
ICECAST_HTTP("Icecast 2 (v2.4+)", "/images/icecast.png"),
ICECAST_TCP("Icecast (v2.3)", "/images/icecast.png"),
SHOUTCAST_V1("Shoutcast v1.x", "/images/shoutcast.png"),
SHOUTCAST_V2("Shoutcast v2.x", "/images/shoutcast.png"),
UNKNOWN("Unknown", null);
private String mLabel;

View File

@@ -31,10 +31,17 @@ import net.miginfocom.swing.MigLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.swing.*;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JSlider;
import javax.swing.JTextField;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@@ -74,8 +81,7 @@ public class BroadcastifyConfigurationEditor extends BroadcastConfigurationEdito
JLabel channelLabel = new JLabel("Broadcastify Stream");
ImageIcon broadcastifyIcon = mIconManager.getScaledIcon(
new ImageIcon(BroadcastServerType.BROADCASTIFY.getIconPath()), 25);
ImageIcon broadcastifyIcon = mIconManager.getScaledIcon(BroadcastServerType.BROADCASTIFY.getIconPath(), 25);
channelLabel.setIcon(broadcastifyIcon);
add(channelLabel, "span, align center");

View File

@@ -29,10 +29,16 @@ import net.miginfocom.swing.MigLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.swing.*;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JSlider;
import javax.swing.JTextField;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@@ -73,7 +79,7 @@ public class IcecastHTTPConfigurationEditor extends BroadcastConfigurationEditor
JLabel channelLabel = new JLabel("Icecast 2 (v2.4+) Stream");
ImageIcon icon = mIconManager.getScaledIcon(new ImageIcon(BroadcastServerType.ICECAST_HTTP.getIconPath()), 25);
ImageIcon icon = mIconManager.getScaledIcon(BroadcastServerType.ICECAST_HTTP.getIconPath(), 25);
channelLabel.setIcon(icon);
add(channelLabel, "span, align center");

View File

@@ -29,10 +29,16 @@ import net.miginfocom.swing.MigLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.swing.*;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JSlider;
import javax.swing.JTextField;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@@ -72,7 +78,7 @@ public class IcecastTCPConfigurationEditor extends BroadcastConfigurationEditor
JLabel channelLabel = new JLabel("Icecast (v2.3) Stream");
ImageIcon icon = mIconManager.getScaledIcon(new ImageIcon(BroadcastServerType.ICECAST_TCP.getIconPath()), 25);
ImageIcon icon = mIconManager.getScaledIcon(BroadcastServerType.ICECAST_TCP.getIconPath(), 25);
channelLabel.setIcon(icon);
add(channelLabel, "span, align center");

View File

@@ -29,10 +29,16 @@ import net.miginfocom.swing.MigLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.swing.*;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JSlider;
import javax.swing.JTextField;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@@ -71,7 +77,7 @@ public class ShoutcastV1ConfigurationEditor extends BroadcastConfigurationEditor
JLabel channelLabel = new JLabel("Shoutcast (v1.x) Stream");
ImageIcon icon = mIconManager.getScaledIcon(new ImageIcon(BroadcastServerType.SHOUTCAST_V1.getIconPath()), 25);
ImageIcon icon = mIconManager.getScaledIcon(BroadcastServerType.SHOUTCAST_V1.getIconPath(), 25);
channelLabel.setIcon(icon);
add(channelLabel, "span, align center");

View File

@@ -29,10 +29,16 @@ import net.miginfocom.swing.MigLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.swing.*;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JSlider;
import javax.swing.JTextField;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@@ -72,7 +78,7 @@ public class ShoutcastV2ConfigurationEditor extends BroadcastConfigurationEditor
JLabel channelLabel = new JLabel("Shoutcast (v2) Stream");
ImageIcon icon = mIconManager.getScaledIcon(new ImageIcon(BroadcastServerType.SHOUTCAST_V2.getIconPath()), 25);
ImageIcon icon = mIconManager.getScaledIcon(BroadcastServerType.SHOUTCAST_V2.getIconPath(), 25);
channelLabel.setIcon(icon);
add(channelLabel, "span, align center");