X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Fscenegraph%2FSchemaBuilder.java;h=a57a07e76547b56e19ee9a040f7be86ee4fa46d1;hb=d005c67f1706391f2eb9dfd6cfd9489a4a7ec60d;hp=dd28e585def9ae2ea079e59dc87db51446d85956;hpb=86739231beb0535bde4abae49d2011e3a042810b;p=simantics%2F3d.git diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/SchemaBuilder.java b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/SchemaBuilder.java index dd28e585..a57a07e7 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/SchemaBuilder.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/SchemaBuilder.java @@ -6,23 +6,25 @@ import org.simantics.db.Resource; import org.simantics.db.exception.DatabaseException; import org.simantics.db.request.Read; import org.simantics.g3d.scenegraph.GeometryProvider; +import org.simantics.g3d.scenegraph.base.INode; import org.simantics.objmap.graph.schema.IMappingSchema; import org.simantics.objmap.graph.schema.MappingSchemas; import org.simantics.objmap.graph.schema.SimpleSchema; import org.simantics.plant3d.ontology.Plant3D; public class SchemaBuilder { - public static IMappingSchema getSchema() throws DatabaseException{ - return Simantics.getSession().syncRequest(new Read>() { + public static IMappingSchema getSchema() throws DatabaseException{ + return Simantics.getSession().syncRequest(new Read>() { @Override - public IMappingSchema perform(ReadGraph g) + public IMappingSchema perform(ReadGraph g) throws DatabaseException { return getSchema(g); } }); } - public static IMappingSchema getSchema(ReadGraph g) throws DatabaseException{ + @SuppressWarnings("unchecked") + public static IMappingSchema getSchema(ReadGraph g) throws DatabaseException{ try { SimpleSchema schema = new SimpleSchema(); schema.addLinkType(MappingSchemas.fromAnnotations(g, Equipment.class)); @@ -33,8 +35,8 @@ public class SchemaBuilder { schema.addLinkType(MappingSchemas.fromAnnotations(g, P3DRootNode.class)); schema.addLinkType(MappingSchemas.fromAnnotations(g, PipeRun.class)); - schema.addLinkType(MappingSchemas.fromAdaptable(g, Plant3D.URIs.Builtin_GeometryProvider, GeometryProvider.class)); - return schema; + schema.addLinkType(MappingSchemas.fromAdaptable(g, Plant3D.URIs.GeometryProvider, GeometryProvider.class)); + return (IMappingSchema)(IMappingSchema)schema; } catch (IllegalAccessException e) { throw new DatabaseException(e); } catch (InstantiationException e) {