]> gerrit.simantics Code Review - simantics/district.git/commitdiff
Additions to district features 67/1867/1
authorjsimomaa <jani.simomaa@gmail.com>
Fri, 6 Oct 2017 05:17:52 +0000 (08:17 +0300)
committerjsimomaa <jani.simomaa@gmail.com>
Wed, 20 Jun 2018 11:47:51 +0000 (14:47 +0300)
Change-Id: I3362da74bce33736a730345c1b03833703696dfb

15 files changed:
org.simantics.district.feature/feature.xml
org.simantics.district.geotools/build.properties
org.simantics.district.imports.ui/build.properties
org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportWizard.java
org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportWizardPage.java
org.simantics.district.maps/build.properties
org.simantics.district.maps/build.xml [deleted file]
org.simantics.district.maps/src/org/simantics/maps/prefs/MapsClientPreferences.java
org.simantics.district.network.ui/build.properties
org.simantics.district.network.ui/src/org/simantics/district/network/ui/DNEdgeBuilder.java
org.simantics.district.network/build.properties
org.simantics.district.network/src/org/simantics/district/network/DistrictNetworkUtil.java
org.simantics.maps.server/build.properties
org.simantics.maps.server/server/data/2017-03-20_v3.5_england_london.mbtiles [new file with mode: 0644]
org.simantics.maps.server/src/org/simantics/district/maps/server/prefs/MapsServerPreferences.java

index f60a2fc011dbedf4c4a8b84b8e5fc3080916a3de..47cc1761548b829b3fe88c61dbdeaa1f6e309aae 100644 (file)
@@ -1,47 +1,73 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<feature\r
-      id="org.simantics.district.feature"\r
-      label="Simantics District Feature"\r
-      version="1.0.0.qualifier">\r
-\r
-   <description url="http://www.example.com/description">\r
-      [Enter Feature Description here.]\r
-   </description>\r
-\r
-   <copyright url="http://www.example.com/copyright">\r
-      [Enter Copyright Description here.]\r
-   </copyright>\r
-\r
-   <license url="http://www.example.com/license">\r
-      [Enter License Description here.]\r
-   </license>\r
-\r
-   <plugin\r
-         id="org.simantics.district.geotools"\r
-         download-size="0"\r
-         install-size="0"\r
-         version="0.0.0"\r
-         unpack="false"/>\r
-\r
-   <plugin\r
-         id="org.simantics.district.network"\r
-         download-size="0"\r
-         install-size="0"\r
-         version="0.0.0"\r
-         unpack="false"/>\r
-\r
-   <plugin\r
-         id="org.simantics.district.network.ontology"\r
-         download-size="0"\r
-         install-size="0"\r
-         version="0.0.0"\r
-         unpack="false"/>\r
-\r
-   <plugin\r
-         id="org.simantics.district.imports"\r
-         download-size="0"\r
-         install-size="0"\r
-         version="0.0.0"\r
-         unpack="false"/>\r
-\r
-</feature>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+      id="org.simantics.district.feature"
+      label="Simantics District Feature"
+      version="1.0.0.qualifier">
+
+   <description url="http://www.example.com/description">
+      [Enter Feature Description here.]
+   </description>
+
+   <copyright url="http://www.example.com/copyright">
+      [Enter Copyright Description here.]
+   </copyright>
+
+   <license url="http://www.example.com/license">
+      [Enter License Description here.]
+   </license>
+
+   <plugin
+         id="org.simantics.district.network"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.simantics.district.network.ontology"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.simantics.district.imports"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.simantics.district.geotools"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"/>
+
+   <plugin
+         id="org.simantics.maps.server"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"/>
+
+   <plugin
+         id="com.fasterxml.jackson.core.jackson-databind"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="com.fasterxml.jackson.core.jackson-core"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="com.fasterxml.jackson.core.jackson-annotations"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+</feature>
index 7a0700c2f5c99521a0b4b589d74c9cd18052ccac..efaa0a7ff368b5ad539199b37fb304a1159eb445 100644 (file)
@@ -2,15 +2,4 @@ source.. = src/
 output.. = bin/
 bin.includes = META-INF/,\
                .,\
