Changeset 25883 in osm for applications/editors
- Timestamp:
- 2011-04-20T22:44:27+02:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/simplifyarea/src/sk/zdila/josm/plugin/simplify
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/simplifyarea/src/sk/zdila/josm/plugin/simplify/SimplifyAreaAction.java
r25560 r25883 203 203 // average nearby nodes 204 204 private Collection<Command> averageNearbyNodes(final Collection<Way> ways, final Collection<Node> nodesAlreadyDeleted) { 205 final double mergeThreshold = Main.pref.getDouble( "simplify-area.merge.threshold", 0.2);205 final double mergeThreshold = Main.pref.getDouble(SimplifyAreaPreferenceSetting.MERGE_THRESHOLD, 0.2); 206 206 207 207 final Map<Node, LatLon> coordMap = new HashMap<Node, LatLon>(); … … 316 316 317 317 private void addNodesToDelete(final Collection<Node> nodesToDelete, final Way w) { 318 final double angleThreshold = Main.pref.getDouble( "simplify-area.angle.threshold", 10);319 final double angleFactor = Main.pref.getDouble( "simplify-area.angle.factor", 1.0);320 final double areaThreshold = Main.pref.getDouble( "simplify-area.area.threshold", 5.0);321 final double areaFactor = Main.pref.getDouble( "simplify-area.area.factor", 1.0);322 final double distanceThreshold = Main.pref.getDouble( "simplify-area.dist.threshold", 3);323 final double distanceFactor = Main.pref.getDouble( "simplify-area.dist.factor", 3);318 final double angleThreshold = Main.pref.getDouble(SimplifyAreaPreferenceSetting.ANGLE_THRESHOLD, 10); 319 final double angleFactor = Main.pref.getDouble(SimplifyAreaPreferenceSetting.ANGLE_FACTOR, 1.0); 320 final double areaThreshold = Main.pref.getDouble(SimplifyAreaPreferenceSetting.AREA_THRESHOLD, 5.0); 321 final double areaFactor = Main.pref.getDouble(SimplifyAreaPreferenceSetting.AREA_FACTOR, 1.0); 322 final double distanceThreshold = Main.pref.getDouble(SimplifyAreaPreferenceSetting.DIST_THRESHOLD, 3); 323 final double distanceFactor = Main.pref.getDouble(SimplifyAreaPreferenceSetting.DIST_FACTOR, 3); 324 324 325 325 final List<Node> nodes = w.getNodes(); -
applications/editors/josm/plugins/simplifyarea/src/sk/zdila/josm/plugin/simplify/SimplifyAreaPreferenceSetting.java
r25881 r25883 14 14 15 15 public class SimplifyAreaPreferenceSetting implements PreferenceSetting { 16 17 static final String DIST_FACTOR = "simplify-area.dist.factor"; 18 static final String DIST_THRESHOLD = "simplify-area.dist.threshold"; 19 static final String AREA_FACTOR = "simplify-area.area.factor"; 20 static final String AREA_THRESHOLD = "simplify-area.area.threshold"; 21 static final String ANGLE_FACTOR = "simplify-area.angle.factor"; 22 static final String ANGLE_THRESHOLD = "simplify-area.angle.threshold"; 23 static final String MERGE_THRESHOLD = "simplify-area.merge.threshold"; 16 24 17 25 private final JTextField mergeThreshold = new JTextField(8); … … 36 44 "Merge Nearby Nodes is another step of the simplification that merges adjanced nodes that are closer than <u>Threshold</u> meters."); 37 45 38 angleThreshold.setText(Main.pref.get( "simplify-area.angle.threshold", "10"));46 angleThreshold.setText(Main.pref.get(ANGLE_THRESHOLD, "10")); 39 47 tab.add(new JLabel(tr("Angle Threshold")), GBC.std()); 40 48 tab.add(angleThreshold, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5)); 41 49 42 angleFactor.setText(Main.pref.get( "simplify-area.angle.factor", "1.0"));50 angleFactor.setText(Main.pref.get(ANGLE_FACTOR, "1.0")); 43 51 tab.add(new JLabel(tr("Angle Factor")), GBC.std()); 44 52 tab.add(angleFactor, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5)); 45 53 46 areaThreshold.setText(Main.pref.get( "simplify-area.area.threshold", "5.0"));54 areaThreshold.setText(Main.pref.get(AREA_THRESHOLD, "5.0")); 47 55 tab.add(new JLabel(tr("Area Threshold")), GBC.std()); 48 56 tab.add(areaThreshold, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5)); 49 57 50 areaFactor.setText(Main.pref.get( "simplify-area.area.factor", "1.0"));58 areaFactor.setText(Main.pref.get(AREA_FACTOR, "1.0")); 51 59 tab.add(new JLabel(tr("Area Factor")), GBC.std()); 52 60 tab.add(areaFactor, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5)); 53 61 54 distanceThreshold.setText(Main.pref.get( "simplify-area.dist.threshold", "3"));62 distanceThreshold.setText(Main.pref.get(DIST_THRESHOLD, "3")); 55 63 tab.add(new JLabel(tr("Distance Threshold")), GBC.std()); 56 64 tab.add(distanceThreshold, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5)); 57 65 58 distanceFactor.setText(Main.pref.get( "simplify-area.dist.factor", "3"));66 distanceFactor.setText(Main.pref.get(DIST_FACTOR, "3")); 59 67 tab.add(new JLabel(tr("Distance Factor")), GBC.std()); 60 68 tab.add(distanceFactor, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5)); 61 69 62 mergeThreshold.setText(Main.pref.get( "simplify-area.merge.threshold", "0.2"));70 mergeThreshold.setText(Main.pref.get(MERGE_THRESHOLD, "0.2")); 63 71 // mergeThreshold.setToolTipText(tr("bla bla")); 64 72 tab.add(new JLabel(tr("Merge Nearby Nodes Threshold")), GBC.std()); … … 70 78 @Override 71 79 public boolean ok() { 72 Main.pref.put( "simplify-area.merge.threshold", mergeThreshold.getText());73 Main.pref.put( "simplify-area.angle.threshold", angleThreshold.getText());74 Main.pref.put( "simplify-area.angle.factor", angleFactor.getText());75 Main.pref.put( "simplify-area.area.threshold", areaThreshold.getText());76 Main.pref.put( "simplify-area.area.factor", areaFactor.getText());77 Main.pref.put( "simplify-area.dist.threshold", distanceThreshold.getText());78 Main.pref.put( "simplify-area.dist.factor", distanceFactor.getText());80 Main.pref.put(MERGE_THRESHOLD, mergeThreshold.getText()); 81 Main.pref.put(ANGLE_THRESHOLD, angleThreshold.getText()); 82 Main.pref.put(ANGLE_FACTOR, angleFactor.getText()); 83 Main.pref.put(AREA_THRESHOLD, areaThreshold.getText()); 84 Main.pref.put(AREA_FACTOR, areaFactor.getText()); 85 Main.pref.put(DIST_THRESHOLD, distanceThreshold.getText()); 86 Main.pref.put(DIST_FACTOR, distanceFactor.getText()); 79 87 return false; 80 88 }
Note:
See TracChangeset
for help on using the changeset viewer.