#82 WIP - converted all classes to get icons from IconManager and removed icon management from the SettingsManager

This commit is contained in:
Denny
2017-01-08 21:06:02 -05:00
parent 488dc9da4c
commit b6498d048a
43 changed files with 4809 additions and 5084 deletions

View File

@@ -1,3 +1,21 @@
/*******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2017 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
******************************************************************************/
package alias;
import alias.AliasEvent.Event;
@@ -5,9 +23,9 @@ import gui.editor.Editor;
import icon.Icon;
import icon.IconCellRenderer;
import icon.IconManager;
import icon.IconModel;
import map.MapIcon;
import net.miginfocom.swing.MigLayout;
import settings.SettingsManager;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
@@ -43,8 +61,7 @@ public class AliasNameEditor extends Editor<Alias>
private void init()
{
setLayout(new MigLayout("fill,wrap 2", "[right][grow,fill]",
"[][][][][][][grow]"));
setLayout(new MigLayout("fill,wrap 2", "[right][grow,fill]", "[][][][][][][grow]"));
add(new JLabel("Name:"));
mName = new JTextField();
@@ -140,7 +157,7 @@ public class AliasNameEditor extends Editor<Alias>
IconCellRenderer renderer = new IconCellRenderer(mIconManager);
renderer.setPreferredSize(new Dimension(200, 30));
mIconCombo.setRenderer( renderer );
mIconCombo.setRenderer(renderer);
mIconCombo.addActionListener(new ActionListener()
{
@Override
@@ -179,6 +196,8 @@ public class AliasNameEditor extends Editor<Alias>
{
mName.setText(alias.getName());
mIconCombo.setModel(new DefaultComboBoxModel<>(mIconManager.getIcons()));
List<String> listNames = mAliasModel.getListNames();
if(listNames.isEmpty())
@@ -218,7 +237,7 @@ public class AliasNameEditor extends Editor<Alias>
if(iconName == null)
{
iconName = SettingsManager.DEFAULT_ICON;
iconName = IconModel.DEFAULT_ICON;
}
Icon savedIcon = mIconManager.getModel().getIcon(iconName);

View File

@@ -266,6 +266,8 @@ public class MultipleAliasEditor extends Editor<List<Alias>>
List<String> streamNames = mBroadcastModel.getBroadcastConfigurationNames();
mStreamCombo.setModel(new DefaultComboBoxModel<String>(streamNames.toArray(new String[streamNames.size()])));
mIconCombo.setModel(new DefaultComboBoxModel<>(mIconManager.getIcons()));
setCheckBoxesUnselected();
setModified(false);