- Timestamp:
- 2014-01-17T00:41:23+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
r6248 r6707 24 24 import org.openstreetmap.josm.gui.layer.ImageryLayer; 25 25 import org.openstreetmap.josm.gui.preferences.imagery.WMSLayerTree; 26 import org.openstreetmap.josm.gui.util.GuiHelper; 26 27 import org.openstreetmap.josm.io.imagery.WMSImagery; 27 28 import org.openstreetmap.josm.tools.GBC; 28 29 import org.openstreetmap.josm.tools.ImageProvider; 30 import org.openstreetmap.josm.tools.ImageProvider.ImageCallback; 29 31 32 /** 33 * Action displayed in imagery menu to add a new imagery layer. 34 * @since 3715 35 */ 30 36 public class AddImageryLayerAction extends JosmAction implements AdaptableAction { 31 37 … … 33 39 private final ImageryInfo info; 34 40 41 /** 42 * Constructs a new {@code AddImageryLayerAction} for the given {@code ImageryInfo}. 43 * If an http:// icon is specified, it is fetched asynchronously. 44 * @param info The imagery info 45 */ 35 46 public AddImageryLayerAction(ImageryInfo info) { 36 47 super(info.getMenuName(), /* ICON */"imagery_menu", tr("Add imagery layer {0}",info.getName()), null, false, false); … … 42 53 try { 43 54 if (info.getIcon() != null) { 44 ImageIcon i = new ImageProvider(info.getIcon()).setOptional(true). 45 setMaxHeight(MAX_ICON_SIZE).setMaxWidth(MAX_ICON_SIZE).get(); 46 if (i != null) { 47 putValue(Action.SMALL_ICON, i); 48 } 55 new ImageProvider(info.getIcon()).setOptional(true). 56 setMaxHeight(MAX_ICON_SIZE).setMaxWidth(MAX_ICON_SIZE).getInBackground(new ImageCallback() { 57 @Override 58 public void finished(final ImageIcon result) { 59 if (result != null) { 60 GuiHelper.runInEDT(new Runnable() { 61 @Override 62 public void run() { 63 putValue(Action.SMALL_ICON, result); 64 } 65 }); 66 } 67 } 68 }); 49 69 } 50 70 } catch (Exception ex) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r6652 r6707 738 738 public class MouseClickWatch extends MouseAdapter { 739 739 @Override public void mouseClicked(MouseEvent e) { 740 if (e.getClickCount() < 2) 741 { 740 if (e.getClickCount() < 2) { 742 741 // single click, clear selection in other table not clicked in 743 742 if (e.getSource() == tagTable) { … … 748 747 } 749 748 // double click, edit or add tag 750 else if (e.getSource() == tagTable) 751 { 749 else if (e.getSource() == tagTable) { 752 750 int row = tagTable.rowAtPoint(e.getPoint()); 753 751 if (row > -1) { … … 764 762 } 765 763 } 766 else 767 { 764 else { 768 765 editHelper.addTag(); 769 766 btnAdd.requestFocusInWindow();
Note:
See TracChangeset
for help on using the changeset viewer.