Changeset 30687 in osm for applications/editors/josm/plugins
- Timestamp:
- 2014-09-24T01:51:24+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/simplifyarea/src/sk/zdila/josm/plugin/simplify
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/simplifyarea/src/sk/zdila/josm/plugin/simplify/SimplifyAreaAction.java
r30623 r30687 1 // License: GPL. Copyright 2007 by Immanuel Scholz and others1 // License: GPL. For details, see LICENSE file. 2 2 package sk.zdila.josm.plugin.simplify; 3 3 … … 62 62 final ButtonSpec[] options = new ButtonSpec[] { new ButtonSpec(tr("Yes, delete nodes"), ImageProvider.get("ok"), tr("Delete nodes outside of downloaded data regions"), null), 63 63 new ButtonSpec(tr("No, abort"), ImageProvider.get("cancel"), tr("Cancel operation"), null) }; 64 final int ret= HelpAwareOptionPane.showOptionDialog(64 return 0 == HelpAwareOptionPane.showOptionDialog( 65 65 Main.parent, 66 66 "<html>" + trn("The selected way has nodes outside of the downloaded data region.", "The selected ways have nodes outside of the downloaded data region.", getCurrentDataSet().getSelectedWays().size()) … … 68 68 tr("Delete nodes outside of data regions?"), JOptionPane.WARNING_MESSAGE, null, // no special icon 69 69 options, options[0], null); 70 return ret == 0;71 70 } 72 71 … … 78 77 final ButtonSpec[] options = new ButtonSpec[] { new ButtonSpec(tr("Yes"), ImageProvider.get("ok"), tr("Simplify all selected ways"), null), 79 78 new ButtonSpec(tr("Cancel"), ImageProvider.get("cancel"), tr("Cancel operation"), null) }; 80 final int ret= HelpAwareOptionPane.showOptionDialog(Main.parent, tr("The selection contains {0} ways. Are you sure you want to simplify them all?", numWays), tr("Simplify ways?"),79 return 0 == HelpAwareOptionPane.showOptionDialog(Main.parent, tr("The selection contains {0} ways. Are you sure you want to simplify them all?", numWays), tr("Simplify ways?"), 81 80 JOptionPane.WARNING_MESSAGE, null, // no special icon 82 81 options, options[0], null); 83 return ret == 0;84 82 } 85 83 … … 115 113 } 116 114 117 final List<Node> nodesToDelete = new ArrayList< Node>(); // can contain duplicate instances115 final List<Node> nodesToDelete = new ArrayList<>(); // can contain duplicate instances 118 116 119 117 for (final Way way : ways) { … … 125 123 } 126 124 127 final Map<Node, Count> nodeCountMap = new HashMap< Node, Count>();125 final Map<Node, Count> nodeCountMap = new HashMap<>(); 128 126 for (final Node node : nodesToDelete) { 129 127 Count count = nodeCountMap.get(node); … … 135 133 } 136 134 137 final Collection<Node> nodesReallyToRemove = new ArrayList< Node>();135 final Collection<Node> nodesReallyToRemove = new ArrayList<>(); 138 136 139 137 for (final Entry<Node, Count> entry : nodeCountMap.entrySet()) { … … 146 144 } 147 145 148 final Collection<Command> allCommands = new ArrayList< Command>();146 final Collection<Command> allCommands = new ArrayList<>(); 149 147 150 148 if (!nodesReallyToRemove.isEmpty()) { … … 186 184 final double mergeThreshold = Main.pref.getDouble(SimplifyAreaPreferenceSetting.MERGE_THRESHOLD, 0.2); 187 185 188 final Map<Node, LatLon> coordMap = new HashMap< Node, LatLon>();186 final Map<Node, LatLon> coordMap = new HashMap<>(); 189 187 for (final Way way : ways) { 190 188 for (final Node n : way.getNodes()) { … … 266 264 } 267 265 268 final Collection<Command> commands = new ArrayList< Command>();269 final Set<Node> nodesToDelete2 = new HashSet< Node>();266 final Collection<Command> commands = new ArrayList<>(); 267 final Set<Node> nodesToDelete2 = new HashSet<>(); 270 268 for (final Way way : ways) { 271 269 final List<Node> nodesToDelete = way.getNodes(); … … 329 327 // remove nodes within threshold 330 328 331 final List<Double> weightList = new ArrayList< Double>(nodes.size()); // weight cache329 final List<Double> weightList = new ArrayList<>(nodes.size()); // weight cache 332 330 for (int i = 0; i < nodes.size(); i++) { 333 331 weightList.add(null); … … 396 394 } 397 395 398 final HashSet<Node> delNodes = new HashSet< Node>(w.getNodes());396 final HashSet<Node> delNodes = new HashSet<>(w.getNodes()); 399 397 delNodes.removeAll(nodes); 400 398 -
applications/editors/josm/plugins/simplifyarea/src/sk/zdila/josm/plugin/simplify/SimplifyAreaPlugin.java
r29778 r30687 1 // License: GPL. For details, see LICENSE file. 1 2 package sk.zdila.josm.plugin.simplify; 2 3 … … 18 19 return new SimplifyAreaPreferenceSetting(); 19 20 } 20 21 21 } -
applications/editors/josm/plugins/simplifyarea/src/sk/zdila/josm/plugin/simplify/SimplifyAreaPreferenceSetting.java
r28353 r30687 1 // License: GPL. For details, see LICENSE file. 1 2 package sk.zdila.josm.plugin.simplify; 2 3 … … 72 73 73 74 mergeThreshold.setText(Main.pref.get(MERGE_THRESHOLD, "0.2")); 74 // mergeThreshold.setToolTipText(tr("bla bla"));75 75 tab.add(new JLabel(tr("Merge Nearby Nodes Threshold")), GBC.std()); 76 76 tab.add(mergeThreshold, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5)); … … 90 90 return false; 91 91 } 92 93 92 }
Note:
See TracChangeset
for help on using the changeset viewer.