Changeset 6336 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2013-10-27T05:35:41+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r6333 r6336 62 62 */ 63 63 public static void zoomToSelection() { 64 if (Main.main == null || Main.main.getEditLayer() == null) return; 65 if (Main.map == null || Main.map.mapView == null) return; 64 if (Main.main == null || !Main.main.hasEditLayer()) return; 66 65 Collection<OsmPrimitive> sel = Main.main.getEditLayer().data.getSelected(); 67 66 if (sel.isEmpty()) { -
trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java
r6258 r6336 67 67 @Override 68 68 public void actionPerformed(ActionEvent e) { 69 if ( Main.main.getEditLayer() == null) {69 if (!Main.main.hasEditLayer()) { 70 70 new Notification( 71 71 tr("No data loaded.")) -
trunk/src/org/openstreetmap/josm/actions/DownloadReferrersAction.java
r6084 r6336 81 81 @Override 82 82 public void actionPerformed(ActionEvent e) { 83 if (!isEnabled() || ! Main.isDisplayingMapView())83 if (!isEnabled()) 84 84 return; 85 OsmDataLayer layer = Main.ma p.mapView.getEditLayer();85 OsmDataLayer layer = Main.main.getEditLayer(); 86 86 if (layer == null) 87 87 return; -
trunk/src/org/openstreetmap/josm/actions/InfoAction.java
r5925 r6336 1 // License: GPL. Copyright 2007 by Immanuel Scholz and others1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.actions; 3 3 … … 17 17 public class InfoAction extends JosmAction { 18 18 19 /** 20 * Constructs a new {@code InfoAction}. 21 */ 19 22 public InfoAction() { 20 23 super(tr("Advanced info"), "about", … … 30 33 DataSet set = getCurrentDataSet(); 31 34 if (set != null) { 32 new InspectPrimitiveDialog(set.getAllSelected(), Main.ma p.mapView.getEditLayer()).showDialog();35 new InspectPrimitiveDialog(set.getAllSelected(), Main.main.getEditLayer()).showDialog(); 33 36 } 34 37 } -
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r6316 r6336 519 519 // Delete the discarded inner ways 520 520 if (!discardedWays.isEmpty()) { 521 Command deleteCmd = DeleteCommand.delete(Main.ma p.mapView.getEditLayer(), discardedWays, true);521 Command deleteCmd = DeleteCommand.delete(Main.main.getEditLayer(), discardedWays, true); 522 522 if (deleteCmd != null) { 523 523 cmds.add(deleteCmd); … … 835 835 836 836 if (chunks.size() > 1) { 837 SplitWayResult split = SplitWayAction.splitWay(Main.ma p.mapView.getEditLayer(), way, chunks, Collections.<OsmPrimitive>emptyList());837 SplitWayResult split = SplitWayAction.splitWay(Main.main.getEditLayer(), way, chunks, Collections.<OsmPrimitive>emptyList()); 838 838 839 839 //execute the command, we need the results -
trunk/src/org/openstreetmap/josm/actions/PasteAction.java
r6227 r6336 131 131 if (data instanceof NodeData) { 132 132 NodeData nodeData = (NodeData)data; 133 if (Main.ma p.mapView.getEditLayer() == source) {133 if (Main.main.getEditLayer() == source) { 134 134 nodeData.setEastNorth(nodeData.getEastNorth().add(offsetEast, offsetNorth)); 135 135 } -
trunk/src/org/openstreetmap/josm/actions/PurgeAction.java
r6084 r6336 90 90 91 91 Collection<OsmPrimitive> sel = getCurrentDataSet().getAllSelected(); 92 layer = Main.ma p.mapView.getEditLayer();92 layer = Main.main.getEditLayer(); 93 93 94 94 toPurge = new HashSet<OsmPrimitive>(sel); … … 209 209 Main.pref.put("purge.clear_undo_redo", cbClearUndoRedo.isSelected()); 210 210 211 Main.main.undoRedo.add(new PurgeCommand(Main.ma p.mapView.getEditLayer(), toPurgeChecked, makeIncomplete));211 Main.main.undoRedo.add(new PurgeCommand(Main.main.getEditLayer(), toPurgeChecked, makeIncomplete)); 212 212 213 213 if (cbClearUndoRedo.isSelected()) { -
trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java
r6296 r6336 48 48 49 49 protected boolean confirmWayWithNodesOutsideBoundingBox(List<? extends OsmPrimitive> primitives) { 50 return DeleteCommand.checkAndConfirmOutlyingDelete(Main.ma p.mapView.getEditLayer(), primitives, null);50 return DeleteCommand.checkAndConfirmOutlyingDelete(Main.main.getEditLayer(), primitives, null); 51 51 } 52 52 -
trunk/src/org/openstreetmap/josm/actions/UpdateSelectionAction.java
r6046 r6336 40 40 try { 41 41 DataSet ds = reader.parseOsm(NullProgressMonitor.INSTANCE); 42 Main.ma p.mapView.getEditLayer().mergeFrom(ds);42 Main.main.getEditLayer().mergeFrom(ds); 43 43 } catch(Exception e) { 44 44 ExceptionDialogUtil.explainException(e); -
trunk/src/org/openstreetmap/josm/actions/UploadAction.java
r6316 r6336 269 269 } 270 270 APIDataSet apiData = new APIDataSet(Main.main.getCurrentDataSet()); 271 uploadData(Main.ma p.mapView.getEditLayer(), apiData);271 uploadData(Main.main.getEditLayer(), apiData); 272 272 } 273 273 } -
trunk/src/org/openstreetmap/josm/actions/ViewportFollowToggleAction.java
r6327 r6336 42 42 @Override 43 43 protected void updateEnabledState() { 44 setEnabled(Main. isDisplayingMapView() && Main.main.getEditLayer() != null);44 setEnabled(Main.main.hasEditLayer()); 45 45 } 46 46 } -
trunk/src/org/openstreetmap/josm/actions/WireframeToggleAction.java
r6327 r6336 37 37 @Override 38 38 protected void updateEnabledState() { 39 setEnabled(Main. isDisplayingMapView() && Main.main.getEditLayer() != null);39 setEnabled(Main.main.hasEditLayer()); 40 40 } 41 41 -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
r6272 r6336 223 223 protected OsmDataLayer getEditLayer() { 224 224 if (!Main.isDisplayingMapView()) return null; 225 return Main.ma p.mapView.getEditLayer();225 return Main.main.getEditLayer(); 226 226 } 227 227 -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java
r6316 r6336 291 291 } 292 292 } 293 final OsmDataLayer editLayer = Main.ma p.mapView.getEditLayer();293 final OsmDataLayer editLayer = Main.main.getEditLayer(); 294 294 if (editLayer != null && osmData) { 295 295 final Set<OsmPrimitive> myPrimitives = getCompletePrimitives(editLayer.data); -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r6317 r6336 283 283 @Override 284 284 public void eventDispatched(AWTEvent event) { 285 if (Main.map == null || Main.map.mapView == null|| !Main.map.mapView.isActiveLayerDrawable())285 if (!Main.isDisplayingMapView() || !Main.map.mapView.isActiveLayerDrawable()) 286 286 return; 287 287 if (event instanceof KeyEvent) { -
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r6310 r6336 156 156 @Override 157 157 public void eventDispatched(AWTEvent e) { 158 if (Main.map == null || Main.map.mapView == null|| !Main.map.mapView.isActiveLayerDrawable())158 if (!Main.isDisplayingMapView() || !Main.map.mapView.isActiveLayerDrawable()) 159 159 return; 160 160 InputEvent ie = (InputEvent) e; -
trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java
r6316 r6336 323 323 @Override 324 324 public void eventDispatched(AWTEvent event) { 325 if (Main.map == null || Main.map.mapView == null 326 || !Main.map.mapView.isActiveLayerDrawable()) { 325 if (!Main.isDisplayingMapView() || !Main.map.mapView.isActiveLayerDrawable()) { 327 326 return; 328 327 } -
trunk/src/org/openstreetmap/josm/actions/relation/DeleteRelationsAction.java
r5799 r6336 39 39 @Override 40 40 public void actionPerformed(ActionEvent e) { 41 if (!isEnabled() || Main.main.getEditLayer() == null)41 if (!isEnabled() || !Main.main.hasEditLayer()) 42 42 return; 43 43 for (Relation r : relations) { -
trunk/src/org/openstreetmap/josm/actions/relation/DownloadMembersAction.java
r5821 r6336 34 34 @Override 35 35 public void actionPerformed(ActionEvent e) { 36 if (!isEnabled() || relations.isEmpty() || Main.map==null || Main.map.mapView==null) return;37 Main.worker.submit(new DownloadRelationTask(relations, Main.ma p.mapView.getEditLayer()));36 if (!isEnabled() || relations.isEmpty() || !Main.isDisplayingMapView()) return; 37 Main.worker.submit(new DownloadRelationTask(relations, Main.main.getEditLayer())); 38 38 } 39 39 -
trunk/src/org/openstreetmap/josm/actions/relation/DownloadSelectedIncompleteMembersAction.java
r5821 r6336 47 47 @Override 48 48 public void actionPerformed(ActionEvent e) { 49 if (!isEnabled() || relations.isEmpty() || Main.map==null || Main.map.mapView==null) return;49 if (!isEnabled() || relations.isEmpty() || !Main.isDisplayingMapView()) return; 50 50 Main.worker.submit(new DownloadRelationMemberTask( 51 51 relations, 52 52 buildSetOfIncompleteMembers(relations), 53 Main.ma p.mapView.getEditLayer()));53 Main.main.getEditLayer())); 54 54 } 55 55 -
trunk/src/org/openstreetmap/josm/actions/relation/EditRelationAction.java
r6333 r6336 40 40 Set<RelationMember> members = new HashSet<RelationMember>(); 41 41 if (Main.isDisplayingMapView()) { 42 OsmDataLayer editLayer = Main.ma p.mapView.getEditLayer();42 OsmDataLayer editLayer = Main.main.getEditLayer(); 43 43 if (editLayer != null && editLayer.data != null) { 44 44 Collection<OsmPrimitive> selection = editLayer.data.getSelected(); … … 58 58 */ 59 59 public static void launchEditor(Relation toEdit) { 60 if (toEdit == null || Main.map==null || Main.map.mapView==null) return;61 RelationEditor.getEditor(Main.ma p.mapView.getEditLayer(), toEdit,60 if (toEdit == null || !Main.isDisplayingMapView()) return; 61 RelationEditor.getEditor(Main.main.getEditLayer(), toEdit, 62 62 getMembersForCurrentSelection(toEdit)).setVisible(true); 63 63 } -
trunk/src/org/openstreetmap/josm/actions/relation/SelectMembersAction.java
r5794 r6336 34 34 @Override 35 35 public void actionPerformed(ActionEvent e) { 36 if (!isEnabled() || relations.isEmpty() || Main.map==null || Main.map.mapView==null) return;36 if (!isEnabled() || relations.isEmpty() || !Main.isDisplayingMapView()) return; 37 37 38 38 HashSet<OsmPrimitive> members = new HashSet<OsmPrimitive>(); … … 41 41 } 42 42 if (add) { 43 Main.ma p.mapView.getEditLayer().data.addSelected(members);43 Main.main.getEditLayer().data.addSelected(members); 44 44 } else { 45 Main.ma p.mapView.getEditLayer().data.setSelected(members);45 Main.main.getEditLayer().data.setSelected(members); 46 46 } 47 47 } -
trunk/src/org/openstreetmap/josm/actions/relation/SelectRelationAction.java
r6069 r6336 31 31 @Override 32 32 public void actionPerformed(ActionEvent e) { 33 if (!isEnabled() || relations.isEmpty() || Main.map==null || Main.map.mapView==null) return;34 OsmDataLayer editLayer = Main.ma p.mapView.getEditLayer();33 if (!isEnabled() || relations.isEmpty()) return; 34 OsmDataLayer editLayer = Main.main.getEditLayer(); 35 35 if (editLayer==null || editLayer.data==null) return; 36 36 if (add) { -
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r6265 r6336 1134 1134 @Override 1135 1135 protected Bounds getBounds() { 1136 if ( Main.map == null || Main.map.mapView == null) {1136 if (!Main.isDisplayingMapView()) { 1137 1137 return null; 1138 1138 } … … 1150 1150 } 1151 1151 1152 public static Match compile(String searchStr, boolean caseSensitive, boolean regexSearch) 1153 throws ParseError { 1152 public static Match compile(String searchStr, boolean caseSensitive, boolean regexSearch) throws ParseError { 1154 1153 return new SearchCompiler(caseSensitive, regexSearch, 1155 1154 new PushbackTokenizer(
Note:
See TracChangeset
for help on using the changeset viewer.