From: jsimomaa Date: Fri, 6 Oct 2017 05:17:52 +0000 (+0300) Subject: Additions to district features X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=a206ff20631f652d4d40c6da20284ee2c053037f;p=simantics%2Fdistrict.git Additions to district features Change-Id: I3362da74bce33736a730345c1b03833703696dfb --- diff --git a/org.simantics.district.feature/feature.xml b/org.simantics.district.feature/feature.xml index f60a2fc0..47cc1761 100644 --- a/org.simantics.district.feature/feature.xml +++ b/org.simantics.district.feature/feature.xml @@ -1,47 +1,73 @@ - - - - - [Enter Feature Description here.] - - - - [Enter Copyright Description here.] - - - - [Enter License Description here.] - - - - - - - - - - - + + + + + [Enter Feature Description here.] + + + + [Enter Copyright Description here.] + + + + [Enter License Description here.] + + + + + + + + + + + + + + + + + + + diff --git a/org.simantics.district.geotools/build.properties b/org.simantics.district.geotools/build.properties index 7a0700c2..efaa0a7f 100644 --- a/org.simantics.district.geotools/build.properties +++ b/org.simantics.district.geotools/build.properties @@ -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/ diff --git a/org.simantics.district.imports.ui/build.properties b/org.simantics.district.imports.ui/build.properties index 6f20375d..6c480f39 100644 --- a/org.simantics.district.imports.ui/build.properties +++ b/org.simantics.district.imports.ui/build.properties @@ -1,5 +1,6 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + icons/ diff --git a/org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportWizard.java b/org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportWizard.java index 703ade17..7ce7d3c6 100644 --- a/org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportWizard.java +++ b/org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportWizard.java @@ -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()) { diff --git a/org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportWizardPage.java b/org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportWizardPage.java index e1b81e0f..23571930 100644 --- a/org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportWizardPage.java +++ b/org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportWizardPage.java @@ -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() { // diff --git a/org.simantics.district.maps/build.properties b/org.simantics.district.maps/build.properties index 651748ee..e9863e28 100644 --- a/org.simantics.district.maps/build.properties +++ b/org.simantics.district.maps/build.properties @@ -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 index 5692f0cf..00000000 --- a/org.simantics.district.maps/build.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.simantics.district.maps/src/org/simantics/maps/prefs/MapsClientPreferences.java b/org.simantics.district.maps/src/org/simantics/maps/prefs/MapsClientPreferences.java index 75ad19d6..b0611313 100644 --- a/org.simantics.district.maps/src/org/simantics/maps/prefs/MapsClientPreferences.java +++ b/org.simantics.district.maps/src/org/simantics/maps/prefs/MapsClientPreferences.java @@ -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(); diff --git a/org.simantics.district.network.ui/build.properties b/org.simantics.district.network.ui/build.properties index 1ab42f55..9046ecdf 100644 --- a/org.simantics.district.network.ui/build.properties +++ b/org.simantics.district.network.ui/build.properties @@ -1,7 +1,8 @@ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - fragment.e4xmi,\ - plugin.xml,\ - adapters.xml -source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + fragment.e4xmi,\ + plugin.xml,\ + adapters.xml,\ + icons/ +source.. = src/ diff --git a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/DNEdgeBuilder.java b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/DNEdgeBuilder.java index eb081445..c2238d8e 100644 --- a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/DNEdgeBuilder.java +++ b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/DNEdgeBuilder.java @@ -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 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); } } diff --git a/org.simantics.district.network/build.properties b/org.simantics.district.network/build.properties index d7586c21..21a6c989 100644 --- a/org.simantics.district.network/build.properties +++ b/org.simantics.district.network/build.properties @@ -1,5 +1,6 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - adapters.xml +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + adapters.xml,\ + scl/ diff --git a/org.simantics.district.network/src/org/simantics/district/network/DistrictNetworkUtil.java b/org.simantics.district.network/src/org/simantics/district/network/DistrictNetworkUtil.java index 9f6f46fa..a2779803 100644 --- a/org.simantics.district.network/src/org/simantics/district/network/DistrictNetworkUtil.java +++ b/org.simantics.district.network/src/org/simantics/district/network/DistrictNetworkUtil.java @@ -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); diff --git a/org.simantics.maps.server/build.properties b/org.simantics.maps.server/build.properties index c049e419..f581e84f 100644 --- a/org.simantics.maps.server/build.properties +++ b/org.simantics.maps.server/build.properties @@ -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 index 00000000..79cf29ba Binary files /dev/null and b/org.simantics.maps.server/server/data/2017-03-20_v3.5_england_london.mbtiles differ diff --git a/org.simantics.maps.server/src/org/simantics/district/maps/server/prefs/MapsServerPreferences.java b/org.simantics.maps.server/src/org/simantics/district/maps/server/prefs/MapsServerPreferences.java index 85b1a453..8ccb8147 100644 --- a/org.simantics.maps.server/src/org/simantics/district/maps/server/prefs/MapsServerPreferences.java +++ b/org.simantics.maps.server/src/org/simantics/district/maps/server/prefs/MapsServerPreferences.java @@ -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"); } }