Changeset 3443 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2010-08-15T22:04:43+02:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AbstractInfoAction.java
r3083 r3443 24 24 public abstract class AbstractInfoAction extends JosmAction { 25 25 26 public AbstractInfoAction( ) {27 super( );26 public AbstractInfoAction(boolean installAdapters) { 27 super(installAdapters); 28 28 } 29 29 -
trunk/src/org/openstreetmap/josm/actions/JosmAction.java
r3416 r3443 66 66 */ 67 67 public JosmAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean register) { 68 this(name, iconName, tooltip, shortcut, register, true); 69 } 70 71 /** 72 * Even newer super for all actions. Use if you don't want to install layer changed and selection changed adapters 73 * @param name 74 * @param iconName 75 * @param tooltip 76 * @param shortcut 77 * @param register 78 * @param installAdapters 79 */ 80 public JosmAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean register, boolean installAdapters) { 68 81 super(name, iconName == null ? null : ImageProvider.get(iconName)); 69 82 setHelpId(); … … 77 90 Main.toolbar.register(this); 78 91 } 79 installAdapters(); 92 if (installAdapters) { 93 installAdapters(); 94 } 80 95 } 81 96 -
trunk/src/org/openstreetmap/josm/actions/mapmode/ZoomAction.java
r2512 r3443 7 7 import java.awt.event.KeyEvent; 8 8 9 import org.openstreetmap.josm.Main; 9 10 import org.openstreetmap.josm.gui.MapFrame; 10 11 import org.openstreetmap.josm.gui.MapView; … … 30 31 31 32 /** 32 * Shortcut to the mapview.33 */34 private final MapView mv;35 /**36 33 * Manager that manages the selection rectangle with the aspect ratio of the 37 34 * MapView. … … 47 44 Shortcut.registerShortcut("mapmode:zoom", tr("Mode: {0}", tr("Zoom")), KeyEvent.VK_Z, Shortcut.GROUP_EDIT), 48 45 mapFrame, ImageProvider.getCursor("normal", "zoom")); 49 mv = mapFrame.mapView; 50 selectionManager = new SelectionManager(this, true, mv); 46 selectionManager = new SelectionManager(this, true, mapFrame.mapView); 51 47 } 52 48 … … 55 51 */ 56 52 public void selectionEnded(Rectangle r, boolean alt, boolean shift, boolean ctrl) { 57 if (r.width >= 3 && r.height >= 3) { 53 if (r.width >= 3 && r.height >= 3 && Main.isDisplayingMapView()) { 54 MapView mv = Main.map.mapView; 58 55 mv.zoomToFactor(mv.getEastNorth(r.x+r.width/2, r.y+r.height/2), r.getWidth()/mv.getWidth()); 59 56 } … … 62 59 @Override public void enterMode() { 63 60 super.enterMode(); 64 selectionManager.register( mv);61 selectionManager.register(Main.map.mapView); 65 62 } 66 63 67 64 @Override public void exitMode() { 68 65 super.exitMode(); 69 selectionManager.unregister( mv);66 selectionManager.unregister(Main.map.mapView); 70 67 } 71 68
Note:
See TracChangeset
for help on using the changeset viewer.