Changeset 31752 in osm


Ignore:
Timestamp:
2015-11-16T01:43:15+01:00 (9 years ago)
Author:
donvip
Message:

[josm_geotools] add missing jars and add additional manual JAI initialization

Location:
applications/editors/josm/plugins/geotools
Files:
6 added
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/geotools/.classpath

    r31742 r31752  
    7272        <classpathentry exported="true" kind="lib" path="lib/jdom-1.1.3.jar"/>
    7373        <classpathentry exported="true" kind="lib" path="lib/jsr-275-1.0-beta-2.jar"/>
     74        <classpathentry exported="true" kind="lib" path="lib/jt-colorconvert-1.0.6.jar"/>
    7475        <classpathentry exported="true" kind="lib" path="lib/jt-contour-1.4.0.jar"/>
    7576        <classpathentry exported="true" kind="lib" path="lib/jt-rangelookup-1.4.0.jar"/>
     77        <classpathentry exported="true" kind="lib" path="lib/jt-stats-1.0.6.jar"/>
     78        <classpathentry exported="true" kind="lib" path="lib/jt-utilities-1.0.6.jar"/>
    7679        <classpathentry exported="true" kind="lib" path="lib/jt-utils-1.4.0.jar"/>
    7780        <classpathentry exported="true" kind="lib" path="lib/jt-vectorbinarize-1.4.0.jar"/>
    7881        <classpathentry exported="true" kind="lib" path="lib/jt-vectorize-1.4.0.jar"/>
     82        <classpathentry exported="true" kind="lib" path="lib/jt-warp-1.0.6.jar"/>
     83        <classpathentry exported="true" kind="lib" path="lib/jt-zonal-1.0.6.jar"/>
    7984        <classpathentry exported="true" kind="lib" path="lib/jt-zonalstats-1.4.0.jar"/>
    8085        <classpathentry combineaccessrules="false" kind="src" path="/JOSM-jts"/>
  • applications/editors/josm/plugins/geotools/src/org/openstreetmap/josm/plugins/geotools/GeoToolsPlugin.java

    r30755 r31752  
    44import java.io.IOException;
    55import java.io.InputStream;
     6import java.util.Iterator;
     7import java.util.ServiceLoader;
    68
     9import javax.imageio.spi.IIORegistry;
     10import javax.imageio.spi.IIOServiceProvider;
    711import javax.media.jai.JAI;
    812import javax.media.jai.OperationRegistry;
     
    1317import org.openstreetmap.josm.Main;
    1418import org.openstreetmap.josm.plugins.Plugin;
     19import org.openstreetmap.josm.plugins.PluginHandler;
    1520import org.openstreetmap.josm.plugins.PluginInformation;
    1621
     
    6570            }
    6671        }
     72
     73        // Manual registering because plugin jar is not on application classpath
     74        IIORegistry ioRegistry = IIORegistry.getDefaultInstance();
     75        ClassLoader loader = PluginHandler.getPluginClassLoader();
     76
     77        Iterator<Class<?>> categories = ioRegistry.getCategories();
     78        while (categories.hasNext()) {
     79            @SuppressWarnings("unchecked")
     80            Iterator<IIOServiceProvider> riter = ServiceLoader.load((Class<IIOServiceProvider>)categories.next(), loader).iterator();
     81            while (riter.hasNext()) {
     82                ioRegistry.registerServiceProvider(riter.next());
     83            }
     84        }
    6785    }
    6886
Note: See TracChangeset for help on using the changeset viewer.