]> git.argeo.org Git - gpl/argeo-slc.git/commitdiff
Improve GIS
authorMathieu Baudier <mbaudier@argeo.org>
Tue, 22 Feb 2011 23:04:26 +0000 (23:04 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Tue, 22 Feb 2011 23:04:26 +0000 (23:04 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@4168 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

32 files changed:
eclipse/plugins/org.argeo.slc.client.gis/.classpath [deleted file]
eclipse/plugins/org.argeo.slc.client.gis/.project [deleted file]
eclipse/plugins/org.argeo.slc.client.gis/.settings/org.eclipse.jdt.core.prefs [deleted file]
eclipse/plugins/org.argeo.slc.client.gis/META-INF/MANIFEST.MF [deleted file]
eclipse/plugins/org.argeo.slc.client.gis/META-INF/spring/gisclient-osgi.xml [deleted file]
eclipse/plugins/org.argeo.slc.client.gis/META-INF/spring/gisclient-views.xml [deleted file]
eclipse/plugins/org.argeo.slc.client.gis/build.properties [deleted file]
eclipse/plugins/org.argeo.slc.client.gis/icons/sample.gif [deleted file]
eclipse/plugins/org.argeo.slc.client.gis/plugin.xml [deleted file]
eclipse/plugins/org.argeo.slc.client.gis/src/main/java/org/argeo/slc/client/gis/ClientGisActivator.java [deleted file]
eclipse/plugins/org.argeo.slc.client.gis/src/main/java/org/argeo/slc/client/gis/GisPerspectiveFactory.java [deleted file]
eclipse/plugins/org.argeo.slc.client.gis/src/main/java/org/argeo/slc/client/gis/views/GeoToolsMapView.java [deleted file]
eclipse/plugins/org.argeo.slc.client.ui.dist/META-INF/spring/jcr.xml [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.ui.dist/META-INF/spring/osgi.xml
eclipse/plugins/org.argeo.slc.client.ui.dist/META-INF/spring/views.xml
eclipse/plugins/org.argeo.slc.client.ui.dist/plugin.xml
eclipse/plugins/org.argeo.slc.client.ui/pom.xml
eclipse/plugins/org.argeo.slc.ui.gis.rap/.classpath [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.ui.gis.rap/.project [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.ui.gis.rap/.settings/org.eclipse.jdt.core.prefs [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.ui.gis.rap/META-INF/MANIFEST.MF [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.ui.gis.rap/build.properties [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.ui.gis.rcp/.classpath [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.ui.gis.rcp/.project [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.ui.gis.rcp/.settings/org.eclipse.jdt.core.prefs [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.ui.gis.rcp/.settings/org.eclipse.pde.core.prefs [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.ui.gis.rcp/META-INF/MANIFEST.MF [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.ui.gis.rcp/META-INF/spring/gisui-views.xml [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.ui.gis.rcp/build.properties [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.ui.gis.rcp/plugin.xml [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.ui.gis.rcp/src/main/java/org/argeo/slc/ui/gis/rcp/views/SwingMapView.java [new file with mode: 0644]
eclipse/plugins/pom.xml

diff --git a/eclipse/plugins/org.argeo.slc.client.gis/.classpath b/eclipse/plugins/org.argeo.slc.client.gis/.classpath
deleted file mode 100644 (file)
index 92f19d2..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<?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
deleted file mode 100644 (file)
index f0dfed9..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?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
deleted file mode 100644 (file)
index 14c8f81..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#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
deleted file mode 100644 (file)
index 31e5274..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Gis
-Bundle-SymbolicName: org.argeo.slc.client.gis; singleton:=true
-Bundle-Version: 0.13.1.SNAPSHOT
-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: com.vividsolutions.jts.geom;version="1.10.0",
- org.apache.commons.logging;version="1.1.1",
- org.argeo.eclipse.spring,
- org.argeo.slc.geotools,
- org.argeo.slc.geotools.data,
- org.argeo.slc.geotools.swing,
- org.argeo.slc.gis.model,
- org.argeo.slc.jts,
- org.geotools.data,
- org.geotools.gce.image,
- org.geotools.geometry,
- org.geotools.map,
- org.geotools.renderer,
- org.geotools.renderer.lite,
- org.geotools.styling,
- org.geotools.swing,
- org.geotools.swing.event,
- org.geotools.swing.tool,
- org.opengis.feature.simple,
- org.opengis.geometry,
- org.opengis.referencing.crs,
- 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
deleted file mode 100644 (file)
index 69235e8..0000000
+++ /dev/null
@@ -1,12 +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
-       <reference id="backend" interface="org.argeo.slc.geotools.Backend" />\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
deleted file mode 100644 (file)
index f395c7b..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<?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"
-       xsi:schemaLocation="
-               http://www.springframework.org/schema/beans
-        http://www.springframework.org/schema/beans/spring-beans.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="backend" ref="backend" />
-               <property name="mapContext" ref="mapContext" />
-       </bean>
-
-       <bean id="mapContext" class="org.geotools.map.DefaultMapContext" />
-
-</beans>
diff --git a/eclipse/plugins/org.argeo.slc.client.gis/build.properties b/eclipse/plugins/org.argeo.slc.client.gis/build.properties
deleted file mode 100644 (file)
index 8950055..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-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
deleted file mode 100644 (file)
index 34fb3c9..0000000
Binary files a/eclipse/plugins/org.argeo.slc.client.gis/icons/sample.gif and /dev/null differ
diff --git a/eclipse/plugins/org.argeo.slc.client.gis/plugin.xml b/eclipse/plugins/org.argeo.slc.client.gis/plugin.xml
deleted file mode 100644 (file)
index b482a4d..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<?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
deleted file mode 100644 (file)
index 7c2d235..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-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
deleted file mode 100644 (file)
index c9de664..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-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
deleted file mode 100644 (file)
index 3697987..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-package org.argeo.slc.client.gis.views;
-
-import java.awt.Color;
-import java.awt.Frame;
-import java.awt.Graphics2D;
-import java.awt.Rectangle;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Point2D;
-
-import javax.swing.SwingUtilities;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.argeo.slc.geotools.Backend;
-import org.argeo.slc.geotools.DataDescriptor;
-import org.argeo.slc.geotools.data.FeatureSourceDataDescriptor;
-import org.argeo.slc.geotools.data.PostgisDataDescriptor;
-import org.argeo.slc.geotools.data.WorldImageDataDescriptor;
-import org.argeo.slc.geotools.swing.VersatileZoomTool;
-import org.argeo.slc.gis.model.FieldPosition;
-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.geometry.DirectPosition2D;
-import org.geotools.geometry.Envelope2D;
-import org.geotools.map.MapContext;
-import org.geotools.renderer.lite.StreamingRenderer;
-import org.geotools.styling.RasterSymbolizer;
-import org.geotools.styling.Style;
-import org.geotools.styling.StyleBuilder;
-import org.geotools.swing.JMapPane;
-import org.geotools.swing.event.MapPaneAdapter;
-import org.geotools.swing.event.MapPaneEvent;
-
-import com.vividsolutions.jts.geom.Coordinate;
-
-public class GeoToolsMapView extends ViewPart {
-       public static final String ID = "org.argeo.slc.client.gis.views.GeoToolsMapView";
-       private final static Log log = LogFactory.getLog(GeoToolsMapView.class);
-
-       private Composite embedded;
-
-       private PositionProvider positionProvider;
-
-       private Backend backend;
-
-       private MapContext mapContext;
-       private JMapPane mapPane;
-
-       /** in s */
-       private Integer positionRefreshPeriod = 1;
-       private FieldPosition currentPosition = null;
-       private Boolean positionProviderDisconnected = false;
-       private VersatileZoomTool versatileZoomTool;
-
-       public void createPartControl(Composite parent) {
-               embedded = new Composite(parent, SWT.EMBEDDED | SWT.NO_BACKGROUND);
-               Frame frame = SWT_AWT.new_Frame(embedded);
-
-               mapPane = new JMapPane(new StreamingRenderer(), mapContext);
-               versatileZoomTool = new VersatileZoomTool();
-               mapPane.setCursorTool(versatileZoomTool);
-
-               mapPane.addMapPaneListener(new CustomMapPaneListener());
-
-               frame.add(mapPane);
-
-               centerOnPosition();
-
-               for (DataDescriptor dd : backend.getAvailableData(null)) {
-                       if (dd instanceof WorldImageDataDescriptor) {
-                               StyleBuilder styleBuilder = new StyleBuilder();
-                               RasterSymbolizer rs = styleBuilder.createRasterSymbolizer();
-                               rs.setGeometryPropertyName("geom");
-                               Style rasterStyle = styleBuilder.createStyle(rs);
-                               try {
-                                       mapContext.addLayer(backend.loadGridCoverage(dd),
-                                                       rasterStyle);
-                               } catch (Exception e) {
-                                       log.warn(e);
-                               }
-
-                       } else if (dd instanceof FeatureSourceDataDescriptor) {
-                               try {
-                                       mapContext.addLayer(backend.loadFeatureSource(dd), null);
-                               } catch (Exception e) {
-                                       log.warn(e);
-                               }
-                       } else if (dd instanceof PostgisDataDescriptor) {
-                               // DataStore dataStore = backend.loadDataStore(dd);
-                               for (DataDescriptor dd2 : backend.getAvailableData(dd))
-                                       mapContext.addLayer(backend.loadFeatureSource(dd2), null);
-                       }
-               }
-               // GisFieldViewer gisFieldViewer = new GisFieldViewer(frame);
-               // gisFieldViewer.setPostGisDataStore(postGisDataStore);
-               // gisFieldViewer.setPositionProvider(positionProvider);
-               // gisFieldViewer.setJaiImageIoClassLoader(jaiImageIoClassLoader);
-               // gisFieldViewer.afterPropertiesSet();
-
-               new Thread(new PositionUpdater()).start();
-
-       }
-
-       protected void receiveNewPosition(FieldPosition position) {
-               if (position != null && versatileZoomTool != null) {
-                       positionProviderDisconnected = false;
-                       currentPosition = position;
-                       Point2D point2d = new DirectPosition2D(currentPosition
-                                       .getLocation().getCoordinate().x, currentPosition
-                                       .getLocation().getCoordinate().y);
-                       versatileZoomTool.setFieldPosition(point2d);
-                       drawPositionLocation();
-               } else {
-                       positionProviderDisconnected = true;
-               }
-       }
-
-       protected void drawPositionLocation() {
-               SwingUtilities.invokeLater(new Runnable() {
-                       public void run() {
-                               if (currentPosition == null)
-                                       return;
-
-                               AffineTransform tr = getMapPane().getWorldToScreenTransform();
-                               DirectPosition2D geoCoords = new DirectPosition2D(
-                                               currentPosition.getLocation().getCoordinate().x,
-                                               currentPosition.getLocation().getCoordinate().y);
-                               if (tr == null)
-                                       return;
-                               tr.transform(geoCoords, geoCoords);
-                               geoCoords.setCoordinateReferenceSystem(getMapPane()
-                                               .getMapContext().getCoordinateReferenceSystem());
-
-                               final int halfRefSize = 3;
-                               Rectangle rect = new Rectangle((int) Math.round(geoCoords
-                                               .getX() - halfRefSize), (int) Math.round(geoCoords
-                                               .getY() - halfRefSize), halfRefSize * 2 + 1,
-                                               halfRefSize * 2 + 1);
-                               Graphics2D g2D = (Graphics2D) getMapPane().getGraphics();
-                               if (g2D == null)
-                                       return;
-                               g2D.setColor(Color.WHITE);
-                               if (positionProviderDisconnected)
-                                       g2D.setXORMode(Color.ORANGE);
-                               else
-                                       g2D.setXORMode(Color.RED);
-                               g2D.drawRect(rect.x, rect.y, rect.width, rect.height);
-                               g2D.drawRect(rect.x - 1, rect.y - 1, rect.width + 2,
-                                               rect.height + 2);
-                       }
-               });
-       }
-
-       protected void centerOnPosition() {
-               if (currentPosition == null)
-                       return;
-               Envelope2D env = new Envelope2D();
-               final double increment = 1d;
-               Coordinate positionCoo = currentPosition.getLocation().getCoordinate();
-               env.setFrameFromDiagonal(positionCoo.x - increment, positionCoo.y
-                               - increment, positionCoo.x + increment, positionCoo.y
-                               + increment);
-               getMapPane().setDisplayArea(env);
-
-       }
-
-       public void setFocus() {
-               if (embedded != null)
-                       embedded.setFocus();
-       }
-
-       protected JMapPane getMapPane() {
-               return mapPane;
-       }
-
-       public void setPositionProvider(PositionProvider positionProvider) {
-               this.positionProvider = positionProvider;
-       }
-
-       public void setBackend(Backend backend) {
-               this.backend = backend;
-       }
-
-       public void setMapContext(MapContext mapContext) {
-               this.mapContext = mapContext;
-       }
-
-       private class CustomMapPaneListener extends MapPaneAdapter {
-
-               @Override
-               public void onRenderingStopped(MapPaneEvent ev) {
-                       drawPositionLocation();
-               }
-
-               @Override
-               public void onDisplayAreaChanged(MapPaneEvent ev) {
-                       drawPositionLocation();
-               }
-
-               @Override
-               public void onRenderingProgress(MapPaneEvent ev) {
-                       drawPositionLocation();
-               }
-
-               @Override
-               public void onRenderingStarted(MapPaneEvent ev) {
-                       drawPositionLocation();
-               }
-
-               @Override
-               public void onResized(MapPaneEvent ev) {
-                       drawPositionLocation();
-               }
-
-       }
-
-       private class PositionUpdater implements Runnable {
-
-               public void run() {
-                       while (true) {
-                               FieldPosition currentPosition = positionProvider
-                                               .currentPosition();
-
-                               receiveNewPosition(currentPosition);
-
-                               if (currentPosition != null) {
-                               }
-
-                               try {
-                                       Thread.sleep(positionRefreshPeriod * 1000);
-                               } catch (InterruptedException e) {
-                                       e.printStackTrace();
-                               }
-                       }
-               }
-       }
-
-}
\ No newline at end of file
diff --git a/eclipse/plugins/org.argeo.slc.client.ui.dist/META-INF/spring/jcr.xml b/eclipse/plugins/org.argeo.slc.client.ui.dist/META-INF/spring/jcr.xml
new file mode 100644 (file)
index 0000000..2701948
--- /dev/null
@@ -0,0 +1,10 @@
+<?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:util="http://www.springframework.org/schema/util"
+       xmlns:p="http://www.springframework.org/schema/p"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
+
+       <bean id="repositoryRegister" class="org.argeo.jcr.DefaultRepositoryRegister">
+       </bean>
+</beans>
index 15e7cfad68e9e114164542583c31100f659b5cc1..0e87da8c0f35ceff64f5156dc6dcce2a50fe4748 100644 (file)
@@ -8,5 +8,8 @@
        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"\r
        osgi:default-timeout="30000">\r
 \r
-       <reference id="jcrRepository" interface="javax.jcr.Repository" />\r
+       <set id="repositories" interface="javax.jcr.Repository">\r
+               <listener ref="repositoryRegister" bind-method="register"\r
+                       unbind-method="unregister" />\r
+       </set>\r
 </beans:beans>
\ No newline at end of file
index 021599cb4a926e4636dc85b85cba77e7b49c0c02..fab48161b852d49c015985dbd6dfa172288fe4da 100644 (file)
@@ -7,13 +7,13 @@
        <!-- Views -->
        <bean id="org.argeo.slc.client.ui.dist.distributionView" class="org.argeo.slc.client.ui.dist.views.DistributionView"
                scope="prototype">
-               <property name="jcrSession" ref="jcrSession" />
+               <property name="repositoryRegister" ref="repositoryRegister" />
        </bean>
 
-       <bean id="jcrSession" class="org.argeo.jcr.ThreadBoundJcrSessionFactory">
-               <property name="repository" ref="jcrRepository" />
-               <property name="workspace" value="slc_repo" />
-               <property name="forceDefaultCredentials" value="true" />
-       </bean>
+<!--   <bean id="jcrSession" class="org.argeo.jcr.ThreadBoundJcrSessionFactory">-->
+<!--           <property name="repository" ref="jcrRepository" />-->
+<!--           <property name="workspace" value="slc_repo" />-->
+<!--           <property name="forceDefaultCredentials" value="true" />-->
+<!--   </bean>-->
 
 </beans>
index 902c781255b82dae42e881d0a91361fcb5a4dd35..89e87ed67c31a8b5d2309cdc2378468f3a1278ed 100644 (file)
@@ -50,7 +50,7 @@
                 locationURI="menu:org.eclipse.ui.main.menu?after=edit">
                <menu label="Queries"
               mnemonic="Queries"
-              id="com.agfa.sebi.ui.queryMenu">
+              id="org.argeo.slc.client.ui.dist.queryMenu">
                 <command
                       commandId="org.argeo.slc.client.ui.dist.openGenericJcrQueryEditor"
                       disabledIcon="icons/saveDisabled.gif"
index 659a279d5eaeb327dd83933e516df924e4f6ef82..7d70d7b1421a4285733676d66bc2675dea4c8119 100644 (file)
@@ -25,8 +25,6 @@
                        <version>${version.slc}</version>
                </dependency>
 
-               <!-- <dependency> <groupId>org.argeo.slc.eclipse</groupId> <artifactId>org.argeo.slc.client.commons</artifactId> 
-                       <version>${version.slc}</version> </dependency> -->
                <!-- SLC -->
                <dependency>
                        <groupId>org.argeo.slc.runtime</groupId>
                </dependency>
 
                <!-- Spring -->
-               <!-- <dependency> <groupId>org.springframework</groupId> <artifactId>org.springframework.context</artifactId> 
-                       </dependency> -->
-               <!-- Commons (with all dependencies that are commons for both RCP and RAP) -->
                <dependency>
                        <groupId>org.argeo.commons.eclipse</groupId>
                        <artifactId>org.argeo.eclipse.ui</artifactId>
                        <version>${version.argeo-commons}</version>
                </dependency>
 
-
                <!-- Eclipse and RCP only dependency, needed at compile time -->
                <dependency>
                        <groupId>org.argeo.commons.eclipse</groupId>
                        <version>${version.argeo-commons}</version>
                        <scope>provided</scope>
                </dependency>
-
-               <!-- Commons -->
-               <!-- TO BE DELETED<dependency> <groupId>org.argeo.commons.eclipse</groupId> 
-                       <artifactId>org.argeo.eclipse.ui</artifactId> <version>${version.argeo-commons}</version> 
-                       </dependency> -->
-               <!-- Eclipse -->
-               <!-- TO BE DELETED <dependency> <groupId>org.eclipse.ui</groupId> <artifactId>org.eclipse.ui</artifactId> 
-                       </dependency> <dependency> <groupId>org.eclipse.core</groupId> <artifactId>org.eclipse.core.runtime</artifactId> 
-                       </dependency> <dependency> <groupId>org.eclipse.swt</groupId> <artifactId>org.eclipse.swt.gtk.linux.x86_64</artifactId> 
-                       </dependency> -->
        </dependencies>
 </project>
diff --git a/eclipse/plugins/org.argeo.slc.ui.gis.rap/.classpath b/eclipse/plugins/org.argeo.slc.ui.gis.rap/.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.ui.gis.rap/.project b/eclipse/plugins/org.argeo.slc.ui.gis.rap/.project
new file mode 100644 (file)
index 0000000..23932fa
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.argeo.slc.ui.gis.rap</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.ui.gis.rap/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/org.argeo.slc.ui.gis.rap/.settings/org.eclipse.jdt.core.prefs
new file mode 100644 (file)
index 0000000..fd54be0
--- /dev/null
@@ -0,0 +1,8 @@
+#Mon Feb 21 08:58:15 CET 2011
+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.ui.gis.rap/META-INF/MANIFEST.MF b/eclipse/plugins/org.argeo.slc.ui.gis.rap/META-INF/MANIFEST.MF
new file mode 100644 (file)
index 0000000..4dfe742
--- /dev/null
@@ -0,0 +1,7 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Rap
+Bundle-SymbolicName: org.argeo.slc.ui.gis.rap
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: Argeo
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/eclipse/plugins/org.argeo.slc.ui.gis.rap/build.properties b/eclipse/plugins/org.argeo.slc.ui.gis.rap/build.properties
new file mode 100644 (file)
index 0000000..5fc538b
--- /dev/null
@@ -0,0 +1,4 @@
+source.. = src/main/java/
+output.. = target/classes/
+bin.includes = META-INF/,\
+               .
diff --git a/eclipse/plugins/org.argeo.slc.ui.gis.rcp/.classpath b/eclipse/plugins/org.argeo.slc.ui.gis.rcp/.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.ui.gis.rcp/.project b/eclipse/plugins/org.argeo.slc.ui.gis.rcp/.project
new file mode 100644 (file)
index 0000000..8274d7a
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.argeo.slc.ui.gis.rcp</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.ui.gis.rcp/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/org.argeo.slc.ui.gis.rcp/.settings/org.eclipse.jdt.core.prefs
new file mode 100644 (file)
index 0000000..404e51b
--- /dev/null
@@ -0,0 +1,8 @@
+#Mon Feb 21 08:56:35 CET 2011
+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.ui.gis.rcp/.settings/org.eclipse.pde.core.prefs b/eclipse/plugins/org.argeo.slc.ui.gis.rcp/.settings/org.eclipse.pde.core.prefs
new file mode 100644 (file)
index 0000000..ad3b348
--- /dev/null
@@ -0,0 +1,3 @@
+#Mon Feb 21 09:12:59 CET 2011
+eclipse.preferences.version=1
+resolve.requirebundle=false
diff --git a/eclipse/plugins/org.argeo.slc.ui.gis.rcp/META-INF/MANIFEST.MF b/eclipse/plugins/org.argeo.slc.ui.gis.rcp/META-INF/MANIFEST.MF
new file mode 100644 (file)
index 0000000..b01d0dd
--- /dev/null
@@ -0,0 +1,26 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Rcp
+Bundle-SymbolicName: org.argeo.slc.ui.gis.rcp;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: Argeo
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime
+Import-Package: com.vividsolutions.jts.geom;version="1.10.0",
+ org.apache.commons.logging;version="[1.1.1,2.0.0)",
+ org.argeo.eclipse.spring,
+ org.argeo.slc.geotools,
+ org.argeo.slc.geotools.map,
+ org.argeo.slc.geotools.swing,
+ org.argeo.slc.jts,
+ org.argeo.slc.ui.gis.views,
+ org.geotools.geometry,
+ org.geotools.map,
+ org.geotools.renderer,
+ org.geotools.renderer.lite,
+ org.geotools.swing,
+ org.geotools.swing.event,
+ org.geotools.swing.tool,
+ org.opengis.geometry,
+ org.opengis.referencing.crs
diff --git a/eclipse/plugins/org.argeo.slc.ui.gis.rcp/META-INF/spring/gisui-views.xml b/eclipse/plugins/org.argeo.slc.ui.gis.rcp/META-INF/spring/gisui-views.xml
new file mode 100644 (file)
index 0000000..60d6679
--- /dev/null
@@ -0,0 +1,12 @@
+<?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"
+       xsi:schemaLocation="
+               http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd
+       ">
+
+       <bean id="org.argeo.slc.ui.gis.mapView" class="org.argeo.slc.ui.gis.rcp.views.SwingMapView"
+               scope="prototype">
+       </bean>
+</beans>
diff --git a/eclipse/plugins/org.argeo.slc.ui.gis.rcp/build.properties b/eclipse/plugins/org.argeo.slc.ui.gis.rcp/build.properties
new file mode 100644 (file)
index 0000000..5fc538b
--- /dev/null
@@ -0,0 +1,4 @@
+source.. = src/main/java/
+output.. = target/classes/
+bin.includes = META-INF/,\
+               .
diff --git a/eclipse/plugins/org.argeo.slc.ui.gis.rcp/plugin.xml b/eclipse/plugins/org.argeo.slc.ui.gis.rcp/plugin.xml
new file mode 100644 (file)
index 0000000..821bdf2
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+   <extension
+         point="org.eclipse.ui.views">
+      <view
+            name="Map"
+            icon="icons/sample.gif"
+            class="org.argeo.eclipse.spring.SpringExtensionFactory"
+            id="org.argeo.slc.ui.gis.mapView">
+      </view>
+   </extension>
+</plugin>
diff --git a/eclipse/plugins/org.argeo.slc.ui.gis.rcp/src/main/java/org/argeo/slc/ui/gis/rcp/views/SwingMapView.java b/eclipse/plugins/org.argeo.slc.ui.gis.rcp/src/main/java/org/argeo/slc/ui/gis/rcp/views/SwingMapView.java
new file mode 100644 (file)
index 0000000..cefa2db
--- /dev/null
@@ -0,0 +1,140 @@
+package org.argeo.slc.ui.gis.rcp.views;
+
+import java.awt.Color;
+import java.awt.Frame;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+
+import javax.swing.SwingUtilities;
+
+import org.argeo.slc.geotools.map.OverlayLocationReceiver;
+import org.argeo.slc.geotools.swing.VersatileZoomTool;
+import org.argeo.slc.ui.gis.views.AbstractMapView;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.awt.SWT_AWT;
+import org.eclipse.swt.widgets.Composite;
+import org.geotools.geometry.DirectPosition2D;
+import org.geotools.geometry.Envelope2D;
+import org.geotools.map.DefaultMapContext;
+import org.geotools.map.MapContext;
+import org.geotools.renderer.lite.StreamingRenderer;
+import org.geotools.swing.JMapPane;
+import org.geotools.swing.event.MapPaneAdapter;
+import org.geotools.swing.event.MapPaneEvent;
+
+import com.vividsolutions.jts.geom.Coordinate;
+import com.vividsolutions.jts.geom.Point;
+
+public class SwingMapView extends AbstractMapView implements
+               OverlayLocationReceiver {
+       public static final String ID = "org.argeo.slc.client.gis.views.GeoToolsMapView";
+
+       private Composite embedded;
+       private JMapPane mapPane;
+
+       private VersatileZoomTool versatileZoomTool;
+
+public void createPartControl(Composite parent) {
+               embedded = new Composite(parent, SWT.EMBEDDED | SWT.NO_BACKGROUND);
+               Frame frame = SWT_AWT.new_Frame(embedded);
+
+               mapPane = new JMapPane(new StreamingRenderer(), new DefaultMapContext());
+               versatileZoomTool = new VersatileZoomTool();
+               mapPane.setCursorTool(versatileZoomTool);
+
+               mapPane.addMapPaneListener(new CustomMapPaneListener());
+
+               frame.add(mapPane);
+       }
+
+       public void receiveOverlayLocation(final Point point, final Boolean stale) {
+               final Point2D point2d = new DirectPosition2D(point.getCoordinate().x,
+                               point.getCoordinate().y);
+               versatileZoomTool.setFieldPosition(point2d);
+               SwingUtilities.invokeLater(new Runnable() {
+                       public void run() {
+                               AffineTransform tr = mapPane.getWorldToScreenTransform();
+                               // DirectPosition2D geoCoords = new DirectPosition2D(point
+                               // .getCoordinate().x, point.getCoordinate().y);
+                               DirectPosition2D geoCoords = new DirectPosition2D(point2d);
+                               if (tr == null)
+                                       return;
+                               tr.transform(geoCoords, geoCoords);
+                               geoCoords.setCoordinateReferenceSystem(mapPane.getMapContext()
+                                               .getCoordinateReferenceSystem());
+
+                               final int halfRefSize = 3;
+                               Rectangle rect = new Rectangle((int) Math.round(geoCoords
+                                               .getX() - halfRefSize), (int) Math.round(geoCoords
+                                               .getY() - halfRefSize), halfRefSize * 2 + 1,
+                                               halfRefSize * 2 + 1);
+                               Graphics2D g2D = (Graphics2D) mapPane.getGraphics();
+                               if (g2D == null)
+                                       return;
+                               g2D.setColor(Color.WHITE);
+                               if (stale)
+                                       g2D.setXORMode(Color.ORANGE);
+                               else
+                                       g2D.setXORMode(Color.RED);
+                               g2D.drawRect(rect.x, rect.y, rect.width, rect.height);
+                               g2D.drawRect(rect.x - 1, rect.y - 1, rect.width + 2,
+                                               rect.height + 2);
+                       }
+               });
+       }
+
+       protected void centerMap(Coordinate coordinate) {
+               Envelope2D env = new Envelope2D();
+               final double increment = 1d;
+               env.setFrameFromDiagonal(coordinate.x - increment, coordinate.y
+                               - increment, coordinate.x + increment, coordinate.y + increment);
+               mapPane.setDisplayArea(env);
+       }
+
+       public void setFocus() {
+               if (embedded != null)
+                       embedded.setFocus();
+       }
+       
+
+       @Override
+       public MapContext getMapContext() {
+               return mapPane.getMapContext();
+       }
+
+       protected void redrawOverlayLocation() {
+               // FIXME: implement it
+       }
+
+       private class CustomMapPaneListener extends MapPaneAdapter {
+
+               @Override
+               public void onRenderingStopped(MapPaneEvent ev) {
+                       redrawOverlayLocation();
+               }
+
+               @Override
+               public void onDisplayAreaChanged(MapPaneEvent ev) {
+                       redrawOverlayLocation();
+               }
+
+               @Override
+               public void onRenderingProgress(MapPaneEvent ev) {
+                       redrawOverlayLocation();
+               }
+
+               @Override
+               public void onRenderingStarted(MapPaneEvent ev) {
+                       redrawOverlayLocation();
+               }
+
+               @Override
+               public void onResized(MapPaneEvent ev) {
+                       redrawOverlayLocation();
+               }
+
+       }
+
+}
\ No newline at end of file
index 2612c90f4722024dccf671e135de952e091a895b..dff317f6875ed54154654d65cf6623363f9d0f24 100644 (file)
@@ -14,6 +14,7 @@
        <modules>
                <module>org.argeo.slc.client.ui</module>
                <module>org.argeo.slc.client.ui.dist</module>
+               <module>org.argeo.slc.client.ui.gis</module>
                <module>org.argeo.slc.client.rcp</module>
                <module>org.argeo.slc.client.rap</module>
        </modules>