[geotk] Need some help to work with geotoolkit-pending module
theuns
theunsheydenrych at gmail.com
Mon Aug 24 10:22:08 EDT 2009
HI Sunish
I have used the the widget for a while now.
I compile the geotoolit-pending library with mvn install
-Dmaven.test.skip
After a successful build i use the widget in a JFrame as follows.
The code below will not necessary compile because i copied it out
quickly from my current project.
The the the usage idea is there.
Hope it helps.
public class TestFrame extends javax.swing.JFrame {
//Map widget stuff
private JMap2D mapWidget;
private MapContext contextSA =
ContextBuilder.buildSouthAfricaContext();
public TestFrame() {
setTitle("Test Frame");
mapWidget = new JMap2D();
mapWidget.getContainer().setContext(contextSA);
mapWidget.getCanvas().setRenderingHint(GO2Hints.KEY_MULTI_THREAD,
GO2Hints.MULTI_THREAD_OFF);
mapWidget.getCanvas().setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
mapWidget.getCanvas().getController().setAutoRepaint(true);
add(mapWidget) ;
...
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException ex) {
Logger.getLogger(UserOverlayFrame.class.getName()).log(Level.SEVERE,
null, ex);
} catch (InstantiationException ex) {
Logger.getLogger(UserOverlayFrame.class.getName()).log(Level.SEVERE,
null, ex);
} catch (IllegalAccessException ex) {
Logger.getLogger(UserOverlayFrame.class.getName()).log(Level.SEVERE,
null, ex);
} catch (UnsupportedLookAndFeelException ex) {
Logger.getLogger(UserOverlayFrame.class.getName()).log(Level.SEVERE,
null, ex);
}
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new TestFrame().setVisible(true);
}
});
}
}
On Mon, 2009-08-24 at 16:06 +0530, suneesh kumar wrote:
> Hello,
>
> I was trying to add JMap2D to a JFrame. At some point of time I am
> getting the following error. It is unable to locate FilterFactory.
> Please help me in proceeding further. I compiled the pending module
> using command mvn -fn install.
> Will I have to add some other dependency jars?
>
> A descriptor is already registered against the name
> "org.geotoolkit.SilhouetteMask" under registry mode "rendered"
> Error in registry file at line number #33
> A descriptor is already registered against the name
> "org.geotoolkit.Mask" under registry mode "rendered"
> Exception in thread "AWT-EventQueue-0"
> java.lang.ExceptionInInitializerError
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:247)
> at sun.misc.Service$LazyIterator.next(Service.java:271)
> at
> org.geotoolkit.factory.FactoryRegistry.register(FactoryRegistry.java:900)
> at
> org.geotoolkit.factory.FactoryRegistry.scanForPlugins(FactoryRegistry.java:816)
> at
> org.geotoolkit.factory.FactoryRegistry.scanForPluginsIfNeeded(FactoryRegistry.java:866)
> at
> org.geotoolkit.factory.FactoryRegistry.getUnfilteredProviders(FactoryRegistry.java:291)
> at
> org.geotoolkit.factory.FactoryRegistry.getServiceImplementation(FactoryRegistry.java:544)
> at
> org.geotoolkit.factory.DynamicFactoryRegistry.getServiceImplementation(DynamicFactoryRegistry.java:326)
> at
> org.geotoolkit.factory.FactoryRegistry.getOrCreateServiceProvider(FactoryRegistry.java:452)
> at
> org.geotoolkit.factory.DynamicFactoryRegistry.getOrCreateServiceProvider(DynamicFactoryRegistry.java:167)
> at
> org.geotoolkit.factory.FactoryRegistry.getServiceProvider(FactoryRegistry.java:329)
> at
> org.geotoolkit.factory.FactoryFinder.getFactory(FactoryFinder.java:236)
> at
> org.geotoolkit.factory.FactoryFinder.getStyleFactory(FactoryFinder.java:696)
> at
> org.geotoolkit.display2d.GO2Utilities.<clinit>(GO2Utilities.java:135)
> at
> org.geotoolkit.display2d.container.ContextContainer2D.<clinit>(ContextContainer2D.java:73)
> at org..geotoolkit.gui.swing.go2.JMap2D.<init>(JMap2D.java:57)
> at org.geotoolkit.gui.swing.go2.JMap2D.<init>(JMap2D.java:49)
> at
> geotoolkittest.GeotoolkitTestView.<init>(GeotoolkitTestView.java:54)
> at
> geotoolkittest.GeotoolkitTestApp.startup(GeotoolkitTestApp.java:19)
> at org.jdesktop.application.Application
> $1.run(Application.java:171)
> at
> java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
> at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
> at
> java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
> at
> java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
> at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
> at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread..java:169)
> at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
> at
> java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
> Caused by: org.geotoolkit.factory.FactoryNotFoundException: No factory
> of kind "FilterFactory" found.
> at
> org.geotoolkit.factory.FactoryRegistry.getOrCreateServiceProvider(FactoryRegistry.java:471)
> at
> org.geotoolkit.factory.DynamicFactoryRegistry.getOrCreateServiceProvider(DynamicFactoryRegistry.java:167)
> at
> org..geotoolkit.factory.FactoryRegistry.getServiceProvider(FactoryRegistry.java:329)
> at
> org.geotoolkit.factory.FactoryFinder.getFactory(FactoryFinder.java:236)
> at
> org.geotoolkit.factory.FactoryFinder.getFilterFactory(FactoryFinder.java:666)
> at
> org.geotoolkit.style.DefaultStyleFactory.<clinit>(DefaultStyleFactory.java:107)
> ... 29 more
>
>
> Thanks in advance
> Sunish Kumar
>
>
>
> ______________________________________________________________________
> See the Web's breaking stories, chosen by people like you. Check out
> Yahoo! Buzz.
> _______________________________________________
> Geotoolkit mailing list
> Geotoolkit at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geotoolkit
More information about the Geotoolkit
mailing list