Changeset 34526 in osm for applications/editors/josm
- Timestamp:
- 2018-08-18T18:38:37+02:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/livegps
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/livegps/build.xml
r33739 r34526 2 2 <project name="livegps" default="dist" basedir="."> 3 3 <property name="commit.message" value="Changed the constructor signature of the plugin main class"/> 4 <property name="plugin.main.version" value="1 2987"/>4 <property name="plugin.main.version" value="14153"/> 5 5 6 6 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/livegps/src/livegps/LiveGpsAcquirer.java
r33739 r34526 21 21 import javax.json.JsonObject; 22 22 23 import org.openstreetmap.josm. Main;23 import org.openstreetmap.josm.spi.preferences.Config; 24 24 import org.openstreetmap.josm.tools.Logging; 25 25 … … 47 47 public LiveGpsAcquirer() { 48 48 49 gpsdHost = Main.pref.get(C_HOST, DEFAULT_HOST);50 gpsdPort = Main.pref.getInt(C_PORT, DEFAULT_PORT);49 gpsdHost = Config.getPref().get(C_HOST, DEFAULT_HOST); 50 gpsdPort = Config.getPref().getInt(C_PORT, DEFAULT_PORT); 51 51 // put the settings back in to the preferences, makes keys appear. 52 Main.pref.put(C_HOST, gpsdHost);53 Main.pref.putInt(C_PORT, gpsdPort);52 Config.getPref().put(C_HOST, gpsdHost); 53 Config.getPref().putInt(C_PORT, gpsdPort); 54 54 } 55 55 -
applications/editors/josm/plugins/livegps/src/livegps/LiveGpsDrawHelper.java
r33739 r34526 6 6 import java.awt.Point; 7 7 8 import org.openstreetmap.josm.Main;9 8 import org.openstreetmap.josm.data.gpx.WayPoint; 10 9 import org.openstreetmap.josm.data.preferences.CachingProperty; … … 13 12 import org.openstreetmap.josm.gui.layer.MapViewGraphics; 14 13 import org.openstreetmap.josm.gui.layer.gpx.GpxDrawHelper; 14 import org.openstreetmap.josm.spi.preferences.Config; 15 15 16 16 public class LiveGpsDrawHelper extends GpxDrawHelper { … … 48 48 Point screen = mv.getPoint(lastPoint.getCoor()); 49 49 50 int TriaHeight = Main.pref.getInt(C_CURSOR_H, 20);51 int TriaWidth = Main.pref.getInt(C_CURSOR_W, 10);52 int TriaThick = Main.pref.getInt(C_CURSOR_T, 4);50 int TriaHeight = Config.getPref().getInt(C_CURSOR_H, 20); 51 int TriaWidth = Config.getPref().getInt(C_CURSOR_W, 10); 52 int TriaThick = Config.getPref().getInt(C_CURSOR_T, 4); 53 53 54 54 /* -
applications/editors/josm/plugins/livegps/src/livegps/LiveGpsLayer.java
r33953 r34526 13 13 import java.util.Map; 14 14 15 import org.openstreetmap.josm.Main;16 15 import org.openstreetmap.josm.data.coor.LatLon; 17 16 import org.openstreetmap.josm.data.gpx.GpxData; … … 20 19 import org.openstreetmap.josm.gui.MainApplication; 21 20 import org.openstreetmap.josm.gui.layer.GpxLayer; 21 import org.openstreetmap.josm.spi.preferences.Config; 22 22 23 23 public class LiveGpsLayer extends GpxLayer implements PropertyChangeListener { … … 139 139 */ 140 140 private void initIntervals() { 141 if ((refreshInterval = Main.pref.getInt(oldC_REFRESH_INTERVAL, 0)) != 0) {141 if ((refreshInterval = Config.getPref().getInt(oldC_REFRESH_INTERVAL, 0)) != 0) { 142 142 refreshInterval *= 1000; 143 Main.pref.put(oldC_REFRESH_INTERVAL, null);143 Config.getPref().put(oldC_REFRESH_INTERVAL, null); 144 144 } else 145 refreshInterval = Main.pref.getInt(C_REFRESH_INTERVAL, DEFAULT_REFRESH_INTERVAL);145 refreshInterval = Config.getPref().getInt(C_REFRESH_INTERVAL, DEFAULT_REFRESH_INTERVAL); 146 146 147 centerInterval = Main.pref.getInt(C_CENTER_INTERVAL, DEFAULT_CENTER_INTERVAL);148 centerFactor = Main.pref.getInt(C_CENTER_FACTOR, DEFAULT_CENTER_FACTOR);147 centerInterval = Config.getPref().getInt(C_CENTER_INTERVAL, DEFAULT_CENTER_INTERVAL); 148 centerFactor = Config.getPref().getInt(C_CENTER_FACTOR, DEFAULT_CENTER_FACTOR); 149 149 if (centerFactor <= 1 || centerFactor >= 99) 150 150 centerFactor = DEFAULT_CENTER_FACTOR; 151 151 152 Main.pref.putInt(C_REFRESH_INTERVAL, refreshInterval);153 Main.pref.putInt(C_CENTER_INTERVAL, centerInterval);154 Main.pref.putInt(C_CENTER_FACTOR, (int) centerFactor);152 Config.getPref().putInt(C_REFRESH_INTERVAL, refreshInterval); 153 Config.getPref().putInt(C_CENTER_INTERVAL, centerInterval); 154 Config.getPref().putInt(C_CENTER_FACTOR, (int) centerFactor); 155 155 156 156 /*
Note:
See TracChangeset
for help on using the changeset viewer.