-<?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>
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/
-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/
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()) {
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;
}
});
+ 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() {
//
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
+ .,\
plugin.xml
+++ /dev/null
-<?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>
}
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();
-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/
}
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));
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);
}
}
-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/
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);
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/
}
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");
}
}