Changeset 12649 in josm
- Timestamp:
- 2017-08-25T21:51:00+02:00 (7 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 33 edited
- 7 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
r12637 r12649 28 28 import org.openstreetmap.josm.data.osm.DatasetConsistencyTest; 29 29 import org.openstreetmap.josm.data.preferences.Setting; 30 import org.openstreetmap.josm.data.preferences.sources.MapPaintPrefHelper; 31 import org.openstreetmap.josm.data.preferences.sources.PresetPrefHelper; 32 import org.openstreetmap.josm.data.preferences.sources.ValidatorPrefHelper; 33 import org.openstreetmap.josm.data.preferences.sources.SourcePrefHelper; 30 34 import org.openstreetmap.josm.gui.ExtendedDialog; 31 35 import org.openstreetmap.josm.gui.MainApplication; 32 import org.openstreetmap.josm.gui.preferences.SourceEditor; 33 import org.openstreetmap.josm.gui.preferences.map.MapPaintPreference; 34 import org.openstreetmap.josm.gui.preferences.map.TaggingPresetPreference; 35 import org.openstreetmap.josm.gui.preferences.validator.ValidatorTagCheckerRulesPreference; 36 import org.openstreetmap.josm.gui.bugreport.DebugTextDisplay; 36 37 import org.openstreetmap.josm.gui.util.GuiHelper; 37 38 import org.openstreetmap.josm.io.OsmApi; … … 42 43 import org.openstreetmap.josm.tools.Utils; 43 44 import org.openstreetmap.josm.tools.bugreport.BugReportSender; 44 import org.openstreetmap.josm.tools.bugreport.DebugTextDisplay;45 45 46 46 /** … … 189 189 text.append('\n'); 190 190 appendCollection(text, "Plugins", Utils.transform(PluginHandler.getBugReportInformation(), i -> "+ " + i)); 191 appendCollection(text, "Tagging presets", getCustomUrls( TaggingPresetPreference.PresetPrefHelper.INSTANCE));192 appendCollection(text, "Map paint styles", getCustomUrls(MapPaintPref erence.MapPaintPrefHelper.INSTANCE));193 appendCollection(text, "Validator rules", getCustomUrls(Validator TagCheckerRulesPreference.RulePrefHelper.INSTANCE));191 appendCollection(text, "Tagging presets", getCustomUrls(PresetPrefHelper.INSTANCE)); 192 appendCollection(text, "Map paint styles", getCustomUrls(MapPaintPrefHelper.INSTANCE)); 193 appendCollection(text, "Validator rules", getCustomUrls(ValidatorPrefHelper.INSTANCE)); 194 194 appendCollection(text, "Last errors/warnings", Utils.transform(Logging.getLastErrorAndWarnings(), i -> "- " + i)); 195 195 … … 202 202 } 203 203 204 private static Collection<String> getCustomUrls(Source Editor.SourcePrefHelper helper) {204 private static Collection<String> getCustomUrls(SourcePrefHelper helper) { 205 205 final Set<String> defaultUrls = helper.getDefault().stream() 206 206 .map(i -> i.url) -
trunk/src/org/openstreetmap/josm/actions/ValidateAction.java
r12636 r12649 13 13 14 14 import org.openstreetmap.josm.data.osm.OsmPrimitive; 15 import org.openstreetmap.josm.data.preferences.sources.ValidatorPrefHelper; 15 16 import org.openstreetmap.josm.data.validation.OsmValidator; 16 17 import org.openstreetmap.josm.data.validation.Test; … … 21 22 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 22 23 import org.openstreetmap.josm.gui.layer.ValidatorLayer; 23 import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference;24 24 import org.openstreetmap.josm.gui.util.GuiHelper; 25 25 import org.openstreetmap.josm.io.OsmTransferException; … … 170 170 } 171 171 tests = null; 172 if (ValidatorPref erence.PREF_USE_IGNORE.get()) {172 if (ValidatorPrefHelper.PREF_USE_IGNORE.get()) { 173 173 getProgressMonitor().subTask(tr("Updating ignored errors ...")); 174 174 for (TestError error : errors) { -
trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java
r12636 r12649 16 16 import org.openstreetmap.josm.data.APIDataSet; 17 17 import org.openstreetmap.josm.data.osm.OsmPrimitive; 18 import org.openstreetmap.josm.data.preferences.sources.ValidatorPrefHelper; 18 19 import org.openstreetmap.josm.data.validation.OsmValidator; 19 20 import org.openstreetmap.josm.data.validation.Severity; … … 27 28 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 28 29 import org.openstreetmap.josm.gui.layer.ValidatorLayer; 29 import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference;30 30 import org.openstreetmap.josm.gui.widgets.HtmlPanel; 31 31 import org.openstreetmap.josm.tools.GBC; … … 64 64 test.visit(selection); 65 65 test.endTest(); 66 if (ValidatorPref erence.PREF_OTHER.get() && ValidatorPreference.PREF_OTHER_UPLOAD.get()) {66 if (ValidatorPrefHelper.PREF_OTHER.get() && ValidatorPrefHelper.PREF_OTHER_UPLOAD.get()) { 67 67 errors.addAll(test.getErrors()); 68 68 } else { … … 86 86 return true; 87 87 88 if (ValidatorPref erence.PREF_USE_IGNORE.get()) {88 if (ValidatorPrefHelper.PREF_USE_IGNORE.get()) { 89 89 int nume = 0; 90 90 for (TestError error : errors) { -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r12634 r12649 68 68 import org.openstreetmap.josm.data.preferences.Setting; 69 69 import org.openstreetmap.josm.data.preferences.StringSetting; 70 import org.openstreetmap.josm.gui.preferences.SourceEditor.ExtendedSourceEntry; 71 import org.openstreetmap.josm.gui.preferences.validator.ValidatorTagCheckerRulesPreference; 72 import org.openstreetmap.josm.gui.preferences.validator.ValidatorTagCheckerRulesPreference.RulePrefHelper; 70 import org.openstreetmap.josm.data.preferences.sources.ExtendedSourceEntry; 71 import org.openstreetmap.josm.data.preferences.sources.ValidatorPrefHelper; 73 72 import org.openstreetmap.josm.io.OfflineAccessException; 74 73 import org.openstreetmap.josm.io.OnlineResource; … … 1714 1713 List<Map<String, String>> l = new ArrayList<>(((MapListSetting) setting).getValue()); 1715 1714 if (l.stream().noneMatch(x -> x.containsValue(url))) { 1716 RulePrefHelper helper = ValidatorTagCheckerRulesPreference.RulePrefHelper.INSTANCE;1715 ValidatorPrefHelper helper = ValidatorPrefHelper.INSTANCE; 1717 1716 Optional<ExtendedSourceEntry> val = helper.getDefault().stream().filter(x -> url.equals(x.url)).findFirst(); 1718 1717 if (val.isPresent()) { -
trunk/src/org/openstreetmap/josm/data/preferences/sources/SourceEntry.java
r12648 r12649 1 1 // License: GPL. For details, see LICENSE file. 2 package org.openstreetmap.josm. gui.preferences;2 package org.openstreetmap.josm.data.preferences.sources; 3 3 4 4 import java.io.File; … … 13 13 * A source entry primarily used to save the user's selection of mappaint styles, 14 14 * but also for preset sources or validator rules. 15 * @since 12649 (moved from gui.preferences package) 15 16 * @since 3796 16 17 */ -
trunk/src/org/openstreetmap/josm/data/preferences/sources/SourceProvider.java
r12648 r12649 1 1 // License: GPL. For details, see LICENSE file. 2 package org.openstreetmap.josm. gui.preferences;2 package org.openstreetmap.josm.data.preferences.sources; 3 3 4 4 import java.util.Collection; … … 8 8 * 9 9 * Used by plugins to offer additional SourceEntrys to the user. 10 * @since 12649 (moved from gui.preferences package) 10 11 */ 11 12 @FunctionalInterface -
trunk/src/org/openstreetmap/josm/data/preferences/sources/SourceType.java
r12648 r12649 1 1 // License: GPL. For details, see LICENSE file. 2 package org.openstreetmap.josm. gui.preferences;2 package org.openstreetmap.josm.data.preferences.sources; 3 3 4 4 /** 5 5 * The different types of source entries. 6 * @since 12649 (moved from gui.preferences package) 6 7 * @since 6670 7 8 */ -
trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
r12636 r12649 26 26 27 27 import org.openstreetmap.josm.Main; 28 import org.openstreetmap.josm.data.preferences.sources.ValidatorPrefHelper; 28 29 import org.openstreetmap.josm.data.validation.tests.Addresses; 29 30 import org.openstreetmap.josm.data.validation.tests.ApiCapabilitiesTest; … … 61 62 import org.openstreetmap.josm.gui.layer.ValidatorLayer; 62 63 import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference; 63 import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference;64 64 import org.openstreetmap.josm.tools.Logging; 65 65 import org.openstreetmap.josm.tools.Utils; … … 185 185 private static void loadIgnoredErrors() { 186 186 ignoredErrors.clear(); 187 if (ValidatorPref erence.PREF_USE_IGNORE.get()) {187 if (ValidatorPrefHelper.PREF_USE_IGNORE.get()) { 188 188 Path path = Paths.get(getValidatorDir()).resolve("ignorederrors"); 189 189 if (path.toFile().exists()) { … … 235 235 */ 236 236 public static synchronized void initializeErrorLayer() { 237 if (!ValidatorPref erence.PREF_LAYER.get())237 if (!ValidatorPrefHelper.PREF_LAYER.get()) 238 238 return; 239 239 if (errorLayer == null) { … … 278 278 private static void applyPrefs(Map<String, Test> tests, boolean beforeUpload) { 279 279 for (String testName : Main.pref.getCollection(beforeUpload 280 ? ValidatorPref erence.PREF_SKIP_TESTS_BEFORE_UPLOAD : ValidatorPreference.PREF_SKIP_TESTS)) {280 ? ValidatorPrefHelper.PREF_SKIP_TESTS_BEFORE_UPLOAD : ValidatorPrefHelper.PREF_SKIP_TESTS)) { 281 281 Test test = tests.get(testName); 282 282 if (test != null) { -
trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
r12620 r12649 40 40 import org.openstreetmap.josm.data.osm.OsmUtils; 41 41 import org.openstreetmap.josm.data.osm.Tag; 42 import org.openstreetmap.josm.data.preferences.sources.SourceEntry; 43 import org.openstreetmap.josm.data.preferences.sources.ValidatorPrefHelper; 42 44 import org.openstreetmap.josm.data.validation.Severity; 43 45 import org.openstreetmap.josm.data.validation.Test; … … 58 60 import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser; 59 61 import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException; 60 import org.openstreetmap.josm.gui.preferences.SourceEntry;61 import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference;62 import org.openstreetmap.josm.gui.preferences.validator.ValidatorTagCheckerRulesPreference;63 62 import org.openstreetmap.josm.io.CachedFile; 64 63 import org.openstreetmap.josm.io.IllegalDataException; … … 714 713 @Override 715 714 public void check(OsmPrimitive p) { 716 errors.addAll(getErrorsForPrimitive(p, ValidatorPref erence.PREF_OTHER.get()));715 errors.addAll(getErrorsForPrimitive(p, ValidatorPrefHelper.PREF_OTHER.get())); 717 716 } 718 717 … … 748 747 public synchronized void initialize() throws Exception { 749 748 checks.clear(); 750 for (SourceEntry source : new Validator TagCheckerRulesPreference.RulePrefHelper().get()) {749 for (SourceEntry source : new ValidatorPrefHelper().get()) { 751 750 if (!source.active) { 752 751 continue; -
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r12620 r12649 36 36 import org.openstreetmap.josm.data.osm.OsmUtils; 37 37 import org.openstreetmap.josm.data.osm.Tag; 38 import org.openstreetmap.josm.data.preferences.sources.ValidatorPrefHelper; 38 39 import org.openstreetmap.josm.data.validation.Severity; 39 40 import org.openstreetmap.josm.data.validation.Test.TagTest; 40 41 import org.openstreetmap.josm.data.validation.TestError; 41 42 import org.openstreetmap.josm.data.validation.util.Entities; 42 import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference;43 43 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 44 44 import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset; … … 80 80 81 81 /** The preferences prefix */ 82 protected static final String PREFIX = ValidatorPref erence.PREFIX + "." + TagChecker.class.getSimpleName();82 protected static final String PREFIX = ValidatorPrefHelper.PREFIX + "." + TagChecker.class.getSimpleName(); 83 83 84 84 /** … … 293 293 } 294 294 // TODO directionKeys are no longer in OsmPrimitive (search pattern is used instead) 295 for (String a : Main.pref.getCollection(ValidatorPref erence.PREFIX + ".knownkeys",295 for (String a : Main.pref.getCollection(ValidatorPrefHelper.PREFIX + ".knownkeys", 296 296 Arrays.asList("is_in", "int_ref", "fixme", "population"))) { 297 297 additionalPresetsValueData.putVoid(a); -
trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
r12636 r12649 27 27 import org.openstreetmap.josm.data.osm.QuadBuckets; 28 28 import org.openstreetmap.josm.data.osm.Way; 29 import org.openstreetmap.josm.data.preferences.sources.ValidatorPrefHelper; 29 30 import org.openstreetmap.josm.data.projection.Ellipsoid; 30 31 import org.openstreetmap.josm.data.validation.Severity; … … 32 33 import org.openstreetmap.josm.data.validation.TestError; 33 34 import org.openstreetmap.josm.gui.MainApplication; 34 import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference;35 35 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 36 36 import org.openstreetmap.josm.tools.Logging; … … 138 138 139 139 protected static final int UNCONNECTED_WAYS = 1301; 140 protected static final String PREFIX = ValidatorPref erence.PREFIX + "." + UnconnectedWays.class.getSimpleName();140 protected static final String PREFIX = ValidatorPrefHelper.PREFIX + "." + UnconnectedWays.class.getSimpleName(); 141 141 142 142 private Set<MyWaySegment> ways; -
trunk/src/org/openstreetmap/josm/gui/bugreport/BugReportDialog.java
r12648 r12649 1 1 // License: GPL. For details, see LICENSE file. 2 package org.openstreetmap.josm. tools.bugreport;2 package org.openstreetmap.josm.gui.bugreport; 3 3 4 4 import static org.openstreetmap.josm.tools.I18n.tr; … … 32 32 import org.openstreetmap.josm.tools.ImageProvider; 33 33 import org.openstreetmap.josm.tools.InputMapUtils; 34 import org.openstreetmap.josm.tools.bugreport.BugReport; 34 35 import org.openstreetmap.josm.tools.bugreport.BugReportQueue.SuppressionMode; 36 import org.openstreetmap.josm.tools.bugreport.BugReportSender; 37 import org.openstreetmap.josm.tools.bugreport.ReportedException; 35 38 36 39 /** -
trunk/src/org/openstreetmap/josm/gui/bugreport/BugReportSettingsPanel.java
r12648 r12649 1 1 // License: GPL. For details, see LICENSE file. 2 package org.openstreetmap.josm. tools.bugreport;2 package org.openstreetmap.josm.gui.bugreport; 3 3 4 4 import static org.openstreetmap.josm.tools.I18n.tr; … … 7 7 import javax.swing.JCheckBox; 8 8 import javax.swing.JPanel; 9 10 import org.openstreetmap.josm.tools.bugreport.BugReport; 9 11 10 12 /** -
trunk/src/org/openstreetmap/josm/gui/bugreport/DebugTextDisplay.java
r12648 r12649 1 1 // License: GPL. For details, see LICENSE file. 2 package org.openstreetmap.josm. tools.bugreport;2 package org.openstreetmap.josm.gui.bugreport; 3 3 4 4 import java.awt.Dimension; … … 9 9 import org.openstreetmap.josm.gui.widgets.JosmTextArea; 10 10 import org.openstreetmap.josm.tools.Utils; 11 import org.openstreetmap.josm.tools.bugreport.BugReport; 11 12 12 13 /** -
trunk/src/org/openstreetmap/josm/gui/bugreport/JosmUpdatePanel.java
r12648 r12649 1 1 // License: GPL. For details, see LICENSE file. 2 package org.openstreetmap.josm. tools.bugreport;2 package org.openstreetmap.josm.gui.bugreport; 3 3 4 4 import static org.openstreetmap.josm.tools.I18n.tr; -
trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java
r12643 r12649 56 56 import org.openstreetmap.josm.actions.JosmAction; 57 57 import org.openstreetmap.josm.actions.PreferencesAction; 58 import org.openstreetmap.josm.data.preferences.sources.SourceEntry; 58 59 import org.openstreetmap.josm.gui.ExtendedDialog; 59 60 import org.openstreetmap.josm.gui.MainApplication; … … 65 66 import org.openstreetmap.josm.gui.mappaint.StyleSource; 66 67 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource; 67 import org.openstreetmap.josm.gui.preferences.SourceEntry;68 68 import org.openstreetmap.josm.gui.preferences.map.MapPaintPreference; 69 69 import org.openstreetmap.josm.gui.util.FileFilterAllFiles; -
trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java
r12643 r12649 40 40 import org.openstreetmap.josm.data.osm.WaySegment; 41 41 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 42 import org.openstreetmap.josm.data.preferences.sources.ValidatorPrefHelper; 42 43 import org.openstreetmap.josm.data.validation.OsmValidator; 43 44 import org.openstreetmap.josm.data.validation.TestError; … … 157 158 buttons.add(fixButton); 158 159 159 if (ValidatorPref erence.PREF_USE_IGNORE.get()) {160 if (ValidatorPrefHelper.PREF_USE_IGNORE.get()) { 160 161 ignoreButton = new SideButton(new AbstractAction() { 161 162 { … … 572 573 */ 573 574 public void updateSelection(Collection<? extends OsmPrimitive> newSelection) { 574 if (!Main.pref.getBoolean(ValidatorPref erence.PREF_FILTER_BY_SELECTION, false))575 if (!Main.pref.getBoolean(ValidatorPrefHelper.PREF_FILTER_BY_SELECTION, false)) 575 576 return; 576 577 if (newSelection.isEmpty()) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java
r12636 r12649 39 39 import org.openstreetmap.josm.data.osm.event.TagsChangedEvent; 40 40 import org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent; 41 import org.openstreetmap.josm.data.preferences.sources.ValidatorPrefHelper; 41 42 import org.openstreetmap.josm.data.validation.Severity; 42 43 import org.openstreetmap.josm.data.validation.TestError; 43 44 import org.openstreetmap.josm.data.validation.util.MultipleNameVisitor; 44 45 import org.openstreetmap.josm.gui.MainApplication; 45 import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference;46 46 import org.openstreetmap.josm.gui.util.GuiHelper; 47 47 import org.openstreetmap.josm.tools.AlphanumComparator; … … 184 184 185 185 Predicate<TestError> filterToUse = e -> !e.isIgnored(); 186 if (!ValidatorPref erence.PREF_OTHER.get()) {186 if (!ValidatorPrefHelper.PREF_OTHER.get()) { 187 187 filterToUse = filterToUse.and(e -> e.getSeverity() != Severity.OTHER); 188 188 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
r12636 r12649 22 22 import org.openstreetmap.josm.data.osm.Node; 23 23 import org.openstreetmap.josm.data.osm.Tag; 24 import org.openstreetmap.josm.data.preferences.sources.MapPaintPrefHelper; 25 import org.openstreetmap.josm.data.preferences.sources.SourceEntry; 24 26 import org.openstreetmap.josm.gui.MainApplication; 25 27 import org.openstreetmap.josm.gui.PleaseWaitRunnable; … … 30 32 import org.openstreetmap.josm.gui.mappaint.styleelement.NodeElement; 31 33 import org.openstreetmap.josm.gui.mappaint.styleelement.StyleElement; 32 import org.openstreetmap.josm.gui.preferences.SourceEntry;33 import org.openstreetmap.josm.gui.preferences.map.MapPaintPreference.MapPaintPrefHelper;34 34 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 35 35 import org.openstreetmap.josm.io.CachedFile; -
trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSource.java
r12378 r12649 21 21 22 22 import org.openstreetmap.josm.data.osm.OsmPrimitive; 23 import org.openstreetmap.josm.data.preferences.sources.SourceEntry; 23 24 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.IconReference; 24 import org.openstreetmap.josm.gui.preferences.SourceEntry;25 25 import org.openstreetmap.josm.io.CachedFile; 26 26 import org.openstreetmap.josm.tools.ImageOverlay; -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
r12620 r12649 32 32 import org.openstreetmap.josm.data.osm.AbstractPrimitive; 33 33 import org.openstreetmap.josm.data.osm.AbstractPrimitive.KeyValueVisitor; 34 import org.openstreetmap.josm.data.preferences.sources.SourceEntry; 34 35 import org.openstreetmap.josm.data.osm.Node; 35 36 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 56 57 import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.TokenMgrError; 57 58 import org.openstreetmap.josm.gui.mappaint.styleelement.LineElement; 58 import org.openstreetmap.josm.gui.preferences.SourceEntry;59 59 import org.openstreetmap.josm.io.CachedFile; 60 60 import org.openstreetmap.josm.tools.CheckParameterUtil; -
trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
r12634 r12649 30 30 import java.util.HashMap; 31 31 import java.util.Iterator; 32 import java.util.LinkedHashSet;33 32 import java.util.List; 34 33 import java.util.Map; 35 34 import java.util.Objects; 36 import java.util.Set;37 35 import java.util.concurrent.CopyOnWriteArrayList; 38 36 import java.util.regex.Matcher; … … 77 75 import org.openstreetmap.josm.actions.ExtensionFileFilter; 78 76 import org.openstreetmap.josm.data.Version; 77 import org.openstreetmap.josm.data.preferences.sources.ExtendedSourceEntry; 78 import org.openstreetmap.josm.data.preferences.sources.SourceEntry; 79 import org.openstreetmap.josm.data.preferences.sources.SourcePrefHelper; 80 import org.openstreetmap.josm.data.preferences.sources.SourceProvider; 81 import org.openstreetmap.josm.data.preferences.sources.SourceType; 79 82 import org.openstreetmap.josm.gui.ExtendedDialog; 80 83 import org.openstreetmap.josm.gui.HelpAwareOptionPane; … … 787 790 } 788 791 selectionModel.setValueIsAdjusting(false); 789 }790 }791 792 /**793 * Source entry with additional metadata.794 */795 public static class ExtendedSourceEntry extends SourceEntry implements Comparable<ExtendedSourceEntry> {796 /** file name used for display */797 public String simpleFileName;798 /** version used for display */799 public String version;800 /** author name used for display */801 public String author;802 /** webpage link used for display */803 public String link;804 /** short description used for display */805 public String description;806 /** Style type: can only have one value: "xml". Used to filter out old XML styles. For MapCSS styles, the value is not set. */807 public String styleType;808 /** minimum JOSM version required to enable this source entry */809 public Integer minJosmVersion;810 811 /**812 * Constructs a new {@code ExtendedSourceEntry}.813 * @param simpleFileName file name used for display814 * @param url URL that {@link org.openstreetmap.josm.io.CachedFile} understands815 */816 public ExtendedSourceEntry(String simpleFileName, String url) {817 super(url, null, null, true);818 this.simpleFileName = simpleFileName;819 }820 821 /**822 * @return string representation for GUI list or menu entry823 */824 public String getDisplayName() {825 return title == null ? simpleFileName : title;826 }827 828 private static void appendRow(StringBuilder s, String th, String td) {829 s.append("<tr><th>").append(th).append("</th><td>").append(Utils.escapeReservedCharactersHTML(td)).append("</td</tr>");830 }831 832 /**833 * Returns a tooltip containing available metadata.834 * @return a tooltip containing available metadata835 */836 public String getTooltip() {837 StringBuilder s = new StringBuilder();838 appendRow(s, tr("Short Description:"), getDisplayName());839 appendRow(s, tr("URL:"), url);840 if (author != null) {841 appendRow(s, tr("Author:"), author);842 }843 if (link != null) {844 appendRow(s, tr("Webpage:"), link);845 }846 if (description != null) {847 appendRow(s, tr("Description:"), description);848 }849 if (version != null) {850 appendRow(s, tr("Version:"), version);851 }852 if (minJosmVersion != null) {853 appendRow(s, tr("Minimum JOSM Version:"), Integer.toString(minJosmVersion));854 }855 return "<html><style>th{text-align:right}td{width:400px}</style>"856 + "<table>" + s + "</table></html>";857 }858 859 @Override860 public String toString() {861 return "<html><b>" + getDisplayName() + "</b>"862 + (author == null ? "" : " <span color=\"gray\">" + tr("by {0}", author) + "</color>")863 + "</html>";864 }865 866 @Override867 public int compareTo(ExtendedSourceEntry o) {868 if (url.startsWith("resource") && !o.url.startsWith("resource"))869 return -1;870 if (o.url.startsWith("resource"))871 return 1;872 else873 return getDisplayName().compareToIgnoreCase(o.getDisplayName());874 792 } 875 793 } … … 1766 1684 1767 1685 /** 1768 * Helper class for specialized extensions preferences.1769 */1770 public abstract static class SourcePrefHelper {1771 1772 private final String pref;1773 1774 /**1775 * Constructs a new {@code SourcePrefHelper} for the given preference key.1776 * @param pref The preference key1777 */1778 public SourcePrefHelper(String pref) {1779 this.pref = pref;1780 }1781 1782 /**1783 * Returns the default sources provided by JOSM core.1784 * @return the default sources provided by JOSM core1785 */1786 public abstract Collection<ExtendedSourceEntry> getDefault();1787 1788 /**1789 * Serializes the given source entry as a map.1790 * @param entry source entry to serialize1791 * @return map (key=value)1792 */1793 public abstract Map<String, String> serialize(SourceEntry entry);1794 1795 /**1796 * Deserializes the given map as a source entry.1797 * @param entryStr map (key=value)1798 * @return source entry1799 */1800 public abstract SourceEntry deserialize(Map<String, String> entryStr);1801 1802 /**1803 * Returns the list of sources.1804 * @return The list of sources1805 */1806 public List<SourceEntry> get() {1807 1808 Collection<Map<String, String>> src = Main.pref.getListOfStructs(pref, (Collection<Map<String, String>>) null);1809 if (src == null)1810 return new ArrayList<>(getDefault());1811 1812 List<SourceEntry> entries = new ArrayList<>();1813 for (Map<String, String> sourcePref : src) {1814 SourceEntry e = deserialize(new HashMap<>(sourcePref));1815 if (e != null) {1816 entries.add(e);1817 }1818 }1819 return entries;1820 }1821 1822 /**1823 * Saves a list of sources to JOSM preferences.1824 * @param entries list of sources1825 * @return {@code true}, if something has changed (i.e. value is different than before)1826 */1827 public boolean put(Collection<? extends SourceEntry> entries) {1828 Collection<Map<String, String>> setting = serializeList(entries);1829 boolean unset = Main.pref.getListOfStructs(pref, (Collection<Map<String, String>>) null) == null;1830 if (unset) {1831 Collection<Map<String, String>> def = serializeList(getDefault());1832 if (setting.equals(def))1833 return false;1834 }1835 return Main.pref.putListOfStructs(pref, setting);1836 }1837 1838 private Collection<Map<String, String>> serializeList(Collection<? extends SourceEntry> entries) {1839 Collection<Map<String, String>> setting = new ArrayList<>(entries.size());1840 for (SourceEntry e : entries) {1841 setting.add(serialize(e));1842 }1843 return setting;1844 }1845 1846 /**1847 * Returns the set of active source URLs.1848 * @return The set of active source URLs.1849 */1850 public final Set<String> getActiveUrls() {1851 Set<String> urls = new LinkedHashSet<>(); // retain order1852 for (SourceEntry e : get()) {1853 if (e.active) {1854 urls.add(e.url);1855 }1856 }1857 return urls;1858 }1859 }1860 1861 /**1862 1686 * Defers loading of sources to the first time the adequate tab is selected. 1863 1687 * @param tab The preferences tab -
trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java
r12630 r12649 7 7 import java.awt.GridBagLayout; 8 8 import java.util.ArrayList; 9 import java.util.Arrays;10 9 import java.util.Collection; 11 import java.util.HashMap;12 10 import java.util.List; 13 import java.util.Map;14 import java.util.Objects;15 import java.util.TreeSet;16 11 17 12 import javax.swing.BorderFactory; … … 20 15 21 16 import org.openstreetmap.josm.Main; 17 import org.openstreetmap.josm.data.preferences.sources.ExtendedSourceEntry; 18 import org.openstreetmap.josm.data.preferences.sources.MapPaintPrefHelper; 19 import org.openstreetmap.josm.data.preferences.sources.SourceEntry; 20 import org.openstreetmap.josm.data.preferences.sources.SourceProvider; 21 import org.openstreetmap.josm.data.preferences.sources.SourceType; 22 22 import org.openstreetmap.josm.gui.MainApplication; 23 23 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles; … … 27 27 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 28 28 import org.openstreetmap.josm.gui.preferences.SourceEditor; 29 import org.openstreetmap.josm.gui.preferences.SourceEditor.ExtendedSourceEntry;30 import org.openstreetmap.josm.gui.preferences.SourceEntry;31 import org.openstreetmap.josm.gui.preferences.SourceProvider;32 import org.openstreetmap.josm.gui.preferences.SourceType;33 29 import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting; 34 30 import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting; 35 31 import org.openstreetmap.josm.tools.GBC; 36 32 import org.openstreetmap.josm.tools.Logging; 37 import org.openstreetmap.josm.tools.Utils;38 33 39 34 /** … … 193 188 } 194 189 195 /**196 * Helper class for map paint styles preferences.197 */198 public static class MapPaintPrefHelper extends SourceEditor.SourcePrefHelper {199 200 /**201 * The unique instance.202 */203 public static final MapPaintPrefHelper INSTANCE = new MapPaintPrefHelper();204 205 /**206 * Constructs a new {@code MapPaintPrefHelper}.207 */208 public MapPaintPrefHelper() {209 super("mappaint.style.entries");210 }211 212 @Override213 public List<SourceEntry> get() {214 List<SourceEntry> ls = super.get();215 if (insertNewDefaults(ls)) {216 put(ls);217 }218 return ls;219 }220 221 /**222 * If the selection of default styles changes in future releases, add223 * the new entries to the user-configured list. Remember the known URLs,224 * so an item that was deleted explicitly is not added again.225 * @param list new defaults226 * @return {@code true} if a change occurred227 */228 private boolean insertNewDefaults(List<SourceEntry> list) {229 boolean changed = false;230 231 Collection<String> knownDefaults = new TreeSet<>(Main.pref.getCollection("mappaint.style.known-defaults"));232 233 Collection<ExtendedSourceEntry> defaults = getDefault();234 int insertionIdx = 0;235 for (final SourceEntry def : defaults) {236 int i = Utils.indexOf(list, se -> Objects.equals(def.url, se.url));237 if (i == -1 && !knownDefaults.contains(def.url)) {238 def.active = false;239 list.add(insertionIdx, def);240 insertionIdx++;241 changed = true;242 } else {243 if (i >= insertionIdx) {244 insertionIdx = i + 1;245 }246 }247 knownDefaults.add(def.url);248 }249 Main.pref.putCollection("mappaint.style.known-defaults", knownDefaults);250 251 // XML style is not bundled anymore252 list.remove(Utils.find(list, se -> "resource://styles/standard/elemstyles.xml".equals(se.url)));253 254 return changed;255 }256 257 @Override258 public Collection<ExtendedSourceEntry> getDefault() {259 ExtendedSourceEntry defJosmMapcss = new ExtendedSourceEntry("elemstyles.mapcss", "resource://styles/standard/elemstyles.mapcss");260 defJosmMapcss.active = true;261 defJosmMapcss.name = "standard";262 defJosmMapcss.title = tr("JOSM default (MapCSS)");263 defJosmMapcss.description = tr("Internal style to be used as base for runtime switchable overlay styles");264 ExtendedSourceEntry defPL2 = new ExtendedSourceEntry("potlatch2.mapcss", "resource://styles/standard/potlatch2.mapcss");265 defPL2.active = false;266 defPL2.name = "standard";267 defPL2.title = tr("Potlatch 2");268 defPL2.description = tr("the main Potlatch 2 style");269 270 return Arrays.asList(defJosmMapcss, defPL2);271 }272 273 @Override274 public Map<String, String> serialize(SourceEntry entry) {275 Map<String, String> res = new HashMap<>();276 res.put("url", entry.url == null ? "" : entry.url);277 res.put("title", entry.title == null ? "" : entry.title);278 res.put("active", Boolean.toString(entry.active));279 if (entry.name != null) {280 res.put("ptoken", entry.name);281 }282 return res;283 }284 285 @Override286 public SourceEntry deserialize(Map<String, String> s) {287 return new SourceEntry(s.get("url"), s.get("ptoken"), s.get("title"), Boolean.parseBoolean(s.get("active")));288 }289 }290 291 190 @Override 292 191 public boolean isExpert() { -
trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java
r12620 r12649 9 9 import java.util.ArrayList; 10 10 import java.util.Collection; 11 import java.util.Collections;12 import java.util.HashMap;13 11 import java.util.List; 14 import java.util.Map;15 12 16 13 import javax.swing.BorderFactory; … … 21 18 22 19 import org.openstreetmap.josm.Main; 20 import org.openstreetmap.josm.data.preferences.sources.ExtendedSourceEntry; 21 import org.openstreetmap.josm.data.preferences.sources.PresetPrefHelper; 22 import org.openstreetmap.josm.data.preferences.sources.SourceEntry; 23 import org.openstreetmap.josm.data.preferences.sources.SourceProvider; 24 import org.openstreetmap.josm.data.preferences.sources.SourceType; 23 25 import org.openstreetmap.josm.gui.ExtendedDialog; 24 26 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; … … 27 29 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane.ValidationListener; 28 30 import org.openstreetmap.josm.gui.preferences.SourceEditor; 29 import org.openstreetmap.josm.gui.preferences.SourceEditor.ExtendedSourceEntry;30 import org.openstreetmap.josm.gui.preferences.SourceEntry;31 import org.openstreetmap.josm.gui.preferences.SourceProvider;32 import org.openstreetmap.josm.gui.preferences.SourceType;33 31 import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting; 34 32 import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting; … … 254 252 } 255 253 256 /**257 * Helper class for tagging presets preferences.258 */259 public static class PresetPrefHelper extends SourceEditor.SourcePrefHelper {260 261 /**262 * The unique instance.263 */264 public static final PresetPrefHelper INSTANCE = new PresetPrefHelper();265 266 /**267 * Constructs a new {@code PresetPrefHelper}.268 */269 public PresetPrefHelper() {270 super("taggingpreset.entries");271 }272 273 @Override274 public Collection<ExtendedSourceEntry> getDefault() {275 ExtendedSourceEntry i = new ExtendedSourceEntry("defaultpresets.xml", "resource://data/defaultpresets.xml");276 i.title = tr("Internal Preset");277 i.description = tr("The default preset for JOSM");278 return Collections.singletonList(i);279 }280 281 @Override282 public Map<String, String> serialize(SourceEntry entry) {283 Map<String, String> res = new HashMap<>();284 res.put("url", entry.url);285 res.put("title", entry.title == null ? "" : entry.title);286 return res;287 }288 289 @Override290 public SourceEntry deserialize(Map<String, String> s) {291 return new SourceEntry(s.get("url"), null, s.get("title"), true);292 }293 }294 295 254 @Override 296 255 public boolean isExpert() { -
trunk/src/org/openstreetmap/josm/gui/preferences/validator/ValidatorPreference.java
r10880 r12649 6 6 import javax.swing.JTabbedPane; 7 7 8 import org.openstreetmap.josm.data.preferences.BooleanProperty;9 8 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; 10 9 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; … … 36 35 } 37 36 38 /** The preferences prefix */39 public static final String PREFIX = "validator";40 41 /** The preferences key for error layer */42 public static final BooleanProperty PREF_LAYER = new BooleanProperty(PREFIX + ".layer", true);43 44 /** The preferences key for enabled tests */45 public static final String PREF_SKIP_TESTS = PREFIX + ".skip";46 47 /** The preferences key for enabled tests */48 public static final BooleanProperty PREF_USE_IGNORE = new BooleanProperty(PREFIX + ".ignore", true);49 50 /** The preferences key for enabled tests before upload*/51 public static final String PREF_SKIP_TESTS_BEFORE_UPLOAD = PREFIX + ".skipBeforeUpload";52 53 /** The preferences key for ignored severity other on upload */54 public static final BooleanProperty PREF_OTHER_UPLOAD = new BooleanProperty(PREFIX + ".otherUpload", false);55 56 /** The preferences for ignored severity other */57 public static final BooleanProperty PREF_OTHER = new BooleanProperty(PREFIX + ".other", false);58 59 /**60 * The preferences key for enabling the permanent filtering61 * of the displayed errors in the tree regarding the current selection62 */63 public static final String PREF_FILTER_BY_SELECTION = PREFIX + ".selectionFilter";64 65 37 @Override 66 38 public void addGui(PreferenceTabbedPane gui) { -
trunk/src/org/openstreetmap/josm/gui/preferences/validator/ValidatorTagCheckerRulesPreference.java
r11247 r12649 8 8 import java.util.Collection; 9 9 import java.util.Collections; 10 import java.util.HashMap;11 10 import java.util.List; 12 import java.util.Map;13 11 14 12 import org.openstreetmap.josm.Main; 13 import org.openstreetmap.josm.data.preferences.sources.ExtendedSourceEntry; 14 import org.openstreetmap.josm.data.preferences.sources.ValidatorPrefHelper; 15 import org.openstreetmap.josm.data.preferences.sources.SourceEntry; 16 import org.openstreetmap.josm.data.preferences.sources.SourceProvider; 17 import org.openstreetmap.josm.data.preferences.sources.SourceType; 15 18 import org.openstreetmap.josm.data.validation.OsmValidator; 16 19 import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker; … … 19 22 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 20 23 import org.openstreetmap.josm.gui.preferences.SourceEditor; 21 import org.openstreetmap.josm.gui.preferences.SourceEditor.ExtendedSourceEntry;22 import org.openstreetmap.josm.gui.preferences.SourceEntry;23 import org.openstreetmap.josm.gui.preferences.SourceProvider;24 import org.openstreetmap.josm.gui.preferences.SourceType;25 24 import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting; 26 25 import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting; … … 64 63 @Override 65 64 public Collection<? extends SourceEntry> getInitialSourcesList() { 66 return RulePrefHelper.INSTANCE.get();65 return ValidatorPrefHelper.INSTANCE.get(); 67 66 } 68 67 69 68 @Override 70 69 public boolean finish() { 71 return RulePrefHelper.INSTANCE.put(activeSourcesModel.getSources());70 return ValidatorPrefHelper.INSTANCE.put(activeSourcesModel.getSources()); 72 71 } 73 72 74 73 @Override 75 74 public Collection<ExtendedSourceEntry> getDefault() { 76 return RulePrefHelper.INSTANCE.getDefault();75 return ValidatorPrefHelper.INSTANCE.getDefault(); 77 76 } 78 77 … … 123 122 } 124 123 125 /**126 * Helper class for validator tag checker rules preferences.127 */128 public static class RulePrefHelper extends SourceEditor.SourcePrefHelper {129 130 /**131 * The unique instance.132 */133 public static final RulePrefHelper INSTANCE = new RulePrefHelper();134 135 /**136 * Constructs a new {@code PresetPrefHelper}.137 */138 public RulePrefHelper() {139 super(MapCSSTagChecker.ENTRIES_PREF_KEY);140 }141 142 @Override143 public Collection<ExtendedSourceEntry> getDefault() {144 List<ExtendedSourceEntry> def = new ArrayList<>();145 146 // CHECKSTYLE.OFF: SingleSpaceSeparator147 addDefault(def, "addresses", tr("Addresses"), tr("Checks for errors on addresses"));148 addDefault(def, "combinations", tr("Tag combinations"), tr("Checks for missing tag or suspicious combinations"));149 addDefault(def, "deprecated", tr("Deprecated features"), tr("Checks for deprecated features"));150 addDefault(def, "geometry", tr("Geometry"), tr("Checks for geometry errors"));151 addDefault(def, "highway", tr("Highways"), tr("Checks for errors on highways"));152 addDefault(def, "multiple", tr("Multiple values"), tr("Checks for wrong multiple values"));153 addDefault(def, "numeric", tr("Numeric values"), tr("Checks for wrong numeric values"));154 addDefault(def, "religion", tr("Religion"), tr("Checks for errors on religious objects"));155 addDefault(def, "relation", tr("Relations"), tr("Checks for errors on relations"));156 addDefault(def, "territories", tr("Territories"), tr("Checks for territories-specific features"));157 addDefault(def, "unnecessary", tr("Unnecessary tags"), tr("Checks for unnecessary tags"));158 addDefault(def, "wikipedia", tr("Wikipedia"), tr("Checks for wrong wikipedia tags"));159 // CHECKSTYLE.ON: SingleSpaceSeparator160 161 return def;162 }163 164 private static void addDefault(List<ExtendedSourceEntry> defaults, String filename, String title, String description) {165 ExtendedSourceEntry i = new ExtendedSourceEntry(filename+".mapcss", "resource://data/validator/"+filename+".mapcss");166 i.title = title;167 i.description = description;168 defaults.add(i);169 }170 171 @Override172 public Map<String, String> serialize(SourceEntry entry) {173 Map<String, String> res = new HashMap<>();174 res.put("url", entry.url);175 res.put("title", entry.title == null ? "" : entry.title);176 res.put("active", Boolean.toString(entry.active));177 return res;178 }179 180 @Override181 public SourceEntry deserialize(Map<String, String> s) {182 return new SourceEntry(s.get("url"), null, s.get("title"), Boolean.parseBoolean(s.get("active")));183 }184 }185 186 124 private SourceEditor sources; 187 125 -
trunk/src/org/openstreetmap/josm/gui/preferences/validator/ValidatorTestsPreference.java
r10880 r12649 17 17 18 18 import org.openstreetmap.josm.Main; 19 import org.openstreetmap.josm.data.preferences.sources.ValidatorPrefHelper; 19 20 import org.openstreetmap.josm.data.validation.OsmValidator; 20 21 import org.openstreetmap.josm.data.validation.Test; … … 58 59 testPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); 59 60 60 prefUseIgnore = new JCheckBox(tr("Use ignore list."), ValidatorPref erence.PREF_USE_IGNORE.get());61 prefUseIgnore = new JCheckBox(tr("Use ignore list."), ValidatorPrefHelper.PREF_USE_IGNORE.get()); 61 62 prefUseIgnore.setToolTipText(tr("Use the ignore list to suppress warnings.")); 62 63 testPanel.add(prefUseIgnore, GBC.eol()); 63 64 64 prefUseLayer = new JCheckBox(tr("Use error layer."), ValidatorPref erence.PREF_LAYER.get());65 prefUseLayer = new JCheckBox(tr("Use error layer."), ValidatorPrefHelper.PREF_LAYER.get()); 65 66 prefUseLayer.setToolTipText(tr("Use the error layer to display problematic elements.")); 66 67 testPanel.add(prefUseLayer, GBC.eol()); 67 68 68 prefOther = new JCheckBox(tr("Show informational level."), ValidatorPref erence.PREF_OTHER.get());69 prefOther = new JCheckBox(tr("Show informational level."), ValidatorPrefHelper.PREF_OTHER.get()); 69 70 prefOther.setToolTipText(tr("Show the informational tests.")); 70 71 testPanel.add(prefOther, GBC.eol()); 71 72 72 73 prefOtherUpload = new JCheckBox(tr("Show informational level on upload."), 73 ValidatorPref erence.PREF_OTHER_UPLOAD.get());74 ValidatorPrefHelper.PREF_OTHER_UPLOAD.get()); 74 75 prefOtherUpload.setToolTipText(tr("Show the informational tests in the upload check windows.")); 75 76 testPanel.add(prefOtherUpload, GBC.eol()); … … 115 116 OsmValidator.initializeTests(testsToInitialize); 116 117 117 Main.pref.putCollection(ValidatorPref erence.PREF_SKIP_TESTS, tests);118 Main.pref.putCollection(ValidatorPref erence.PREF_SKIP_TESTS_BEFORE_UPLOAD, testsBeforeUpload);119 ValidatorPref erence.PREF_USE_IGNORE.put(prefUseIgnore.isSelected());120 ValidatorPref erence.PREF_OTHER.put(prefOther.isSelected());121 ValidatorPref erence.PREF_OTHER_UPLOAD.put(prefOtherUpload.isSelected());122 ValidatorPref erence.PREF_LAYER.put(prefUseLayer.isSelected());118 Main.pref.putCollection(ValidatorPrefHelper.PREF_SKIP_TESTS, tests); 119 Main.pref.putCollection(ValidatorPrefHelper.PREF_SKIP_TESTS_BEFORE_UPLOAD, testsBeforeUpload); 120 ValidatorPrefHelper.PREF_USE_IGNORE.put(prefUseIgnore.isSelected()); 121 ValidatorPrefHelper.PREF_OTHER.put(prefOther.isSelected()); 122 ValidatorPrefHelper.PREF_OTHER_UPLOAD.put(prefOtherUpload.isSelected()); 123 ValidatorPrefHelper.PREF_LAYER.put(prefUseLayer.isSelected()); 123 124 return false; 124 125 } -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReader.java
r12620 r12649 25 25 26 26 import org.openstreetmap.josm.Main; 27 import org.openstreetmap.josm. gui.preferences.map.TaggingPresetPreference;27 import org.openstreetmap.josm.data.preferences.sources.PresetPrefHelper; 28 28 import org.openstreetmap.josm.gui.tagging.presets.items.Check; 29 29 import org.openstreetmap.josm.gui.tagging.presets.items.CheckGroup; … … 103 103 */ 104 104 public static Set<String> getPresetSources() { 105 return new TaggingPresetPreference.PresetPrefHelper().getActiveUrls();105 return new PresetPrefHelper().getActiveUrls(); 106 106 } 107 107 -
trunk/src/org/openstreetmap/josm/io/FileWatcher.java
r12634 r12649 16 16 import java.util.concurrent.Executors; 17 17 18 import org.openstreetmap.josm.data.preferences.sources.SourceEntry; 18 19 import org.openstreetmap.josm.data.validation.OsmValidator; 19 20 import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker; … … 21 22 import org.openstreetmap.josm.gui.mappaint.StyleSource; 22 23 import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException; 23 import org.openstreetmap.josm.gui.preferences.SourceEntry;24 24 import org.openstreetmap.josm.tools.CheckParameterUtil; 25 25 import org.openstreetmap.josm.tools.Logging; -
trunk/src/org/openstreetmap/josm/tools/bugreport/BugReport.java
r11746 r12649 53 53 * @param e The {@link ReportedException} to use. No more data should be added after creating the report. 54 54 */ 55 BugReport(ReportedException e) {55 public BugReport(ReportedException e) { 56 56 this.exception = e; 57 57 includeAllStackTraces = e.mayHaveConcurrentSource(); -
trunk/src/org/openstreetmap/josm/tools/bugreport/BugReportQueue.java
r12624 r12649 9 9 import java.util.function.Predicate; 10 10 11 import org.openstreetmap.josm.gui.bugreport.BugReportDialog; 11 12 import org.openstreetmap.josm.tools.Logging; 12 13 -
trunk/src/org/openstreetmap/josm/tools/bugreport/BugReportSender.java
r12620 r12649 23 23 24 24 import org.openstreetmap.josm.Main; 25 import org.openstreetmap.josm.gui.bugreport.DebugTextDisplay; 25 26 import org.openstreetmap.josm.gui.widgets.JMultilineLabel; 26 27 import org.openstreetmap.josm.gui.widgets.UrlLabel; -
trunk/src/org/openstreetmap/josm/tools/bugreport/package-info.java
r10754 r12649 2 2 3 3 /** 4 * Provides c lasses for the bug report system, allowing users to create tickets on issue tracker directly from JOSM.4 * Provides core classes for the bug report system, allowing to save technical information used later in tickets on issue tracker. 5 5 */ 6 6 package org.openstreetmap.josm.tools.bugreport; -
trunk/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java
r12465 r12649 36 36 import org.openstreetmap.josm.data.osm.OsmPrimitive; 37 37 import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer; 38 import org.openstreetmap.josm.data.preferences.sources.SourceEntry; 38 39 import org.openstreetmap.josm.gui.NavigatableComponent; 39 40 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource; 40 import org.openstreetmap.josm.gui.preferences.SourceEntry;41 41 import org.openstreetmap.josm.io.IllegalDataException; 42 42 import org.openstreetmap.josm.io.OsmReader; -
trunk/test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java
r12630 r12649 34 34 import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer; 35 35 import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer.StyleRecord; 36 import org.openstreetmap.josm.data.preferences.sources.SourceEntry; 36 37 import org.openstreetmap.josm.data.projection.Projections; 37 38 import org.openstreetmap.josm.gui.MainApplication; … … 41 42 import org.openstreetmap.josm.gui.mappaint.mapcss.Selector; 42 43 import org.openstreetmap.josm.gui.mappaint.styleelement.StyleElement; 43 import org.openstreetmap.josm.gui.preferences.SourceEntry;44 44 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 45 45 import org.openstreetmap.josm.io.Compression; -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTestIT.java
r12509 r12649 15 15 import org.junit.rules.Timeout; 16 16 import org.openstreetmap.josm.JOSMFixture; 17 import org.openstreetmap.josm.data.preferences.sources.ExtendedSourceEntry; 17 18 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles; 18 19 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.IconReference; … … 23 24 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSRule; 24 25 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource; 25 import org.openstreetmap.josm.gui.preferences.SourceEditor.ExtendedSourceEntry;26 26 import org.openstreetmap.josm.tools.ImageProvider; 27 27 -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTestIT.java
r12620 r12649 18 18 import org.openstreetmap.josm.JOSMFixture; 19 19 import org.openstreetmap.josm.Main; 20 import org.openstreetmap.josm. gui.preferences.SourceEditor.ExtendedSourceEntry;20 import org.openstreetmap.josm.data.preferences.sources.ExtendedSourceEntry; 21 21 import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset; 22 22 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetReader; -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorTagCheckerRulesPreferenceTestIT.java
r10235 r12649 12 12 import org.junit.Test; 13 13 import org.openstreetmap.josm.JOSMFixture; 14 import org.openstreetmap.josm.data.preferences.sources.ExtendedSourceEntry; 14 15 import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker; 15 16 import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.ParseResult; 16 import org.openstreetmap.josm.gui.preferences.SourceEditor.ExtendedSourceEntry;17 17 18 18 /** -
trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportSettingsPanelTest.java
r11020 r12649 6 6 import org.junit.Rule; 7 7 import org.junit.Test; 8 import org.openstreetmap.josm.gui.bugreport.BugReportSettingsPanel; 8 9 import org.openstreetmap.josm.testutils.JOSMTestRules; 9 10 -
trunk/test/unit/org/openstreetmap/josm/tools/bugreport/DebugTextDisplayTest.java
r11102 r12649 6 6 import org.junit.Rule; 7 7 import org.junit.Test; 8 import org.openstreetmap.josm.gui.bugreport.DebugTextDisplay; 8 9 import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils; 9 10 import org.openstreetmap.josm.testutils.JOSMTestRules;
Note:
See TracChangeset
for help on using the changeset viewer.