Changeset 12825 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2017-09-11T20:43:41+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r12821 r12825 88 88 import org.openstreetmap.josm.data.osm.UserInfo; 89 89 import org.openstreetmap.josm.data.osm.search.SearchMode; 90 import org.openstreetmap.josm.data.preferences.sources.SourceType; 90 91 import org.openstreetmap.josm.data.projection.ProjectionCLI; 91 92 import org.openstreetmap.josm.data.projection.datum.NTV2GridShiftFileSource; … … 93 94 import org.openstreetmap.josm.data.projection.datum.NTV2Proj4DirGridShiftFileSource; 94 95 import org.openstreetmap.josm.data.validation.OsmValidator; 96 import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker; 95 97 import org.openstreetmap.josm.gui.ProgramArguments.Option; 96 98 import org.openstreetmap.josm.gui.SplashScreen.SplashProgressMonitor; … … 110 112 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 111 113 import org.openstreetmap.josm.gui.layer.TMSLayer; 114 import org.openstreetmap.josm.gui.mappaint.loader.MapPaintStyleLoader; 112 115 import org.openstreetmap.josm.gui.oauth.OAuthAuthorizationWizard; 113 116 import org.openstreetmap.josm.gui.preferences.ToolbarPreferences; … … 126 129 import org.openstreetmap.josm.io.CertificateAmendment; 127 130 import org.openstreetmap.josm.io.DefaultProxySelector; 131 import org.openstreetmap.josm.io.FileWatcher; 128 132 import org.openstreetmap.josm.io.MessageNotifier; 129 133 import org.openstreetmap.josm.io.OnlineResource; … … 1094 1098 MessageNotifier.setNotifierCallback(MainApplication::notifyNewMessages); 1095 1099 DeleteCommand.setDeletionCallback(DeleteAction.defaultDeletionCallback); 1100 FileWatcher.registerLoader(SourceType.MAP_PAINT_STYLE, MapPaintStyleLoader::reloadStyle); 1101 FileWatcher.registerLoader(SourceType.TAGCHECKER_RULE, MapCSSTagChecker::reloadRule); 1096 1102 OsmUrlToBounds.setMapSizeSupplier(() -> { 1097 1103 if (isDisplayingMapView()) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
r12651 r12825 301 301 if (Main.pref.getBoolean("mappaint.auto_reload_local_styles", true) && source.isLocal()) { 302 302 try { 303 Main.fileWatcher.registerS tyleSource(source);303 Main.fileWatcher.registerSource(source); 304 304 } catch (IOException | IllegalStateException | IllegalArgumentException e) { 305 305 Logging.error(e); -
trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSource.java
r12649 r12825 22 22 import org.openstreetmap.josm.data.osm.OsmPrimitive; 23 23 import org.openstreetmap.josm.data.preferences.sources.SourceEntry; 24 import org.openstreetmap.josm.data.preferences.sources.SourceType; 24 25 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.IconReference; 25 26 import org.openstreetmap.josm.io.CachedFile; … … 70 71 */ 71 72 public StyleSource(String url, String name, String title) { 72 super( url, name, title, true);73 super(SourceType.MAP_PAINT_STYLE, url, name, title, true); 73 74 } 74 75 -
trunk/src/org/openstreetmap/josm/gui/mappaint/loader/MapPaintStyleLoader.java
r12651 r12825 6 6 import java.util.ArrayList; 7 7 import java.util.Collection; 8 import java.util.Collections; 8 9 import java.util.List; 9 10 11 import org.openstreetmap.josm.data.preferences.sources.SourceEntry; 10 12 import org.openstreetmap.josm.gui.MainApplication; 11 13 import org.openstreetmap.josm.gui.PleaseWaitRunnable; … … 67 69 MainApplication.worker.submit(new MapPaintStyleLoader(toReload)); 68 70 } 71 72 /** 73 * Reload style. 74 * @param style {@link StyleSource} to reload 75 * @throws IllegalArgumentException if {@code style} is not a {@code StyleSource} instance 76 * @since 12825 77 */ 78 public static void reloadStyle(SourceEntry style) { 79 if (style instanceof StyleSource) { 80 MainApplication.worker.submit(new MapPaintStyleLoader(Collections.singleton((StyleSource) style))); 81 } else { 82 throw new IllegalArgumentException(style + " is not a StyleSource"); 83 } 84 } 69 85 } -
trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
r12649 r12825 741 741 if (sources == null) return; 742 742 for (ExtendedSourceEntry info: sources) { 743 data.add(new SourceEntry(info. url, info.name, info.getDisplayName(), true));743 data.add(new SourceEntry(info.type, info.url, info.name, info.getDisplayName(), true)); 744 744 } 745 745 fireTableDataChanged(); … … 969 969 active = editEntryDialog.active(); 970 970 } 971 final SourceEntry entry = new SourceEntry( 971 final SourceEntry entry = new SourceEntry(sourceType, 972 972 editEntryDialog.getURL(), 973 973 null, editEntryDialog.getTitle(), active); … … 1509 1509 Matcher m = Pattern.compile("^(.+);(.+)$").matcher(line); 1510 1510 if (m.matches()) { 1511 last = new ExtendedSourceEntry( m.group(1), m.group(2));1511 last = new ExtendedSourceEntry(sourceType, m.group(1), m.group(2)); 1512 1512 sources.add(last); 1513 1513 } else {
Note:
See TracChangeset
for help on using the changeset viewer.