Ignore:
Timestamp:
2017-09-13T16:30:27+02:00 (2 years ago)
Author:
bastiK
Message:

see #15229 - fix deprecations caused by [12840]

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java

    r12726 r12841  
    398398        }
    399399
    400         for (String linearTag : Main.pref.getCollection("multipoly.lineartagstokeep", DEFAULT_LINEAR_TAGS)) {
     400        for (String linearTag : Main.pref.getList("multipoly.lineartagstokeep", DEFAULT_LINEAR_TAGS)) {
    401401            values.remove(linearTag);
    402402        }
  • trunk/src/org/openstreetmap/josm/actions/DialogsToggleAction.java

    r12643 r12841  
    4343    public void actionPerformed(ActionEvent e) {
    4444        toggleSelectedState(e);
    45         Main.pref.put("draw.dialogspanel", isSelected());
     45        Main.pref.putBoolean("draw.dialogspanel", isSelected());
    4646        notifySelectedState();
    4747        setMode();
     
    6161            // Toolbars listen to preference changes, use it here
    6262            if (!Main.pref.getBoolean("toolbar.always-visible", true) && (!selected || toolbarPreviouslyVisible)) {
    63                 Main.pref.put("toolbar.visible", selected);
     63                Main.pref.putBoolean("toolbar.visible", selected);
    6464            }
    6565            if (!Main.pref.getBoolean("sidetoolbar.always-visible", true) && (!selected || sideToolbarPreviouslyVisible)) {
    66                 Main.pref.put("sidetoolbar.visible", selected);
     66                Main.pref.putBoolean("sidetoolbar.visible", selected);
    6767            }
    6868            map.mapView.rememberLastPositionOnScreen();
  • trunk/src/org/openstreetmap/josm/actions/FullscreenToggleAction.java

    r12637 r12841  
    5353    public void actionPerformed(ActionEvent e) {
    5454        toggleSelectedState(e);
    55         Main.pref.put("draw.fullscreen", isSelected());
     55        Main.pref.putBoolean("draw.fullscreen", isSelected());
    5656        notifySelectedState();
    5757        setMode();
  • trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java

    r12689 r12841  
    114114            return candidates.get(0);
    115115
    116         switch (Main.pref.getInteger("merge-nodes.mode", 0)) {
     116        switch (Main.pref.getInt("merge-nodes.mode", 0)) {
    117117        case 0:
    118118            return candidates.get(size - 1);
  • trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java

    r12671 r12841  
    330330
    331331            if (recordHistory) {
    332                 Collection<String> oldFileHistory = Main.pref.getCollection("file-open.history");
     332                Collection<String> oldFileHistory = Main.pref.getList("file-open.history");
    333333                fileHistory.addAll(oldFileHistory);
    334334                // remove the files which failed to load from the list
    335335                fileHistory.removeAll(failedAll);
    336                 int maxsize = Math.max(0, Main.pref.getInteger("file-open.history.max-size", 15));
     336                int maxsize = Math.max(0, Main.pref.getInt("file-open.history.max-size", 15));
    337337                Main.pref.putCollectionBounded("file-open.history", maxsize, fileHistory);
    338338            }
  • trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java

    r12675 r12841  
    104104     */
    105105    protected void restoreUploadAddressHistory(HistoryComboBox cbHistory) {
    106         List<String> cmtHistory = new LinkedList<>(Main.pref.getCollection(getClass().getName() + ".uploadAddressHistory",
     106        List<String> cmtHistory = new LinkedList<>(Main.pref.getList(getClass().getName() + ".uploadAddressHistory",
    107107                new LinkedList<String>()));
    108108        // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement()
     
    118118    protected void remindUploadAddressHistory(HistoryComboBox cbHistory) {
    119119        cbHistory.addCurrentItemToHistory();
    120         Main.pref.putCollection(getClass().getName() + ".uploadAddressHistory", cbHistory.getHistory());
     120        Main.pref.putList(getClass().getName() + ".uploadAddressHistory", cbHistory.getHistory());
    121121    }
    122122
  • trunk/src/org/openstreetmap/josm/actions/PurgeAction.java

    r12718 r12841  
    9999
    100100            clearUndoRedo = cbClearUndoRedo.isSelected();
    101             Main.pref.put("purge.clear_undo_redo", clearUndoRedo);
     101            Main.pref.putBoolean("purge.clear_undo_redo", clearUndoRedo);
    102102        }
    103103
  • trunk/src/org/openstreetmap/josm/actions/RenameLayerAction.java

    r11343 r12841  
    8181        String nameText = name.getText();
    8282        if (filerename.isEnabled()) {
    83             Main.pref.put("layer.rename-file", filerename.isSelected());
     83            Main.pref.putBoolean("layer.rename-file", filerename.isSelected());
    8484            if (filerename.isSelected()) {
    8585                String newname = nameText;
  • trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java

    r12671 r12841  
    229229        }
    230230
    231         int maxsize = Math.max(0, Main.pref.getInteger("file-open.history.max-size", 15));
    232         Collection<String> oldHistory = Main.pref.getCollection("file-open.history");
     231        int maxsize = Math.max(0, Main.pref.getInt("file-open.history.max-size", 15));
     232        Collection<String> oldHistory = Main.pref.getList("file-open.history");
    233233        List<String> history = new LinkedList<>(oldHistory);
    234234        history.remove(filepath);
  • trunk/src/org/openstreetmap/josm/actions/SearchNotesDownloadAction.java

    r12620 r12841  
    4141    public void actionPerformed(ActionEvent e) {
    4242        HistoryComboBox searchTermBox = new HistoryComboBox();
    43         List<String> searchHistory = new LinkedList<>(Main.pref.getCollection(HISTORY_KEY, new LinkedList<String>()));
     43        List<String> searchHistory = new LinkedList<>(Main.pref.getList(HISTORY_KEY, new LinkedList<String>()));
    4444        Collections.reverse(searchHistory);
    4545        searchTermBox.setPossibleItems(searchHistory);
     
    7070
    7171        searchTermBox.addCurrentItemToHistory();
    72         Main.pref.putCollection(HISTORY_KEY, searchTermBox.getHistory());
     72        Main.pref.putList(HISTORY_KEY, searchTermBox.getHistory());
    7373
    7474        performSearch(searchTerm);
     
    9191        }
    9292
    93         int noteLimit = Main.pref.getInteger("osm.notes.downloadLimit", 1000);
    94         int closedLimit = Main.pref.getInteger("osm.notes.daysClosed", 7);
     93        int noteLimit = Main.pref.getInt("osm.notes.downloadLimit", 1000);
     94        int closedLimit = Main.pref.getInt("osm.notes.daysClosed", 7);
    9595
    9696        StringBuilder sb = new StringBuilder(128);
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawSnapHelper.java

    r12630 r12841  
    237237
    238238    private void computeSnapAngles() {
    239         snapAngles = Main.pref.getCollection(DRAW_ANGLESNAP_ANGLES,
     239        snapAngles = Main.pref.getList(DRAW_ANGLESNAP_ANGLES,
    240240                Arrays.asList("0", "30", "45", "60", "90", "120", "135", "150", "180"))
    241241                .stream()
     
    259259     */
    260260    public void saveAngles(String... angles) {
    261         Main.pref.putCollection(DRAW_ANGLESNAP_ANGLES, Arrays.asList(angles));
     261        Main.pref.putList(DRAW_ANGLESNAP_ANGLES, Arrays.asList(angles));
    262262    }
    263263
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

    r12726 r12841  
    307307    @Override
    308308    protected void readPreferences() {
    309         initialMoveDelay = Main.pref.getInteger("edit.initial-move-delay", 200);
    310         initialMoveThreshold = Main.pref.getInteger("extrude.initial-move-threshold", 1);
     309        initialMoveDelay = Main.pref.getInt("edit.initial-move-delay", 200);
     310        initialMoveThreshold = Main.pref.getInt("extrude.initial-move-threshold", 1);
    311311        mainColor = new ColorProperty(marktr("Extrude: main line"), Color.RED).get();
    312312        helperColor = new ColorProperty(marktr("Extrude: helper line"), Color.ORANGE).get();
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r12785 r12841  
    202202        mv.addMouseListener(this);
    203203        mv.addMouseMotionListener(this);
    204         mv.setVirtualNodesEnabled(Main.pref.getInteger("mappaint.node.virtual-size", 8) != 0);
     204        mv.setVirtualNodesEnabled(Main.pref.getInt("mappaint.node.virtual-size", 8) != 0);
    205205        drawTargetHighlight = Main.pref.getBoolean("draw.target-highlight", true);
    206         initialMoveDelay = Main.pref.getInteger("edit.initial-move-delay", 200);
    207         initialMoveThreshold = Main.pref.getInteger("edit.initial-move-threshold", 5);
     206        initialMoveDelay = Main.pref.getInt("edit.initial-move-delay", 200);
     207        initialMoveThreshold = Main.pref.getInt("edit.initial-move-threshold", 5);
    208208        repeatedKeySwitchLassoOption = Main.pref.getBoolean("mappaint.select.toggle-lasso-on-repeated-S", true);
    209209        cycleManager.init();
     
    828828            }
    829829        }
    830         int max = Main.pref.getInteger("warn.move.maxelements", 20), limit = max;
     830        int max = Main.pref.getInt("warn.move.maxelements", 20), limit = max;
    831831        for (OsmPrimitive osm : getLayerManager().getEditDataSet().getSelected()) {
    832832            if (osm instanceof Way) {
     
    11751175
    11761176        private void init() {
    1177             nodeVirtualSize = Main.pref.getInteger("mappaint.node.virtual-size", 8);
    1178             int virtualSnapDistSq = Main.pref.getInteger("mappaint.node.virtual-snap-distance", 8);
     1177            nodeVirtualSize = Main.pref.getInt("mappaint.node.virtual-size", 8);
     1178            int virtualSnapDistSq = Main.pref.getInt("mappaint.node.virtual-snap-distance", 8);
    11791179            virtualSnapDistSq2 = virtualSnapDistSq*virtualSnapDistSq;
    1180             virtualSpace = Main.pref.getInteger("mappaint.node.virtual-space", 70);
     1180            virtualSpace = Main.pref.getInt("mappaint.node.virtual-space", 70);
    11811181        }
    11821182
  • trunk/src/org/openstreetmap/josm/actions/relation/EditRelationAction.java

    r12636 r12841  
    7070    public void actionPerformed(ActionEvent e) {
    7171        if (!isEnabled() || relations.isEmpty()) return;
    72         if (relations.size() > Main.pref.getInteger("warn.open.maxrelations", 5) &&
     72        if (relations.size() > Main.pref.getInt("warn.open.maxrelations", 5) &&
    7373            /* I18N english text for value 1 makes no real sense, never called for values <= maxrel (usually 5) */
    7474            JOptionPane.OK_OPTION != JOptionPane.showConfirmDialog(Main.parent,
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r12839 r12841  
    112112        });
    113113
    114         for (String s: Main.pref.getCollection("search.history", Collections.<String>emptyList())) {
     114        for (String s: Main.pref.getList("search.history", Collections.<String>emptyList())) {
    115115            SearchSetting ss = SearchSetting.readFromString(s);
    116116            if (ss != null) {
     
    140140            searchHistory.addFirst(new SearchSetting(s));
    141141        }
    142         int maxsize = Main.pref.getInteger("search.history-size", DEFAULT_SEARCH_HISTORY_SIZE);
     142        int maxsize = Main.pref.getInt("search.history-size", DEFAULT_SEARCH_HISTORY_SIZE);
    143143        while (searchHistory.size() > maxsize) {
    144144            searchHistory.removeLast();
     
    148148            savedHistory.add(item.writeToString());
    149149        }
    150         Main.pref.putCollection("search.history", savedHistory);
     150        Main.pref.putList("search.history", new ArrayList<>(savedHistory));
    151151    }
    152152
Note: See TracChangeset for help on using the changeset viewer.