- Timestamp:
- 2013-11-23T14:21:45+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PresetListPanel.java
r6084 r6403 92 92 for (TaggingPreset t : TaggingPreset.getMatchingPresets(types, tags, true)) { 93 93 JLabel lbl = new JLabel(t.getName() + " …"); 94 lbl.setIcon( (Icon) t.getValue(Action.SMALL_ICON));94 lbl.setIcon(t.getIcon()); 95 95 lbl.addMouseListener(new PresetLabelML(lbl, t, presetHandler)); 96 96 add(lbl, GBC.eol().fill(GBC.HORIZONTAL)); -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
r6362 r6403 68 68 import org.openstreetmap.josm.gui.ExtendedDialog; 69 69 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles; 70 import org.openstreetmap.josm.gui.tagging.TaggingPreset; 70 71 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingComboBox; 71 72 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionListItem; … … 670 671 ImageIcon icon = MapPaintStyles.getNodeIcon(t, false); // Filters deprecated icon 671 672 if (icon == null) { 672 icon = new ImageIcon(new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB)); 673 // If no icon found in map style look at presets 674 Map<String, String> map = new HashMap<String, String>(); 675 map.put(t.getKey(), t.getValue()); 676 for (TaggingPreset tp : TaggingPreset.getMatchingPresets(null, map, false)) { 677 icon = tp.getIcon(); 678 if (icon != null) { 679 break; 680 } 681 } 682 // If still nothing display an empty icon 683 if (icon == null) { 684 icon = new ImageIcon(new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB)); 685 } 673 686 } 674 687 GridBagConstraints gbc = new GridBagConstraints(); … … 723 736 } 724 737 725 726 738 /** 727 739 * Read tags from comboboxes and add it to all selected objects -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r6326 r6403 123 123 return group != null ? group.getRawName() + "/" + name : name; 124 124 } 125 126 /* 125 126 /** 127 * Returns the preset icon. 128 * @return The preset icon, or {@code null} if none defined 129 * @since 6403 130 */ 131 public final ImageIcon getIcon() { 132 Object icon = getValue(Action.SMALL_ICON); 133 if (icon instanceof ImageIcon) { 134 return (ImageIcon) icon; 135 } 136 return null; 137 } 138 139 /** 127 140 * Called from the XML parser to set the icon. 128 141 * This task is performed in the background in order to speedup startup. … … 156 169 } 157 170 158 /* 171 /** 159 172 * Called from the XML parser to set the types this preset affects. 160 173 */
Note:
See TracChangeset
for help on using the changeset viewer.