- Timestamp:
- 2014-06-09T14:05:46+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions/mapmode
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r7217 r7227 114 114 private static final BasicStroke BASIC_STROKE = new BasicStroke(1); 115 115 116 private static int snapToIntersectionThreshold; 117 116 118 public DrawAction(MapFrame mapFrame) { 117 119 super(tr("Draw"), "node/autonode", tr("Draw nodes"), … … 129 131 cursorJoinNode = ImageProvider.getCursor("crosshair", "joinnode"); 130 132 cursorJoinWay = ImageProvider.getCursor("crosshair", "joinway"); 133 134 readPreferences(); 135 snapHelper.init(); 131 136 } 132 137 … … 201 206 return; 202 207 super.enterMode(); 203 204 rubberLineColor = Main.pref.getColor(marktr("helper line"), null); 205 if (rubberLineColor == null) rubberLineColor = PaintColors.SELECTED.get(); 206 207 rubberLineStroke = GuiHelper.getCustomizedStroke(Main.pref.get("draw.stroke.helper-line","3")); 208 drawHelperLine = Main.pref.getBoolean("draw.helper-line", true); 209 drawTargetHighlight = Main.pref.getBoolean("draw.target-highlight", true); 208 readPreferences(); 210 209 211 210 // determine if selection is suitable to continue drawing. If it … … 232 231 // would like to but haven't got mouse position yet: 233 232 // computeHelperLine(false, false, false); 233 } 234 235 private void readPreferences() { 236 rubberLineColor = Main.pref.getColor(marktr("helper line"), null); 237 if (rubberLineColor == null) rubberLineColor = PaintColors.SELECTED.get(); 238 239 rubberLineStroke = GuiHelper.getCustomizedStroke(Main.pref.get("draw.stroke.helper-line","3")); 240 drawHelperLine = Main.pref.getBoolean("draw.helper-line", true); 241 drawTargetHighlight = Main.pref.getBoolean("draw.target-highlight", true); 242 snapToIntersectionThreshold = Main.pref.getInteger("edit.snap-intersection-threshold",10); 234 243 } 235 244 … … 994 1003 B.north() + q * (A.north() - B.north())); 995 1004 996 int snapToIntersectionThreshold997 = Main.pref.getInteger("edit.snap-intersection-threshold",10);998 1005 999 1006 // only adjust to intersection if within snapToIntersectionThreshold pixel of mouse click; otherwise -
trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java
r7217 r7227 105 105 "add_node_lock"); 106 106 cursorImproveLock = ImageProvider.getCursor("crosshair", "lock"); 107 107 readPreferences(); 108 108 } 109 109 … … 117 117 } 118 118 super.enterMode(); 119 119 readPreferences(); 120 121 mv = Main.map.mapView; 122 mousePos = null; 123 oldModeHelpText = ""; 124 125 if (getCurrentDataSet() == null) { 126 return; 127 } 128 129 updateStateByCurrentSelection(); 130 131 Main.map.mapView.addMouseListener(this); 132 Main.map.mapView.addMouseMotionListener(this); 133 Main.map.mapView.addTemporaryLayer(this); 134 DataSet.addSelectionListener(this); 135 136 Main.map.keyDetector.addModifierListener(this); 137 } 138 139 private void readPreferences() { 120 140 guideColor = Main.pref.getColor(marktr("improve way accuracy helper line"), null); 121 141 if (guideColor == null) guideColor = PaintColors.HIGHLIGHT.get(); … … 126 146 deleteNodeStroke = GuiHelper.getCustomizedStroke(Main.pref.get("improvewayaccuracy.stroke.delete-node", "1")); 127 147 dotSize = Main.pref.getInteger("improvewayaccuracy.dot-size",6); 128 129 mv = Main.map.mapView;130 mousePos = null;131 oldModeHelpText = "";132 133 if (getCurrentDataSet() == null) {134 return;135 }136 137 updateStateByCurrentSelection();138 139 Main.map.mapView.addMouseListener(this);140 Main.map.mapView.addMouseMotionListener(this);141 Main.map.mapView.addTemporaryLayer(this);142 DataSet.addSelectionListener(this);143 144 Main.map.keyDetector.addModifierListener(this);145 148 } 146 149
Note:
See TracChangeset
for help on using the changeset viewer.