Changeset 35371 in osm for applications
- Timestamp:
- 2020-03-16T23:15:34+01:00 (5 years ago)
- Location:
- applications/editors/josm/plugins/javafx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/javafx
- Property svn:ignore
-
old new 2 2 build 3 3 javadoc 4 MANIFEST*
-
- Property svn:ignore
-
applications/editors/josm/plugins/javafx/build.xml
r34729 r35371 14 14 <property name="plugin.class.osx" value="org.openstreetmap.josm.plugins.javafx.JavaFxPluginOsx"/> 15 15 <property name="plugin.description" value="Provides the OpenJFX (JavaFX) library for JOSM core and other JOSM plugins. Provides additional features such as MP3 audio playback."/> 16 < property name="plugin.minimum.java.version" value="10"/>16 <!--<property name="plugin.minimum.java.version" value="10"/>--> 17 17 <property name="plugin.provides" value="javafx"/> 18 18 <!--<property name="plugin.icon" value="..."/>--> -
applications/editors/josm/plugins/javafx/src/org/openstreetmap/josm/plugins/javafx/JavaFxPlugin.java
r34713 r35371 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.plugins.javafx; 3 import static org.openstreetmap.josm.tools.I18n.tr; 3 4 4 5 import java.io.File; … … 15 16 import java.nio.file.attribute.BasicFileAttributes; 16 17 import java.security.CodeSource; 18 import java.util.Collections; 17 19 import java.util.Enumeration; 18 20 import java.util.List; … … 22 24 23 25 import org.openstreetmap.josm.data.Preferences; 26 import org.openstreetmap.josm.gui.MainApplication; 24 27 import org.openstreetmap.josm.io.audio.AudioPlayer; 25 28 import org.openstreetmap.josm.plugins.DynamicURLClassLoader; 26 29 import org.openstreetmap.josm.plugins.Plugin; 30 import org.openstreetmap.josm.plugins.PluginHandler; 27 31 import org.openstreetmap.josm.plugins.PluginInformation; 28 32 import org.openstreetmap.josm.plugins.javafx.io.audio.JavaFxMediaPlayer; 29 33 import org.openstreetmap.josm.tools.Logging; 34 import org.openstreetmap.josm.tools.PlatformManager; 35 import org.openstreetmap.josm.tools.Utils; 30 36 31 37 /** 32 * OpenJFX plugin brings OpenJFX (JavaFX) to other plugins.38 * JavaFX plugin brings OpenJFX (JavaFX) to other plugins. 33 39 */ 34 40 abstract class JavaFxPlugin extends Plugin { … … 38 44 * @param info plugin info 39 45 * @param ext native libraries extension 40 * @param orderedNativeLibraries native librari res that must be loaded in this order46 * @param orderedNativeLibraries native libraries that must be loaded in this order 41 47 */ 42 48 protected JavaFxPlugin(PluginInformation info, String ext, List<String> orderedNativeLibraries) { 43 49 super(info); 50 boolean isJavaFx = Utils.getSystemProperty("javafx.runtime.version") != null || ("Oracle Corporation".equals(Utils.getSystemProperty("java.vendor")) && Utils.getJavaVersion() < 11); 51 if (!isJavaFx && Utils.getJavaVersion() >= 10) { 52 extractNativeLibs(ext); 53 loadNativeLibs(ext, orderedNativeLibraries); 54 } else if (!isJavaFx) { 55 Logging.error("JavaFX is not available"); 56 StringBuilder message = new StringBuilder(tr("JavaFX is not available.")); 57 PlatformManager.getPlatform(); 58 if (PlatformManager.isPlatformUnixoid()) { 59 message.append(tr(" Please install OpenJFX through your package manager.")); 60 } else { 61 message.append(tr(" Please update to Java 11+.")); 62 } 63 if (PluginHandler.confirmDisablePlugin(MainApplication.getMainFrame(), message.toString(), info.getName())) { 64 PluginHandler.removePlugins(Collections.singletonList(info)); 65 } 66 return; 67 } 44 68 AudioPlayer.setSoundPlayerClass(JavaFxMediaPlayer.class); 45 extractNativeLibs(ext);46 loadNativeLibs(ext, orderedNativeLibraries);47 69 } 48 70
Note:
See TracChangeset
for help on using the changeset viewer.