Changeset 9572 in josm for trunk/src/org
- Timestamp:
- 2016-01-23T02:10:43+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions/mapmode
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r9444 r9572 141 141 readPreferences(); 142 142 snapHelper.init(); 143 readPreferences(); 143 144 } 144 145 … … 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(); -
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r9444 r9572 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); … … 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); -
trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java
r9358 r9572 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(); -
trunk/src/org/openstreetmap/josm/actions/mapmode/MapMode.java
r9231 r9572 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 /** … … 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; … … 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(); … … 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 } … … 83 88 return ""; 84 89 } 90 91 protected void readPreferences() {} 85 92 86 93 /** … … 160 167 // Do nothing 161 168 } 169 170 @Override 171 public void preferenceChanged(PreferenceChangeEvent e) { 172 readPreferences(); 173 } 162 174 }
Note:
See TracChangeset
for help on using the changeset viewer.