--- /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: 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"
--- /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="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
--- /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"
+ 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>
--- /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.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
META-INF/,\
.,\
icons/,\
- splash.bmp
+ splash.bmp,\
+ plugin_customization.ini
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
--- /dev/null
+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
<?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>
<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" />
IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
configurer.setInitialSize(new Point(1024, 800));
configurer.setShowCoolBar(true);
- configurer.setShowStatusLine(false);
+ configurer.setShowStatusLine(true);
+ configurer.setShowPerspectiveBar(true);
}
public void postWindowOpen() {
--- /dev/null
+<?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>
--- /dev/null
+#Fri May 07 16:28:04 CEST 2010
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
--- /dev/null
+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"
--- /dev/null
+#
+# 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
--- /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
+ <service ref="postGisDataStore" interface="org.geotools.data.DataStore" />\r
+</beans:beans>
\ No newline at end of file
--- /dev/null
+<?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
--- /dev/null
+bin.includes = META-INF/
+++ /dev/null
-<?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>
+++ /dev/null
-#Fri May 07 16:28:04 CEST 2010
-eclipse.preferences.version=1
-pluginProject.extensions=false
-resolve.requirebundle=false
+++ /dev/null
-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"
+++ /dev/null
-#
-# 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
+++ /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
- <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
+++ /dev/null
-<?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
+++ /dev/null
-bin.includes = META-INF/
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;
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;
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;
private JMapPane mapPane;
private JMapFrame mapFrame;
+ private Frame awtFrame = null;
/** in s */
private Integer positionRefreshPeriod = 1;
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();
}
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);
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();
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());
this.dataSource = dataSource;
}
+ public void setPostGisDataStore(DataStore postGisDataStore) {
+ this.postGisDataStore = postGisDataStore;
+ }
+
private class CustomMapPaneListener extends MapPaneAdapter {
@Override