Skip to content

Commit

Permalink
Remove old-style access to properties
Browse files Browse the repository at this point in the history
  • Loading branch information
floscher committed May 23, 2018
1 parent ab54c73 commit 9d4c22f
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/org/wikipedia/gui/SophoxDownloadReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import java.util.Collection;
import java.util.concurrent.Future;
import java.util.function.Consumer;

import javax.swing.AbstractAction;
import javax.swing.Icon;
import javax.swing.JButton;
Expand All @@ -27,7 +26,6 @@
import javax.swing.event.ListSelectionListener;
import javax.swing.plaf.basic.BasicArrowButton;

import org.openstreetmap.josm.Main;
import org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask;
import org.openstreetmap.josm.actions.downloadtasks.PostDownloadHandler;
import org.openstreetmap.josm.data.Bounds;
Expand Down Expand Up @@ -89,9 +87,13 @@ public static class SophoxDownloadSourcePanel extends AbstractDownloadSourcePane
private static final String HELP_PAGE = "https://wiki.openstreetmap.org/wiki/Wikidata%2BOSM_SPARQL_query_service";
private static final String SIMPLE_NAME = "sophoxdownloadpanel";
private static final AbstractProperty<Integer> PANEL_SIZE_PROPERTY =
new IntegerProperty(TAB_SPLIT_NAMESPACE + SIMPLE_NAME, 150).cached();
new IntegerProperty(TAB_SPLIT_NAMESPACE + SIMPLE_NAME, 150).cached();
private static final BooleanProperty SOPHOX_QUERY_LIST_OPENED =
new BooleanProperty("download.sophox.query-list.opened", false);
new BooleanProperty("download.sophox.query-list.opened", false);
private static final BooleanProperty SOPHOX_DOWNLOADPRIMITIVE_REFERRERS =
new BooleanProperty("sophox.downloadprimitive.referrers", true);
private static final BooleanProperty SOPHOX_DOWNLOADPRIMITIVE_FULL =
new BooleanProperty("sophox.downloadprimitive.full", true);
private static final String ACTION_IMG_SUBDIR = "dialogs";

private final JosmTextArea sophoxQuery;
Expand Down Expand Up @@ -167,20 +169,16 @@ public void focusLost(FocusEvent e) {
}
});

// TODO: Once new core is widely avialable, replace:
// Main.pref.getBoolean --> Config.getPref().getBoolean
// Main.pref.put --> Config.getPref().putBoolean

referrers = new JCheckBox(tr("Download referrers (parent relations)"));
referrers.setToolTipText(tr("Select if the referrers of the object should be downloaded as well, i.e.,"
+ "parent relations and for nodes, additionally, parent ways"));
referrers.setSelected(Main.pref.getBoolean("sophox.downloadprimitive.referrers", true));
referrers.addActionListener(e -> Main.pref.putBoolean("sophox.downloadprimitive.referrers", referrers.isSelected()));
referrers.setSelected(SOPHOX_DOWNLOADPRIMITIVE_REFERRERS.get());
referrers.addActionListener(e -> SOPHOX_DOWNLOADPRIMITIVE_REFERRERS.put(referrers.isSelected()));

fullRel = new JCheckBox(tr("Download relation members"));
fullRel.setToolTipText(tr("Select if the members of a relation should be downloaded as well"));
fullRel.setSelected(Main.pref.getBoolean("sophox.downloadprimitive.full", true));
fullRel.addActionListener(e -> Main.pref.putBoolean("sophox.downloadprimitive.full", fullRel.isSelected()));
fullRel.setSelected(SOPHOX_DOWNLOADPRIMITIVE_FULL.get());
fullRel.addActionListener(e -> SOPHOX_DOWNLOADPRIMITIVE_FULL.put(fullRel.isSelected()));

// https://stackoverflow.com/questions/527719/how-to-add-hyperlink-in-jlabel
JButton helpLink = new JButton();
Expand Down

0 comments on commit 9d4c22f

Please sign in to comment.