Skip to content
Permalink
Browse files

wrong map iterator

  • Loading branch information...
bobjacobsen committed Oct 29, 2018
1 parent 33775fd commit 008637fd88fb12cbd96ccd1e93ca5fff211c614e
Showing with 8 additions and 7 deletions.
  1. +3 −2 java/src/apps/GuiLafConfigPane.java
  2. +5 −5 java/src/jmri/jmrit/display/palette/IconItemPanel.java
@@ -117,15 +117,16 @@ void doLAF(JPanel panel) {
installedLAFs.put(plaf.getName(), plaf.getClassName());
}
// make the radio buttons
for (String name : installedLAFs.keySet()) {
for (java.util.Map.Entry<String, String> entry : installedLAFs.entrySet()) {
String name = entry.getKey();
JRadioButton jmi = new JRadioButton(name);
panel.add(jmi);
LAFGroup.add(jmi);
jmi.setActionCommand(name);
jmi.addActionListener((ActionEvent e) -> {
InstanceManager.getDefault(GuiLafPreferencesManager.class).setLookAndFeel(name);
});
if (installedLAFs.get(name).equals(UIManager.getLookAndFeel().getClass().getName())) {
if ( entry.getValue().equals(UIManager.getLookAndFeel().getClass().getName())) {
jmi.setSelected(true);
}
}
@@ -163,14 +163,14 @@ protected void initIconFamiliesPanel() {
HashMap<String, HashMap<String, NamedIcon>> families = ItemPalette.getFamilyMaps(_itemType);
if (families != null && families.size() > 0) {
if (families.size() != 1) {
log.warn("ItemType \"{}\" has {}", _itemType, families.size());
log.warn("ItemType \"{}\" has {} entries, more than the single one expected", _itemType, families.size());
}
Iterator<String> iter = families.keySet().iterator();
while (iter.hasNext()) {
String family = iter.next();
_iconMap = families.get(family);

for (HashMap<String, NamedIcon> map : families.values() ) {
_iconMap = map; // setting object member variable
addIconsToPanel(_iconMap);
}

} else {
// make create message
log.error("Item type \"{}\" has {} families.", _itemType, (families == null ? "null" : families.size()));

0 comments on commit 008637f

Please sign in to comment.
You can’t perform that action at this time.