Changeset 4713 in josm for trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
- Timestamp:
- 2011-12-26T21:48:25+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
r4531 r4713 5 5 6 6 import java.awt.event.ActionEvent; 7 7 import javax.swing.Action; 8 import javax.swing.ImageIcon; 8 9 import javax.swing.JOptionPane; 9 10 10 import org.openstreetmap.josm.Main; 11 11 import org.openstreetmap.josm.data.imagery.ImageryInfo; 12 12 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType; 13 13 import org.openstreetmap.josm.gui.layer.ImageryLayer; 14 import org.openstreetmap.josm.tools.ImageRequest; 14 15 15 16 public class AddImageryLayerAction extends JosmAction implements AdaptableAction { 16 17 18 private static final int MAX_ICON_SIZE = 24; 17 19 private final ImageryInfo info; 18 20 … … 22 24 this.info = info; 23 25 installAdapters(); 26 27 // change toolbar icon from if specified 28 try { 29 if (info.getIcon() != null) { 30 ImageIcon i = new ImageRequest().setName(info.getIcon()).setMaxHeight(MAX_ICON_SIZE).setMaxWidth(MAX_ICON_SIZE).get(); 31 putValue(Action.SMALL_ICON, i); 32 } 33 } catch (Exception ex) { 34 throw new RuntimeException(ex.getMessage(), ex); 35 } 24 36 } 25 37
Note:
See TracChangeset
for help on using the changeset viewer.