Ignore:
Timestamp:
2017-09-23T23:20:03+02:00 (7 years ago)
Author:
bastiK
Message:

see #15229 - move non-essential helper methods from Preferences to PreferencesUtils

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java

    r12846 r12891  
    3333import javax.swing.ImageIcon;
    3434
    35 import org.openstreetmap.josm.Main;
    3635import org.openstreetmap.josm.data.Bounds;
     36import org.openstreetmap.josm.data.PreferencesUtils;
    3737import org.openstreetmap.josm.data.SystemOfMeasurement;
    3838import org.openstreetmap.josm.data.SystemOfMeasurement.SoMChangeListener;
     
    279279    public ColorMode getColorMode(String layerName) {
    280280        try {
    281             int i = Main.pref.getInteger("draw.rawgps.colors", specName(layerName), 0);
     281            int i = PreferencesUtils.getInteger(Config.getPref(), "draw.rawgps.colors", specName(layerName), 0);
    282282            return ColorMode.fromIndex(i);
    283283        } catch (IndexOutOfBoundsException e) {
     
    300300    public void readPreferences(String layerName) {
    301301        String spec = specName(layerName);
    302         forceLines = Main.pref.getBoolean("draw.rawgps.lines.force", spec, false);
    303         direction = Main.pref.getBoolean("draw.rawgps.direction", spec, false);
    304         lineWidth = Main.pref.getInteger("draw.rawgps.linewidth", spec, 0);
    305         alphaLines = Main.pref.getBoolean("draw.rawgps.lines.alpha-blend", spec, false);
     302        forceLines = PreferencesUtils.getBoolean(Config.getPref(), "draw.rawgps.lines.force", spec, false);
     303        direction = PreferencesUtils.getBoolean(Config.getPref(), "draw.rawgps.direction", spec, false);
     304        lineWidth = PreferencesUtils.getInteger(Config.getPref(), "draw.rawgps.linewidth", spec, 0);
     305        alphaLines = PreferencesUtils.getBoolean(Config.getPref(), "draw.rawgps.lines.alpha-blend", spec, false);
    306306
    307307        if (!data.fromServer) {
    308             maxLineLength = Main.pref.getInteger("draw.rawgps.max-line-length.local", spec, -1);
    309             lines = Main.pref.getBoolean("draw.rawgps.lines.local", spec, true);
     308            maxLineLength = PreferencesUtils.getInteger(Config.getPref(), "draw.rawgps.max-line-length.local", spec, -1);
     309            lines = PreferencesUtils.getBoolean(Config.getPref(), "draw.rawgps.lines.local", spec, true);
    310310        } else {
    311             maxLineLength = Main.pref.getInteger("draw.rawgps.max-line-length", spec, 200);
    312             lines = Main.pref.getBoolean("draw.rawgps.lines", spec, true);
    313         }
    314         large = Main.pref.getBoolean("draw.rawgps.large", spec, false);
    315         largesize = Main.pref.getInteger("draw.rawgps.large.size", spec, 3);
    316         hdopCircle = Main.pref.getBoolean("draw.rawgps.hdopcircle", spec, false);
     311            maxLineLength = PreferencesUtils.getInteger(Config.getPref(), "draw.rawgps.max-line-length", spec, 200);
     312            lines = PreferencesUtils.getBoolean(Config.getPref(), "draw.rawgps.lines", spec, true);
     313        }
     314        large = PreferencesUtils.getBoolean(Config.getPref(), "draw.rawgps.large", spec, false);
     315        largesize = PreferencesUtils.getInteger(Config.getPref(), "draw.rawgps.large.size", spec, 3);
     316        hdopCircle = PreferencesUtils.getBoolean(Config.getPref(), "draw.rawgps.hdopcircle", spec, false);
    317317        colored = getColorMode(layerName);
    318         alternateDirection = Main.pref.getBoolean("draw.rawgps.alternatedirection", spec, false);
    319         delta = Main.pref.getInteger("draw.rawgps.min-arrow-distance", spec, 40);
    320         colorTracksTune = Main.pref.getInteger("draw.rawgps.colorTracksTune", spec, 45);
    321         colorModeDynamic = Main.pref.getBoolean("draw.rawgps.colors.dynamic", spec, false);
     318        alternateDirection = PreferencesUtils.getBoolean(Config.getPref(), "draw.rawgps.alternatedirection", spec, false);
     319        delta = PreferencesUtils.getInteger(Config.getPref(), "draw.rawgps.min-arrow-distance", spec, 40);
     320        colorTracksTune = PreferencesUtils.getInteger(Config.getPref(), "draw.rawgps.colorTracksTune", spec, 45);
     321        colorModeDynamic = PreferencesUtils.getBoolean(Config.getPref(), "draw.rawgps.colors.dynamic", spec, false);
    322322        /* good HDOP's are between 1 and 3, very bad HDOP's go into 3 digit values */
    323323        hdoprange = Config.getPref().getInt("hdop.range", 7);
     
    326326
    327327        // get heatmap parameters
    328         heatMapEnabled = Main.pref.getBoolean("draw.rawgps.heatmap.enabled", spec, false);
    329         heatMapDrawExtraLine = Main.pref.getBoolean("draw.rawgps.heatmap.line-extra", spec, false);
    330         heatMapDrawColorTableIdx = Main.pref.getInteger("draw.rawgps.heatmap.colormap", spec, 0);
    331         heatMapDrawPointMode = Main.pref.getBoolean("draw.rawgps.heatmap.use-points", spec, false);
    332         heatMapDrawGain = Main.pref.getInteger("draw.rawgps.heatmap.gain", spec, 0);
    333         heatMapDrawLowerLimit = Main.pref.getInteger("draw.rawgps.heatmap.lower-limit", spec, 0);
     328        heatMapEnabled = PreferencesUtils.getBoolean(Config.getPref(), "draw.rawgps.heatmap.enabled", spec, false);
     329        heatMapDrawExtraLine = PreferencesUtils.getBoolean(Config.getPref(), "draw.rawgps.heatmap.line-extra", spec, false);
     330        heatMapDrawColorTableIdx = PreferencesUtils.getInteger(Config.getPref(), "draw.rawgps.heatmap.colormap", spec, 0);
     331        heatMapDrawPointMode = PreferencesUtils.getBoolean(Config.getPref(), "draw.rawgps.heatmap.use-points", spec, false);
     332        heatMapDrawGain = PreferencesUtils.getInteger(Config.getPref(), "draw.rawgps.heatmap.gain", spec, 0);
     333        heatMapDrawLowerLimit = PreferencesUtils.getInteger(Config.getPref(), "draw.rawgps.heatmap.lower-limit", spec, 0);
    334334
    335335        // shrink to range
Note: See TracChangeset for help on using the changeset viewer.