+
+ public static Resource structuralTypeResource(ReadGraph graph, Variable component, Resource baseType) throws DatabaseException {
+
+ if(component.getURI(graph).endsWith("/Alternative/Alternative/Panel2"))
+ System.err.println("structuralTypeResource " + component.getURI(graph));
+
+ StructuralOverrideData od = StructuralOverrideData.compute(graph, component);
+ return od.type();
+
+// Resource represents = component.getPossibleRepresents(graph);
+// if(represents == null) {
+// String uri = component.getPossiblePropertyValue(graph, "typeURI");
+// if(uri != null) return graph.syncRequest(new org.simantics.db.common.primitiverequest.Resource(uri), TransientCacheAsyncListener.<Resource>instance());
+// throw new DatabaseException("No type for " + component.getURI(graph));
+// }
+// return graph.getPossibleType(represents, baseType);
+//
+// Pair<Resource,Resource> representsAndType = graph.syncRequest(new PossibleRepresentsAndTypeWithOverrides(component));
+// return representsAndType.second;
+
+ }
+
+ public static Resource getComponentType(ReadGraph graph, Variable configuration, Resource component) throws DatabaseException {
+
+ Variable componentVariable = configuration.browse(graph, component);
+ return componentVariable.getType(graph);
+
+ }
+
+