-               lib/commons-pool-1.5.4.jar,\
-               lib/core-0.26.jar,\
-               lib/GeographicLib-Java-1.44.jar,\
-               lib/gt-metadata-16.0.jar,\
-               lib/gt-opengis-16.0.jar,\
-               lib/gt-referencing-16.0.jar,\
-               lib/jai_core-1.1.3.jar,\
-               lib/jgridshift-1.0.jar,\
-               lib/jsr-275-1.0-beta-2.jar,\
-               lib/jts-1.13.jar,\
-               lib/gt-epsg-hsql-16.0.jar,\
-               lib/hsqldb-2.3.4.jar
+               lib/
index 6f20375d6c7d98fbc80bb5da99be9866b1fe2f73..6c480f39f1bf02b9d3cd69ecf5d747da230d11bf 100644 (file)
@@ -1,5 +1,6 @@
-source.. = src/\r
-output.. = bin/\r
-bin.includes = META-INF/,\\r
-               .,\\r
-               plugin.xml\r
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml,\
+               icons/
index 703ade176923886f2691d9fe47d034d9f5ef33b7..7ce7d3c6a49f395fd9b7a1b2fc722a18b499121c 100644 (file)
@@ -185,8 +185,7 @@ public class CSVImportWizard extends Wizard implements IImportWizard {
                                                 endCoords = new double[] { endXCoord / MapScalingTransform.getScaleX(), endYCoord / MapScalingTransform.getScaleY() };
                                             }
                                             
-                                            Resource edge = DNEdgeBuilder.create(graph, model.getParentDiagram(), new double[] { startCoords[1], -startCoords[0]}, new double[] { endCoords[1], -endCoords[0]}, 0.0000001);
-                                            graph.claim(edge, DistrictNetworkResource.getInstance(graph).HasMapping, model.getComponentMappings().get(mappingValue));
+                                            Resource edge = DNEdgeBuilder.create(graph, model.getParentDiagram(), model.getComponentMappings().get(mappingValue), new double[] { startCoords[1], -startCoords[0]}, new double[] { endCoords[1], -endCoords[0]}, 0.0000001);
                                             
                                             String diameterS = row.get(diameterColumnIndex);
                                             if (!diameterS.isEmpty()) {
index e1b81e0f10df3b6fad4729d26e77754c0460dd06..2357193077c97301e80d91023ebdb8c9c51be976 100644 (file)
@@ -17,6 +17,8 @@ import org.eclipse.jface.viewers.ColumnWeightData;
 import org.eclipse.jface.wizard.IWizardContainer;
 import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
@@ -148,6 +150,31 @@ public class CSVImportWizardPage extends WizardPage {
             }
         });
         
+        sourceCRSCombo.addModifyListener(new ModifyListener() {
+            
+            @Override
+            public void modifyText(ModifyEvent e) {
+                String currentText = sourceCRSCombo.getText();
+                if (codes.contains(currentText)) {
+                    // Select this
+                    String[] items = sourceCRSCombo.getItems();
+                    int i;
+                    for (i = 0; i < items.length; i++) {
+                        String item = items[i];
+                        if (currentText.equals(item)) {
+                            break;
+                        }
+                    }
+                    if (i != 0) {
+                        sourceCRSCombo.select(i);
+                        model.setSourceCRS("EPSG:" + currentText);
+                    } else {
+                        System.err.println("this should not happen");
+                    }
+                }
+            }
+        });
+        
 //        wktFileSelection = new FileSelectionWidget(composite, "WKT file", SWT.OPEN);
 //        wktFileSelection.addListener(new FileSelectionListener() {
 //
index 651748ee77a938d29cfd978d8b9dc7e826e39d00..e9863e281eaccc5123e82ed75713bab3e8b87bbe 100644 (file)
@@ -1,4 +1,5 @@
 source.. = src/
 output.. = bin/
 bin.includes = META-INF/,\
+               .,\
                plugin.xml
