+++ /dev/null
-<?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>
+++ /dev/null
-<?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>
+++ /dev/null
-#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
+++ /dev/null
-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"
+++ /dev/null
-<?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
+++ /dev/null
-<?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>
+++ /dev/null
-source.. = src/main/java/
-output.. = target/classes/
-bin.includes = plugin.xml,\
- META-INF/,\
- .,\
- icons/
+++ /dev/null
-<?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>
+++ /dev/null
-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);
- }
-}
+++ /dev/null
-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");
- }
-
-}
+++ /dev/null
-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
--- /dev/null
+<?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>
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
<!-- 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>
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"
<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>
--- /dev/null
+<?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>
--- /dev/null
+<?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>
--- /dev/null
+#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
--- /dev/null
+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
--- /dev/null
+source.. = src/main/java/
+output.. = target/classes/
+bin.includes = META-INF/,\
+ .
--- /dev/null
+<?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>
--- /dev/null
+<?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>
--- /dev/null
+#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
--- /dev/null
+#Mon Feb 21 09:12:59 CET 2011
+eclipse.preferences.version=1
+resolve.requirebundle=false
--- /dev/null
+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
--- /dev/null
+<?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>
--- /dev/null
+source.. = src/main/java/
+output.. = target/classes/
+bin.includes = META-INF/,\
+ .
--- /dev/null
+<?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>
--- /dev/null
+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
<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>