First working integration of field viewer in SLC RCP
authorMathieu Baudier <mbaudier@argeo.org>
Wed, 13 Oct 2010 10:41:36 +0000 (10:41 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Wed, 13 Oct 2010 10:41:36 +0000 (10:41 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@3841 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

32 files changed:
eclipse/plugins/org.argeo.slc.client.gis/.classpath [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.gis/.project [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.gis/.settings/org.eclipse.jdt.core.prefs [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.gis/META-INF/MANIFEST.MF [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.gis/META-INF/spring/gisclient-osgi.xml [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.gis/META-INF/spring/gisclient-views.xml [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.gis/build.properties [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.gis/icons/sample.gif [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.gis/plugin.xml [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.gis/src/main/java/org/argeo/slc/client/gis/ClientGisActivator.java [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.gis/src/main/java/org/argeo/slc/client/gis/GisPerspectiveFactory.java [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.gis/src/main/java/org/argeo/slc/client/gis/views/GeoToolsMapView.java [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.rcp/build.properties
eclipse/plugins/org.argeo.slc.client.rcp/plugin.xml
eclipse/plugins/org.argeo.slc.client.rcp/plugin_customization.ini [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.rcp/slc-client-rcp.product
eclipse/plugins/org.argeo.slc.client.rcp/src/org/argeo/slc/client/rcp/ApplicationWorkbenchWindowAdvisor.java
modules/gis/org.argeo.slc.gis.position.backend/.project [new file with mode: 0644]
modules/gis/org.argeo.slc.gis.position.backend/.settings/org.eclipse.pde.core.prefs [new file with mode: 0644]
modules/gis/org.argeo.slc.gis.position.backend/META-INF/MANIFEST.MF [new file with mode: 0644]
modules/gis/org.argeo.slc.gis.position.backend/META-INF/registryFile.jai [new file with mode: 0644]
modules/gis/org.argeo.slc.gis.position.backend/META-INF/spring/backend-osgi.xml [new file with mode: 0644]
modules/gis/org.argeo.slc.gis.position.backend/META-INF/spring/backend.xml [new file with mode: 0644]
modules/gis/org.argeo.slc.gis.position.backend/build.properties [new file with mode: 0644]
modules/gis/org.argeo.slc.gis.position.ui/.project [deleted file]
modules/gis/org.argeo.slc.gis.position.ui/.settings/org.eclipse.pde.core.prefs [deleted file]
modules/gis/org.argeo.slc.gis.position.ui/META-INF/MANIFEST.MF [deleted file]
modules/gis/org.argeo.slc.gis.position.ui/META-INF/registryFile.jai [deleted file]
modules/gis/org.argeo.slc.gis.position.ui/META-INF/spring/ui-osgi.xml [deleted file]
modules/gis/org.argeo.slc.gis.position.ui/META-INF/spring/ui.xml [deleted file]
modules/gis/org.argeo.slc.gis.position.ui/build.properties [deleted file]
runtime/org.argeo.slc.support.gis/src/main/java/org/argeo/slc/geotools/swing/GisFieldViewer.java

diff --git a/eclipse/plugins/org.argeo.slc.client.gis/.classpath b/eclipse/plugins/org.argeo.slc.client.gis/.classpath
new file mode 100644 (file)
index 0000000..92f19d2
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry kind="src" path="src/main/java"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/eclipse/plugins/org.argeo.slc.client.gis/.project b/eclipse/plugins/org.argeo.slc.client.gis/.project
new file mode 100644 (file)
index 0000000..f0dfed9
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.argeo.slc.client.gis</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
diff --git a/eclipse/plugins/org.argeo.slc.client.gis/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/org.argeo.slc.client.gis/.settings/org.eclipse.jdt.core.prefs
new file mode 100644 (file)
index 0000000..14c8f81
--- /dev/null
@@ -0,0 +1,8 @@
+#Wed Oct 13 08:00:18 CEST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/eclipse/plugins/org.argeo.slc.client.gis/META-INF/MANIFEST.MF b/eclipse/plugins/org.argeo.slc.client.gis/META-INF/MANIFEST.MF
new file mode 100644 (file)
index 0000000..5f4b240
--- /dev/null
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Gis
+Bundle-SymbolicName: org.argeo.slc.client.gis; singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.argeo.slc.client.gis.ClientGisActivator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.argeo.dep.osgi.jai.imageio;bundle-version="1.1.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Import-Package: org.argeo.eclipse.spring,
+ org.argeo.slc.geotools.swing;version="0.13.0.SNAPSHOT-r3817",
+ org.argeo.slc.jts;version="0.13.0.SNAPSHOT-r3817",
+ org.geotools.data,
+ org.springframework.osgi.util;version="1.2.1"
diff --git a/eclipse/plugins/org.argeo.slc.client.gis/META-INF/spring/gisclient-osgi.xml b/eclipse/plugins/org.argeo.slc.client.gis/META-INF/spring/gisclient-osgi.xml
new file mode 100644 (file)
index 0000000..5757bd3
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
+       xsi:schemaLocation="http://www.springframework.org/schema/osgi  \r
+       http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
+       http://www.springframework.org/schema/beans   \r
+       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
+\r
+       <reference id="positionProvider" interface="org.argeo.slc.jts.PositionProvider" />\r
+       \r
+       <reference id="postGisDataStore" interface="org.geotools.data.DataStore" />\r
+       <!--\r
+<service ref="postGisDataStore" interface="org.geotools.data.DataStore" />\r
+       <bundle id="geotools" symbolic-name="org.argeo.dep.osgi.geotools" />\r
+       <bundle id="jai.imageio" symbolic-name="org.argeo.dep.osgi.jai.imageio" />\r
+--></beans:beans>
\ No newline at end of file
diff --git a/eclipse/plugins/org.argeo.slc.client.gis/META-INF/spring/gisclient-views.xml b/eclipse/plugins/org.argeo.slc.client.gis/META-INF/spring/gisclient-views.xml
new file mode 100644 (file)
index 0000000..307115f
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
+       xmlns:osgi="http://www.springframework.org/schema/osgi"
+       xsi:schemaLocation="
+               http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd
+               http://www.springframework.org/schema/osgi  
+               http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd
+       ">
+
+       <bean id="org.argeo.slc.client.gis.mapView" class="org.argeo.slc.client.gis.views.GeoToolsMapView"
+               scope="prototype">
+               <property name="positionProvider" ref="positionProvider" />
+               <property name="postGisDataStore" ref="postGisDataStore" />
+               <property name="jaiImageIoClassLoader" ref="jai.imageio.bdClassLoader" />
+       </bean>
+
+       <bean id="jai.imageio.bdClassLoader"
+               class="org.springframework.osgi.util.BundleDelegatingClassLoader"
+               factory-method="createBundleClassLoaderFor">
+               <constructor-arg>
+                       <osgi:bundle symbolic-name="org.argeo.dep.osgi.jai.imageio" />
+               </constructor-arg>
+       </bean>
+
+</beans>
diff --git a/eclipse/plugins/org.argeo.slc.client.gis/build.properties b/eclipse/plugins/org.argeo.slc.client.gis/build.properties
new file mode 100644 (file)
index 0000000..8950055
--- /dev/null
@@ -0,0 +1,6 @@
+source.. = src/main/java/
+output.. = target/classes/
+bin.includes = plugin.xml,\
+               META-INF/,\
+               .,\
+               icons/
diff --git a/eclipse/plugins/org.argeo.slc.client.gis/icons/sample.gif b/eclipse/plugins/org.argeo.slc.client.gis/icons/sample.gif
new file mode 100644 (file)
index 0000000..34fb3c9
Binary files /dev/null and b/eclipse/plugins/org.argeo.slc.client.gis/icons/sample.gif differ
diff --git a/eclipse/plugins/org.argeo.slc.client.gis/plugin.xml b/eclipse/plugins/org.argeo.slc.client.gis/plugin.xml
new file mode 100644 (file)
index 0000000..b482a4d
--- /dev/null
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+   <extension
+         point="org.eclipse.ui.views">
+      <category
+            name="GIS"
+            id="org.argeo.slc.client.gis">
+      </category>
+      <view
+            name="Map"
+            icon="icons/sample.gif"
+            category="org.argeo.slc.client.gis"
+            class="org.argeo.eclipse.spring.SpringExtensionFactory"
+            id="org.argeo.slc.client.gis.mapView">
+      </view>
+   </extension>
+   <extension
+         point="org.eclipse.ui.perspectiveExtensions">
+      <perspectiveExtension
+            targetID="org.argeo.slc.client.gis.perspective">
+         <view
+               ratio="0.5"
+               relative="org.eclipse.ui.editorss"
+               relationship="right"
+               id="org.argeo.slc.client.gis.mapView">
+         </view>
+      </perspectiveExtension>
+   </extension>
+   <extension
+         point="org.eclipse.ui.perspectives">
+      <perspective
+            class="org.argeo.slc.client.gis.GisPerspectiveFactory"
+            id="org.argeo.slc.client.gis.perspective"
+            name="GIS">
+      </perspective>
+   </extension>
+
+</plugin>
diff --git a/eclipse/plugins/org.argeo.slc.client.gis/src/main/java/org/argeo/slc/client/gis/ClientGisActivator.java b/eclipse/plugins/org.argeo.slc.client.gis/src/main/java/org/argeo/slc/client/gis/ClientGisActivator.java
new file mode 100644 (file)
index 0000000..7c2d235
--- /dev/null
@@ -0,0 +1,61 @@
+package org.argeo.slc.client.gis;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class ClientGisActivator extends AbstractUIPlugin {
+
+       // The plug-in ID
+       public static final String PLUGIN_ID = "org.argeo.slc.client.gis"; //$NON-NLS-1$
+
+       // The shared instance
+       private static ClientGisActivator plugin;
+       
+       /**
+        * The constructor
+        */
+       public ClientGisActivator() {
+       }
+
+       /*
+        * (non-Javadoc)
+        * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+        */
+       public void start(BundleContext context) throws Exception {
+               super.start(context);
+               plugin = this;
+       }
+
+       /*
+        * (non-Javadoc)
+        * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+        */
+       public void stop(BundleContext context) throws Exception {
+               plugin = null;
+               super.stop(context);
+       }
+
+       /**
+        * Returns the shared instance
+        *
+        * @return the shared instance
+        */
+       public static ClientGisActivator getDefault() {
+               return plugin;
+       }
+
+       /**
+        * Returns an image descriptor for the image file at the given
+        * plug-in relative path
+        *
+        * @param path the path
+        * @return the image descriptor
+        */
+       public static ImageDescriptor getImageDescriptor(String path) {
+               return imageDescriptorFromPlugin(PLUGIN_ID, path);
+       }
+}
diff --git a/eclipse/plugins/org.argeo.slc.client.gis/src/main/java/org/argeo/slc/client/gis/GisPerspectiveFactory.java b/eclipse/plugins/org.argeo.slc.client.gis/src/main/java/org/argeo/slc/client/gis/GisPerspectiveFactory.java
new file mode 100644 (file)
index 0000000..c9de664
--- /dev/null
@@ -0,0 +1,19 @@
+package org.argeo.slc.client.gis;
+
+import org.eclipse.ui.IFolderLayout;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+
+public class GisPerspectiveFactory implements IPerspectiveFactory {
+
+       public void createInitialLayout(IPageLayout layout) {
+               String editorArea = layout.getEditorArea();
+               layout.setEditorAreaVisible(false);
+               layout.setFixed(false);
+
+               IFolderLayout topLeft = layout.createFolder("topLeft",
+                               IPageLayout.LEFT, 0.5f, editorArea);
+               topLeft.addView("org.argeo.slc.client.gis.mapView");
+       }
+
+}
diff --git a/eclipse/plugins/org.argeo.slc.client.gis/src/main/java/org/argeo/slc/client/gis/views/GeoToolsMapView.java b/eclipse/plugins/org.argeo.slc.client.gis/src/main/java/org/argeo/slc/client/gis/views/GeoToolsMapView.java
new file mode 100644 (file)
index 0000000..6a7bd02
--- /dev/null
@@ -0,0 +1,52 @@
+package org.argeo.slc.client.gis.views;
+
+import java.awt.Frame;
+
+import org.argeo.slc.geotools.swing.GisFieldViewer;
+import org.argeo.slc.jts.PositionProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.awt.SWT_AWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.part.ViewPart;
+import org.geotools.data.DataStore;
+
+public class GeoToolsMapView extends ViewPart {
+       public static final String ID = "org.argeo.slc.client.gis.views.GeoToolsMapView";
+
+       private Composite embedded;
+
+       private PositionProvider positionProvider;
+
+       private DataStore postGisDataStore;
+
+       private ClassLoader jaiImageIoClassLoader;
+
+       public void createPartControl(Composite parent) {
+               embedded = new Composite(parent, SWT.EMBEDDED | SWT.NO_BACKGROUND);
+               Frame frame = SWT_AWT.new_Frame(embedded);
+
+               GisFieldViewer gisFieldViewer = new GisFieldViewer(frame);
+               gisFieldViewer.setPostGisDataStore(postGisDataStore);
+               gisFieldViewer.setPositionProvider(positionProvider);
+               gisFieldViewer.setJaiImageIoClassLoader(jaiImageIoClassLoader);
+               gisFieldViewer.afterPropertiesSet();
+       }
+
+       public void setFocus() {
+               if (embedded != null)
+                       embedded.setFocus();
+       }
+
+       public void setPositionProvider(PositionProvider positionProvider) {
+               this.positionProvider = positionProvider;
+       }
+
+       public void setPostGisDataStore(DataStore postGisDataStore) {
+               this.postGisDataStore = postGisDataStore;
+       }
+
+       public void setJaiImageIoClassLoader(ClassLoader jaiImageIoClassLoader) {
+               this.jaiImageIoClassLoader = jaiImageIoClassLoader;
+       }
+
+}
\ No newline at end of file
index 8923d2306c2c5093384540561d0813ff34d98ff7..8b65761d0761cfc503dfcb8dfecb9edb758db20a 100644 (file)
@@ -4,4 +4,5 @@ bin.includes = plugin.xml,\
                META-INF/,\
                .,\
                icons/,\
-               splash.bmp
+               splash.bmp,\
+               plugin_customization.ini
index be1a9c1a143b31f099d453a585dc74ed169bd3a1..b7ce60120baa93a27477bf4e9a8125302b23fb37 100644 (file)
             id="org.argeo.slc.client.rcp.perspective">
       </perspective>
    </extension>
-   <extension
-         id="org.argeo.slc.client.rcp.product"
-         point="org.eclipse.core.runtime.products">
-      <product
-            application="org.argeo.slc.client.rcp.application"
-            name="SLC">
-         <property
-               name="windowImages"
-               value="icons/argeo-icon-256.png">
-         </property>
-         <property
-               name="appName"
-               value="SLC">
-         </property>
-      </product>
-   </extension>
    <extension
          point="org.eclipse.ui.menus">
       <menuContribution
                name="appName"
                value="SLC">
          </property>
+         <property
+               name="preferenceCustomization"
+               value="plugin_customization.ini">
+         </property>
       </product>
    </extension>
    <!-- <extension
diff --git a/eclipse/plugins/org.argeo.slc.client.rcp/plugin_customization.ini b/eclipse/plugins/org.argeo.slc.client.rcp/plugin_customization.ini
new file mode 100644 (file)
index 0000000..ed3f69f
--- /dev/null
@@ -0,0 +1,5 @@
+org.eclipse.ui/DOCK_PERSPECTIVE_BAR=topRight
+org.eclipse.ui/SHOW_TEXT_ON_PERSPECTIVE_BAR=false
+org.eclipse.ui/PERSPECTIVE_BAR_SIZE=100
+org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=true
+org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP = false
index 5f944ad345a704a5748b1ed5ef1b4447be75cae4..abb73be76519276b395656e6d725d989e64e47b5 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?pde version="3.5"?>
 
-<product name="SLC" id="org.argeo.slc.client.rcp.product" application="org.argeo.slc.client.rcp.application" version="1.0.0.qualifier" useFeatures="false" includeLaunchers="true">
+<product name="SLC" uid="org.argeo.slc.client.rcp.product" id="org.argeo.slc.client.rcp.product" application="org.argeo.slc.client.rcp.application" version="1.0.0.qualifier" useFeatures="false" includeLaunchers="true">
 
    <configIni use="default">
    </configIni>
@@ -42,6 +42,8 @@
       <plugin id="com.springsource.javax.jms"/>
       <plugin id="com.springsource.javax.mail"/>
       <plugin id="com.springsource.javax.management.j2ee"/>
+      <plugin id="com.springsource.javax.media.jai.codec"/>
+      <plugin id="com.springsource.javax.media.jai.core"/>
       <plugin id="com.springsource.javax.persistence"/>
       <plugin id="com.springsource.javax.resource"/>
       <plugin id="com.springsource.javax.servlet"/>
       <plugin id="org.argeo.dep.osgi.activemq.optional" fragment="true"/>
       <plugin id="org.argeo.dep.osgi.commons.exec"/>
       <plugin id="org.argeo.dep.osgi.directory.shared.asn.codec" fragment="true"/>
+      <plugin id="org.argeo.dep.osgi.geoapi"/>
+      <plugin id="org.argeo.dep.osgi.geotools"/>
+      <plugin id="org.argeo.dep.osgi.jai.imageio"/>
+      <plugin id="org.argeo.dep.osgi.java3d"/>
+      <plugin id="org.argeo.dep.osgi.jsr275"/>
+      <plugin id="org.argeo.dep.osgi.jts"/>
       <plugin id="org.argeo.dep.osgi.maven.embedder"/>
       <plugin id="org.argeo.dep.osgi.mina.filter.ssl" fragment="true"/>
       <plugin id="org.argeo.dep.osgi.springframework.ldap"/>
       <plugin id="org.argeo.eclipse.ui"/>
-      <plugin id="org.argeo.infra.core" fragment=""/>
+      <plugin id="org.argeo.infra.core"/>
       <plugin id="org.argeo.infra.security.services" fragment="true"/>
       <plugin id="org.argeo.security.core"/>
       <plugin id="org.argeo.security.manager.ldap"/>
       <plugin id="org.argeo.slc.agent.ext.xalan" fragment="true"/>
       <plugin id="org.argeo.slc.client.agent"/>
       <plugin id="org.argeo.slc.client.core"/>
+      <plugin id="org.argeo.slc.client.gis"/>
       <plugin id="org.argeo.slc.client.hibernate"/>
       <plugin id="org.argeo.slc.client.rcp"/>
       <plugin id="org.argeo.slc.client.ui"/>
       <plugin id="org.argeo.slc.demo.log4j" fragment="true"/>
       <plugin id="org.argeo.slc.detached"/>
       <plugin id="org.argeo.slc.ext.activemq" fragment="true"/>
+      <plugin id="org.argeo.slc.gis.ext.dbcp" fragment="true"/>
+      <plugin id="org.argeo.slc.gis.position.backend"/>
+      <plugin id="org.argeo.slc.gis.position.gpsbabel"/>
       <plugin id="org.argeo.slc.server"/>
       <plugin id="org.argeo.slc.server.h2"/>
       <plugin id="org.argeo.slc.server.hibernate"/>
       <plugin id="org.argeo.slc.support.activemq"/>
       <plugin id="org.argeo.slc.support.ant"/>
       <plugin id="org.argeo.slc.support.castor" fragment="true"/>
+      <plugin id="org.argeo.slc.support.gis"/>
       <plugin id="org.argeo.slc.support.hibernate" fragment="true"/>
       <plugin id="org.argeo.slc.support.maven" fragment="true"/>
       <plugin id="org.argeo.slc.support.osgi"/>
       <plugin id="org.argeo.security.services" autoStart="true" startLevel="0" />
       <plugin id="org.argeo.slc.agent" autoStart="true" startLevel="0" />
       <plugin id="org.argeo.slc.client.agent" autoStart="true" startLevel="0" />
+      <plugin id="org.argeo.slc.client.gis" autoStart="true" startLevel="0" />
       <plugin id="org.argeo.slc.client.hibernate" autoStart="true" startLevel="0" />
       <plugin id="org.argeo.slc.client.ui" autoStart="true" startLevel="0" />
       <plugin id="org.argeo.slc.demo.ant" autoStart="true" startLevel="0" />
       <plugin id="org.argeo.slc.demo.basic" autoStart="true" startLevel="0" />
+      <plugin id="org.argeo.slc.gis.position.backend" autoStart="true" startLevel="0" />
+      <plugin id="org.argeo.slc.gis.position.gpsbabel" autoStart="true" startLevel="0" />
       <plugin id="org.argeo.slc.server.h2" autoStart="true" startLevel="0" />
       <plugin id="org.argeo.slc.server.hibernate" autoStart="true" startLevel="0" />
       <plugin id="org.argeo.slc.server.services" autoStart="true" startLevel="0" />
index 2d78e0b231f06a61e8cd09d28764690391d0022b..cda5efc3c6ee6094d49ac78078486713014ee03e 100644 (file)
@@ -34,7 +34,8 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
                IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
                configurer.setInitialSize(new Point(1024, 800));
                configurer.setShowCoolBar(true);
-               configurer.setShowStatusLine(false);
+               configurer.setShowStatusLine(true);
+               configurer.setShowPerspectiveBar(true);
        }
 
        public void postWindowOpen() {
diff --git a/modules/gis/org.argeo.slc.gis.position.backend/.project b/modules/gis/org.argeo.slc.gis.position.backend/.project
new file mode 100644 (file)
index 0000000..7435128
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.argeo.slc.gis.position.backend</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+       </natures>
+</projectDescription>
diff --git a/modules/gis/org.argeo.slc.gis.position.backend/.settings/org.eclipse.pde.core.prefs b/modules/gis/org.argeo.slc.gis.position.backend/.settings/org.eclipse.pde.core.prefs
new file mode 100644 (file)
index 0000000..3ef6632
--- /dev/null
@@ -0,0 +1,4 @@
+#Fri May 07 16:28:04 CEST 2010
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/modules/gis/org.argeo.slc.gis.position.backend/META-INF/MANIFEST.MF b/modules/gis/org.argeo.slc.gis.position.backend/META-INF/MANIFEST.MF
new file mode 100644 (file)
index 0000000..861c3e9
--- /dev/null
@@ -0,0 +1,14 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Ui
+Bundle-SymbolicName: org.argeo.slc.gis.position.backend
+Bundle-Version: 1.0.0.qualifier
+Import-Package: org.apache.commons.dbcp;version="1.2.2.osgi",
+ org.argeo.slc.core.deploy;version="0.12.2.SNAPSHOT-r3503",
+ org.argeo.slc.geotools;version="0.12.2.SNAPSHOT-r3562",
+ org.argeo.slc.geotools.swing;version="0.12.2.SNAPSHOT-r3565",
+ org.argeo.slc.jts;version="0.12.2.SNAPSHOT-r3562",
+ org.geotools.data,
+ org.geotools.data.postgis,
+ org.geotools.jdbc,
+ org.springframework.osgi.util;version="1.2.1"
diff --git a/modules/gis/org.argeo.slc.gis.position.backend/META-INF/registryFile.jai b/modules/gis/org.argeo.slc.gis.position.backend/META-INF/registryFile.jai
new file mode 100644 (file)
index 0000000..76e43bb
--- /dev/null
@@ -0,0 +1,225 @@
+#
+# The registry file for Geotools Grid Coverage implementation. This file should be automatically
+# parsed by JAI under initialization. If it is not, then Registry.registerServices(...) can parse
+# it. This may happen if this file is unreachable from the JAI class loader.
+#
+# If this file is updated, remember to update Registry.registerServices(...) accordingly.
+#
+# Version: $Id: registryFile.jai 34781 2010-01-13 11:56:07Z simonegiannecchini $
+#
+##################################################################################################
+#
+# Each line can be in one of the formats described below. Space or tab characters separate
+# keywords in each line. The comment character is '#'; on each line all characters following
+# the first comment character are ignored. The file must be encoded in UTF-8.
+#
+# 1. To register descriptors :
+#
+#      descriptor <descriptor-class-name>
+#
+# 2. To register factory objects under a product against a specific mode :
+#
+#      <registry-mode-name>  <factory-class-name>  <product-name>  <descriptor-name>  <local-name>
+#
+#    The <local-name> is (only) used later on in this file to set preferences
+#    between factory objects, if wanted.
+#
+##################################################################################################
+#
+# Image operation descriptors :
+#
+descriptor  org.geotools.image.jai.CombineDescriptor
+descriptor  org.geotools.image.jai.HysteresisDescriptor
+descriptor  org.geotools.image.jai.NodataFilterDescriptor
+descriptor  org.geotools.image.palette.ColorReductionDescriptor
+descriptor  org.geotools.image.palette.ColorInversionDescriptor
+
+
+#
+# "rendered" factory objects
+#
+rendered  org.geotools.image.jai.CombineCRIF                   org.geotools  org.geotools.Combine       Combine
+rendered  org.geotools.image.jai.HysteresisCRIF                org.geotools  org.geotools.Hysteresis    Hysteresis
+rendered  org.geotools.image.jai.NodataFilterCRIF              org.geotools  org.geotools.NodataFilter  NodataFilter
+rendered  org.geotools.image.palette.ColorReductionCRIF        org.geotools  org.geotools.ColorReduction ColorReduction
+rendered  org.geotools.image.palette.ColorInversionCRIF        org.geotools  org.geotools.ColorInversion ColorInversion
+#
+# The registry file for Geotools Grid Coverage implementation. This file should be automatically
+# parsed by JAI under initialization. If it is not, then Registry.registerServices(...) can parse
+# it. This may happen if this file is unreachable from the JAI class loader.
+#
+# If this file is updated, remember to update Registry.registerServices(...) accordingly.
+#
+# Version: $Id: registryFile.jai 34781 2010-01-13 11:56:07Z simonegiannecchini $
+#
+##################################################################################################
+#
+# Each line can be in one of the formats described below. Space or tab characters separate
+# keywords in each line. The comment character is '#'; on each line all characters following
+# the first comment character are ignored. The file must be encoded in UTF-8.
+#
+# 1. To register descriptors :
+#
+#      descriptor <descriptor-class-name>
+#
+# 2. To register factory objects under a product against a specific mode :
+#
+#      <registry-mode-name>  <factory-class-name>  <product-name>  <descriptor-name>  <local-name>
+#
+#    The <local-name> is (only) used later on in this file to set preferences
+#    between factory objects, if wanted.
+#
+##################################################################################################
+#
+# Image operation descriptors :
+#
+descriptor  org.geotools.image.jai.CombineDescriptor
+descriptor  org.geotools.image.jai.HysteresisDescriptor
+descriptor  org.geotools.image.jai.NodataFilterDescriptor
+descriptor  org.geotools.image.palette.ColorReductionDescriptor
+descriptor  org.geotools.image.palette.ColorInversionDescriptor
+
+
+#
+# "rendered" factory objects
+#
+rendered  org.geotools.image.jai.CombineCRIF                   org.geotools  org.geotools.Combine       Combine
+rendered  org.geotools.image.jai.HysteresisCRIF                org.geotools  org.geotools.Hysteresis    Hysteresis
+rendered  org.geotools.image.jai.NodataFilterCRIF              org.geotools  org.geotools.NodataFilter  NodataFilter
+rendered  org.geotools.image.palette.ColorReductionCRIF        org.geotools  org.geotools.ColorReduction ColorReduction
+rendered  org.geotools.image.palette.ColorInversionCRIF        org.geotools  org.geotools.ColorInversion ColorInversion
+#
+# The registry file for Geotools Grid Coverage implementation. This file should be automatically
+# parsed by JAI under initialization. If it is not, then Registry.registerServices(...) can parse
+# it. This may happen if this file is unreachable from the JAI class loader.
+#
+# If this file is updated, remember to update Registry.registerServices(...) accordingly.
+#
+# Version: $Id: registryFile.jai 34781 2010-01-13 11:56:07Z simonegiannecchini $
+#
+##################################################################################################
+#
+# Each line can be in one of the formats described below. Space or tab characters separate
+# keywords in each line. The comment character is '#'; on each line all characters following
+# the first comment character are ignored. The file must be encoded in UTF-8.
+#
+# 1. To register descriptors :
+#
+#      descriptor <descriptor-class-name>
+#
+# 2. To register factory objects under a product against a specific mode :
+#
+#      <registry-mode-name>  <factory-class-name>  <product-name>  <descriptor-name>  <local-name>
+#
+#    The <local-name> is (only) used later on in this file to set preferences
+#    between factory objects, if wanted.
+#
+##################################################################################################
+#
+# Image operation descriptors :
+#
+descriptor  org.geotools.image.jai.CombineDescriptor
+descriptor  org.geotools.image.jai.HysteresisDescriptor
+descriptor  org.geotools.image.jai.NodataFilterDescriptor
+descriptor  org.geotools.image.palette.ColorReductionDescriptor
+descriptor  org.geotools.image.palette.ColorInversionDescriptor
+
+
+#
+# "rendered" factory objects
+#
+rendered  org.geotools.image.jai.CombineCRIF                   org.geotools  org.geotools.Combine       Combine
+rendered  org.geotools.image.jai.HysteresisCRIF                org.geotools  org.geotools.Hysteresis    Hysteresis
+rendered  org.geotools.image.jai.NodataFilterCRIF              org.geotools  org.geotools.NodataFilter  NodataFilter
+rendered  org.geotools.image.palette.ColorReductionCRIF        org.geotools  org.geotools.ColorReduction ColorReduction
+rendered  org.geotools.image.palette.ColorInversionCRIF        org.geotools  org.geotools.ColorInversion ColorInversion
+#
+# The registry file for Geotools Grid Coverage implementation. This file should be automatically
+# parsed by JAI under initialization. If it is not, then Registry.registerServices(...) can parse
+# it. This may happen if this file is unreachable from the JAI class loader.
+#
+# If this file is updated, remember to update Registry.registerServices(...) accordingly.
+#
+# Version: $Id: registryFile.jai 34781 2010-01-13 11:56:07Z simonegiannecchini $
+#
+##################################################################################################
+#
+# Each line can be in one of the formats described below. Space or tab characters separate
+# keywords in each line. The comment character is '#'; on each line all characters following
+# the first comment character are ignored. The file must be encoded in UTF-8.
+#
+# 1. To register descriptors :
+#
+#      descriptor <descriptor-class-name>
+#
+# 2. To register factory objects under a product against a specific mode :
+#
+#      <registry-mode-name>  <factory-class-name>  <product-name>  <descriptor-name>  <local-name>
+#
+#    The <local-name> is (only) used later on in this file to set preferences
+#    between factory objects, if wanted.
+#
+##################################################################################################
+#
+# Image operation descriptors :
+#
+descriptor  org.geotools.image.jai.CombineDescriptor
+descriptor  org.geotools.image.jai.HysteresisDescriptor
+descriptor  org.geotools.image.jai.NodataFilterDescriptor
+descriptor  org.geotools.image.palette.ColorReductionDescriptor
+descriptor  org.geotools.image.palette.ColorInversionDescriptor
+
+
+#
+# "rendered" factory objects
+#
+rendered  org.geotools.image.jai.CombineCRIF                   org.geotools  org.geotools.Combine       Combine
+rendered  org.geotools.image.jai.HysteresisCRIF                org.geotools  org.geotools.Hysteresis    Hysteresis
+rendered  org.geotools.image.jai.NodataFilterCRIF              org.geotools  org.geotools.NodataFilter  NodataFilter
+rendered  org.geotools.image.palette.ColorReductionCRIF        org.geotools  org.geotools.ColorReduction ColorReduction
+rendered  org.geotools.image.palette.ColorInversionCRIF        org.geotools  org.geotools.ColorInversion ColorInversion
+#
+# The registry file for Geotools Grid Coverage implementation. This file should be automatically
+# parsed by JAI under initialization. If it is not, then Registry.registerServices(...) can parse
+# it. This may happen if this file is unreachable from the JAI class loader.
+#
+# If this file is updated, remember to update Registry.registerServices(...) accordingly.
+#
+# Version: $Id: registryFile.jai 34781 2010-01-13 11:56:07Z simonegiannecchini $
+#
+##################################################################################################
+#
+# Each line can be in one of the formats described below. Space or tab characters separate
+# keywords in each line. The comment character is '#'; on each line all characters following
+# the first comment character are ignored. The file must be encoded in UTF-8.
+#
+# 1. To register descriptors :
+#
+#      descriptor <descriptor-class-name>
+#
+# 2. To register factory objects under a product against a specific mode :
+#
+#      <registry-mode-name>  <factory-class-name>  <product-name>  <descriptor-name>  <local-name>
+#
+#    The <local-name> is (only) used later on in this file to set preferences
+#    between factory objects, if wanted.
+#
+##################################################################################################
+#
+# Image operation descriptors :
+#
+descriptor  org.geotools.image.jai.CombineDescriptor
+descriptor  org.geotools.image.jai.HysteresisDescriptor
+descriptor  org.geotools.image.jai.NodataFilterDescriptor
+descriptor  org.geotools.image.palette.ColorReductionDescriptor
+descriptor  org.geotools.image.palette.ColorInversionDescriptor
+
+
+#
+# "rendered" factory objects
+#
+rendered  org.geotools.image.jai.CombineCRIF                   org.geotools  org.geotools.Combine       Combine
+rendered  org.geotools.image.jai.HysteresisCRIF                org.geotools  org.geotools.Hysteresis    Hysteresis
+rendered  org.geotools.image.jai.NodataFilterCRIF              org.geotools  org.geotools.NodataFilter  NodataFilter
+rendered  org.geotools.image.palette.ColorReductionCRIF        org.geotools  org.geotools.ColorReduction ColorReduction
+rendered  org.geotools.image.palette.ColorInversionCRIF        org.geotools  org.geotools.ColorInversion ColorInversion
diff --git a/modules/gis/org.argeo.slc.gis.position.backend/META-INF/spring/backend-osgi.xml b/modules/gis/org.argeo.slc.gis.position.backend/META-INF/spring/backend-osgi.xml
new file mode 100644 (file)
index 0000000..59b3754
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
+       xsi:schemaLocation="http://www.springframework.org/schema/osgi  \r
+       http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
+       http://www.springframework.org/schema/beans   \r
+       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
+\r
+       <service ref="postGisDataStore" interface="org.geotools.data.DataStore" />\r
+</beans:beans>
\ No newline at end of file
diff --git a/modules/gis/org.argeo.slc.gis.position.backend/META-INF/spring/backend.xml b/modules/gis/org.argeo.slc.gis.position.backend/META-INF/spring/backend.xml
new file mode 100644 (file)
index 0000000..db78299
--- /dev/null
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+       xmlns:p="http://www.springframework.org/schema/p" xmlns:util="http://www.springframework.org/schema/util"\r
+       xsi:schemaLocation="\r
+       http://www.springframework.org/schema/beans\r
+       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\r
+       http://www.springframework.org/schema/util \r
+       http://www.springframework.org/schema/util/spring-util-2.5.xsd\r
+    ">\r
+\r
+\r
+       <bean id="postGisDataStore" factory-bean="postGisDataStoreFactory"\r
+               factory-method="createDataStore">\r
+               <constructor-arg>\r
+                       <map>\r
+                               <!-- Cannot access the .key property, wait for Spring 3.0 to do it properly \r
+                                       <entry key-ref="JDBCDataStore.DATASOURCE" value-ref="dataSource" /> -->\r
+                                       <entry key="Data Source" value-ref="dataSource" />\r
+                       </map>\r
+               </constructor-arg>\r
+       </bean>\r
+\r
+       <util:constant id="JDBCDataStore.DATASOURCE"\r
+               static-field="org.geotools.jdbc.JDBCDataStoreFactory.DATASOURCE" />\r
+\r
+       <bean id="postGisDataStoreFactory" class="org.geotools.data.postgis.PostgisNGDataStoreFactory"></bean>\r
+\r
+       <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"\r
+               destroy-method="close">\r
+               <property name="driverClassName" value="org.postgresql.Driver" />\r
+               <property name="url" value="jdbc:postgresql://air/test_berlin" />\r
+               <property name="username" value="argeo" />\r
+               <property name="password" value="argeo" />\r
+               <property name="testOnBorrow" value="true" />\r
+               <property name="validationQuery" value="SELECT 1" />\r
+               <property name="maxActive" value="10" />\r
+               <property name="maxIdle" value="2" />\r
+       </bean>\r
+\r
+</beans>
\ No newline at end of file
diff --git a/modules/gis/org.argeo.slc.gis.position.backend/build.properties b/modules/gis/org.argeo.slc.gis.position.backend/build.properties
new file mode 100644 (file)
index 0000000..5f22cdd
--- /dev/null
@@ -0,0 +1 @@
+bin.includes = META-INF/
diff --git a/modules/gis/org.argeo.slc.gis.position.ui/.project b/modules/gis/org.argeo.slc.gis.position.ui/.project
deleted file mode 100644 (file)
index 19e593f..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>org.argeo.slc.gis.position.ui</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.pde.ManifestBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.SchemaBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>org.eclipse.pde.PluginNature</nature>
-       </natures>
-</projectDescription>
diff --git a/modules/gis/org.argeo.slc.gis.position.ui/.settings/org.eclipse.pde.core.prefs b/modules/gis/org.argeo.slc.gis.position.ui/.settings/org.eclipse.pde.core.prefs
deleted file mode 100644 (file)
index 3ef6632..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#Fri May 07 16:28:04 CEST 2010
-eclipse.preferences.version=1
-pluginProject.extensions=false
-resolve.requirebundle=false
diff --git a/modules/gis/org.argeo.slc.gis.position.ui/META-INF/MANIFEST.MF b/modules/gis/org.argeo.slc.gis.position.ui/META-INF/MANIFEST.MF
deleted file mode 100644 (file)
index 8ecfab8..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Ui
-Bundle-SymbolicName: org.argeo.slc.gis.position.ui
-Bundle-Version: 1.0.0.qualifier
-Import-Package: org.apache.commons.dbcp;version="1.2.2.osgi",
- org.argeo.slc.core.deploy;version="0.12.2.SNAPSHOT-r3503",
- org.argeo.slc.geotools;version="0.12.2.SNAPSHOT-r3562",
- org.argeo.slc.geotools.swing;version="0.12.2.SNAPSHOT-r3565",
- org.argeo.slc.jts;version="0.12.2.SNAPSHOT-r3562",
- org.springframework.osgi.util;version="1.2.1"
diff --git a/modules/gis/org.argeo.slc.gis.position.ui/META-INF/registryFile.jai b/modules/gis/org.argeo.slc.gis.position.ui/META-INF/registryFile.jai
deleted file mode 100644 (file)
index 76e43bb..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-#
-# The registry file for Geotools Grid Coverage implementation. This file should be automatically
-# parsed by JAI under initialization. If it is not, then Registry.registerServices(...) can parse
-# it. This may happen if this file is unreachable from the JAI class loader.
-#
-# If this file is updated, remember to update Registry.registerServices(...) accordingly.
-#
-# Version: $Id: registryFile.jai 34781 2010-01-13 11:56:07Z simonegiannecchini $
-#
-##################################################################################################
-#
-# Each line can be in one of the formats described below. Space or tab characters separate
-# keywords in each line. The comment character is '#'; on each line all characters following
-# the first comment character are ignored. The file must be encoded in UTF-8.
-#
-# 1. To register descriptors :
-#
-#      descriptor <descriptor-class-name>
-#
-# 2. To register factory objects under a product against a specific mode :
-#
-#      <registry-mode-name>  <factory-class-name>  <product-name>  <descriptor-name>  <local-name>
-#
-#    The <local-name> is (only) used later on in this file to set preferences
-#    between factory objects, if wanted.
-#
-##################################################################################################
-#
-# Image operation descriptors :
-#
-descriptor  org.geotools.image.jai.CombineDescriptor
-descriptor  org.geotools.image.jai.HysteresisDescriptor
-descriptor  org.geotools.image.jai.NodataFilterDescriptor
-descriptor  org.geotools.image.palette.ColorReductionDescriptor
-descriptor  org.geotools.image.palette.ColorInversionDescriptor
-
-
-#
-# "rendered" factory objects
-#
-rendered  org.geotools.image.jai.CombineCRIF                   org.geotools  org.geotools.Combine       Combine
-rendered  org.geotools.image.jai.HysteresisCRIF                org.geotools  org.geotools.Hysteresis    Hysteresis
-rendered  org.geotools.image.jai.NodataFilterCRIF              org.geotools  org.geotools.NodataFilter  NodataFilter
-rendered  org.geotools.image.palette.ColorReductionCRIF        org.geotools  org.geotools.ColorReduction ColorReduction
-rendered  org.geotools.image.palette.ColorInversionCRIF        org.geotools  org.geotools.ColorInversion ColorInversion
-#
-# The registry file for Geotools Grid Coverage implementation. This file should be automatically
-# parsed by JAI under initialization. If it is not, then Registry.registerServices(...) can parse
-# it. This may happen if this file is unreachable from the JAI class loader.
-#
-# If this file is updated, remember to update Registry.registerServices(...) accordingly.
-#
-# Version: $Id: registryFile.jai 34781 2010-01-13 11:56:07Z simonegiannecchini $
-#
-##################################################################################################
-#
-# Each line can be in one of the formats described below. Space or tab characters separate
-# keywords in each line. The comment character is '#'; on each line all characters following
-# the first comment character are ignored. The file must be encoded in UTF-8.
-#
-# 1. To register descriptors :
-#
-#      descriptor <descriptor-class-name>
-#
-# 2. To register factory objects under a product against a specific mode :
-#
-#      <registry-mode-name>  <factory-class-name>  <product-name>  <descriptor-name>  <local-name>
-#
-#    The <local-name> is (only) used later on in this file to set preferences
-#    between factory objects, if wanted.
-#
-##################################################################################################
-#
-# Image operation descriptors :
-#
-descriptor  org.geotools.image.jai.CombineDescriptor
-descriptor  org.geotools.image.jai.HysteresisDescriptor
-descriptor  org.geotools.image.jai.NodataFilterDescriptor
-descriptor  org.geotools.image.palette.ColorReductionDescriptor
-descriptor  org.geotools.image.palette.ColorInversionDescriptor
-
-
-#
-# "rendered" factory objects
-#
-rendered  org.geotools.image.jai.CombineCRIF                   org.geotools  org.geotools.Combine       Combine
-rendered  org.geotools.image.jai.HysteresisCRIF                org.geotools  org.geotools.Hysteresis    Hysteresis
-rendered  org.geotools.image.jai.NodataFilterCRIF              org.geotools  org.geotools.NodataFilter  NodataFilter
-rendered  org.geotools.image.palette.ColorReductionCRIF        org.geotools  org.geotools.ColorReduction ColorReduction
-rendered  org.geotools.image.palette.ColorInversionCRIF        org.geotools  org.geotools.ColorInversion ColorInversion
-#
-# The registry file for Geotools Grid Coverage implementation. This file should be automatically
-# parsed by JAI under initialization. If it is not, then Registry.registerServices(...) can parse
-# it. This may happen if this file is unreachable from the JAI class loader.
-#
-# If this file is updated, remember to update Registry.registerServices(...) accordingly.
-#
-# Version: $Id: registryFile.jai 34781 2010-01-13 11:56:07Z simonegiannecchini $
-#
-##################################################################################################
-#
-# Each line can be in one of the formats described below. Space or tab characters separate
-# keywords in each line. The comment character is '#'; on each line all characters following
-# the first comment character are ignored. The file must be encoded in UTF-8.
-#
-# 1. To register descriptors :
-#
-#      descriptor <descriptor-class-name>
-#
-# 2. To register factory objects under a product against a specific mode :
-#
-#      <registry-mode-name>  <factory-class-name>  <product-name>  <descriptor-name>  <local-name>
-#
-#    The <local-name> is (only) used later on in this file to set preferences
-#    between factory objects, if wanted.
-#
-##################################################################################################
-#
-# Image operation descriptors :
-#
-descriptor  org.geotools.image.jai.CombineDescriptor
-descriptor  org.geotools.image.jai.HysteresisDescriptor
-descriptor  org.geotools.image.jai.NodataFilterDescriptor
-descriptor  org.geotools.image.palette.ColorReductionDescriptor
-descriptor  org.geotools.image.palette.ColorInversionDescriptor
-
-
-#
-# "rendered" factory objects
-#
-rendered  org.geotools.image.jai.CombineCRIF                   org.geotools  org.geotools.Combine       Combine
-rendered  org.geotools.image.jai.HysteresisCRIF                org.geotools  org.geotools.Hysteresis    Hysteresis
-rendered  org.geotools.image.jai.NodataFilterCRIF              org.geotools  org.geotools.NodataFilter  NodataFilter
-rendered  org.geotools.image.palette.ColorReductionCRIF        org.geotools  org.geotools.ColorReduction ColorReduction
-rendered  org.geotools.image.palette.ColorInversionCRIF        org.geotools  org.geotools.ColorInversion ColorInversion
-#
-# The registry file for Geotools Grid Coverage implementation. This file should be automatically
-# parsed by JAI under initialization. If it is not, then Registry.registerServices(...) can parse
-# it. This may happen if this file is unreachable from the JAI class loader.
-#
-# If this file is updated, remember to update Registry.registerServices(...) accordingly.
-#
-# Version: $Id: registryFile.jai 34781 2010-01-13 11:56:07Z simonegiannecchini $
-#
-##################################################################################################
-#
-# Each line can be in one of the formats described below. Space or tab characters separate
-# keywords in each line. The comment character is '#'; on each line all characters following
-# the first comment character are ignored. The file must be encoded in UTF-8.
-#
-# 1. To register descriptors :
-#
-#      descriptor <descriptor-class-name>
-#
-# 2. To register factory objects under a product against a specific mode :
-#
-#      <registry-mode-name>  <factory-class-name>  <product-name>  <descriptor-name>  <local-name>
-#
-#    The <local-name> is (only) used later on in this file to set preferences
-#    between factory objects, if wanted.
-#
-##################################################################################################
-#
-# Image operation descriptors :
-#
-descriptor  org.geotools.image.jai.CombineDescriptor
-descriptor  org.geotools.image.jai.HysteresisDescriptor
-descriptor  org.geotools.image.jai.NodataFilterDescriptor
-descriptor  org.geotools.image.palette.ColorReductionDescriptor
-descriptor  org.geotools.image.palette.ColorInversionDescriptor
-
-
-#
-# "rendered" factory objects
-#
-rendered  org.geotools.image.jai.CombineCRIF                   org.geotools  org.geotools.Combine       Combine
-rendered  org.geotools.image.jai.HysteresisCRIF                org.geotools  org.geotools.Hysteresis    Hysteresis
-rendered  org.geotools.image.jai.NodataFilterCRIF              org.geotools  org.geotools.NodataFilter  NodataFilter
-rendered  org.geotools.image.palette.ColorReductionCRIF        org.geotools  org.geotools.ColorReduction ColorReduction
-rendered  org.geotools.image.palette.ColorInversionCRIF        org.geotools  org.geotools.ColorInversion ColorInversion
-#
-# The registry file for Geotools Grid Coverage implementation. This file should be automatically
-# parsed by JAI under initialization. If it is not, then Registry.registerServices(...) can parse
-# it. This may happen if this file is unreachable from the JAI class loader.
-#
-# If this file is updated, remember to update Registry.registerServices(...) accordingly.
-#
-# Version: $Id: registryFile.jai 34781 2010-01-13 11:56:07Z simonegiannecchini $
-#
-##################################################################################################
-#
-# Each line can be in one of the formats described below. Space or tab characters separate
-# keywords in each line. The comment character is '#'; on each line all characters following
-# the first comment character are ignored. The file must be encoded in UTF-8.
-#
-# 1. To register descriptors :
-#
-#      descriptor <descriptor-class-name>
-#
-# 2. To register factory objects under a product against a specific mode :
-#
-#      <registry-mode-name>  <factory-class-name>  <product-name>  <descriptor-name>  <local-name>
-#
-#    The <local-name> is (only) used later on in this file to set preferences
-#    between factory objects, if wanted.
-#
-##################################################################################################
-#
-# Image operation descriptors :
-#
-descriptor  org.geotools.image.jai.CombineDescriptor
-descriptor  org.geotools.image.jai.HysteresisDescriptor
-descriptor  org.geotools.image.jai.NodataFilterDescriptor
-descriptor  org.geotools.image.palette.ColorReductionDescriptor
-descriptor  org.geotools.image.palette.ColorInversionDescriptor
-
-
-#
-# "rendered" factory objects
-#
-rendered  org.geotools.image.jai.CombineCRIF                   org.geotools  org.geotools.Combine       Combine
-rendered  org.geotools.image.jai.HysteresisCRIF                org.geotools  org.geotools.Hysteresis    Hysteresis
-rendered  org.geotools.image.jai.NodataFilterCRIF              org.geotools  org.geotools.NodataFilter  NodataFilter
-rendered  org.geotools.image.palette.ColorReductionCRIF        org.geotools  org.geotools.ColorReduction ColorReduction
-rendered  org.geotools.image.palette.ColorInversionCRIF        org.geotools  org.geotools.ColorInversion ColorInversion
diff --git a/modules/gis/org.argeo.slc.gis.position.ui/META-INF/spring/ui-osgi.xml b/modules/gis/org.argeo.slc.gis.position.ui/META-INF/spring/ui-osgi.xml
deleted file mode 100644 (file)
index 9c6e89b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
-       xsi:schemaLocation="http://www.springframework.org/schema/osgi  \r
-       http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
-       http://www.springframework.org/schema/beans   \r
-       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
-\r
-       <reference id="positionProvider" interface="org.argeo.slc.jts.PositionProvider" /><!--\r
-\r
-       <bundle id="geotools" symbolic-name="org.argeo.dep.osgi.geotools" />\r
-       <bundle id="jai.imageio" symbolic-name="org.argeo.dep.osgi.jai.imageio" />\r
---></beans:beans>
\ No newline at end of file
diff --git a/modules/gis/org.argeo.slc.gis.position.ui/META-INF/spring/ui.xml b/modules/gis/org.argeo.slc.gis.position.ui/META-INF/spring/ui.xml
deleted file mode 100644 (file)
index 80ebc89..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
-       xmlns:osgi="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-       xmlns:p="http://www.springframework.org/schema/p"\r
-       xsi:schemaLocation="\r
-       http://www.springframework.org/schema/beans\r
-       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\r
-       http://www.springframework.org/schema/osgi  \r
-       http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
-    ">\r
-\r
-       <bean id="ui" class="org.argeo.slc.geotools.swing.GisFieldViewer">\r
-               <property name="positionProvider" ref="positionProvider" />\r
-               <property name="dataSource" ref="dataSource" />\r
-               <property name="jaiImageIoClassLoader" ref="jai.imageio.bdClassLoader" /><!--\r
-               <property name="vectors">\r
-                       <bean class="org.argeo.slc.core.deploy.DefaultResourceSet">\r
-                               <property name="base"\r
-                                       value="file:/home/mbaudier/gis/projects/100122-EasternBalkans2010/data" />\r
-                               <property name="include" value="*.shp" />\r
-                       </bean>\r
-                       \r
-               </property>\r
-               --><!--\r
-               <property name="rasters">\r
-                       <bean class="org.argeo.slc.core.deploy.DefaultResourceSet">\r
-                               <property name="base"\r
-                                       value="file:/home/mbaudier/gis/data/100501-Poehali" />\r
-                               <property name="include" value="*.gif" />\r
-                       </bean>\r
-               </property>\r
-       --></bean>\r
-\r
-       <bean id="jai.imageio.bdClassLoader"\r
-               class="org.springframework.osgi.util.BundleDelegatingClassLoader"\r
-               factory-method="createBundleClassLoaderFor">\r
-               <constructor-arg>\r
-                       <osgi:bundle symbolic-name="org.argeo.dep.osgi.jai.imageio" />\r
-               </constructor-arg>\r
-       </bean>\r
-\r
-       <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"\r
-               destroy-method="close">\r
-               <property name="driverClassName" value="org.postgresql.Driver" />\r
-               <property name="url" value="jdbc:postgresql://air/test_berlin" />\r
-               <property name="username" value="argeo" />\r
-               <property name="password" value="argeo" />\r
-               <property name="testOnBorrow" value="true" />\r
-               <property name="validationQuery" value="SELECT 1" />\r
-               <property name="maxActive" value="10" />\r
-               <property name="maxIdle" value="2" />\r
-       </bean>\r
-\r
-</beans>
\ No newline at end of file
diff --git a/modules/gis/org.argeo.slc.gis.position.ui/build.properties b/modules/gis/org.argeo.slc.gis.position.ui/build.properties
deleted file mode 100644 (file)
index 5f22cdd..0000000
+++ /dev/null
@@ -1 +0,0 @@
-bin.includes = META-INF/
index e3447e0533aff6de09ccd43501b2ff843ba2ec3f..3e5926d143900190f35286291928d344b4c13493 100644 (file)
@@ -17,6 +17,7 @@
 package org.argeo.slc.geotools.swing;
 
 import java.awt.Color;
+import java.awt.Frame;
 import java.awt.Graphics2D;
 import java.awt.Rectangle;
 import java.awt.geom.AffineTransform;
@@ -40,10 +41,10 @@ import org.argeo.slc.geotools.BeanFeatureTypeBuilder;
 import org.argeo.slc.gis.model.FieldPosition;
 import org.argeo.slc.jts.PositionProvider;
 import org.geotools.data.DataStore;
-import org.geotools.data.DataStoreFinder;
 import org.geotools.data.FeatureSource;
 import org.geotools.data.FileDataStoreFinder;
 import org.geotools.data.WorldFileReader;
+import org.geotools.data.postgis.PostgisNGDataStoreFactory;
 import org.geotools.factory.CommonFactoryFinder;
 import org.geotools.gce.image.WorldImageFormat;
 import org.geotools.geometry.DirectPosition2D;
@@ -51,6 +52,7 @@ import org.geotools.geometry.Envelope2D;
 import org.geotools.map.DefaultMapContext;
 import org.geotools.map.MapContext;
 import org.geotools.map.MapLayer;
+import org.geotools.renderer.lite.StreamingRenderer;
 import org.geotools.styling.FeatureTypeStyle;
 import org.geotools.styling.LineSymbolizer;
 import org.geotools.styling.RasterSymbolizer;
@@ -103,6 +105,7 @@ public class GisFieldViewer implements InitializingBean, DisposableBean {
 
        private JMapPane mapPane;
        private JMapFrame mapFrame;
+       private Frame awtFrame = null;
 
        /** in s */
        private Integer positionRefreshPeriod = 1;
@@ -113,6 +116,16 @@ public class GisFieldViewer implements InitializingBean, DisposableBean {
 
        private DataSource dataSource;
 
+       private DataStore postGisDataStore;
+
+       public GisFieldViewer() {
+               super();
+       }
+
+       public GisFieldViewer(Frame awtFrame) {
+               this.awtFrame = awtFrame;
+       }
+
        public static void main(String[] args) throws Exception {
                new GisFieldViewer().afterPropertiesSet();
        }
@@ -133,18 +146,24 @@ public class GisFieldViewer implements InitializingBean, DisposableBean {
                MapContext mapContext = new DefaultMapContext();
                mapContext.setTitle("GIS Field Viewer");
 
-               // Now display the map
-               // UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-               mapFrame = new JMapFrame(mapContext);
-               mapFrame.enableStatusBar(true);
-               mapFrame.enableToolBar(false);
-               mapFrame.enableLayerTable(true);
-               mapFrame.initComponents();
-               mapFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+               if (awtFrame == null) {
+                       // Now display the map
+                       // UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+                       mapFrame = new JMapFrame(mapContext);
+                       mapFrame.enableStatusBar(true);
+                       mapFrame.enableToolBar(false);
+                       mapFrame.enableLayerTable(true);
+                       mapFrame.initComponents();
+                       mapFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
 
-               mapFrame.setSize(800, 600);
+                       mapFrame.setSize(800, 600);
+
+                       mapPane = mapFrame.getMapPane();
+               } else {
+                       mapPane = new JMapPane(new StreamingRenderer(), mapContext);
+                       awtFrame.add(mapPane);
+               }
 
-               mapPane = mapFrame.getMapPane();
                // ReferencedEnvelope referencedEnvelope = new
                // ReferencedEnvelope(sphericalMercator);
                // mapFrame.getMapContext().setAreaOfInterest(referencedEnvelope);
@@ -153,22 +172,23 @@ public class GisFieldViewer implements InitializingBean, DisposableBean {
 
                mapPane.addMapPaneListener(new CustomMapPaneListener());
 
-               SwingUtilities.invokeLater(new Runnable() {
-                       public void run() {
-                               // Fullscreen
-                               // GraphicsEnvironment ge = GraphicsEnvironment
-                               // .getLocalGraphicsEnvironment();
-                               // GraphicsDevice[] devices = ge.getScreenDevices();
-                               // if (devices.length < 1)
-                               // throw new RuntimeException("No device available");
-                               // GraphicsDevice gd = devices[0];
-                               // mapFrame.setUndecorated(true);
-                               // // http://ubuntuforums.org/showthread.php?t=820924
-                               // mapFrame.setResizable(true);
-                               // gd.setFullScreenWindow(mapFrame);
-                               mapFrame.setVisible(true);
-                       }
-               });
+               if (mapFrame != null)
+                       SwingUtilities.invokeLater(new Runnable() {
+                               public void run() {
+                                       // Fullscreen
+                                       // GraphicsEnvironment ge = GraphicsEnvironment
+                                       // .getLocalGraphicsEnvironment();
+                                       // GraphicsDevice[] devices = ge.getScreenDevices();
+                                       // if (devices.length < 1)
+                                       // throw new RuntimeException("No device available");
+                                       // GraphicsDevice gd = devices[0];
+                                       // mapFrame.setUndecorated(true);
+                                       // // http://ubuntuforums.org/showthread.php?t=820924
+                                       // mapFrame.setResizable(true);
+                                       // gd.setFullScreenWindow(mapFrame);
+                                       mapFrame.setVisible(true);
+                               }
+                       });
 
                // Center on position in order to facten first rendering
                centerOnPosition();
@@ -207,20 +227,25 @@ public class GisFieldViewer implements InitializingBean, DisposableBean {
 
                try {
                        Map params = new HashMap();
-                       params.put("dbtype", "postgis");
-                       params.put("host", "air");
-                       params.put("port", new Integer(5432));
-                       params.put("database", "test_berlin");
-                       params.put("user", "argeo");
-                       params.put("passwd", "argeo");
-
-                       DataStore pgDatastore = DataStoreFinder.getDataStore(params);
-
+                       // params.put("dbtype", "postgis");
+                       // params.put("host", "air");
+                       // params.put("port", new Integer(5432));
+                       // params.put("database", "test_berlin");
+                       // params.put("user", "argeo");
+                       // params.put("passwd", "argeo");
+                       //
+                       // DataStore pgDatastore = DataStoreFinder.getDataStore(params);
+
+                       PostgisNGDataStoreFactory factory = new PostgisNGDataStoreFactory();
                        // JDBCDataStore pgDatastore = new JDBCDataStore();
                        // pgDatastore.setDataSource(dataSource);
                        // pgDatastore.setSQLDialect(new PostGISDialect(pgDatastore));
 
-                       FeatureSource<SimpleFeatureType, SimpleFeature> source = pgDatastore
+                       params.put(PostgisNGDataStoreFactory.DATASOURCE.key, dataSource);
+
+                       //JDBCDataStore pgDatastore = factory.createDataStore(params);
+
+                       FeatureSource<SimpleFeatureType, SimpleFeature> source = postGisDataStore
                                        .getFeatureSource("ways");
                        // log.debug("source CRS: "+source.getBounds().getCoordinateReferenceSystem());
                        // log.debug("context CRS: "+mapContext.getCoordinateReferenceSystem());
@@ -410,6 +435,10 @@ public class GisFieldViewer implements InitializingBean, DisposableBean {
                this.dataSource = dataSource;
        }
 
+       public void setPostGisDataStore(DataStore postGisDataStore) {
+               this.postGisDataStore = postGisDataStore;
+       }
+
        private class CustomMapPaneListener extends MapPaneAdapter {
 
                @Override