diff --git a/org.simantics.district.maps/build.xml b/org.simantics.district.maps/build.xml
deleted file mode 100644 (file)
index 5692f0c..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0"?>
-<project name="org.simantics.maps" basedir="." default="jar">
-    <property name="src" value="src"/>
-    <property name="output" value="classes"/>
-    <property name="lib" value="lib"/>
-    <property name="sg" value="../org.simantics.scenegraph/"/>
-    <property environment="env"/>
-    <property name="compiler" value="${env.JAVA_HOME}/bin/javac"/>
-    <property name="jrelib" value="${env.JAVA_HOME}/jre/lib"/>
-       
-    <path id="compile.classpath">
-      <fileset dir="${sg}">
-        <include name="*.jar"/>
-      </fileset>
-    </path>
-
-    <target name="compile" depends="create">
-        <javac destdir="${output}" sourcepath="" source="1.6" target="1.6">
-            <src path="${src}"/>
-            <include name="fi/vtt/simantics/map/**"/>
-            <exclude name="fi/vtt/simantics/map/eclipse/**"/>
-            <classpath refid="compile.classpath"/>
-        </javac>
-    </target>
-
-    <target name="jar" depends="compile">
-        <jar destfile="org.simantics.maps.jar">
-            <fileset dir="${output}"/>
-        </jar>
-    </target>
-       
-    <target name="clean">
-        <delete dir="${output}"/>
-       <delete>
-         <fileset dir="." includes="*.jar"/>
-       </delete>
-    </target>
-
-    <target name="create">
-        <mkdir dir="${output}"/>
-    </target>
-</project>
index 75ad19d6471004b0206a006b46c6d6d0a4222c8e..b061131378529eaeec8dd9c78927f3429d9c36d9 100644 (file)
@@ -34,8 +34,8 @@ public class MapsClientPreferences {
     }
     
     public static String possibleBuiltinServerURL() {
-        int port = getServerPreferences().getInt(P_DEFAULT_PORT, -1);
-        String style = getServerPreferences().get(P_CURRENT_TM2STYLE, null);
+        int port = getServerPreferences().getInt(P_DEFAULT_PORT, 8080);
+        String style = getServerPreferences().get(P_CURRENT_TM2STYLE, "mapbox-studio-osm-bright.tm2");
         if (port != -1 && style != null) {
             try {
                 return new URL("http", "localhost", port, "/" + style).toString();
index 1ab42f55beb2a453423bb530ba3ea432516f9dec..9046ecdfaaddce78df624bd84dbed1825e52edbd 100644 (file)
@@ -1,7 +1,8 @@
-output.. = bin/\r
-bin.includes = META-INF/,\\r
-               .,\\r
-               fragment.e4xmi,\\r
-               plugin.xml,\\r
-               adapters.xml\r
-source.. = src/\r
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               fragment.e4xmi,\
+               plugin.xml,\
+               adapters.xml,\
+               icons/
+source.. = src/
index eb0814450768ed5de2651dfee24f81c94a0cb108..c2238d8e56eb0e082ce7ce4482cb402a7faba869 100644 (file)
@@ -37,11 +37,15 @@ public class DNEdgeBuilder {
     }
 
     public static Resource create(WriteGraph graph, Resource diagramResource, double[] start, double[] end, double padding) throws DatabaseException {
+        return create(graph, diagramResource, null, start, end, padding);
+    }
+    
+    public static Resource create(WriteGraph graph, Resource diagramResource, Resource mapping, double[] start, double[] end, double padding) throws DatabaseException {
         
         DistrictNetworkResource DN = DistrictNetworkResource.getInstance(graph);
         
         // 1. Get diagram edge to construct
-        Resource edge = getOrCreateEdge(graph, diagramResource);
+        Resource edge = getOrCreateEdge(graph, diagramResource, mapping);
         
         // 2. Add vertices
         Collection<Resource> vertices = graph.syncRequest(new ObjectsWithType(diagramResource, Layer0.getInstance(graph).ConsistsOf, DistrictNetworkResource.getInstance(graph).Vertex));
@@ -102,8 +106,8 @@ public class DNEdgeBuilder {
         return vertex;
     }
 
-    private static Resource getOrCreateEdge(WriteGraph graph, Resource diagramResource) throws DatabaseException {
-        return DistrictNetworkUtil.createEdge(graph, diagramResource);
+    private static Resource getOrCreateEdge(WriteGraph graph, Resource diagramResource, Resource mapping) throws DatabaseException {
+        return DistrictNetworkUtil.createEdge(graph, diagramResource, mapping);
     }
 
 }
index d7586c21ab4f398385f66e8422ee9cde9b04139f..21a6c989ec06e97251b51ed84de4cc61ec873c18 100644 (file)
@@ -1,5 +1,6 @@
-source.. = src/\r
-output.. = bin/\r
-bin.includes = META-INF/,\\r
-               .,\\r
-               adapters.xml\r
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               adapters.xml,\
+               scl/
index 9f6f46fa6de2efc150e4b962e0d62e265c25e321..a2779803931e342a5b7c6f101921cab9c8489967 100644 (file)
@@ -20,14 +20,20 @@ import org.simantics.operation.Layer0X;
 public class DistrictNetworkUtil {
 
     public static Resource createEdge(WriteGraph graph, Resource composite) throws DatabaseException {
+        return createEdge(graph, composite, graph.getPossibleObject(composite, DistrictNetworkResource.getInstance(graph).EdgeDefaultMapping));
+    }
+    
+    public static Resource createEdge(WriteGraph graph, Resource composite, Resource mapping) throws DatabaseException {
         Layer0 L0 = Layer0.getInstance(graph);
         DistrictNetworkResource DN = DistrictNetworkResource.getInstance(graph);
+        if (mapping == null) {
+            mapping = graph.getSingleObject(composite, DN.EdgeDefaultMapping);
+        }
         
         Resource edge = graph.newResource();
         graph.claim(edge, L0.InstanceOf, DN.Edge);
         
-        Resource defaultEdgeMapping = graph.getPossibleObject(composite, DN.EdgeDefaultMapping);
-        graph.claim(edge, DN.HasMapping, defaultEdgeMapping);
+        graph.claim(edge, DN.HasMapping, mapping);
         
         OrderedSetUtils.add(graph, composite, edge);
         graph.claim(composite, L0.ConsistsOf, L0.PartOf, edge);
index c049e419f9868e59e674d8a3c6f5221f8c807884..f581e84fffe65e16079e6af63d818624d63b0a48 100644 (file)
@@ -2,12 +2,7 @@ source.. = src/
 output.. = bin/
 bin.includes = META-INF/,\
                .,\
-               lib/zt-exec-1.9.jar,\
-               lib/commons-io-2.5.jar,\
-               lib/slf4j-api-1.7.24.jar,\
-               lib/logback-classic-1.2.1.jar,\
-               lib/logback-core-1.2.1.jar,\
-               lib/snakeyaml-1.18.jar,\
-               lib/jna-4.3.0.jar,\
-               lib/zt-process-killer-1.6.jar,\
-               plugin.xml
+               plugin.xml,\
+               node/,\
+               server/,\
+               lib/
diff --git a/org.simantics.maps.server/server/data/2017-03-20_v3.5_england_london.mbtiles b/org.simantics.maps.server/server/data/2017-03-20_v3.5_england_london.mbtiles
new file mode 100644 (file)
index 0000000..79cf29b
Binary files /dev/null and b/org.simantics.maps.server/server/data/2017-03-20_v3.5_england_london.mbtiles differ
index 85b1a453ba6f4c0a8c0722a1cf113524ff084567..8ccb8147ea539fa9247cfac913d54061e4871077 100644 (file)
@@ -29,11 +29,11 @@ public class MapsServerPreferences {
     }
     
     public static String currentMBTiles() {
-        return getPreferences().get(P_CURRENT_MBTILES, "");
+        return getPreferences().get(P_CURRENT_MBTILES, "helsinki_finland.mbtiles");
     }
     
     public static String currentTM2Style() {
-        return getPreferences().get(P_CURRENT_TM2STYLE, "");
+        return getPreferences().get(P_CURRENT_TM2STYLE, "mapbox-studio-osm-bright.tm2");
     }
 
 }