Changeset 8412 in josm
- Timestamp:
- 2015-05-22T01:06:28+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r8404 r8412 1081 1081 1082 1082 /** 1083 * Closes JOSM and optionally terminates the Java Virtual Machine (JVM). If there are some unsaved data layers, asks first for user confirmation. 1083 * Closes JOSM and optionally terminates the Java Virtual Machine (JVM). 1084 * If there are some unsaved data layers, asks first for user confirmation. 1084 1085 * @param exit If {@code true}, the JVM is terminated by running {@link System#exit} with a given return code. 1085 1086 * @param exitCode The return code … … 1088 1089 */ 1089 1090 public static boolean exitJosm(boolean exit, int exitCode) { 1090 JCSCacheManager.shutdown();1091 1091 if (Main.saveUnsavedModifications()) { 1092 worker.shutdown(); 1093 ImageProvider.shutdown(false); 1094 JCSCacheManager.shutdown(); 1092 1095 geometry.remember("gui.geometry"); 1093 1096 if (map != null) { … … 1102 1105 } 1103 1106 } 1107 worker.shutdownNow(); 1108 ImageProvider.shutdown(true); 1109 1104 1110 if (exit) { 1105 1111 System.exit(exitCode); -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java
r8308 r8412 434 434 protected class SaveAndUploadTask implements Runnable { 435 435 436 private SaveLayersModel model;437 private ProgressMonitor monitor;438 private ExecutorService worker;436 private final SaveLayersModel model; 437 private final ProgressMonitor monitor; 438 private final ExecutorService worker; 439 439 private boolean canceled; 440 440 private Future<?> currentFuture; … … 592 592 } 593 593 }); 594 worker.shutdownNow(); 594 595 } 595 596 … … 598 599 currentTask.cancel(); 599 600 } 601 worker.shutdown(); 600 602 canceled = true; 601 603 } -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r8404 r8412 1612 1612 * @return The same image as {@code bi} where all pixels of the given color are transparent. 1613 1613 * This resulting image has also the special property {@link #PROP_TRANSPARENCY_FORCED} set to {@code color} 1614 * @since 71321615 1614 * @see BufferedImage#getProperty 1616 1615 * @see #isTransparencyForced 1616 * @since 7132 1617 1617 */ 1618 1618 public static BufferedImage makeImageTransparent(BufferedImage bi, Color color) { … … 1653 1653 * @param bi The {@code BufferedImage} to test 1654 1654 * @return {@code true} if the transparency of {@code bi} has been enforced by a previous call to {@code makeImageTransparent}. 1655 * @see #makeImageTransparent 1655 1656 * @since 7132 1656 * @see #makeImageTransparent1657 1657 */ 1658 1658 public static boolean isTransparencyForced(BufferedImage bi) { … … 1664 1664 * @param bi The {@code BufferedImage} to test 1665 1665 * @return {@code true} if {@code bi} has a transparent color determined by a previous call to {@code read}. 1666 * @see #read 1666 1667 * @since 7132 1667 * @see #read1668 1668 */ 1669 1669 public static boolean hasTransparentColor(BufferedImage bi) { 1670 1670 return bi != null && !bi.getProperty(PROP_TRANSPARENCY_COLOR).equals(Image.UndefinedProperty); 1671 1671 } 1672 1673 /** 1674 * Shutdown background image fetcher. 1675 * @param now if {@code true}, attempts to stop all actively executing tasks, halts the processing of waiting tasks. 1676 * if {@code false}, initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted 1677 * @since 8412 1678 */ 1679 public static void shutdown(boolean now) { 1680 if (now) { 1681 IMAGE_FETCHER.shutdownNow(); 1682 } else { 1683 IMAGE_FETCHER.shutdown(); 1684 } 1685 } 1672 1686 }
Note:
See TracChangeset
for help on using the changeset viewer.