Changeset 10413 in josm for trunk/src/org
- Timestamp:
- 2016-06-18T00:06:41+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 54 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r10383 r10413 76 76 if (Main.main == null || !Main.main.hasEditLayer()) 77 77 return; 78 Collection<OsmPrimitive> sel = Main. main.getEditLayer().data.getSelected();78 Collection<OsmPrimitive> sel = Main.getLayerManager().getEditLayer().data.getSelected(); 79 79 if (sel.isEmpty()) { 80 80 JOptionPane.showMessageDialog( … … 220 220 */ 221 221 protected Layer getFirstSelectedLayer() { 222 if (Main. main.getActiveLayer() == null) {222 if (Main.getLayerManager().getActiveLayer() == null) { 223 223 return null; 224 224 } -
trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java
r10382 r10413 119 119 if (Main.pref.getBoolean("multipoly.show-relation-editor", false)) { 120 120 //Open relation edit window, if set up in preferences 121 RelationEditor editor = RelationEditor.getEditor(Main. main.getEditLayer(), relation, null);121 RelationEditor editor = RelationEditor.getEditor(Main.getLayerManager().getEditLayer(), relation, null); 122 122 123 123 editor.setModal(true); 124 124 editor.setVisible(true); 125 125 } else { 126 Main. main.getEditLayer().setRecentRelation(relation);126 Main.getLayerManager().getEditLayer().setRecentRelation(relation); 127 127 } 128 128 } … … 165 165 if (multipolygonRelation != null) { 166 166 if (!multipolygonRelation.isNew() && multipolygonRelation.isIncomplete()) { 167 Main.worker.submit(new DownloadRelationTask(Collections.singleton(multipolygonRelation), Main. main.getEditLayer()));167 Main.worker.submit(new DownloadRelationTask(Collections.singleton(multipolygonRelation), Main.getLayerManager().getEditLayer())); 168 168 } else if (multipolygonRelation.hasIncompleteMembers()) { 169 169 Main.worker.submit(new DownloadRelationMemberTask(multipolygonRelation, 170 170 DownloadSelectedIncompleteMembersAction.buildSetOfIncompleteMembers(Collections.singleton(multipolygonRelation)), 171 Main. main.getEditLayer()));171 Main.getLayerManager().getEditLayer())); 172 172 } 173 173 } -
trunk/src/org/openstreetmap/josm/actions/DeleteLayerAction.java
r10318 r10413 30 30 @Override 31 31 public void actionPerformed(ActionEvent e) { 32 Layer activeLayer = Main. main.getActiveLayer();32 Layer activeLayer = Main.getLayerManager().getActiveLayer(); 33 33 if (activeLayer == null) { 34 34 return; -
trunk/src/org/openstreetmap/josm/actions/DownloadReferrersAction.java
r10409 r10413 52 52 if (!isEnabled()) 53 53 return; 54 OsmDataLayer layer = Main. main.getEditLayer();54 OsmDataLayer layer = Main.getLayerManager().getEditLayer(); 55 55 if (layer == null) 56 56 return; -
trunk/src/org/openstreetmap/josm/actions/FollowLineAction.java
r10409 r10413 60 60 @Override 61 61 public void actionPerformed(ActionEvent evt) { 62 OsmDataLayer osmLayer = Main. main.getEditLayer();62 OsmDataLayer osmLayer = Main.getLayerManager().getEditLayer(); 63 63 if (osmLayer == null) 64 64 return; -
trunk/src/org/openstreetmap/josm/actions/InfoAction.java
r10382 r10413 37 37 DataSet set = getLayerManager().getEditDataSet(); 38 38 if (set != null) { 39 new InspectPrimitiveDialog(set.getAllSelected(), Main. main.getEditLayer()).showDialog();39 new InspectPrimitiveDialog(set.getAllSelected(), Main.getLayerManager().getEditLayer()).showDialog(); 40 40 } 41 41 } -
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r10409 r10413 636 636 // Delete the discarded inner ways 637 637 if (!discardedWays.isEmpty()) { 638 Command deleteCmd = DeleteCommand.delete(Main. main.getEditLayer(), discardedWays, true);638 Command deleteCmd = DeleteCommand.delete(Main.getLayerManager().getEditLayer(), discardedWays, true); 639 639 if (deleteCmd != null) { 640 640 cmds.add(deleteCmd); -
trunk/src/org/openstreetmap/josm/actions/MergeLayerAction.java
r10318 r10413 115 115 116 116 protected Layer getSourceLayer() { 117 return Main.map != null ? Main. main.getActiveLayer() : null;117 return Main.map != null ? Main.getLayerManager().getActiveLayer() : null; 118 118 } 119 119 -
trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java
r10382 r10413 87 87 Node targetNode = selectTargetNode(selectedNodes); 88 88 Node targetLocationNode = selectTargetLocationNode(selectedNodes); 89 Command cmd = mergeNodes(Main. main.getEditLayer(), selectedNodes, targetNode, targetLocationNode);89 Command cmd = mergeNodes(Main.getLayerManager().getEditLayer(), selectedNodes, targetNode, targetLocationNode); 90 90 if (cmd != null) { 91 91 Main.main.undoRedo.add(cmd); 92 Main. main.getEditLayer().data.setSelected(targetNode);92 Main.getLayerManager().getEditLayer().data.setSelected(targetNode); 93 93 } 94 94 } -
trunk/src/org/openstreetmap/josm/actions/PasteAction.java
r10382 r10413 145 145 if (data instanceof NodeData) { 146 146 NodeData nodeData = (NodeData) data; 147 if (Main. main.getEditLayer() == source) {147 if (Main.getLayerManager().getEditLayer() == source) { 148 148 nodeData.setEastNorth(nodeData.getEastNorth().add(offsetEast, offsetNorth)); 149 149 } -
trunk/src/org/openstreetmap/josm/actions/PurgeAction.java
r10382 r10413 96 96 97 97 Collection<OsmPrimitive> sel = getLayerManager().getEditDataSet().getAllSelected(); 98 layer = Main. main.getEditLayer();98 layer = Main.getLayerManager().getEditLayer(); 99 99 100 100 toPurge = new HashSet<>(sel); … … 218 218 } 219 219 220 Main.main.undoRedo.add(new PurgeCommand(Main. main.getEditLayer(), toPurgeChecked, makeIncomplete));220 Main.main.undoRedo.add(new PurgeCommand(Main.getLayerManager().getEditLayer(), toPurgeChecked, makeIncomplete)); 221 221 222 222 if (clearUndoRedo) { -
trunk/src/org/openstreetmap/josm/actions/UpdateSelectionAction.java
r10382 r10413 44 44 try { 45 45 DataSet ds = reader.parseOsm(NullProgressMonitor.INSTANCE); 46 Main. main.getEditLayer().mergeFrom(ds);46 Main.getLayerManager().getEditLayer().mergeFrom(ds); 47 47 } catch (OsmTransferException e) { 48 48 ExceptionDialogUtil.explainException(e); … … 58 58 */ 59 59 public static void updatePrimitives(final Collection<OsmPrimitive> selection) { 60 UpdatePrimitivesTask task = new UpdatePrimitivesTask(Main. main.getEditLayer(), selection);60 UpdatePrimitivesTask task = new UpdatePrimitivesTask(Main.getLayerManager().getEditLayer(), selection); 61 61 Main.worker.submit(task); 62 62 } -
trunk/src/org/openstreetmap/josm/actions/UploadAction.java
r10382 r10413 269 269 } 270 270 APIDataSet apiData = new APIDataSet(Main.main.getCurrentDataSet()); 271 uploadData(Main. main.getEditLayer(), apiData);271 uploadData(Main.getLayerManager().getEditLayer(), apiData); 272 272 } 273 273 } -
trunk/src/org/openstreetmap/josm/actions/ZoomToAction.java
r10386 r10413 82 82 83 83 protected final void updateEnabledState() { 84 if (Main.main == null || Main. main.getEditLayer() != this.table.getLayer()) {84 if (Main.main == null || Main.getLayerManager().getEditLayer() != this.table.getLayer()) { 85 85 setEnabled(false); 86 86 putValue(SHORT_DESCRIPTION, descriptionInactiveLayer); -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
r10409 r10413 214 214 protected OsmDataLayer getEditLayer() { 215 215 if (!Main.isDisplayingMapView()) return null; 216 return Main. main.getEditLayer();216 return Main.getLayerManager().getEditLayer(); 217 217 } 218 218 -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java
r10318 r10413 297 297 } 298 298 } 299 final OsmDataLayer editLayer = Main. main.getEditLayer();299 final OsmDataLayer editLayer = Main.getLayerManager().getEditLayer(); 300 300 if (editLayer != null && osmData) { 301 301 final Set<OsmPrimitive> myPrimitives = getCompletePrimitives(editLayer.data); -
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r10382 r10413 708 708 Node targetNode = MergeNodesAction.selectTargetNode(changedNodes); 709 709 Node locNode = MergeNodesAction.selectTargetLocationNode(changedNodes); 710 Command mergeCmd = MergeNodesAction.mergeNodes(Main. main.getEditLayer(), changedNodes, targetNode, locNode);710 Command mergeCmd = MergeNodesAction.mergeNodes(Main.getLayerManager().getEditLayer(), changedNodes, targetNode, locNode); 711 711 if (mergeCmd != null) { 712 712 Main.main.undoRedo.add(mergeCmd); -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r10383 r10413 920 920 Collection<Node> nodesToMerge = new LinkedList<>(selNodes); 921 921 nodesToMerge.add(target); 922 mergeNodes(Main. main.getEditLayer(), nodesToMerge, target);922 mergeNodes(Main.getLayerManager().getEditLayer(), nodesToMerge, target); 923 923 } 924 924 -
trunk/src/org/openstreetmap/josm/actions/relation/DeleteRelationsAction.java
r9472 r10413 30 30 if (toDelete == null) 31 31 return; 32 DeleteAction.deleteRelations(Main. main.getEditLayer(), toDelete);32 DeleteAction.deleteRelations(Main.getLayerManager().getEditLayer(), toDelete); 33 33 // clear selection after deletion 34 34 if (Main.map.relationListDialog != null) -
trunk/src/org/openstreetmap/josm/actions/relation/DownloadMembersAction.java
r9059 r10413 36 36 public void actionPerformed(ActionEvent e) { 37 37 if (!isEnabled() || relations.isEmpty() || !Main.isDisplayingMapView()) return; 38 Main.worker.submit(new DownloadRelationTask(relations, Main. main.getEditLayer()));38 Main.worker.submit(new DownloadRelationTask(relations, Main.getLayerManager().getEditLayer())); 39 39 } 40 40 -
trunk/src/org/openstreetmap/josm/actions/relation/DownloadSelectedIncompleteMembersAction.java
r9059 r10413 59 59 relations, 60 60 incompleteMembers, 61 Main. main.getEditLayer()));61 Main.getLayerManager().getEditLayer())); 62 62 } 63 63 -
trunk/src/org/openstreetmap/josm/actions/relation/DuplicateRelationAction.java
r8510 r10413 34 34 copy.setModified(true); 35 35 RelationEditor editor = RelationEditor.getEditor( 36 Main. main.getEditLayer(),36 Main.getLayerManager().getEditLayer(), 37 37 copy, 38 38 null /* no selected members */ -
trunk/src/org/openstreetmap/josm/actions/relation/EditRelationAction.java
r10378 r10413 43 43 Set<RelationMember> members = new HashSet<>(); 44 44 if (Main.isDisplayingMapView()) { 45 OsmDataLayer editLayer = Main. main.getEditLayer();45 OsmDataLayer editLayer = Main.getLayerManager().getEditLayer(); 46 46 if (editLayer != null && editLayer.data != null) { 47 47 Collection<OsmPrimitive> selection = editLayer.data.getSelected(); … … 62 62 public static void launchEditor(Relation toEdit) { 63 63 if (toEdit == null || toEdit.isDeleted() || !Main.isDisplayingMapView()) return; 64 RelationEditor.getEditor(Main. main.getEditLayer(), toEdit,64 RelationEditor.getEditor(Main.getLayerManager().getEditLayer(), toEdit, 65 65 getMembersForCurrentSelection(toEdit)).setVisible(true); 66 66 } -
trunk/src/org/openstreetmap/josm/actions/relation/RecentRelationsAction.java
r10345 r10413 140 140 if (!Main.isDisplayingMapView()) 141 141 return Collections.emptyList(); 142 Layer activeLayer = Main. main.getActiveLayer();142 Layer activeLayer = Main.getLayerManager().getActiveLayer(); 143 143 if (!(activeLayer instanceof OsmDataLayer)) { 144 144 return Collections.emptyList(); -
trunk/src/org/openstreetmap/josm/actions/relation/SelectMembersAction.java
r8510 r10413 43 43 } 44 44 if (add) { 45 Main. main.getEditLayer().data.addSelected(members);45 Main.getLayerManager().getEditLayer().data.addSelected(members); 46 46 } else { 47 Main. main.getEditLayer().data.setSelected(members);47 Main.getLayerManager().getEditLayer().data.setSelected(members); 48 48 } 49 49 } -
trunk/src/org/openstreetmap/josm/actions/relation/SelectRelationAction.java
r8510 r10413 34 34 public void actionPerformed(ActionEvent e) { 35 35 if (!isEnabled() || relations.isEmpty()) return; 36 OsmDataLayer editLayer = Main. main.getEditLayer();36 OsmDataLayer editLayer = Main.getLayerManager().getEditLayer(); 37 37 if (editLayer == null || editLayer.data == null) return; 38 38 if (add) { -
trunk/src/org/openstreetmap/josm/command/Command.java
r10248 r10413 131 131 */ 132 132 public Command() { 133 this.layer = Main. main == null ? null : Main.main.getEditLayer();133 this.layer = Main.getLayerManager().getEditLayer(); 134 134 } 135 135 -
trunk/src/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommand.java
r10364 r10413 84 84 85 85 Main.getLayerManager().setActiveLayer(layer); 86 OsmDataLayer editLayer = Main. main.getEditLayer();86 OsmDataLayer editLayer = Main.getLayerManager().getEditLayer(); 87 87 88 88 // restore the former state -
trunk/src/org/openstreetmap/josm/data/validation/Test.java
r9989 r10413 333 333 } 334 334 if (!primitivesToDelete.isEmpty()) { 335 return DeleteCommand.delete(Main. main.getEditLayer(), primitivesToDelete);335 return DeleteCommand.delete(Main.getLayerManager().getEditLayer(), primitivesToDelete); 336 336 } else { 337 337 return null; -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
r9971 r10413 409 409 410 410 if (DeleteCommand.checkAndConfirmOutlyingDelete(nodes, Collections.singleton(target))) 411 return MergeNodesAction.mergeNodes(Main. main.getEditLayer(), nodes, target);411 return MergeNodesAction.mergeNodes(Main.getLayerManager().getEditLayer(), nodes, target); 412 412 } 413 413 -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolver.java
r10369 r10413 196 196 public void prepareForEditing() { 197 197 AutoCompletionList acList = new AutoCompletionList(); 198 Main. main.getEditLayer().data.getAutoCompletionManager().populateWithMemberRoles(acList);198 Main.getLayerManager().getEditLayer().data.getAutoCompletionManager().populateWithMemberRoles(acList); 199 199 tfRole.setAutoCompletionList(acList); 200 200 AutoCompletingTextField editor = (AutoCompletingTextField) tblResolver.getColumnModel().getColumn(2).getCellEditor(); … … 203 203 } 204 204 AutoCompletionList acList2 = new AutoCompletionList(); 205 Main. main.getEditLayer().data.getAutoCompletionManager().populateWithKeys(acList2);205 Main.getLayerManager().getEditLayer().data.getAutoCompletionManager().populateWithKeys(acList2); 206 206 tfKey.setAutoCompletionList(acList2); 207 207 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java
r10332 r10413 121 121 ChangesetCache.getInstance().addChangesetCacheListener(inActiveDataLayerModel); 122 122 Main.getLayerManager().addActiveLayerChangeListener(inActiveDataLayerModel); 123 OsmDataLayer editLayer = Main. main.getEditLayer();123 OsmDataLayer editLayer = Main.getLayerManager().getEditLayer(); 124 124 if (editLayer != null) { 125 125 editLayer.data.addDataSetListener(inActiveDataLayerModel); … … 134 134 ChangesetCache.getInstance().removeChangesetCacheListener(inActiveDataLayerModel); 135 135 Main.getLayerManager().removeActiveLayerChangeListener(inActiveDataLayerModel); 136 OsmDataLayer editLayer = Main. main.getEditLayer();136 OsmDataLayer editLayer = Main.getLayerManager().getEditLayer(); 137 137 if (editLayer != null) { 138 138 editLayer.data.removeDataSetListener(inActiveDataLayerModel); … … 237 237 238 238 protected void initWithCurrentData() { 239 OsmDataLayer editLayer = Main. main.getEditLayer();239 OsmDataLayer editLayer = Main.getLayerManager().getEditLayer(); 240 240 if (editLayer != null) { 241 241 inSelectionModel.initFromPrimitives(editLayer.data.getAllSelected()); … … 323 323 return; 324 324 325 DataSet ds = Main. main.getEditLayer().data;325 DataSet ds = Main.getLayerManager().getEditLayer().data; 326 326 selectObjectsByChangesetIds(ds, sel); 327 327 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java
r10369 r10413 345 345 protected static FilteredCollection<? extends OsmPrimitive> getAffectedPrimitives(TreePath path) { 346 346 PseudoCommand c = ((CommandListMutableTreeNode) path.getLastPathComponent()).getCommand(); 347 final OsmDataLayer currentLayer = Main. main.getEditLayer();347 final OsmDataLayer currentLayer = Main.getLayerManager().getEditLayer(); 348 348 return new FilteredCollection<>( 349 349 c.getParticipatingPrimitives(), … … 389 389 throw new IllegalStateException(); 390 390 391 OsmDataLayer editLayer = Main. main.getEditLayer();391 OsmDataLayer editLayer = Main.getLayerManager().getEditLayer(); 392 392 if (editLayer == null) return; 393 393 editLayer.data.setSelected(getAffectedPrimitives(path)); -
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
r10378 r10413 234 234 */ 235 235 public void refreshView() { 236 OsmDataLayer editLayer = Main. main.getEditLayer();236 OsmDataLayer editLayer = Main.getLayerManager().getEditLayer(); 237 237 conflicts = editLayer == null ? new ConflictCollection() : editLayer.getConflicts(); 238 238 GuiHelper.runInEDT(new Runnable() { -
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
r10386 r10413 362 362 363 363 public void run() { 364 RelationEditor.getEditor(Main. main.getEditLayer(), null, null).setVisible(true);364 RelationEditor.getEditor(Main.getLayerManager().getEditLayer(), null, null).setVisible(true); 365 365 } 366 366 … … 694 694 @Override 695 695 public void dataChanged(DataChangedEvent event) { 696 initFromLayer(Main. main.getEditLayer());696 initFromLayer(Main.getLayerManager().getEditLayer()); 697 697 } 698 698 -
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r10383 r10413 212 212 if (idx < 0) return; 213 213 if (isDoubleClick(e)) { 214 OsmDataLayer layer = Main. main.getEditLayer();214 OsmDataLayer layer = Main.getLayerManager().getEditLayer(); 215 215 if (layer == null) return; 216 216 OsmPrimitive osm = model.getElementAt(idx); … … 335 335 Collection<OsmPrimitive> sel = model.getSelected(); 336 336 if (sel.isEmpty()) return; 337 OsmDataLayer editLayer = Main. main.getEditLayer();337 OsmDataLayer editLayer = Main.getLayerManager().getEditLayer(); 338 338 if (editLayer == null) return; 339 339 editLayer.data.setSelected(sel); -
trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
r10378 r10413 144 144 public void showDialog() { 145 145 super.showDialog(); 146 Layer layer = Main. main.getActiveLayer();146 Layer layer = Main.getLayerManager().getActiveLayer(); 147 147 if (layer instanceof OsmDataLayer) { 148 148 refresh(((OsmDataLayer) layer).data.getAllSelected()); -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanel.java
r10332 r10413 198 198 + "edit layer ''{0}''.</html>", 199 199 primitives.size(), 200 Main. main.getEditLayer().getName()200 Main.getLayerManager().getEditLayer().getName() 201 201 ), 202 202 title, JOptionPane.WARNING_MESSAGE, helpTopic … … 336 336 return null; 337 337 } 338 OsmDataLayer layer = Main. main.getEditLayer();338 OsmDataLayer layer = Main.getLayerManager().getEditLayer(); 339 339 Set<OsmPrimitive> target = new HashSet<>(); 340 340 for (HistoryOsmPrimitive p : model.getSelectedPrimitives()) { … … 386 386 return; 387 387 } 388 Main. main.getEditLayer().data.setSelected(target);388 Main.getLayerManager().getEditLayer().data.setSelected(target); 389 389 } 390 390 } … … 409 409 return; 410 410 } 411 Main. main.getEditLayer().data.setSelected(target);411 Main.getLayerManager().getEditLayer().data.setSelected(target); 412 412 AutoScaleAction.zoomToSelection(); 413 413 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java
r10378 r10413 335 335 + "edit layer ''{1}''.</html>", 336 336 currentChangeset.getId(), 337 Main. main.getEditLayer().getName()337 Main.getLayerManager().getEditLayer().getName() 338 338 ), 339 339 tr("Nothing to select"), … … 348 348 return; 349 349 if (Main.main == null || !Main.main.hasEditLayer()) return; 350 OsmDataLayer layer = Main. main.getEditLayer();350 OsmDataLayer layer = Main.getLayerManager().getEditLayer(); 351 351 Set<OsmPrimitive> target = new HashSet<>(); 352 352 for (OsmPrimitive p: layer.data.allPrimitives()) { … … 396 396 + "edit layer ''{1}''.</html>", 397 397 currentChangeset.getId(), 398 Main. main.getEditLayer().getName()398 Main.getLayerManager().getEditLayer().getName() 399 399 ), 400 400 tr("Nothing to zoom to"), … … 409 409 return; 410 410 if (Main.main == null || !Main.main.hasEditLayer()) return; 411 OsmDataLayer layer = Main. main.getEditLayer();411 OsmDataLayer layer = Main.getLayerManager().getEditLayer(); 412 412 Set<OsmPrimitive> target = new HashSet<>(); 413 413 for (OsmPrimitive p: layer.data.allPrimitives()) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r10345 r10413 563 563 Main.map.relationListDialog.selectRelation(relation); 564 564 RelationEditor.getEditor( 565 Main. main.getEditLayer(),565 Main.getLayerManager().getEditLayer(), 566 566 relation, 567 567 ((MemberInfo) membershipData.getValueAt(row, 1)).role -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
r10378 r10413 419 419 mainPanel.add(p, BorderLayout.CENTER); 420 420 421 AutoCompletionManager autocomplete = Main. main.getEditLayer().data.getAutoCompletionManager();421 AutoCompletionManager autocomplete = Main.getLayerManager().getEditLayer().data.getAutoCompletionManager(); 422 422 List<AutoCompletionListItem> keyList = autocomplete.getKeys(); 423 423 Collections.sort(keyList, defaultACItemComparator); … … 676 676 +"<br><br>"+tr("Please select a key")), GBC.eol().fill(GBC.HORIZONTAL)); 677 677 678 AutoCompletionManager autocomplete = Main. main.getEditLayer().data.getAutoCompletionManager();678 AutoCompletionManager autocomplete = Main.getLayerManager().getEditLayer().data.getAutoCompletionManager(); 679 679 List<AutoCompletionListItem> keyList = autocomplete.getKeys(); 680 680 -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java
r10386 r10413 235 235 private void updateEnabledState() { 236 236 setEnabled(Main.main != null 237 && Main. main.getEditLayer() == getLayer()237 && Main.getLayerManager().getEditLayer() == getLayer() 238 238 && getSelectedRowCount() == 1 239 239 && hasGap()); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
r10089 r10413 108 108 @Override 109 109 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 110 if (Main. main.getEditLayer() != this.layer) return;110 if (Main.getLayerManager().getEditLayer() != this.layer) return; 111 111 // just trigger a repaint 112 112 Collection<RelationMember> sel = getSelectedMembers(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ParentRelationLoadingTask.java
r10212 r10413 31 31 * final ParentRelationLoadingTask task = new ParentRelationLoadingTask( 32 32 * child, // the child relation 33 * Main. main.getEditLayer(), // the edit layer33 * Main.getLayerManager().getEditLayer(), // the edit layer 34 34 * true, // load fully 35 35 * new PleaseWaitProgressMonitor() // a progress monitor -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTree.java
r10378 r10413 135 135 return; 136 136 } 137 DataSetMerger visitor = new DataSetMerger(Main. main.getEditLayer().data, ds);137 DataSetMerger visitor = new DataSetMerger(Main.getLayerManager().getEditLayer().data, ds); 138 138 visitor.merge(); 139 139 if (!visitor.getConflicts().isEmpty()) { 140 Main. main.getEditLayer().getConflicts().add(visitor.getConflicts());140 Main.getLayerManager().getEditLayer().getConflicts().add(visitor.getConflicts()); 141 141 } 142 142 final RelationTreeModel model = (RelationTreeModel) getModel(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableModel.java
r10378 r10413 62 62 @Override 63 63 public int getRowCount() { 64 if (Main. main.getEditLayer() != layer)64 if (Main.getLayerManager().getEditLayer() != layer) 65 65 return 0; 66 66 return cache.size(); … … 104 104 @Override 105 105 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 106 if (layer == Main. main.getEditLayer()) {106 if (layer == Main.getLayerManager().getEditLayer()) { 107 107 cache.clear(); 108 108 cache.addAll(newSelection); -
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java
r10378 r10413 106 106 107 107 if (Main.main != null) { 108 OsmDataLayer editLayer = Main. main.getEditLayer();108 OsmDataLayer editLayer = Main.getLayerManager().getEditLayer(); 109 109 if (editLayer != null) { 110 110 editLayer.data.addDataSetListener(this); … … 174 174 if (history.getNumVersions() > 0) { 175 175 HistoryOsmPrimitive newLatest = null; 176 OsmDataLayer editLayer = Main. main.getEditLayer();176 OsmDataLayer editLayer = Main.getLayerManager().getEditLayer(); 177 177 if (editLayer != null) { 178 178 OsmPrimitive p = editLayer.data.getPrimitiveById(history.getId(), history.getType()); … … 532 532 if (latest == null) 533 533 return null; 534 OsmDataLayer editLayer = Main. main.getEditLayer();534 OsmDataLayer editLayer = Main.getLayerManager().getEditLayer(); 535 535 if (editLayer == null) 536 536 return null; … … 666 666 */ 667 667 public void unlinkAsListener() { 668 OsmDataLayer editLayer = Main. main.getEditLayer();668 OsmDataLayer editLayer = Main.getLayerManager().getEditLayer(); 669 669 if (editLayer != null) { 670 670 editLayer.data.removeDataSetListener(this); -
trunk/src/org/openstreetmap/josm/gui/history/NodeListViewer.java
r10210 r10413 243 243 OsmPrimitive p = getPrimitiveToZoom(); 244 244 if (p != null) { 245 OsmDataLayer editLayer = Main. main.getEditLayer();245 OsmDataLayer editLayer = Main.getLayerManager().getEditLayer(); 246 246 if (editLayer != null) { 247 247 editLayer.data.setSelected(p.getPrimitiveId()); … … 259 259 if (primitiveId == null) 260 260 return null; 261 OsmDataLayer editLayer = Main. main.getEditLayer();261 OsmDataLayer editLayer = Main.getLayerManager().getEditLayer(); 262 262 if (editLayer == null) 263 263 return null; -
trunk/src/org/openstreetmap/josm/gui/history/VersionInfoPanel.java
r10378 r10413 149 149 String text; 150 150 if (isLatest) { 151 OsmDataLayer editLayer = Main. main.getEditLayer();151 OsmDataLayer editLayer = Main.getLayerManager().getEditLayer(); 152 152 text = tr("<html>Version <strong>{0}</strong> currently edited in layer ''{1}''</html>", 153 153 Long.toString(version), -
trunk/src/org/openstreetmap/josm/gui/io/AbstractUploadTask.java
r10378 r10413 79 79 // FIXME: should now about the layer this task is running for. might 80 80 // be different from the current edit layer 81 OsmDataLayer layer = Main. main.getEditLayer();81 OsmDataLayer layer = Main.getLayerManager().getEditLayer(); 82 82 if (layer == null) 83 83 throw new IllegalStateException(tr("Failed to update primitive with id {0} because current edit layer is null", id)); … … 268 268 ); 269 269 if (ret == 0) { 270 DownloadReferrersAction.downloadReferrers(Main. main.getEditLayer(), Arrays.asList(conflict.a));270 DownloadReferrersAction.downloadReferrers(Main.getLayerManager().getEditLayer(), Arrays.asList(conflict.a)); 271 271 } 272 272 } -
trunk/src/org/openstreetmap/josm/gui/io/DownloadPrimitivesWithReferrersTask.java
r8840 r10413 129 129 130 130 // Append downloaded data to JOSM 131 OsmDataLayer layer = Main. main.getEditLayer();131 OsmDataLayer layer = Main.getLayerManager().getEditLayer(); 132 132 if (layer == null || this.newLayer) 133 133 Main.main.addLayer(tmpLayer); -
trunk/src/org/openstreetmap/josm/gui/io/TagSettingsPanel.java
r10210 r10413 97 97 */ 98 98 public void startUserInput() { 99 pnlTagEditor.initAutoCompletion(Main. main.getEditLayer());99 pnlTagEditor.initAutoCompletion(Main.getLayerManager().getEditLayer()); 100 100 } 101 101 -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java
r10369 r10413 389 389 @Override 390 390 public void run() { 391 RelationEditor.getEditor(Main. main.getEditLayer(), r, members).setVisible(true);391 RelationEditor.getEditor(Main.getLayerManager().getEditLayer(), r, members).setVisible(true); 392 392 } 393 393 }); -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetItem.java
r10212 r10413 41 41 protected void initAutoCompletionField(AutoCompletingTextField field, List<String> keys) { 42 42 if (Main.main == null) return; 43 OsmDataLayer layer = Main. main.getEditLayer();43 OsmDataLayer layer = Main.getLayerManager().getEditLayer(); 44 44 if (layer == null) { 45 45 return;
Note:
See TracChangeset
for help on using the changeset viewer.