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

@@ -24,7 +24,8 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.swing.*;
import javax.swing.ImageIcon;
import java.net.URL;
@JacksonXmlRootElement(localName = "icon")
public class Icon implements Comparable<Icon>
@@ -80,7 +81,17 @@ public class Icon implements Comparable<Icon>
{
try
{
mImageIcon = new ImageIcon(mPath);
URL imageURL = Icon.class.getResource(mPath);
if(imageURL == null && !mPath.startsWith("/"))
{
imageURL = (Icon.class.getResource("/" + mPath));
}
if(imageURL != null)
{
mImageIcon = new ImageIcon(imageURL);
}
}
catch(Exception e)
{