- Timestamp:
- 2012-08-20T01:26:42+02:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r5391 r5460 822 822 CheckParameterUtil.ensureParameterNotNull(p); 823 823 Projection oldValue = proj; 824 Bounds b = (Main.map != null && Main.map.mapView != null) ? Main.map.mapView.getRealBounds() : null;824 Bounds b = isDisplayingMapView() ? map.mapView.getRealBounds() : null; 825 825 proj = p; 826 826 fireProjectionChanged(oldValue, proj, b); -
trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
r5458 r5460 58 58 59 59 protected boolean isLayerAlreadyPresent() { 60 if (Main. map != null && Main.map.mapView != null) {60 if (Main.isDisplayingMapView()) { 61 61 for (ImageryLayer layer : Main.map.mapView.getLayersOfType(ImageryLayer.class)) { 62 62 if (info.equals(layer.getInfo())) { … … 75 75 } else if (info.getImageryType() == ImageryType.TMS || info.getImageryType() == ImageryType.BING || info.getImageryType() == ImageryType.SCANEX) { 76 76 setEnabled(true); 77 } else if (Main. map != null && Main.map.mapView != null&& !Main.map.mapView.getAllLayers().isEmpty()) {77 } else if (Main.isDisplayingMapView() && !Main.map.mapView.getAllLayers().isEmpty()) { 78 78 setEnabled(true); 79 79 } else { -
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r4982 r5460 129 129 130 130 public void autoScale() { 131 if (Main. map != null) {131 if (Main.isDisplayingMapView()) { 132 132 if (mode.equals("previous")) { 133 133 Main.map.mapView.zoomPrevious(); … … 237 237 } 238 238 } else if ("previous".equals(mode)) { 239 setEnabled(Main. map != null && Main.map.mapView != null&& Main.map.mapView.hasZoomUndoEntries());239 setEnabled(Main.isDisplayingMapView() && Main.map.mapView.hasZoomUndoEntries()); 240 240 } else if ("next".equals(mode)) { 241 setEnabled(Main. map != null && Main.map.mapView != null&& Main.map.mapView.hasZoomRedoEntries());241 setEnabled(Main.isDisplayingMapView() && Main.map.mapView.hasZoomRedoEntries()); 242 242 } else { 243 243 setEnabled( -
trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java
r4845 r5460 201 201 } 202 202 updateOffsetIntl(); 203 if (Main. map != null) {203 if (Main.isDisplayingMapView()) { 204 204 Main.map.repaint(); 205 205 } -
trunk/src/org/openstreetmap/josm/actions/LassoModeAction.java
r5161 r5460 19 19 @Override 20 20 public void enterMode() { 21 if (Main. map != null) {21 if (Main.isDisplayingMapView()) { 22 22 Main.map.mapModeSelect.setLassoMode(true); 23 23 Main.map.mapModeSelect.enterMode(); … … 28 28 @Override 29 29 public void exitMode() { 30 Main.map.mapModeSelect.setLassoMode(false); 31 Main.map.mapModeSelect.exitMode(); 30 if (Main.isDisplayingMapView()) { 31 Main.map.mapModeSelect.setLassoMode(false); 32 Main.map.mapModeSelect.exitMode(); 33 } 32 34 super.exitMode(); 33 35 } -
trunk/src/org/openstreetmap/josm/actions/Map_Rectifier_WMSmenuAction.java
r5050 r5460 224 224 @Override 225 225 protected void updateEnabledState() { 226 setEnabled(Main. map != null && Main.map.mapView != null&& !Main.map.mapView.getAllLayers().isEmpty());226 setEnabled(Main.isDisplayingMapView() && !Main.map.mapView.getAllLayers().isEmpty()); 227 227 } 228 228 } -
trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java
r5459 r5460 105 105 return; 106 106 } 107 boolean check = Main.map != null 108 && Main.map.mapView !=null 107 boolean check = Main.isDisplayingMapView() 109 108 && Main.map.mapView.getActiveLayer() != null; 110 109 if(!check) { -
trunk/src/org/openstreetmap/josm/actions/ToggleGPXLinesAction.java
r4982 r5460 21 21 public void actionPerformed(ActionEvent e) { 22 22 Main.pref.put("draw.rawgps.lines", !Main.pref.getBoolean("draw.rawgps.lines", true)); 23 if (Main.map != null) {23 if (Main.isDisplayingMapView()) { 24 24 Main.map.mapView.repaint(); 25 25 } -
trunk/src/org/openstreetmap/josm/actions/ViewportFollowToggleAction.java
r4982 r5460 64 64 @Override 65 65 protected void updateEnabledState() { 66 setEnabled(Main. map != null&& Main.main.getEditLayer() != null);66 setEnabled(Main.isDisplayingMapView() && Main.main.getEditLayer() != null); 67 67 } 68 68 } -
trunk/src/org/openstreetmap/josm/actions/WireframeToggleAction.java
r4982 r5460 67 67 68 68 notifySelectedState(); 69 if (Main. map != null) {69 if (Main.isDisplayingMapView()) { 70 70 Main.map.mapView.repaint(); 71 71 } … … 78 78 @Override 79 79 protected void updateEnabledState() { 80 setEnabled(Main. map != null&& Main.main.getEditLayer() != null);80 setEnabled(Main.isDisplayingMapView() && Main.main.getEditLayer() != null); 81 81 } 82 82 -
trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
r5275 r5460 326 326 @Override 327 327 protected void updateEnabledState() { 328 setEnabled(Main. map != null && Main.map.mapView != null&& Main.map.mapView.isActiveLayerDrawable());328 setEnabled(Main.isDisplayingMapView() && Main.map.mapView.isActiveLayerDrawable()); 329 329 } 330 330 -
trunk/src/org/openstreetmap/josm/actions/mapmode/MapMode.java
r4327 r5460 71 71 */ 72 72 public void actionPerformed(ActionEvent e) { 73 if (Main. map != null)73 if (Main.isDisplayingMapView()) { 74 74 Main.map.selectMapMode(this); 75 } 75 76 } 76 77 -
trunk/src/org/openstreetmap/josm/data/imagery/OffsetBookmark.java
r5224 r5460 103 103 public static void bookmarkOffset(String name, ImageryLayer layer) { 104 104 LatLon center; 105 if (Main. map != null && Main.map.mapView != null) {105 if (Main.isDisplayingMapView()) { 106 106 center = Main.getProjection().eastNorth2latlon(Main.map.mapView.getCenter()); 107 107 } else { -
trunk/src/org/openstreetmap/josm/gui/MainMenu.java
r5092 r5460 593 593 */ 594 594 protected void refreshEnabled() { 595 presetsMenu.setEnabled(Main.map != null 596 && Main.map.mapView !=null 595 presetsMenu.setEnabled(Main.isDisplayingMapView() 597 596 && Main.map.mapView.getEditLayer() != null 598 597 ); -
trunk/src/org/openstreetmap/josm/gui/MapView.java
r5459 r5460 143 143 addEditLayerChangeListener(listener); 144 144 if (initialFire) { 145 if (Main. map != null && Main.map.mapView != null&& Main.map.mapView.getEditLayer() != null) {145 if (Main.isDisplayingMapView() && Main.map.mapView.getEditLayer() != null) { 146 146 fireEditLayerChanged(null, Main.map.mapView.getEditLayer()); 147 147 } … … 623 623 tempG.draw(border); 624 624 625 if (Main. map != null&& Main.map.filterDialog != null) {625 if (Main.isDisplayingMapView() && Main.map.filterDialog != null) { 626 626 Main.map.filterDialog.drawOSDText(tempG); 627 627 } -
trunk/src/org/openstreetmap/josm/gui/actionsupport/AlignImageryPanel.java
r5128 r5460 2 2 3 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 4 6 import java.awt.Color; 5 7 import java.awt.Font; 6 import java.awt.GridBagConstraints;7 8 import java.awt.GridBagLayout; 8 9 import java.awt.Toolkit; 9 10 import java.awt.event.ActionEvent; 10 11 import java.awt.event.ActionListener; 11 import javax.swing.BoxLayout; 12 12 13 import javax.swing.JButton; 13 14 import javax.swing.JLabel; 14 15 import javax.swing.JPanel; 15 import javax.swing.Box;16 16 import javax.swing.border.CompoundBorder; 17 17 import javax.swing.border.EmptyBorder; … … 20 20 import org.openstreetmap.josm.Main; 21 21 import org.openstreetmap.josm.tools.GBC; 22 import static org.openstreetmap.josm.tools.I18n.tr;23 22 import org.openstreetmap.josm.tools.ImageProvider; 24 23 import org.openstreetmap.josm.tools.UrlLabel; … … 50 49 @Override 51 50 public void actionPerformed( ActionEvent e ) { 52 if (Main. map!=null) {51 if (Main.isDisplayingMapView()) { 53 52 Main.map.removeTopPanel(AlignImageryPanel.class); 54 53 Main.pref.put(PREF, false); … … 73 72 74 73 public static void addNagPanelIfNeeded() { 75 if ( Main.map != null&& !Main.pref.getBoolean("expert") && Main.pref.getBoolean(PREF, true) ) {74 if (Main.isDisplayingMapView() && !Main.pref.getBoolean("expert") && Main.pref.getBoolean(PREF, true) ) { 76 75 if (Main.map.getTopPanel(AlignImageryPanel.class) == null) { 77 76 double w = Toolkit.getDefaultToolkit().getScreenSize().getWidth(); -
trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java
r5200 r5460 315 315 tpDownloadAreaSelectors.setSelectedIndex(idx); 316 316 317 if (Main. map != null) {317 if (Main.isDisplayingMapView()) { 318 318 MapView mv = Main.map.mapView; 319 319 currentBounds = new Bounds( -
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialogManager.java
r4932 r5460 131 131 // remove all history browsers if the number of layers drops to 0 132 132 // 133 if (Main. map != null&& Main.map.mapView.getNumLayers() == 0) {133 if (Main.isDisplayingMapView() && Main.map.mapView.getNumLayers() == 0) { 134 134 hideAll(); 135 135 } -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
r5432 r5460 223 223 // } TODO: pop up image dialog but don't load image again 224 224 225 if (centerView && Main. map != null&& entry != null && entry.getPos() != null) {225 if (centerView && Main.isDisplayingMapView() && entry != null && entry.getPos() != null) { 226 226 Main.map.mapView.zoomTo(entry.getPos()); 227 227 } -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ThumbsLoader.java
r3385 r5460 45 45 data.get(i).thumbnail = loadThumb(data.get(i)); 46 46 47 if (Main. map != null && Main.map.mapView != null) {47 if (Main.isDisplayingMapView()) { 48 48 layer.updateOffscreenBuffer = true; 49 49 Main.map.mapView.repaint(); -
trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintMenu.java
r5253 r5460 55 55 @Override 56 56 public void updateEnabledState() { 57 setEnabled(Main. map != null&& Main.main.getEditLayer() != null);57 setEnabled(Main.isDisplayingMapView() && Main.main.getEditLayer() != null); 58 58 } 59 59 } -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
r5095 r5460 170 170 AutoScaleAction.autoScale("selection"); 171 171 } 172 if (Main. map != null&& Main.map.relationListDialog != null) {172 if (Main.isDisplayingMapView() && Main.map.relationListDialog != null) { 173 173 Main.map.relationListDialog.selectRelations(null); // unselect all relations to fix #7342 174 174 Main.map.relationListDialog.dataChanged(null); … … 221 221 // make sure this isn't called unless there *is* a MapView 222 222 // 223 if (Main. map != null && Main.map.mapView != null) {223 if (Main.isDisplayingMapView()) { 224 224 Main.worker.execute(new Runnable() { 225 225 public void run() { -
trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java
r5005 r5460 152 152 int height = Toolkit.getDefaultToolkit().getScreenSize().height; 153 153 int width = Toolkit.getDefaultToolkit().getScreenSize().width; 154 if (Main. map != null && Main.map.mapView != null) {154 if (Main.isDisplayingMapView()) { 155 155 height = Main.map.mapView.getHeight(); 156 156 width = Main.map.mapView.getWidth();
Note:
See TracChangeset
for help on using the changeset viewer.