Changeset 32453 in osm for applications
- Timestamp:
- 2016-06-30T00:01:38+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/czechaddress
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/czechaddress/build.xml
r32306 r32453 5 5 <property name="commit.message" value="Commit message"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value=" 7001"/>7 <property name="plugin.main.version" value="10279"/> 8 8 9 9 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/CzechAddressPlugin.java
r31665 r32453 22 22 23 23 import org.openstreetmap.josm.Main; 24 import org.openstreetmap.josm.data.osm.DataSet; 24 25 import org.openstreetmap.josm.data.osm.OsmPrimitive; 25 26 import org.openstreetmap.josm.gui.IconToggleButton; … … 147 148 reasoner.update(street); 148 149 149 org.openstreetmap.josm.data.osm.DataSet dataSet = Main.main.getCurrentDataSet();150 DataSet dataSet = Main.getLayerManager().getEditDataSet(); 150 151 if (dataSet != null) { 151 152 for (OsmPrimitive prim : dataSet.allPrimitives()) { -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/MapUtils.java
r16750 r32453 22 22 */ 23 23 public static void zoomToMany(Collection<OsmPrimitive> primitives) { 24 Main. main.getCurrentDataSet().setSelected(primitives);24 Main.getLayerManager().getEditDataSet().setSelected(primitives); 25 25 (new AutoScaleAction("selection")).actionPerformed(null); 26 26 } … … 30 30 */ 31 31 public static void zoomTo(OsmPrimitive primitive) { 32 Main. main.getCurrentDataSet().setSelected(primitive);32 Main.getLayerManager().getEditDataSet().setSelected(primitive); 33 33 (new AutoScaleAction("selection")).actionPerformed(null); 34 34 } -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/actions/FactoryAction.java
r27852 r32453 107 107 FactoryDialog.getInstance().selectionListenerActivated = false; 108 108 FactoryDialog.getInstance().selectNextUnmatchedHouseByCheckBox(); 109 Main. main.getCurrentDataSet().addPrimitive(newNode);110 Main. main.getCurrentDataSet().setSelected(newNode);109 Main.getLayerManager().getEditDataSet().addPrimitive(newNode); 110 Main.getLayerManager().getEditDataSet().setSelected(newNode); 111 111 FactoryDialog.getInstance().selectionListenerActivated = true; 112 112 } -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/actions/PointManipulatorAction.java
r29727 r32453 43 43 */ 44 44 public void actionPerformed(ActionEvent e) { 45 org.openstreetmap.josm.data.osm.DataSet dataSet = Main. main.getCurrentDataSet();45 org.openstreetmap.josm.data.osm.DataSet dataSet = Main.getLayerManager().getEditDataSet(); 46 46 if (dataSet == null) return; 47 47 Collection<OsmPrimitive> data = dataSet.getSelected(); -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/actions/SplitAreaByEmptyWayAction.java
r30737 r32453 14 14 import org.openstreetmap.josm.Main; 15 15 import org.openstreetmap.josm.actions.JosmAction; 16 import org.openstreetmap.josm.data.osm.DataSet; 16 17 import org.openstreetmap.josm.data.osm.Node; 17 18 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 53 54 */ 54 55 public void actionPerformed(ActionEvent e) { 55 56 Collection<Way> selectedWays = Main.main.getCurrentDataSet().getSelectedWays();57 Collection<Way> newSelection = new LinkedList<>( Main.main.getCurrentDataSet().getSelectedWays());56 DataSet ds = Main.getLayerManager().getEditDataSet(); 57 Collection<Way> selectedWays = ds.getSelectedWays(); 58 Collection<Way> newSelection = new LinkedList<>(ds.getSelectedWays()); 58 59 59 60 for (Way area : selectedWays) { 60 61 if (! area.isClosed()) continue; 61 62 62 for (OsmPrimitive prim2 : Main.main.getCurrentDataSet().allNonDeletedPrimitives()) {63 for (OsmPrimitive prim2 : ds.allNonDeletedPrimitives()) { 63 64 if (!(prim2 instanceof Way)) continue; 64 65 if (prim2.equals(area)) continue; … … 82 83 83 84 if (errorCode == 0) { 84 Main.main.getCurrentDataSet().addPrimitive(newArea1);85 Main.main.getCurrentDataSet().addPrimitive(newArea2);85 ds.addPrimitive(newArea1); 86 ds.addPrimitive(newArea2); 86 87 87 88 area.setDeleted(true); … … 98 99 } 99 100 100 Main.main.getCurrentDataSet().setSelected(newSelection);101 ds.setSelected(newSelection); 101 102 } 102 103 … … 113 114 private int splitArea(Way area, Way border, Way newArea1, Way newArea2) { 114 115 115 for (Relation r : Main. main.getCurrentDataSet().getRelations())116 for (Relation r : Main.getLayerManager().getEditDataSet().getRelations()) 116 117 for (RelationMember rm : r.getMembers()) 117 118 if (rm.refersTo(area) || rm.refersTo(border)) -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/LocationSelector.java
r30737 r32453 87 87 88 88 BoundingXYVisitor visitor = new BoundingXYVisitor(); 89 org.openstreetmap.josm.data.osm.DataSet dataSet = Main. main.getCurrentDataSet();89 org.openstreetmap.josm.data.osm.DataSet dataSet = Main.getLayerManager().getEditDataSet(); 90 90 if (dataSet == null) return; 91 91 … … 110 110 System.out.println("AUTO: Center is " + center); 111 111 112 for (OsmPrimitive op : Main. main.getCurrentDataSet().allPrimitives()) {112 for (OsmPrimitive op : Main.getLayerManager().getEditDataSet().allPrimitives()) { 113 113 114 114 if (!(op instanceof Node)) { -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/ManagerDialog.java
r30737 r32453 47 47 dbEditButton.setIcon(ImageProvider.get("actions", "edit.png")); 48 48 49 org.openstreetmap.josm.data.osm.DataSet dataSet = Main. main.getCurrentDataSet();49 org.openstreetmap.josm.data.osm.DataSet dataSet = Main.getLayerManager().getEditDataSet(); 50 50 if (dataSet != null) { 51 51 Capitalizator cap = new Capitalizator(dataSet.allPrimitives(), -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/PointManipulatorDialog.java
r30737 r32453 104 104 proposalContainer.applyAll(); 105 105 106 Main. main.getCurrentDataSet().setSelected((Node) null); // TODO: This is an ugly hack.107 Main. main.getCurrentDataSet().setSelected(proposalContainer.getTarget());106 Main.getLayerManager().getEditDataSet().setSelected((Node) null); // TODO: This is an ugly hack. 107 Main.getLayerManager().getEditDataSet().setSelected(proposalContainer.getTarget()); 108 108 109 109 AddressElement elem = (AddressElement) matchesComboBox.getSelectedItem(); -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/utils/UniversalListRenderer.java
r23190 r32453 13 13 14 14 @Override 15 public Component getListCellRendererComponent(JList list, Object value,15 public Component getListCellRendererComponent(JList<?> list, Object value, 16 16 int index, boolean isSelected, boolean cellHasFocus) { 17 17 -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/proposal/ExtractAddressIntoNodeProposal.java
r29661 r32453 66 66 way.remove(key); 67 67 68 Main. main.getCurrentDataSet().addPrimitive(addrNode);68 Main.getLayerManager().getEditDataSet().addPrimitive(addrNode); 69 69 } 70 70 … … 78 78 return "Vytvořit z budovy samostatný adresní uzel."; 79 79 } 80 81 82 83 80 }
Note:
See TracChangeset
for help on using the changeset viewer.