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=5b761a11a0ee0d3f7001ecd3dfe781bc0b1ff7cd;hpb=d00bd5522f6a92bbfeb2a72a7d28ba25c3f36fed;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 5b761a11..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)); @@ -34,7 +36,7 @@ public class SchemaBuilder { schema.addLinkType(MappingSchemas.fromAnnotations(g, PipeRun.class)); schema.addLinkType(MappingSchemas.fromAdaptable(g, Plant3D.URIs.GeometryProvider, GeometryProvider.class)); - return schema; + return (IMappingSchema)(IMappingSchema)schema; } catch (IllegalAccessException e) { throw new DatabaseException(e); } catch (InstantiationException e) {