diff --git a/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java b/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
index bdc4aad..8ee76cf 100644
a
|
b
|
public class DrawAction extends MapMode implements MapViewPaintable, SelectionCh
|
140 | 140 | |
141 | 141 | readPreferences(); |
142 | 142 | snapHelper.init(); |
| 143 | readPreferences(); |
143 | 144 | } |
144 | 145 | |
145 | 146 | private JCheckBoxMenuItem addMenuItem() { |
… |
… |
public class DrawAction extends MapMode implements MapViewPaintable, SelectionCh
|
238 | 239 | ignoreNextKeyRelease = true; |
239 | 240 | } |
240 | 241 | |
241 | | private void readPreferences() { |
| 242 | @Override |
| 243 | protected void readPreferences() { |
242 | 244 | rubberLineColor = Main.pref.getColor(marktr("helper line"), null); |
243 | 245 | if (rubberLineColor == null) rubberLineColor = PaintColors.SELECTED.get(); |
244 | 246 | |
diff --git a/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java b/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
index 0e017a4..18d28fb 100644
a
|
b
|
public class ExtrudeAction extends MapMode implements MapViewPaintable, KeyPress
|
294 | 294 | super.enterMode(); |
295 | 295 | Main.map.mapView.addMouseListener(this); |
296 | 296 | Main.map.mapView.addMouseMotionListener(this); |
297 | | readPreferences(); |
298 | 297 | ignoreNextKeyRelease = true; |
299 | 298 | Main.map.keyDetector.addKeyListener(this); |
300 | 299 | Main.map.keyDetector.addModifierListener(this); |
301 | 300 | } |
302 | 301 | |
303 | | private void readPreferences() { |
| 302 | @Override |
| 303 | protected void readPreferences() { |
304 | 304 | initialMoveDelay = Main.pref.getInteger("edit.initial-move-delay", 200); |
305 | 305 | initialMoveThreshold = Main.pref.getInteger("extrude.initial-move-threshold", 1); |
306 | 306 | mainColor = Main.pref.getColor(marktr("Extrude: main line"), null); |
diff --git a/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java b/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java
index 0d343ee..87599f2 100644
a
|
b
|
public class ImproveWayAccuracyAction extends MapMode implements MapViewPaintabl
|
141 | 141 | Main.map.keyDetector.addModifierListener(this); |
142 | 142 | } |
143 | 143 | |
144 | | private void readPreferences() { |
| 144 | @Override |
| 145 | protected void readPreferences() { |
145 | 146 | guideColor = Main.pref.getColor(marktr("improve way accuracy helper line"), null); |
146 | 147 | if (guideColor == null) guideColor = PaintColors.HIGHLIGHT.get(); |
147 | 148 | |
diff --git a/src/org/openstreetmap/josm/actions/mapmode/MapMode.java b/src/org/openstreetmap/josm/actions/mapmode/MapMode.java
index ba5d48a..f6d774f 100644
a
|
b
|
import org.openstreetmap.josm.gui.MapFrame;
|
14 | 14 | import org.openstreetmap.josm.gui.layer.Layer; |
15 | 15 | import org.openstreetmap.josm.tools.ImageProvider; |
16 | 16 | import org.openstreetmap.josm.tools.Shortcut; |
| 17 | import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent; |
| 18 | import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener; |
17 | 19 | |
18 | 20 | /** |
19 | 21 | * A class implementing MapMode is able to be selected as an mode for map editing. |
… |
… |
import org.openstreetmap.josm.tools.Shortcut;
|
21 | 23 | * |
22 | 24 | * MapModes should register/deregister all necessary listeners on the map's view control. |
23 | 25 | */ |
24 | | public abstract class MapMode extends JosmAction implements MouseListener, MouseMotionListener { |
| 26 | public abstract class MapMode extends JosmAction implements MouseListener, MouseMotionListener, PreferenceChangedListener { |
25 | 27 | protected final Cursor cursor; |
26 | 28 | protected boolean ctrl; |
27 | 29 | protected boolean alt; |
… |
… |
public abstract class MapMode extends JosmAction implements MouseListener, Mouse
|
62 | 64 | */ |
63 | 65 | public void enterMode() { |
64 | 66 | putValue("active", Boolean.TRUE); |
| 67 | Main.pref.addPreferenceChangeListener(this); |
| 68 | readPreferences(); |
65 | 69 | Main.map.mapView.setNewCursor(cursor, this); |
66 | 70 | updateStatusLine(); |
67 | 71 | } |
… |
… |
public abstract class MapMode extends JosmAction implements MouseListener, Mouse
|
71 | 75 | */ |
72 | 76 | public void exitMode() { |
73 | 77 | putValue("active", Boolean.FALSE); |
| 78 | Main.pref.removePreferenceChangeListener(this); |
74 | 79 | Main.map.mapView.resetCursor(this); |
75 | 80 | } |
76 | 81 | |
… |
… |
public abstract class MapMode extends JosmAction implements MouseListener, Mouse
|
83 | 88 | return ""; |
84 | 89 | } |
85 | 90 | |
| 91 | protected void readPreferences() {} |
| 92 | |
86 | 93 | /** |
87 | 94 | * Call selectMapMode(this) on the parent mapFrame. |
88 | 95 | */ |
… |
… |
public abstract class MapMode extends JosmAction implements MouseListener, Mouse
|
159 | 166 | public void mouseDragged(MouseEvent e) { |
160 | 167 | // Do nothing |
161 | 168 | } |
| 169 | |
| 170 | @Override |
| 171 | public void preferenceChanged(PreferenceChangeEvent e) { |
| 172 | readPreferences(); |
| 173 | } |
162 | 174 | } |