Changeset 12634 in josm for trunk/src/org/openstreetmap/josm/io
- Timestamp:
- 2017-08-24T15:54:00+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/FileWatcher.java
r12620 r12634 14 14 import java.util.HashMap; 15 15 import java.util.Map; 16 import java.util.concurrent.Executors; 16 17 17 import org.openstreetmap.josm.Main;18 18 import org.openstreetmap.josm.data.validation.OsmValidator; 19 19 import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker; … … 24 24 import org.openstreetmap.josm.tools.CheckParameterUtil; 25 25 import org.openstreetmap.josm.tools.Logging; 26 import org.openstreetmap.josm.tools.Utils; 26 27 27 28 /** … … 140 141 if (style != null) { 141 142 Logging.info("Map style "+style.getDisplayString()+" has been modified. Reloading style..."); 142 Main.worker.submit(new MapPaintStyleLoader(Collections.singleton(style))); 143 Executors.newSingleThreadExecutor(Utils.newThreadFactory("mapstyle-reload-%d", Thread.NORM_PRIORITY)).submit( 144 new MapPaintStyleLoader(Collections.singleton(style))); 143 145 } else if (rule != null) { 144 146 Logging.info("Validator rule "+rule.getDisplayString()+" has been modified. Reloading rule..."); -
trunk/src/org/openstreetmap/josm/io/OsmConnection.java
r12620 r12634 121 121 } 122 122 final Runnable authTask = new FutureTask<>(() -> { 123 // Concerning Utils.newDirectExecutor: Main .worker cannot be used since this connection is already124 // executed via Main.worker. The OAuth connections would block otherwise.123 // Concerning Utils.newDirectExecutor: Main worker cannot be used since this connection is already 124 // executed via main worker. The OAuth connections would block otherwise. 125 125 final OAuthAuthorizationWizard wizard = new OAuthAuthorizationWizard( 126 126 Main.parent, apiUrl.toExternalForm(), Utils.newDirectExecutor()); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
r12630 r12634 145 145 Future<?> future = osmTask.download(newLayer, new Bounds(minlat, minlon, maxlat, maxlon), 146 146 null /* let the task manage the progress monitor */); 147 Main .worker.submit(new PostDownloadHandler(osmTask, future));147 MainApplication.worker.submit(new PostDownloadHandler(osmTask, future)); 148 148 } 149 149 } … … 196 196 try { 197 197 final SearchCompiler.Match search = SearchCompiler.compile(args.get("search")); 198 Main .worker.submit(() -> {198 MainApplication.worker.submit(() -> { 199 199 final DataSet ds = Main.getLayerManager().getEditDataSet(); 200 200 final Collection<OsmPrimitive> filteredPrimitives = SubclassFilteredCollection.filter(ds.allPrimitives(), search); … … 214 214 // add changeset tags after download if necessary 215 215 if (args.containsKey("changeset_comment") || args.containsKey("changeset_source")) { 216 Main .worker.submit(() -> {216 MainApplication.worker.submit(() -> { 217 217 if (Main.getLayerManager().getEditDataSet() != null) { 218 218 if (args.containsKey("changeset_comment")) { -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadDataHandler.java
r9990 r12634 7 7 import java.nio.charset.StandardCharsets; 8 8 9 import org.openstreetmap.josm.Main;10 9 import org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask; 11 10 import org.openstreetmap.josm.data.osm.DataSet; 11 import org.openstreetmap.josm.gui.MainApplication; 12 12 import org.openstreetmap.josm.io.IllegalDataException; 13 13 import org.openstreetmap.josm.io.OsmReader; … … 40 40 @Override 41 41 protected void handleRequest() throws RequestHandlerErrorException { 42 Main .worker.submit(new LoadDataTask(isLoadInNewLayer(), dataSet, args.get("layer_name")));42 MainApplication.worker.submit(new LoadDataTask(isLoadInNewLayer(), dataSet, args.get("layer_name"))); 43 43 } 44 44 -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadObjectHandler.java
r12620 r12634 14 14 import org.openstreetmap.josm.data.osm.PrimitiveId; 15 15 import org.openstreetmap.josm.data.osm.SimplePrimitiveId; 16 import org.openstreetmap.josm.gui.MainApplication; 16 17 import org.openstreetmap.josm.gui.io.DownloadPrimitivesWithReferrersTask; 17 18 import org.openstreetmap.josm.gui.util.GuiHelper; … … 68 69 final DownloadPrimitivesWithReferrersTask task = new DownloadPrimitivesWithReferrersTask( 69 70 newLayer, ps, referrers, relationMembers, args.get("layer_name"), null); 70 Main .worker.submit(task);71 Main .worker.submit(() -> {71 MainApplication.worker.submit(task); 72 MainApplication.worker.submit(() -> { 72 73 final List<PrimitiveId> downloaded = task.getDownloadedId(); 73 74 final DataSet ds = Main.getLayerManager().getEditDataSet(); -
trunk/src/org/openstreetmap/josm/io/session/SessionImporter.java
r8404 r12634 7 7 import java.io.IOException; 8 8 9 import org.openstreetmap.josm.Main;10 9 import org.openstreetmap.josm.actions.ExtensionFileFilter; 11 10 import org.openstreetmap.josm.actions.SessionLoadAction.Loader; 11 import org.openstreetmap.josm.gui.MainApplication; 12 12 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 13 13 import org.openstreetmap.josm.io.FileImporter; … … 37 37 public void importData(File file, ProgressMonitor progressMonitor) throws IOException, IllegalDataException { 38 38 boolean zip = Utils.hasExtension(file, "joz"); 39 Main .worker.submit(new Loader(file, zip));39 MainApplication.worker.submit(new Loader(file, zip)); 40 40 } 41 41 }
Note:
See TracChangeset
for help on using the changeset viewer.