From a4395a1da139133059833fb1f909f5033676f8bc Mon Sep 17 00:00:00 2001 From: jsimomaa Date: Wed, 29 Mar 2017 19:31:14 +0300 Subject: [PATCH] Some fixes to district stuff refs #6958 Change-Id: I55cd490238b75fede3e0b90dcf720cb28c23433f --- .../src/org/simantics/maps/sg/MapNode.java | 2 +- .../graph.tg | Bin 11188 -> 11300 bytes .../graph/DistrictNetwork.pgraph | 3 +++ .../graph/images/map.png | Bin 0 -> 804 bytes .../ontology/DistrictNetworkResource.java | 6 ++++++ .../fragment.e4xmi | 2 +- .../icons/map.png | Bin 0 -> 804 bytes .../icons/map_go.png | Bin 0 -> 842 bytes .../network/ui/function/Functions.java | 10 +++++++--- org.simantics.district.ui.feature/feature.xml | 7 +++++++ 10 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 org.simantics.district.network.ontology/graph/images/map.png create mode 100644 org.simantics.district.network.ui/icons/map.png create mode 100644 org.simantics.district.network.ui/icons/map_go.png diff --git a/org.simantics.district.maps/src/org/simantics/maps/sg/MapNode.java b/org.simantics.district.maps/src/org/simantics/maps/sg/MapNode.java index 01eab3a3..e06adcb2 100644 --- a/org.simantics.district.maps/src/org/simantics/maps/sg/MapNode.java +++ b/org.simantics.district.maps/src/org/simantics/maps/sg/MapNode.java @@ -169,7 +169,7 @@ public class MapNode extends G2DNode implements ITileListener { public void init() { try { - ITileProvider provider = new OSMTileProvider(new WebService("http://localhost:8080/osm-bright/"), TILE_PIXEL_SIZE); + ITileProvider provider = new OSMTileProvider(new WebService("http://localhost:8080/mapbox-studio-osm-bright.tm2/"), TILE_PIXEL_SIZE); // Try to load eclipse specific implementation of TileJobQueue, if it doesn't exist, fall back to pojo implementation try { diff --git a/org.simantics.district.network.ontology/graph.tg b/org.simantics.district.network.ontology/graph.tg index c1cb1b6d1c219e7161f7bd853ee81def90644e73..317d8ce0641b5e4731d36d472db40508ab67870f 100644 GIT binary patch literal 11300 zcmeI2iE~`lmBzI%EwwD!mg5Z&0z80?tj&uc#K@K`x3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LHqOC|z}5(eBcX|FrMlZeMWk*XCS$%jIpg&F`MG zIlSgyPP~$S?N4t#I(N_HmV7tSx?G!>p_KbUpT9C{vy3I(Fopf1gS}J@CoF1<9i^|{sKf+h&jKCqp=|}kZl;(#!W4Org zQ}V2$LeCbJ7EK=jI@A>T!@zsG!+NW=`~Q>GXfI_Jc(Pe PzU8D=Yv3q@p4a&w8Dj$> diff --git a/org.simantics.district.network.ontology/graph/DistrictNetwork.pgraph b/org.simantics.district.network.ontology/graph/DistrictNetwork.pgraph index 5c30822b..7719ed48 100644 --- a/org.simantics.district.network.ontology/graph/DistrictNetwork.pgraph +++ b/org.simantics.district.network.ontology/graph/DistrictNetwork.pgraph @@ -69,6 +69,9 @@ DN.HasInLayerTag mbpQb1@7I~O+ue5CWtZi#AZox@gcwb{Xkx^Rf;Ty8yn6DWhJV4kC*wg94<7Vt zlteKm5+jKLV^qM1yt2HO4YZw^&a^Wfzb_m+@y40e_0^+M6ajz$03Zl}fU=sqfA9W} z@#^~O(a%3QB{YI^J_A4y)M^1_vjjn1H`Mc5t@6>y50A!C6seTL>`UqQ7p$DgY@K|> zQm^as;HM{#Qwj<3}(>R-AM4&+cd0t49%y2X`UaCBJg8YmB)K#uA{Z>9n zOp8>WCg#&r06`o8oz6gaIn`fY2FR)ssCr@3rc|5f%`bIJO$zbt__PK3gH51Sff`H}0ZWac9&q~*( zO@qNscV0VSU%X#sYO9)Qx4M=(eR(m}UFhondELHSnO2hr&mMO3 zv6gmw!P2y#u0c!?LPO88NyxOTj>XWm>*77F&55fo9Z?)iynObdfA;SdwVRl$W~G3* zEGt!2+1T-%ja32&!XdoMS_mM#IQK#{6D_nvjYu`GlvO3XdE)qYJJ;7 - + diff --git a/org.simantics.district.network.ui/icons/map.png b/org.simantics.district.network.ui/icons/map.png new file mode 100644 index 0000000000000000000000000000000000000000..f90ef25ec7f1cb0fdae38d9fe2d9edeee9928ef1 GIT binary patch literal 804 zcmV+<1Ka$GP)mbpQb1@7I~O+ue5C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, Resource element) throws DatabaseException { + Resource indexRoot = graph.sync(new IndexRoot(element)); - List composites = ModelingUtils.searchByType(graph, indexRoot, StructuralResource2.getInstance(graph).Composite); - List nonDistrictComposites = composites.stream().filter(comp -> { + List diagrams = ModelingUtils.searchByType(graph, indexRoot, DiagramResource.getInstance(graph).Diagram); + + List nonDistrictComposites = composites.values().stream().filter(comp -> { try { return !graph.isInstanceOf(comp, DistrictNetworkResource.getInstance(graph).Composite); } catch (ServiceException e1) { @@ -297,7 +301,7 @@ public class Functions { String name = graph.getRelatedValue2(mapping, L0.HasName); result.put(name, mapping); } catch (DatabaseException e) { - e.printStackTrace(); + LOGGER.error("Could not read name of " + mapping, e); } }); return result; diff --git a/org.simantics.district.ui.feature/feature.xml b/org.simantics.district.ui.feature/feature.xml index 8e0633e8..d4f241b2 100644 --- a/org.simantics.district.ui.feature/feature.xml +++ b/org.simantics.district.ui.feature/feature.xml @@ -48,4 +48,11 @@ version="0.0.0" unpack="false"/> + + -- 2.47.1