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

see #15229 - fix deprecations caused by [12840]

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
67 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/ConditionalOptionPaneUtil.java

    r11921 r12841  
    6060                immediateChoices.get(prefKey),
    6161                sessionChoices.get(prefKey),
    62                 !Main.pref.getBoolean("message." + prefKey, true) ? Main.pref.getInteger("message." + prefKey + ".value", -1) : -1
     62                !Main.pref.getBoolean("message." + prefKey, true) ? Main.pref.getInt("message." + prefKey + ".value", -1) : -1
    6363        );
    6464    }
     
    239239                    break;
    240240                case PERMANENT:
    241                     Main.pref.put("message." + prefKey, false);
    242                     Main.pref.putInteger("message." + prefKey + ".value", value);
     241                    Main.pref.putBoolean("message." + prefKey, false);
     242                    Main.pref.putInt("message." + prefKey + ".value", value);
    243243                    break;
    244244            }
  • trunk/src/org/openstreetmap/josm/gui/GettingStarted.java

    r12620 r12841  
    9595            String motd = new WikiReader().readLang("StartupPage");
    9696            // Save this to prefs in case JOSM is updated so MOTD can be refreshed
    97             Main.pref.putInteger("cache.motd.html.version", myVersion);
     97            Main.pref.putInt("cache.motd.html.version", myVersion);
    9898            Main.pref.put("cache.motd.html.java", myJava);
    9999            Main.pref.put("cache.motd.html.lang", myLang);
     
    115115            // 2. Cannot be written (e.g. while developing). Obviously we don't want to update
    116116            // everytime because of something we can't read.
    117             return (Main.pref.getInteger("cache.motd.html.version", -999) == myVersion)
     117            return (Main.pref.getInt("cache.motd.html.version", -999) == myVersion)
    118118            && Main.pref.get("cache.motd.html.java").equals(myJava)
    119119            && Main.pref.get("cache.motd.html.lang").equals(myLang);
  • trunk/src/org/openstreetmap/josm/gui/IconToggleButton.java

    r11553 r12841  
    120120            Main.pref.put(getPreferenceKey(), null);
    121121        } else {
    122             Main.pref.put(getPreferenceKey(), b);
     122            Main.pref.putBoolean(getPreferenceKey(), b);
    123123        }
    124124    }
  • trunk/src/org/openstreetmap/josm/gui/MainApplication.java

    r12828 r12841  
    12521252                if (wasv6 && !hasv6) {
    12531253                    Logging.info(tr("Detected no useable IPv6 network, prefering IPv4 over IPv6 after next restart."));
    1254                     Main.pref.put("validated.ipv6", hasv6); // be sure it is stored before the restart!
     1254                    Main.pref.putBoolean("validated.ipv6", hasv6); // be sure it is stored before the restart!
    12551255                    try {
    12561256                        RestartAction.restartJOSM();
     
    12591259                    }
    12601260                }
    1261                 Main.pref.put("validated.ipv6", hasv6);
     1261                Main.pref.putBoolean("validated.ipv6", hasv6);
    12621262            }, "IPv6-checker").start();
    12631263        }
  • trunk/src/org/openstreetmap/josm/gui/MainFrame.java

    r12678 r12841  
    110110            geometry.remember("gui.geometry");
    111111        }
    112         Main.pref.put("gui.maximized", (windowState & JFrame.MAXIMIZED_BOTH) != 0);
     112        Main.pref.putBoolean("gui.maximized", (windowState & JFrame.MAXIMIZED_BOTH) != 0);
    113113    }
    114114
  • trunk/src/org/openstreetmap/josm/gui/MapFrame.java

    r12636 r12841  
    583583            public void actionPerformed(ActionEvent e) {
    584584                boolean sel = ((JCheckBoxMenuItem) e.getSource()).getState();
    585                 Main.pref.put("sidetoolbar.always-visible", sel);
     585                Main.pref.putBoolean("sidetoolbar.always-visible", sel);
    586586            }
    587587        });
     
    625625                @Override
    626626                public void actionPerformed(ActionEvent e) {
    627                     Main.pref.put("sidetoolbar.visible", false);
     627                    Main.pref.putBoolean("sidetoolbar.visible", false);
    628628                }
    629629            });
  • trunk/src/org/openstreetmap/josm/gui/MapStatus.java

    r12735 r12841  
    775775            public void actionPerformed(ActionEvent e) {
    776776                boolean sel = ((JCheckBoxMenuItem) e.getSource()).getState();
    777                 Main.pref.put("statusbar.always-visible", sel);
     777                Main.pref.putBoolean("statusbar.always-visible", sel);
    778778            }
    779779        });
     
    10791079        // Compute total length of selected way(s) until an arbitrary limit set to 250 ways
    10801080        // in order to prevent performance issue if a large number of ways are selected (old behaviour kept in that case, see #8403)
    1081         int maxWays = Math.max(1, Main.pref.getInteger("selection.max-ways-for-statusline", 250));
     1081        int maxWays = Math.max(1, Main.pref.getInt("selection.max-ways-for-statusline", 250));
    10821082        if (!ways.isEmpty() && ways.size() <= maxWays) {
    10831083            dist = 0.0;
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r12778 r12841  
    871871        if ((now.getTime() - zoomTimestamp.getTime()) > (Main.pref.getDouble("zoom.undo.delay", 1.0) * 1000)) {
    872872            zoomUndoBuffer.push(new ZoomData(center, scale));
    873             if (zoomUndoBuffer.size() > Main.pref.getInteger("zoom.undo.max", 50)) {
     873            if (zoomUndoBuffer.size() > Main.pref.getInt("zoom.undo.max", 50)) {
    874874                zoomUndoBuffer.remove(0);
    875875            }
     
    11441144
    11451145        if (ds != null) {
    1146             double snapDistanceSq = Main.pref.getInteger("mappaint.segment.snap-distance", 10);
     1146            double snapDistanceSq = Main.pref.getInt("mappaint.segment.snap-distance", 10);
    11471147            snapDistanceSq *= snapDistanceSq;
    11481148
    1149             for (Way w : ds.searchWays(getBBox(p, Main.pref.getInteger("mappaint.segment.snap-distance", 10)))) {
     1149            for (Way w : ds.searchWays(getBBox(p, Main.pref.getInt("mappaint.segment.snap-distance", 10)))) {
    11501150                if (!predicate.test(w)) {
    11511151                    continue;
  • trunk/src/org/openstreetmap/josm/gui/Notification.java

    r11100 r12841  
    4343     * E.g. "Please select at least one node".
    4444     */
    45     public static final int TIME_SHORT = Main.pref.getInteger("notification-time-short-ms", 3000);
     45    public static final int TIME_SHORT = Main.pref.getInt("notification-time-short-ms", 3000);
    4646
    4747    /**
    4848     * Short message of one or two lines (5 s).
    4949     */
    50     public static final int TIME_DEFAULT = Main.pref.getInteger("notification-time-default-ms", 5000);
     50    public static final int TIME_DEFAULT = Main.pref.getInt("notification-time-default-ms", 5000);
    5151
    5252    /**
    5353     * Somewhat longer message (10 s).
    5454     */
    55     public static final int TIME_LONG = Main.pref.getInteger("notification-time-long-ms", 10_000);
     55    public static final int TIME_LONG = Main.pref.getInt("notification-time-long-ms", 10_000);
    5656
    5757    /**
     
    5959     * (Make sure is still sensible to show as a notification)
    6060     */
    61     public static final int TIME_VERY_LONG = Main.pref.getInteger("notification-time-very_long-ms", 20_000);
     61    public static final int TIME_VERY_LONG = Main.pref.getInt("notification-time-very_long-ms", 20_000);
    6262
    6363    private Component content;
  • trunk/src/org/openstreetmap/josm/gui/PleaseWaitDialog.java

    r12675 r12841  
    8282                int w = getWidth();
    8383                if (w > 200) {
    84                     Main.pref.putInteger("progressdialog.size", w);
     84                    Main.pref.putInt("progressdialog.size", w);
    8585                }
    8686            }
     
    9898        setDropTarget(null); // Workaround to JDK bug 7027598/7100524/7169912 (#8613)
    9999        pack();
    100         setSize(Main.pref.getInteger("progressdialog.size", 600), getSize().height);
     100        setSize(Main.pref.getInt("progressdialog.size", 600), getSize().height);
    101101    }
    102102
  • trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java

    r12620 r12841  
    162162            setFileCacheEnabled(Main.pref.getBoolean("slippy_map_chooser.file_cache", true));
    163163        }
    164         setMaxTilesInMemory(Main.pref.getInteger("slippy_map_chooser.max_tiles", 1000));
     164        setMaxTilesInMemory(Main.pref.getInt("slippy_map_chooser.max_tiles", 1000));
    165165
    166166        List<TileSource> tileSources = getAllTileSources();
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolver.java

    r11772 r12841  
    7878     */
    7979    public void rememberPreferences() {
    80         Main.pref.put(getClass().getName() + ".showTagsWithConflictsOnly", cbShowTagsWithConflictsOnly.isSelected());
    81         Main.pref.put(getClass().getName() + ".showTagsWithMultiValuesOnly", cbShowTagsWithMultiValuesOnly.isSelected());
     80        Main.pref.putBoolean(getClass().getName() + ".showTagsWithConflictsOnly", cbShowTagsWithConflictsOnly.isSelected());
     81        Main.pref.putBoolean(getClass().getName() + ".showTagsWithMultiValuesOnly", cbShowTagsWithMultiValuesOnly.isSelected());
    8282    }
    8383
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java

    r12636 r12841  
    275275        @Override
    276276        public void itemStateChanged(ItemEvent e) {
    277             Main.pref.put("changeset-dialog.for-selected-objects-only", cbInSelectionOnly.isSelected());
     277            Main.pref.putBoolean("changeset-dialog.for-selected-objects-only", cbInSelectionOnly.isSelected());
    278278            pnlList.removeAll();
    279279            if (cbInSelectionOnly.isSelected()) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/OsmIdSelectionDialog.java

    r12301 r12841  
    180180    protected void restorePrimitivesHistory(HistoryComboBox cbHistory) {
    181181        List<String> cmtHistory = new LinkedList<>(
    182                 Main.pref.getCollection(getClass().getName() + ".primitivesHistory", new LinkedList<String>()));
     182                Main.pref.getList(getClass().getName() + ".primitivesHistory", new LinkedList<String>()));
    183183        // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement()
    184184        Collections.reverse(cmtHistory);
     
    193193    protected void remindPrimitivesHistory(HistoryComboBox cbHistory) {
    194194        cbHistory.addCurrentItemToHistory();
    195         Main.pref.putCollection(getClass().getName() + ".primitivesHistory", cbHistory.getHistory());
     195        Main.pref.putList(getClass().getName() + ".primitivesHistory", cbHistory.getHistory());
    196196    }
    197197
     
    208208    public void setupDialog() {
    209209        setContent(panel, false);
    210         cbType.setSelectedIndex(Main.pref.getInteger("downloadprimitive.lasttype", 0));
     210        cbType.setSelectedIndex(Main.pref.getInt("downloadprimitive.lasttype", 0));
    211211        tfId.setType(cbType.getType());
    212212        if (Main.pref.getBoolean("downloadprimitive.autopaste", true)) {
     
    221221        String buf = ClipboardUtils.getClipboardStringContent();
    222222        if (buf == null || buf.isEmpty()) return;
    223         if (buf.length() > Main.pref.getInteger("downloadprimitive.max-autopaste-length", 2000)) return;
     223        if (buf.length() > Main.pref.getInt("downloadprimitive.max-autopaste-length", 2000)) return;
    224224        final List<SimplePrimitiveId> ids = SimplePrimitiveId.fuzzyParse(buf);
    225225        if (!ids.isEmpty()) {
     
    244244    @Override public void windowClosed(WindowEvent e) {
    245245        if (e != null && e.getComponent() == this && getValue() == getContinueButtonIndex()) {
    246             Main.pref.putInteger("downloadprimitive.lasttype", cbType.getSelectedIndex());
     246            Main.pref.putInt("downloadprimitive.lasttype", cbType.getSelectedIndex());
    247247
    248248            if (!tfId.readIds()) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java

    r12663 r12841  
    524524                }
    525525            }
    526             int maxsize = Main.pref.getInteger("select.history-size", SELECTION_HISTORY_SIZE);
     526            int maxsize = Main.pref.getInt("select.history-size", SELECTION_HISTORY_SIZE);
    527527            while (history.size() > maxsize) {
    528528                history.removeLast();
     
    662662         */
    663663        public synchronized void sort() {
    664             if (selection.size() <= Main.pref.getInteger("selection.no_sort_above", 100_000)) {
    665                 boolean quick = selection.size() > Main.pref.getInteger("selection.fast_sort_above", 10_000);
     664            if (selection.size() <= Main.pref.getInt("selection.no_sort_above", 100_000)) {
     665                boolean quick = selection.size() > Main.pref.getInt("selection.fast_sort_above", 10_000);
    666666                Comparator<OsmPrimitive> c = Main.pref.getBoolean("selection.sort_relations_before_ways", true)
    667667                        ? OsmPrimitiveComparator.orderingRelationsWaysNodes()
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java

    r12678 r12841  
    773773    protected void setIsShowing(boolean val) {
    774774        isShowing = val;
    775         Main.pref.put(preferencePrefix+".visible", val);
     775        Main.pref.putBoolean(preferencePrefix+".visible", val);
    776776        stateChanged();
    777777    }
     
    782782        }
    783783        isDocked = val;
    784         Main.pref.put(preferencePrefix+".docked", val);
     784        Main.pref.putBoolean(preferencePrefix+".docked", val);
    785785        stateChanged();
    786786    }
     
    788788    protected void setIsCollapsed(boolean val) {
    789789        isCollapsed = val;
    790         Main.pref.put(preferencePrefix+".minimized", val);
     790        Main.pref.putBoolean(preferencePrefix+".minimized", val);
    791791        stateChanged();
    792792    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java

    r11326 r12841  
    209209     */
    210210    public void rememberSettings() {
    211         Main.pref.put("changeset-query.advanced.user-restrictions", cbUserRestriction.isSelected());
    212         Main.pref.put("changeset-query.advanced.open-restrictions", cbOpenAndCloseRestrictions.isSelected());
    213         Main.pref.put("changeset-query.advanced.time-restrictions", cbTimeRestrictions.isSelected());
    214         Main.pref.put("changeset-query.advanced.bbox-restrictions", cbBoundingBoxRestriction.isSelected());
     211        Main.pref.putBoolean("changeset-query.advanced.user-restrictions", cbUserRestriction.isSelected());
     212        Main.pref.putBoolean("changeset-query.advanced.open-restrictions", cbOpenAndCloseRestrictions.isSelected());
     213        Main.pref.putBoolean("changeset-query.advanced.time-restrictions", cbTimeRestrictions.isSelected());
     214        Main.pref.putBoolean("changeset-query.advanced.bbox-restrictions", cbBoundingBoxRestriction.isSelected());
    215215
    216216        pnlUserRestriction.rememberSettings();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/BasicChangesetQueryPanel.java

    r12743 r12841  
    191191            Main.pref.put("changeset-query.basic.query", q.toString());
    192192        }
    193         Main.pref.put("changeset-query.basic.my-changesets-only", cbMyChangesetsOnly.isSelected());
     193        Main.pref.putBoolean("changeset-query.basic.my-changesets-only", cbMyChangesetsOnly.isSelected());
    194194    }
    195195
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/RecentTagCollection.java

    r12659 r12841  
    1212import org.openstreetmap.josm.data.osm.search.SearchSetting;
    1313import org.openstreetmap.josm.data.osm.search.SearchCompiler;
    14 import org.openstreetmap.josm.data.preferences.CollectionProperty;
     14import org.openstreetmap.josm.data.preferences.ListProperty;
    1515
    1616/**
     
    4444    }
    4545
    46     public void loadFromPreference(CollectionProperty property) {
     46    public void loadFromPreference(ListProperty property) {
    4747        recentTags.clear();
    4848        Iterator<String> it = property.get().iterator();
     
    5454    }
    5555
    56     public void saveToPreference(CollectionProperty property) {
     56    public void saveToPreference(ListProperty property) {
    5757        List<String> c = new ArrayList<>(recentTags.size() * 2);
    5858        for (Tag t : recentTags.keySet()) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java

    r12758 r12841  
    7373import org.openstreetmap.josm.data.osm.search.SearchSetting;
    7474import org.openstreetmap.josm.data.preferences.BooleanProperty;
    75 import org.openstreetmap.josm.data.preferences.CollectionProperty;
     75import org.openstreetmap.josm.data.preferences.ListProperty;
    7676import org.openstreetmap.josm.data.preferences.EnumProperty;
    7777import org.openstreetmap.josm.data.preferences.IntegerProperty;
     
    128128            DEFAULT_LRU_TAGS_NUMBER);
    129129    /** The preference storage of recent tags */
    130     public static final CollectionProperty PROPERTY_RECENT_TAGS = new CollectionProperty("properties.recent-tags",
     130    public static final ListProperty PROPERTY_RECENT_TAGS = new ListProperty("properties.recent-tags",
    131131            Collections.<String>emptyList());
    132132    public static final StringProperty PROPERTY_TAGS_TO_IGNORE = new StringProperty("properties.recent-tags.ignore",
  • trunk/src/org/openstreetmap/josm/gui/download/BookmarkList.java

    r12743 r12841  
    300300     */
    301301    public final void save() {
    302         List<Collection<String>> coll = new LinkedList<>();
     302        List<List<String>> coll = new LinkedList<>();
    303303        for (Object o : ((DefaultListModel<Bookmark>) getModel()).toArray()) {
    304304            if (o instanceof HomeLocationBookmark || o instanceof ChangesetBookmark) {
     
    315315            coll.add(Arrays.asList(array));
    316316        }
    317         Main.pref.putArray("bookmarks", coll);
     317        Main.pref.putListOfLists("bookmarks", coll);
    318318    }
    319319
  • trunk/src/org/openstreetmap/josm/gui/download/DownloadObjectDialog.java

    r12279 r12841  
    103103        super.windowClosed(e);
    104104        if (e != null && e.getComponent() == this && getValue() == 1) {
    105             Main.pref.put("downloadprimitive.referrers", referrers.isSelected());
    106             Main.pref.put("downloadprimitive.full", fullRel.isSelected());
    107             Main.pref.put("download.newlayer", newLayer.isSelected());
     105            Main.pref.putBoolean("downloadprimitive.referrers", referrers.isSelected());
     106            Main.pref.putBoolean("downloadprimitive.full", fullRel.isSelected());
     107            Main.pref.putBoolean("download.newlayer", newLayer.isSelected());
    108108        }
    109109    }
  • trunk/src/org/openstreetmap/josm/gui/download/OverpassQueryList.java

    r12620 r12841  
    244244     */
    245245    private void savePreferences() {
    246         Collection<Map<String, String>> toSave = new ArrayList<>(this.items.size());
     246        List<Map<String, String>> toSave = new ArrayList<>(this.items.size());
    247247        for (SelectorItem item : this.items.values()) {
    248248            Map<String, String> it = new HashMap<>();
     
    254254        }
    255255
    256         Main.pref.putListOfStructs(PREFERENCE_ITEMS, toSave);
     256        Main.pref.putListOfMaps(PREFERENCE_ITEMS, toSave);
    257257    }
    258258
     
    263263    private static Map<String, SelectorItem> restorePreferences() {
    264264        Collection<Map<String, String>> toRetrieve =
    265                 Main.pref.getListOfStructs(PREFERENCE_ITEMS, Collections.emptyList());
     265                Main.pref.getListOfMaps(PREFERENCE_ITEMS, Collections.emptyList());
    266266        Map<String, SelectorItem> result = new HashMap<>();
    267267
  • trunk/src/org/openstreetmap/josm/gui/download/OverpassQueryWizardDialog.java

    r12655 r12841  
    2020
    2121import org.openstreetmap.josm.Main;
    22 import org.openstreetmap.josm.data.preferences.CollectionProperty;
     22import org.openstreetmap.josm.data.preferences.ListProperty;
    2323import org.openstreetmap.josm.gui.ExtendedDialog;
    2424import org.openstreetmap.josm.gui.util.GuiHelper;
     
    4747    private static final String SPAN_START = "<span>";
    4848    private static final String SPAN_END = "</span>";
    49     private static final CollectionProperty OVERPASS_WIZARD_HISTORY =
    50             new CollectionProperty("download.overpass.wizard", new ArrayList<String>());
     49    private static final ListProperty OVERPASS_WIZARD_HISTORY =
     50            new ListProperty("download.overpass.wizard", new ArrayList<String>());
    5151    private final transient OverpassTurboQueryWizard overpassQueryBuilder;
    5252
  • trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java

    r12634 r12841  
    115115        cbSearchExpression = new HistoryComboBox();
    116116        cbSearchExpression.setToolTipText(tr("Enter a place name to search for"));
    117         List<String> cmtHistory = new LinkedList<>(Main.pref.getCollection(HISTORY_KEY, new LinkedList<String>()));
     117        List<String> cmtHistory = new LinkedList<>(Main.pref.getList(HISTORY_KEY, new LinkedList<String>()));
    118118        Collections.reverse(cmtHistory);
    119119        cbSearchExpression.setPossibleItems(cmtHistory);
     
    189189                return;
    190190            cbSearchExpression.addCurrentItemToHistory();
    191             Main.pref.putCollection(HISTORY_KEY, cbSearchExpression.getHistory());
     191            Main.pref.putList(HISTORY_KEY, cbSearchExpression.getHistory());
    192192            NameQueryTask task = new NameQueryTask(cbSearchExpression.getText());
    193193            MainApplication.worker.submit(task);
  • trunk/src/org/openstreetmap/josm/gui/history/VersionTable.java

    r11646 r12841  
    341341        Object val = tbl.getColumnModel().getColumn(col).getHeaderValue();
    342342        Component comp = tcr.getTableCellRendererComponent(tbl, val, false, false, -1, col);
    343         maxwidth = Math.max(comp.getPreferredSize().width + Main.pref.getInteger("table.header-inset", 0), maxwidth);
     343        maxwidth = Math.max(comp.getPreferredSize().width + Main.pref.getInt("table.header-inset", 0), maxwidth);
    344344
    345345        int spacing = tbl.getIntercellSpacing().width;
  • trunk/src/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanel.java

    r12719 r12841  
    7878        hcbUploadComment.setToolTipText(tr("Enter an upload comment"));
    7979        hcbUploadComment.setMaxTextLength(Changeset.MAX_CHANGESET_TAG_LENGTH);
    80         List<String> cmtHistory = new LinkedList<>(Main.pref.getCollection(HISTORY_KEY, new LinkedList<String>()));
     80        List<String> cmtHistory = new LinkedList<>(Main.pref.getList(HISTORY_KEY, new LinkedList<String>()));
    8181        Collections.reverse(cmtHistory); // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement()
    8282        hcbUploadComment.setPossibleItems(cmtHistory);
     
    100100        hcbUploadSource.setToolTipText(tr("Enter a source"));
    101101        hcbUploadSource.setMaxTextLength(Changeset.MAX_CHANGESET_TAG_LENGTH);
    102         List<String> sourceHistory = new LinkedList<>(Main.pref.getCollection(SOURCE_HISTORY_KEY, getDefaultSources()));
     102        List<String> sourceHistory = new LinkedList<>(Main.pref.getList(SOURCE_HISTORY_KEY, getDefaultSources()));
    103103        Collections.reverse(sourceHistory); // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement()
    104104        hcbUploadSource.setPossibleItems(sourceHistory);
     
    166166        // store the history of comments
    167167        hcbUploadComment.addCurrentItemToHistory();
    168         Main.pref.putCollection(HISTORY_KEY, hcbUploadComment.getHistory());
    169         Main.pref.putInteger(HISTORY_LAST_USED_KEY, (int) (TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())));
     168        Main.pref.putList(HISTORY_KEY, hcbUploadComment.getHistory());
     169        Main.pref.putInt(HISTORY_LAST_USED_KEY, (int) (TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())));
    170170        // store the history of sources
    171171        hcbUploadSource.addCurrentItemToHistory();
    172         Main.pref.putCollection(SOURCE_HISTORY_KEY, hcbUploadSource.getHistory());
     172        Main.pref.putList(SOURCE_HISTORY_KEY, hcbUploadSource.getHistory());
    173173    }
    174174
  • trunk/src/org/openstreetmap/josm/gui/io/ChangesetManagementPanel.java

    r12634 r12841  
    256256            case ItemEvent.SELECTED:
    257257                firePropertyChange(CLOSE_CHANGESET_AFTER_UPLOAD, false, true);
    258                 Main.pref.put("upload.changeset.close", true);
     258                Main.pref.putBoolean("upload.changeset.close", true);
    259259                break;
    260260            case ItemEvent.DESELECTED:
    261261                firePropertyChange(CLOSE_CHANGESET_AFTER_UPLOAD, true, false);
    262                 Main.pref.put("upload.changeset.close", false);
     262                Main.pref.putBoolean("upload.changeset.close", false);
    263263                break;
    264264            default: // Do nothing
  • trunk/src/org/openstreetmap/josm/gui/io/CustomConfigurator.java

    r12826 r12841  
    400400                        MainApplication.worker.submit(pluginDownloadTask);
    401401                    }
    402                     Collection<String> pls = new ArrayList<>(Main.pref.getCollection("plugins"));
     402                    List<String> pls = new ArrayList<>(Main.pref.getList("plugins"));
    403403                    for (PluginInformation pi2: toInstallPlugins) {
    404404                        if (!pls.contains(pi2.name)) {
     
    413413                        new File(Main.pref.getPluginsDirectory(), pi4.name+".jar").deleteOnExit();
    414414                    }
    415                     Main.pref.putCollection("plugins", pls);
     415                    Main.pref.putList("plugins", pls);
    416416                });
    417417            }
  • trunk/src/org/openstreetmap/josm/gui/io/RecentlyOpenedFilesMenu.java

    r12634 r12841  
    5858    private void rebuild() {
    5959        removeAll();
    60         Collection<String> fileHistory = Main.pref.getCollection("file-open.history");
     60        Collection<String> fileHistory = Main.pref.getList("file-open.history");
    6161
    6262        for (final String file : fileHistory) {
     
    101101        @Override
    102102        public void actionPerformed(ActionEvent e) {
    103             Main.pref.putCollection("file-open.history", null);
     103            Main.pref.putList("file-open.history", null);
    104104        }
    105105    }
  • trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java

    r12799 r12841  
    653653
    654654    private static String getLastChangesetTagFromHistory(String historyKey, List<String> def) {
    655         Collection<String> history = Main.pref.getCollection(historyKey, def);
    656         int age = (int) (System.currentTimeMillis() / 1000 - Main.pref.getInteger(BasicUploadSettingsPanel.HISTORY_LAST_USED_KEY, 0));
     655        Collection<String> history = Main.pref.getList(historyKey, def);
     656        int age = (int) (System.currentTimeMillis() / 1000 - Main.pref.getInt(BasicUploadSettingsPanel.HISTORY_LAST_USED_KEY, 0));
    657657        if (history != null && age < Main.pref.getLong(BasicUploadSettingsPanel.HISTORY_MAX_AGE_KEY, TimeUnit.HOURS.toMillis(4))
    658658                && !history.isEmpty()) {
  • trunk/src/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanel.java

    r12687 r12841  
    323323        UploadStrategy strategy = UploadStrategy.getFromPreferences();
    324324        rbStrategy.get(strategy).setSelected(true);
    325         int chunkSize = Main.pref.getInteger("osm-server.upload-strategy.chunk-size", 1);
     325        int chunkSize = Main.pref.getInt("osm-server.upload-strategy.chunk-size", 1);
    326326        tfChunkSize.setText(Integer.toString(chunkSize));
    327327        updateNumRequestsLabels();
     
    337337        try {
    338338            chunkSize = Integer.parseInt(tfChunkSize.getText().trim());
    339             Main.pref.putInteger("osm-server.upload-strategy.chunk-size", chunkSize);
     339            Main.pref.putInt("osm-server.upload-strategy.chunk-size", chunkSize);
    340340        } catch (NumberFormatException e) {
    341341            // don't save invalid value to preferences
  • trunk/src/org/openstreetmap/josm/gui/io/importexport/GpxExporter.java

    r12671 r12841  
    162162        setCanceled(false);
    163163
    164         Main.pref.put("lastAddAuthor", author.isSelected());
     164        Main.pref.putBoolean("lastAddAuthor", author.isSelected());
    165165        if (!authorName.getText().isEmpty()) {
    166166            Main.pref.put("lastAuthorName", authorName.getText());
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r12671 r12841  
    174174                Main.pref.put("geoimage.timezone", timezone.formatTimezone());
    175175                Main.pref.put("geoimage.delta", delta.formatOffset());
    176                 Main.pref.put("geoimage.showThumbs", yLayer.useThumbs);
     176                Main.pref.putBoolean("geoimage.showThumbs", yLayer.useThumbs);
    177177
    178178                yLayer.useThumbs = cbShowThumbs.isSelected();
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerAction.java

    r12636 r12841  
    119119            for (Marker marker : layer.data) {
    120120                final Node node = new Node(marker.getCoor());
    121                 final Collection<String> mapping = Main.pref.getCollection("gpx.to-osm-mapping", Arrays.asList(
     121                final Collection<String> mapping = Main.pref.getList("gpx.to-osm-mapping", Arrays.asList(
    122122                        GpxConstants.GPX_NAME, "name",
    123123                        GpxConstants.GPX_DESC, "description",
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/DateFilterPanel.java

    r12377 r12841  
    105105        Main.pref.putLong(prefDateMin, dateFrom.getDate().getTime());
    106106        Main.pref.putLong(prefDateMax, dateTo.getDate().getTime());
    107         Main.pref.put(prefDate0, noTimestampCb.isSelected());
     107        Main.pref.putBoolean(prefDate0, noTimestampCb.isSelected());
    108108    }
    109109
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongPanel.java

    r10611 r12841  
    8585            add(new JLabel(tr("Download near:")), GBC.eol());
    8686            downloadNear = new JList<>(new String[]{tr("track only"), tr("waypoints only"), tr("track and waypoints")});
    87             downloadNear.setSelectedIndex(Main.pref.getInteger(prefNear, 0));
     87            downloadNear.setSelectedIndex(Main.pref.getInt(prefNear, 0));
    8888            add(downloadNear, GBC.eol());
    8989        } else {
     
    138138     */
    139139    protected final void rememberSettings() {
    140         Main.pref.put(prefOsm, isDownloadOsmData());
    141         Main.pref.put(prefGps, isDownloadGpxData());
     140        Main.pref.putBoolean(prefOsm, isDownloadOsmData());
     141        Main.pref.putBoolean(prefGps, isDownloadGpxData());
    142142        Main.pref.putDouble(prefDist, getDistance());
    143143        Main.pref.putDouble(prefArea, getArea());
    144144        if (prefNear != null) {
    145             Main.pref.putInteger(prefNear, getNear());
     145            Main.pref.putInt(prefNear, getNear());
    146146        }
    147147    }
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java

    r12725 r12841  
    183183
    184184    private void setupColors() {
    185         hdopAlpha = Main.pref.getInteger("hdop.color.alpha", -1);
     185        hdopAlpha = Main.pref.getInt("hdop.color.alpha", -1);
    186186        velocityScale = ColorScale.createHSBScale(256);
    187187        /** Colors (without custom alpha channel, if given) for HDOP painting. **/
     
    320320        colorModeDynamic = Main.pref.getBoolean("draw.rawgps.colors.dynamic", spec, false);
    321321        /* good HDOP's are between 1 and 3, very bad HDOP's go into 3 digit values */
    322         hdoprange = Main.pref.getInteger("hdop.range", 7);
    323         minTrackDurationForTimeColoring = Main.pref.getInteger("draw.rawgps.date-coloring-min-dt", 60);
    324         largePointAlpha = Main.pref.getInteger("draw.rawgps.large.alpha", -1) & 0xFF;
     322        hdoprange = Main.pref.getInt("hdop.range", 7);
     323        minTrackDurationForTimeColoring = Main.pref.getInt("draw.rawgps.date-coloring-min-dt", 60);
     324        largePointAlpha = Main.pref.getInt("draw.rawgps.large.alpha", -1) & 0xFF;
    325325
    326326        // get heatmap parameters
  • trunk/src/org/openstreetmap/josm/gui/layer/imagery/ReprojectionTile.java

    r12669 r12841  
    159159
    160160        ImageWarp.PointTransform transform;
    161         int stride = Main.pref.getInteger("imagery.warp.projection-interpolation.stride", 7);
     161        int stride = Main.pref.getInt("imagery.warp.projection-interpolation.stride", 7);
    162162        if (stride > 0) {
    163163            transform = new ImageWarp.GridTransform(pointTransform, stride);
  • trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarker.java

    r12725 r12841  
    6464        enabled = Main.pref.getBoolean("marker.traceaudio", true);
    6565        if (!enabled) return;
    66         dropTolerance = Main.pref.getInteger("marker.playHeadDropTolerance", 50);
     66        dropTolerance = Main.pref.getInt("marker.playHeadDropTolerance", 50);
    6767        if (MainApplication.isDisplayingMapView()) {
    6868            MapFrame map = MainApplication.getMap();
  • trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java

    r12825 r12841  
    256256        }
    257257
    258         Collection<String> prefIconDirs = Main.pref.getCollection("mappaint.icon.sources");
     258        Collection<String> prefIconDirs = Main.pref.getList("mappaint.icon.sources");
    259259        for (String fileset : prefIconDirs) {
    260260            String[] a;
  • trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSetting.java

    r12831 r12841  
    7979                Main.pref.put(prefKey, null);
    8080            } else {
    81                 Main.pref.put(prefKey, b);
     81                Main.pref.putBoolean(prefKey, b);
    8282            }
    8383        }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/AreaElement.java

    r12722 r12841  
    9090            );
    9191
    92             fillImage.alpha = Utils.clamp(Main.pref.getInteger("mappaint.fill-image-alpha", 255), 0, 255);
     92            fillImage.alpha = Utils.clamp(Main.pref.getInt("mappaint.fill-image-alpha", 255), 0, 255);
    9393            Integer pAlpha = Utils.colorFloat2int(c.get(FILL_OPACITY, null, float.class));
    9494            if (pAlpha != null) {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LabelCompositionStrategy.java

    r11615 r12841  
    238238            } else {
    239239                this.nameTags = new ArrayList<>(
    240                         Main.pref.getCollection("mappaint.nameOrder", Arrays.asList(DEFAULT_NAME_TAGS))
     240                        Main.pref.getList("mappaint.nameOrder", Arrays.asList(DEFAULT_NAME_TAGS))
    241241                );
    242242                this.nameComplementTags = new ArrayList<>(
    243                         Main.pref.getCollection("mappaint.nameComplementOrder", Arrays.asList(DEFAULT_NAME_COMPLEMENT_TAGS))
     243                        Main.pref.getList("mappaint.nameComplementOrder", Arrays.asList(DEFAULT_NAME_COMPLEMENT_TAGS))
    244244                );
    245245            }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java

    r12756 r12841  
    196196        mapImage.offsetY = Math.round(offsetYF);
    197197
    198         mapImage.alpha = Utils.clamp(Main.pref.getInteger("mappaint.icon-image-alpha", 255), 0, 255);
     198        mapImage.alpha = Utils.clamp(Main.pref.getInt("mappaint.icon-image-alpha", 255), 0, 255);
    199199        Integer pAlpha = Utils.colorFloat2int(c.get(keys[ICON_OPACITY_IDX], null, float.class));
    200200        if (pAlpha != null) {
     
    357357            // However, it would be better, if the settings could be changed at runtime.
    358358            int size = max(
    359                     Main.pref.getInteger("mappaint.node.selected-size", 5),
    360                     Main.pref.getInteger("mappaint.node.unselected-size", 3),
    361                     Main.pref.getInteger("mappaint.node.connection-size", 5),
    362                     Main.pref.getInteger("mappaint.node.tagged-size", 3)
     359                    Main.pref.getInt("mappaint.node.selected-size", 5),
     360                    Main.pref.getInt("mappaint.node.unselected-size", 3),
     361                    Main.pref.getInt("mappaint.node.connection-size", 5),
     362                    Main.pref.getInt("mappaint.node.tagged-size", 3)
    363363            );
    364364            return new SimpleBoxProvider(new Rectangle(-size/2, -size/2, size, size));
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/StyleElement.java

    r12539 r12841  
    148148                s = defaultFontSize;
    149149                if (s == null) {
    150                     defaultFontSize = s = (float) Main.pref.getInteger("mappaint.fontsize", 8);
     150                    defaultFontSize = s = (float) Main.pref.getInt("mappaint.fontsize", 8);
    151151                }
    152152            }
  • trunk/src/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanel.java

    r10268 r12841  
    281281    public void rememberPreferences(Preferences pref) {
    282282        CheckParameterUtil.ensureParameterNotNull(pref, "pref");
    283         pref.put("oauth.settings.use-default", cbUseDefaults.isSelected());
     283        pref.putBoolean("oauth.settings.use-default", cbUseDefaults.isSelected());
    284284        if (cbUseDefaults.isSelected()) {
    285285            new OAuthParameters(null, null, null, null, null, null, null).rememberPreferences(pref);
  • trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java

    r12825 r12841  
    423423
    424424            if (!iconPaths.isEmpty()) {
    425                 if (Main.pref.putCollection(iconPref, iconPaths)) {
     425                if (Main.pref.putList(iconPref, iconPaths)) {
    426426                    changed = true;
    427427                }
    428             } else if (Main.pref.putCollection(iconPref, null)) {
     428            } else if (Main.pref.putList(iconPref, null)) {
    429429                changed = true;
    430430            }
  • trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java

    r12643 r12841  
    496496            @Override
    497497            public void actionPerformed(ActionEvent e) {
    498                 Collection<String> t = new LinkedList<>(getToolString());
     498                List<String> t = new LinkedList<>(getToolString());
    499499                ActionParser parser = new ActionParser(null);
    500500                // get text definition of current action
     
    502502                // remove the button from toolbar preferences
    503503                t.remove(res);
    504                 Main.pref.putCollection("toolbar", t);
     504                Main.pref.putList("toolbar", t);
    505505                MainApplication.getToolbar().refreshToolbarControl();
    506506            }
     
    532532            public void actionPerformed(ActionEvent e) {
    533533                boolean sel = ((JCheckBoxMenuItem) e.getSource()).getState();
    534                 Main.pref.put("toolbar.always-visible", sel);
    535                 Main.pref.put("menu.always-visible", sel);
     534                Main.pref.putBoolean("toolbar.always-visible", sel);
     535                Main.pref.putBoolean("menu.always-visible", sel);
    536536            }
    537537        });
     
    971971        @Override
    972972        public boolean ok() {
    973             Collection<String> t = new LinkedList<>();
     973            List<String> t = new LinkedList<>();
    974974            ActionParser parser = new ActionParser(null);
    975975            for (int i = 0; i < selected.size(); ++i) {
     
    987987                t = Collections.singletonList(EMPTY_TOOLBAR_MARKER);
    988988            }
    989             Main.pref.putCollection("toolbar", t);
     989            Main.pref.putList("toolbar", t);
    990990            MainApplication.getToolbar().refreshToolbarControl();
    991991            return false;
     
    10741074    public static Collection<String> getToolString() {
    10751075
    1076         Collection<String> toolStr = Main.pref.getCollection("toolbar", Arrays.asList(deftoolbar));
     1076        Collection<String> toolStr = Main.pref.getList("toolbar", Arrays.asList(deftoolbar));
    10771077        if (toolStr == null || toolStr.isEmpty()) {
    10781078            toolStr = Arrays.asList(deftoolbar);
     
    12141214            }
    12151215        }
    1216         Main.pref.putCollection("toolbar", t);
     1216        Main.pref.putList("toolbar", t);
    12171217        MainApplication.getToolbar().refreshToolbarControl();
    12181218    }
  • trunk/src/org/openstreetmap/josm/gui/preferences/audio/AudioPreference.java

    r9778 r12841  
    133133    @Override
    134134    public boolean ok() {
    135         Main.pref.put("audio.menuinvisible", !audioMenuVisible.isSelected());
    136         Main.pref.put("marker.traceaudio", markerAudioTraceVisible.isSelected());
    137         Main.pref.put("marker.buttonlabels", markerButtonLabels.isSelected());
    138         Main.pref.put("marker.audiofromexplicitwaypoints", audioMarkersFromExplicitWaypoints.isSelected());
    139         Main.pref.put("marker.audiofromuntimedwaypoints", audioMarkersFromUntimedWaypoints.isSelected());
    140         Main.pref.put("marker.audiofromnamedtrackpoints", audioMarkersFromNamedTrackpoints.isSelected());
    141         Main.pref.put("marker.audiofromwavtimestamps", audioMarkersFromWavTimestamps.isSelected());
    142         Main.pref.put("marker.audiofromstart", audioMarkersFromStart.isSelected());
     135        Main.pref.putBoolean("audio.menuinvisible", !audioMenuVisible.isSelected());
     136        Main.pref.putBoolean("marker.traceaudio", markerAudioTraceVisible.isSelected());
     137        Main.pref.putBoolean("marker.buttonlabels", markerButtonLabels.isSelected());
     138        Main.pref.putBoolean("marker.audiofromexplicitwaypoints", audioMarkersFromExplicitWaypoints.isSelected());
     139        Main.pref.putBoolean("marker.audiofromuntimedwaypoints", audioMarkersFromUntimedWaypoints.isSelected());
     140        Main.pref.putBoolean("marker.audiofromnamedtrackpoints", audioMarkersFromNamedTrackpoints.isSelected());
     141        Main.pref.putBoolean("marker.audiofromwavtimestamps", audioMarkersFromWavTimestamps.isSelected());
     142        Main.pref.putBoolean("marker.audiofromstart", audioMarkersFromStart.isSelected());
    143143        Main.pref.put("audio.forwardbackamount", audioForwardBackAmount.getText());
    144144        Main.pref.put("audio.fastfwdmultiplier", audioFastForwardMultiplier.getText());
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/DrawingPreference.java

    r12400 r12841  
    109109        // virtual nodes
    110110        virtualNodes.setToolTipText(tr("Draw virtual nodes in select mode for easy way modification."));
    111         virtualNodes.setSelected(Main.pref.getInteger("mappaint.node.virtual-size", 8) != 0);
     111        virtualNodes.setSelected(Main.pref.getInt("mappaint.node.virtual-size", 8) != 0);
    112112
    113113        // background layers in inactive color
     
    195195    public boolean ok() {
    196196        boolean restart = gpxPanel.savePreferences();
    197         Main.pref.put("draw.data.area_outline_only", outlineOnly.isSelected());
    198         Main.pref.put("draw.segment.direction", directionHint.isSelected());
    199         Main.pref.put("draw.segment.head_only", headArrow.isSelected());
    200         Main.pref.put("draw.oneway", onewayArrow.isSelected());
    201         Main.pref.put("draw.segment.order_number", segmentOrderNumber.isSelected());
    202         Main.pref.put("draw.segment.order_number.on_selected", segmentOrderNumberOnSelectedWay.isSelected());
    203         Main.pref.put("draw.data.downloaded_area", sourceBounds.isSelected());
    204         Main.pref.put("draw.data.inactive_color", inactive.isSelected());
    205         Main.pref.put("mappaint.use-antialiasing", useAntialiasing.isSelected());
    206         Main.pref.put("mappaint.wireframe.use-antialiasing", useWireframeAntialiasing.isSelected());
    207         Main.pref.put("draw.target-highlight", useHighlighting.isSelected());
    208         Main.pref.put("draw.helper-line", drawHelperLine.isSelected());
    209         Main.pref.put("display.discardable-keys", discardableKeys.isSelected());
     197        Main.pref.putBoolean("draw.data.area_outline_only", outlineOnly.isSelected());
     198        Main.pref.putBoolean("draw.segment.direction", directionHint.isSelected());
     199        Main.pref.putBoolean("draw.segment.head_only", headArrow.isSelected());
     200        Main.pref.putBoolean("draw.oneway", onewayArrow.isSelected());
     201        Main.pref.putBoolean("draw.segment.order_number", segmentOrderNumber.isSelected());
     202        Main.pref.putBoolean("draw.segment.order_number.on_selected", segmentOrderNumberOnSelectedWay.isSelected());
     203        Main.pref.putBoolean("draw.data.downloaded_area", sourceBounds.isSelected());
     204        Main.pref.putBoolean("draw.data.inactive_color", inactive.isSelected());
     205        Main.pref.putBoolean("mappaint.use-antialiasing", useAntialiasing.isSelected());
     206        Main.pref.putBoolean("mappaint.wireframe.use-antialiasing", useWireframeAntialiasing.isSelected());
     207        Main.pref.putBoolean("draw.target-highlight", useHighlighting.isSelected());
     208        Main.pref.putBoolean("draw.helper-line", drawHelperLine.isSelected());
     209        Main.pref.putBoolean("display.discardable-keys", discardableKeys.isSelected());
    210210        AutoFilterManager.PROP_AUTO_FILTER_ENABLED.put(autoFilters.isSelected());
    211211        AutoFilterManager.PROP_AUTO_FILTER_RULE.put(((AutoFilterRule) autoFilterRules.getSelectedItem()).getKey());
    212         int vn = Main.pref.getInteger("mappaint.node.virtual-size", 8);
     212        int vn = Main.pref.getInt("mappaint.node.virtual-size", 8);
    213213        if (virtualNodes.isSelected()) {
    214214            if (vn < 1) {
     
    218218            vn = 0;
    219219        }
    220         Main.pref.putInteger("mappaint.node.virtual-size", vn);
     220        Main.pref.putInt("mappaint.node.virtual-size", vn);
    221221        return restart;
    222222    }
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java

    r12620 r12841  
    454454            layerNameDot = "";
    455455        }
    456         Main.pref.put("marker.makeautomarkers"+layerNameDot, makeAutoMarkers.isSelected());
     456        Main.pref.putBoolean("marker.makeautomarkers"+layerNameDot, makeAutoMarkers.isSelected());
    457457        if (drawRawGpsLinesGlobal.isSelected()) {
    458458            Main.pref.put("draw.rawgps.lines" + layerNameDot, null);
     
    466466        } else {
    467467            if (layerName == null || !locLayer) {
    468                 Main.pref.put("draw.rawgps.lines" + layerNameDot, drawRawGpsLinesAll.isSelected());
     468                Main.pref.putBoolean("draw.rawgps.lines" + layerNameDot, drawRawGpsLinesAll.isSelected());
    469469                Main.pref.put("draw.rawgps.max-line-length" + layerNameDot, drawRawGpsMaxLineLength.getText());
    470470            }
    471471            if (layerName == null || locLayer) {
    472                 Main.pref.put("draw.rawgps.lines.local" + layerNameDot, drawRawGpsLinesAll.isSelected() || drawRawGpsLinesLocal.isSelected());
     472                Main.pref.putBoolean("draw.rawgps.lines.local" + layerNameDot, drawRawGpsLinesAll.isSelected() || drawRawGpsLinesLocal.isSelected());
    473473                Main.pref.put("draw.rawgps.max-line-length.local" + layerNameDot, drawRawGpsMaxLineLengthLocal.getText());
    474474            }
    475             Main.pref.put("draw.rawgps.lines.force"+layerNameDot, forceRawGpsLines.isSelected());
    476             Main.pref.put("draw.rawgps.direction"+layerNameDot, drawGpsArrows.isSelected());
    477             Main.pref.put("draw.rawgps.alternatedirection"+layerNameDot, drawGpsArrowsFast.isSelected());
     475            Main.pref.putBoolean("draw.rawgps.lines.force"+layerNameDot, forceRawGpsLines.isSelected());
     476            Main.pref.putBoolean("draw.rawgps.direction"+layerNameDot, drawGpsArrows.isSelected());
     477            Main.pref.putBoolean("draw.rawgps.alternatedirection"+layerNameDot, drawGpsArrowsFast.isSelected());
    478478            Main.pref.put("draw.rawgps.min-arrow-distance"+layerNameDot, drawGpsArrowsMinDist.getText());
    479479        }
    480480
    481         Main.pref.put("draw.rawgps.hdopcircle"+layerNameDot, hdopCircleGpsPoints.isSelected());
    482         Main.pref.put("draw.rawgps.large"+layerNameDot, largeGpsPoints.isSelected());
     481        Main.pref.putBoolean("draw.rawgps.hdopcircle"+layerNameDot, hdopCircleGpsPoints.isSelected());
     482        Main.pref.putBoolean("draw.rawgps.large"+layerNameDot, largeGpsPoints.isSelected());
    483483        Main.pref.put("draw.rawgps.linewidth"+layerNameDot, drawLineWidth.getText());
    484         Main.pref.put("draw.rawgps.lines.alpha-blend"+layerNameDot, drawLineWithAlpha.isSelected());
    485 
    486         Main.pref.put("mappaint.gpx.use-antialiasing", useGpsAntialiasing.isSelected());
     484        Main.pref.putBoolean("draw.rawgps.lines.alpha-blend"+layerNameDot, drawLineWithAlpha.isSelected());
     485
     486        Main.pref.putBoolean("mappaint.gpx.use-antialiasing", useGpsAntialiasing.isSelected());
    487487
    488488        TemplateEntryProperty.forMarker(layerName).put(waypointLabelPattern.getText());
     
    495495            return false;
    496496        } else if (colorTypeVelocity.isSelected()) {
    497             Main.pref.putInteger("draw.rawgps.colors"+layerNameDot, 1);
     497            Main.pref.putInt("draw.rawgps.colors"+layerNameDot, 1);
    498498        } else if (colorTypeDilution.isSelected()) {
    499             Main.pref.putInteger("draw.rawgps.colors"+layerNameDot, 2);
     499            Main.pref.putInt("draw.rawgps.colors"+layerNameDot, 2);
    500500        } else if (colorTypeDirection.isSelected()) {
    501             Main.pref.putInteger("draw.rawgps.colors"+layerNameDot, 3);
     501            Main.pref.putInt("draw.rawgps.colors"+layerNameDot, 3);
    502502        } else if (colorTypeTime.isSelected()) {
    503             Main.pref.putInteger("draw.rawgps.colors"+layerNameDot, 4);
     503            Main.pref.putInt("draw.rawgps.colors"+layerNameDot, 4);
    504504        } else if (colorTypeHeatMap.isSelected()) {
    505             Main.pref.putInteger("draw.rawgps.colors"+layerNameDot, 5);
     505            Main.pref.putInt("draw.rawgps.colors"+layerNameDot, 5);
    506506        } else {
    507             Main.pref.putInteger("draw.rawgps.colors"+layerNameDot, 0);
    508         }
    509         Main.pref.put("draw.rawgps.colors.dynamic"+layerNameDot, colorDynamic.isSelected());
     507            Main.pref.putInt("draw.rawgps.colors"+layerNameDot, 0);
     508        }
     509        Main.pref.putBoolean("draw.rawgps.colors.dynamic"+layerNameDot, colorDynamic.isSelected());
    510510        int ccti = colorTypeVelocityTune.getSelectedIndex();
    511         Main.pref.putInteger("draw.rawgps.colorTracksTune"+layerNameDot, ccti == 2 ? 10 : (ccti == 1 ? 20 : 45));
    512         Main.pref.putInteger("draw.rawgps.heatmap.colormap"+layerNameDot, colorTypeHeatMapTune.getSelectedIndex());
    513         Main.pref.put("draw.rawgps.heatmap.use-points"+layerNameDot, colorTypeHeatMapPoints.isSelected());
    514         Main.pref.putInteger("draw.rawgps.heatmap.gain"+layerNameDot, colorTypeHeatMapGain.getValue());
    515         Main.pref.putInteger("draw.rawgps.heatmap.lower-limit"+layerNameDot, colorTypeHeatMapLowerLimit.getValue());
     511        Main.pref.putInt("draw.rawgps.colorTracksTune"+layerNameDot, ccti == 2 ? 10 : (ccti == 1 ? 20 : 45));
     512        Main.pref.putInt("draw.rawgps.heatmap.colormap"+layerNameDot, colorTypeHeatMapTune.getSelectedIndex());
     513        Main.pref.putBoolean("draw.rawgps.heatmap.use-points"+layerNameDot, colorTypeHeatMapPoints.isSelected());
     514        Main.pref.putInt("draw.rawgps.heatmap.gain"+layerNameDot, colorTypeHeatMapGain.getValue());
     515        Main.pref.putInt("draw.rawgps.heatmap.lower-limit"+layerNameDot, colorTypeHeatMapLowerLimit.getValue());
    516516
    517517        return false;
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java

    r12620 r12841  
    202202    public boolean ok() {
    203203        boolean mod = false;
    204         Main.pref.put("draw.splashscreen", showSplashScreen.isSelected());
    205         Main.pref.put("osm-primitives.showid", showID.isSelected());
    206         Main.pref.put("osm-primitives.localize-name", showLocalizedName.isSelected());
     204        Main.pref.putBoolean("draw.splashscreen", showSplashScreen.isSelected());
     205        Main.pref.putBoolean("osm-primitives.showid", showID.isSelected());
     206        Main.pref.putBoolean("osm-primitives.localize-name", showLocalizedName.isSelected());
    207207        MapFrame.MODELESS.put(modeless.isSelected());
    208         Main.pref.put(ToggleDialog.PROP_DYNAMIC_BUTTONS.getKey(), dynamicButtons.isSelected());
    209         Main.pref.put(DateUtils.PROP_ISO_DATES.getKey(), isoDates.isSelected());
    210         Main.pref.put(FileChooserManager.PROP_USE_NATIVE_FILE_DIALOG.getKey(), nativeFileChoosers.isSelected());
     208        Main.pref.putBoolean(ToggleDialog.PROP_DYNAMIC_BUTTONS.getKey(), dynamicButtons.isSelected());
     209        Main.pref.putBoolean(DateUtils.PROP_ISO_DATES.getKey(), isoDates.isSelected());
     210        Main.pref.putBoolean(FileChooserManager.PROP_USE_NATIVE_FILE_DIALOG.getKey(), nativeFileChoosers.isSelected());
    211211        MapMover.PROP_ZOOM_REVERSE_WHEEL.put(zoomReverseWheel.isSelected());
    212212        NavigatableComponent.PROP_ZOOM_INTERMEDIATE_STEPS.put(zoomIntermediateSteps.isSelected());
  • trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java

    r12649 r12841  
    105105        @Override
    106106        public Collection<String> getInitialIconPathsList() {
    107             return Main.pref.getCollection(ICONPREF, null);
     107            return Main.pref.getList(ICONPREF, null);
    108108        }
    109109
     
    170170    @Override
    171171    public boolean ok() {
    172         boolean reload = Main.pref.put("mappaint.icon.enable-defaults", enableIconDefault.isSelected());
     172        boolean reload = Main.pref.putBoolean("mappaint.icon.enable-defaults", enableIconDefault.isSelected());
    173173        reload |= sources.finish();
    174174        if (reload) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java

    r12649 r12841  
    206206        @Override
    207207        public Collection<String> getInitialIconPathsList() {
    208             return Main.pref.getCollection(ICONPREF, null);
     208            return Main.pref.getList(ICONPREF, null);
    209209        }
    210210
     
    246246    @Override
    247247    public boolean ok() {
    248         boolean restart = Main.pref.put("taggingpreset.sortmenu", sortMenu.getSelectedObjects() != null);
     248        boolean restart = Main.pref.putBoolean("taggingpreset.sortmenu", sortMenu.getSelectedObjects() != null);
    249249        restart |= sources.finish();
    250250
  • trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java

    r12634 r12841  
    302302            List<String> l = new LinkedList<>(model.getSelectedPluginNames());
    303303            Collections.sort(l);
    304             Main.pref.putCollection("plugins", l);
     304            Main.pref.putList("plugins", l);
    305305            if (!model.getNewlyDeactivatedPlugins().isEmpty())
    306306                return true;
     
    359359                        model.updateAvailablePlugins(task.getAvailablePlugins());
    360360                        pnlPluginPreferences.refreshView();
    361                         Main.pref.putInteger("pluginmanager.version", Version.getInstance().getVersion()); // fix #7030
     361                        Main.pref.putInt("pluginmanager.version", Version.getInstance().getVersion()); // fix #7030
    362362                    });
    363363                }
  • trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferencesModel.java

    r12620 r12841  
    4040    public PluginPreferencesModel() {
    4141        currentActivePlugins = new HashSet<>();
    42         currentActivePlugins.addAll(Main.pref.getCollection("plugins", currentActivePlugins));
     42        currentActivePlugins.addAll(Main.pref.getList("plugins"));
    4343    }
    4444
     
    8080        filterDisplayedPlugins(filterExpression);
    8181        Set<String> activePlugins = new HashSet<>();
    82         activePlugins.addAll(Main.pref.getCollection("plugins", activePlugins));
     82        activePlugins.addAll(Main.pref.getList("plugins"));
    8383        for (PluginInformation pi: availablePlugins) {
    8484            if (selectedPluginsMap.get(pi) == null && activePlugins.contains(pi.name)) {
     
    230230     */
    231231    public void initFromPreferences() {
    232         Collection<String> enabledPlugins = Main.pref.getCollection("plugins", null);
     232        Collection<String> enabledPlugins = Main.pref.getList("plugins", null);
    233233        if (enabledPlugins == null) {
    234234            this.selectedPluginsMap.clear();
  • trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginUpdatePolicyPanel.java

    r12620 r12841  
    196196        }
    197197        if (days == 0) {
    198             days = Main.pref.getInteger("pluginmanager.time-based-update.interval", PluginHandler.DEFAULT_TIME_BASED_UPDATE_INTERVAL);
     198            days = Main.pref.getInt("pluginmanager.time-based-update.interval", PluginHandler.DEFAULT_TIME_BASED_UPDATE_INTERVAL);
    199199        }
    200200        tfUpdateInterval.setText(Integer.toString(days));
     
    235235            days = PluginHandler.DEFAULT_TIME_BASED_UPDATE_INTERVAL;
    236236        }
    237         Main.pref.putInteger("pluginmanager.time-based-update.interval", days);
     237        Main.pref.putInt("pluginmanager.time-based-update.interval", days);
    238238    }
    239239
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java

    r12620 r12841  
    7272                }
    7373            });
    74             Collection<String> samples = Arrays.asList(
     74            List<String> samples = Arrays.asList(
    7575                    "+proj=lonlat +ellps=WGS84 +datum=WGS84 +bounds=-180,-90,180,90",
    7676                    "+proj=tmerc +lat_0=0 +lon_0=9 +k_0=1 +x_0=3500000 +y_0=0 +ellps=bessel +nadgrids=BETA2007.gsb");
    77             List<String> inputHistory = new LinkedList<>(Main.pref.getCollection("projection.custom.value.history", samples));
     77            List<String> inputHistory = new LinkedList<>(Main.pref.getList("projection.custom.value.history", samples));
    7878            Collections.reverse(inputHistory);
    7979            cbInput.setPossibleItems(inputHistory);
     
    149149        public void rememberHistory() {
    150150            cbInput.addCurrentItemToHistory();
    151             Main.pref.putCollection("projection.custom.value.history", cbInput.getHistory());
     151            Main.pref.putList("projection.custom.value.history", cbInput.getHistory());
    152152        }
    153153    }
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java

    r12786 r12841  
    2828import org.openstreetmap.josm.data.coor.conversion.CoordinateFormatManager;
    2929import org.openstreetmap.josm.data.coor.conversion.ICoordinateFormat;
    30 import org.openstreetmap.josm.data.preferences.CollectionProperty;
     30import org.openstreetmap.josm.data.preferences.ListProperty;
    3131import org.openstreetmap.josm.data.preferences.StringProperty;
    3232import org.openstreetmap.josm.data.projection.CustomProjection;
     
    291291    private static final StringProperty PROP_PROJECTION_DEFAULT = new StringProperty("projection.default", mercator.getId());
    292292    private static final StringProperty PROP_COORDINATES = new StringProperty("coordinates", null);
    293     private static final CollectionProperty PROP_SUB_PROJECTION_DEFAULT = new CollectionProperty("projection.default.sub", null);
     293    private static final ListProperty PROP_SUB_PROJECTION_DEFAULT = new ListProperty("projection.default.sub", null);
    294294    private static final String[] unitsValues = ALL_SYSTEMS.keySet().toArray(new String[ALL_SYSTEMS.size()]);
    295295    private static final String[] unitsValuesTr = new String[unitsValues.length];
     
    482482        }
    483483        id = pc.getId();
    484         Main.pref.putCollection("projection.sub."+id, pref);
     484        Main.pref.putList("projection.sub."+id, pref == null ? null : new ArrayList<>(pref));
    485485        if (makeDefault) {
    486486            PROP_PROJECTION_DEFAULT.put(id);
    487             PROP_SUB_PROJECTION_DEFAULT.put(pref);
     487            PROP_SUB_PROJECTION_DEFAULT.put(pref == null ? null : new ArrayList<>(pref));
    488488        } else {
    489489            projectionChoice = id;
     
    560560     */
    561561    public static Collection<String> getSubprojectionPreference(String pcId) {
    562         return Main.pref.getCollection("projection.sub."+pcId, null);
     562        return Main.pref.getList("projection.sub."+pcId, null);
    563563    }
    564564
  • trunk/src/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreference.java

    r12707 r12841  
    196196        if (enabled) {
    197197            for (Entry<PermissionPrefWithDefault, JCheckBox> p : prefs.entrySet()) {
    198                 Main.pref.put(p.getKey().pref, p.getValue().isSelected());
    199             }
    200             Main.pref.put(RequestHandler.loadInNewLayerKey, loadInNewLayer.isSelected());
    201             Main.pref.put(RequestHandler.globalConfirmationKey, alwaysAskUserConfirm.isSelected());
     198                Main.pref.putBoolean(p.getKey().pref, p.getValue().isSelected());
     199            }
     200            Main.pref.putBoolean(RequestHandler.loadInNewLayerKey, loadInNewLayer.isSelected());
     201            Main.pref.putBoolean(RequestHandler.globalConfirmationKey, alwaysAskUserConfirm.isSelected());
    202202        }
    203203        if (changed) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java

    r12634 r12841  
    2828
    2929import org.openstreetmap.josm.Main;
    30 import org.openstreetmap.josm.data.preferences.CollectionProperty;
     30import org.openstreetmap.josm.data.preferences.ListProperty;
    3131import org.openstreetmap.josm.gui.MainApplication;
    3232import org.openstreetmap.josm.gui.help.HelpUtil;
     
    5858    /** indicates whether to use the default OSM URL or not */
    5959    private JCheckBox cbUseDefaultServerUrl;
    60     private final transient CollectionProperty SERVER_URL_HISTORY = new CollectionProperty("osm-server.url-history", Arrays.asList(
     60    private final transient ListProperty SERVER_URL_HISTORY = new ListProperty("osm-server.url-history", Arrays.asList(
    6161            "http://api06.dev.openstreetmap.org/api", "http://master.apis.dev.openstreetmap.org/api"));
    6262
  • trunk/src/org/openstreetmap/josm/gui/preferences/validator/ValidatorTestsPreference.java

    r12649 r12841  
    9797    @Override
    9898    public boolean ok() {
    99         Collection<String> tests = new LinkedList<>();
    100         Collection<String> testsBeforeUpload = new LinkedList<>();
     99        List<String> tests = new LinkedList<>();
     100        List<String> testsBeforeUpload = new LinkedList<>();
    101101
    102102        for (Test test : allTests) {
     
    116116        OsmValidator.initializeTests(testsToInitialize);
    117117
    118         Main.pref.putCollection(ValidatorPrefHelper.PREF_SKIP_TESTS, tests);
    119         Main.pref.putCollection(ValidatorPrefHelper.PREF_SKIP_TESTS_BEFORE_UPLOAD, testsBeforeUpload);
     118        Main.pref.putList(ValidatorPrefHelper.PREF_SKIP_TESTS, tests);
     119        Main.pref.putList(ValidatorPrefHelper.PREF_SKIP_TESTS_BEFORE_UPLOAD, testsBeforeUpload);
    120120        ValidatorPrefHelper.PREF_USE_IGNORE.put(prefUseIgnore.isSelected());
    121121        ValidatorPrefHelper.PREF_OTHER.put(prefOther.isSelected());
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java

    r12691 r12841  
    210210        }
    211211        File arch = TaggingPresetReader.getZipIcons();
    212         final Collection<String> s = Main.pref.getCollection("taggingpreset.icon.sources", null);
     212        final Collection<String> s = Main.pref.getList("taggingpreset.icon.sources", null);
    213213        ImageProvider imgProv = new ImageProvider(iconName);
    214214        imgProv.setDirs(s);
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetItem.java

    r12835 r12841  
    127127
    128128    protected static ImageIcon loadImageIcon(String iconName, File zipIcons, Integer maxSize) {
    129         final Collection<String> s = Main.pref.getCollection("taggingpreset.icon.sources", null);
     129        final Collection<String> s = Main.pref.getList("taggingpreset.icon.sources", null);
    130130        ImageProvider imgProv = new ImageProvider(iconName).setDirs(s).setId("presets").setArchive(zipIcons).setOptional(true);
    131131        if (maxSize != null) {
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresets.java

    r12643 r12841  
    9191            }
    9292            for (JMenu submenu : submenus.values()) {
    93                 if (submenu.getItemCount() >= Main.pref.getInteger("taggingpreset.min-elements-for-scroller", 15)) {
     93                if (submenu.getItemCount() >= Main.pref.getInt("taggingpreset.min-elements-for-scroller", 15)) {
    9494                    MenuScroller.setScrollerFor(submenu);
    9595                }
  • trunk/src/org/openstreetmap/josm/gui/widgets/HistoryComboBox.java

    r12304 r12841  
    2424     */
    2525    public HistoryComboBox() {
    26         int maxsize = Main.pref.getInteger("search.history-size", DEFAULT_SEARCH_HISTORY_SIZE);
     26        int maxsize = Main.pref.getInt("search.history-size", DEFAULT_SEARCH_HISTORY_SIZE);
    2727        model = new ComboBoxHistory(maxsize);
    2828        setModel(model);
Note: See TracChangeset for help on using the changeset viewer.