Decoder icon updates. Changed from colorized icons to a standard set of decoder icons and will now color the text of the channel node to reflect the status (green - processing, red - no tuner, no color - disabled )

This commit is contained in:
dennis.sheirer
2014-12-06 20:20:50 +00:00
parent fb630916a9
commit 0b535d8143
41 changed files with 65 additions and 47 deletions

BIN
images/acars.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

BIN
images/ais.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

BIN
images/am.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 B

BIN
images/aprs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 504 B

BIN
images/dmr.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 520 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 396 B

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 571 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 566 B

BIN
images/ltr.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 505 B

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 687 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 692 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 691 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 532 B

BIN
images/motorola_type_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 657 B

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 829 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 859 B

BIN
images/nxdn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

BIN
images/p25_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

BIN
images/p25_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 649 B

After

Width:  |  Height:  |  Size: 443 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 802 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 806 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 815 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 712 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 723 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 983 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1003 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 900 B

View File

@@ -17,6 +17,7 @@
******************************************************************************/ ******************************************************************************/
package controller; package controller;
import java.awt.Color;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@@ -57,6 +58,11 @@ public class BaseNode extends DefaultMutableTreeNode
return null; return null;
} }
public Color getForegroundColor()
{
return null;
}
public String toString() public String toString()
{ {
if( getUserObject() != null ) if( getUserObject() != null )

View File

@@ -17,6 +17,7 @@
******************************************************************************/ ******************************************************************************/
package controller; package controller;
import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Image; import java.awt.Image;
import java.util.HashMap; import java.util.HashMap;
@@ -25,6 +26,8 @@ import javax.swing.ImageIcon;
import javax.swing.JTree; import javax.swing.JTree;
import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.DefaultTreeCellRenderer;
import controller.channel.ChannelNode;
public class ControllerTreeCellRenderer extends DefaultTreeCellRenderer public class ControllerTreeCellRenderer extends DefaultTreeCellRenderer
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@@ -46,18 +49,17 @@ public class ControllerTreeCellRenderer extends DefaultTreeCellRenderer
if( value instanceof BaseNode ) if( value instanceof BaseNode )
{ {
ImageIcon icon = getIcon( (BaseNode)value ); BaseNode node = (BaseNode)value;
if( icon != null ) ImageIcon icon = getIcon( node );
setIcon( icon );
Color foreground = node.getForegroundColor();
if( foreground != null )
{ {
if( icon.getIconHeight() > 16 ) setForeground( foreground );
{
}
else
{
setIcon( icon );
}
} }
} }

View File

@@ -17,6 +17,7 @@
******************************************************************************/ ******************************************************************************/
package controller.channel; package controller.channel;
import java.awt.Color;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import javax.swing.JPanel; import javax.swing.JPanel;
@@ -98,21 +99,27 @@ public class ChannelNode extends ConfigurableNode implements ChannelEventListene
@Override @Override
public String getIconPath() public String getIconPath()
{ {
StringBuilder sb = new StringBuilder(); return getChannel().getDecodeConfiguration().getDecoderType()
.getIconFilename();
Channel channel = getChannel(); }
sb.append( channel.getDecodeConfiguration().getDecoderType().getIconPrefix() ); @Override
public Color getForegroundColor()
if( channel.getEnabled() ) {
if( getChannel().getEnabled() )
{ {
sb.append( channel.isProcessing() ? "_green" : "_red" ); if( getChannel().isProcessing() )
{
return Color.GREEN;
}
else
{
return Color.RED;
}
} }
sb.append( ".png" ); return null;
}
return sb.toString();
}
@Override @Override
public JPanel getEditor() public JPanel getEditor()

View File

@@ -18,6 +18,7 @@
package controller.site; package controller.site;
import java.awt.Color;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.Enumeration; import java.util.Enumeration;
@@ -59,27 +60,27 @@ public class SiteNode extends ConfigurableNode
public String getIconPath() public String getIconPath()
{ {
String retVal = "images/site.png"; return "images/site.png";
}
@Override
public Color getForegroundColor()
{
@SuppressWarnings( "unchecked" ) @SuppressWarnings( "unchecked" )
Enumeration<DefaultMutableTreeNode> nodes = children(); Enumeration<DefaultMutableTreeNode> nodes = children();
while( nodes.hasMoreElements() ) while( nodes.hasMoreElements() )
{ {
ChannelNode child = (ChannelNode)nodes.nextElement(); ChannelNode child = (ChannelNode)nodes.nextElement();
if( child.getIconPath().contains( "green.png" ) ) if( child.getForegroundColor() != null )
{ {
return "images/site_green.png"; return Color.BLUE;
}
else if( child.getIconPath().contains( "red.png" ) )
{
retVal = "images/site_red.png";
} }
} }
return retVal; return null;
} }
@Override @Override
public JPanel getEditor() public JPanel getEditor()

View File

@@ -18,6 +18,7 @@
package controller.system; package controller.system;
import java.awt.Color;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.Enumeration; import java.util.Enumeration;
@@ -29,6 +30,7 @@ import javax.swing.JSeparator;
import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultMutableTreeNode;
import controller.ConfigurableNode; import controller.ConfigurableNode;
import controller.channel.ChannelNode;
import controller.site.Site; import controller.site.Site;
import controller.site.SiteNode; import controller.site.SiteNode;
@@ -58,28 +60,28 @@ public class SystemNode extends ConfigurableNode
@Override @Override
public String getIconPath() public String getIconPath()
{ {
String retVal = "images/system.png"; return "images/system.png";
}
@Override
public Color getForegroundColor()
{
@SuppressWarnings( "unchecked" ) @SuppressWarnings( "unchecked" )
Enumeration<DefaultMutableTreeNode> nodes = children(); Enumeration<DefaultMutableTreeNode> nodes = children();
while( nodes.hasMoreElements() ) while( nodes.hasMoreElements() )
{ {
SiteNode child = (SiteNode)nodes.nextElement(); SiteNode child = (SiteNode)nodes.nextElement();
if( child.getIconPath().contains( "green.png" ) ) if( child.getForegroundColor() != null )
{ {
return "images/system_green.png"; return Color.BLUE;
}
else if( child.getIconPath().contains( "red.png" ) )
{
retVal = "images/system_red.png";
} }
} }
return retVal; return null;
} }
@Override @Override
public JPanel getEditor() public JPanel getEditor()
{ {