X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Feditor%2FPlant3DEditor.java;h=b4448e670749caef8e30b8685d33422eb922cb55;hb=5f2d09d9a19cd4612bd474087437df6de4c04535;hp=af7a67f5f96f8e21221c8197c81179fb6b4b0a5e;hpb=9c0ec8f21b0c189de8c5dc2d68e440e62f7206dd;p=simantics%2F3d.git diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/editor/Plant3DEditor.java b/org.simantics.plant3d/src/org/simantics/plant3d/editor/Plant3DEditor.java index af7a67f5..b4448e67 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/editor/Plant3DEditor.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/editor/Plant3DEditor.java @@ -304,36 +304,46 @@ public class Plant3DEditor extends ResourceEditorPart { @Override public void run() { + nodeMap.setChangeTracking(false); nodeMap.populate(); + nodeMap.setChangeTracking(true); panel.addListener(new RenderListener() { - - @Override - public void preRender() { - - } - - @Override - public void postRender() { - panel.removeListener(this); - - try { - P3DUtil.finalizeDBLoad2(rootNode); - if (nodeMap.isRangeModified()); - nodeMap.commit("Load sync"); - } catch (Exception e) { - ExceptionUtils.logAndShowError("Failed to load model correctly", e); - } - - List props = new ArrayList<>(); - collectProps(rootNode, props); - fitToWindow(props); - } - }); + + @Override + public void preRender() { + + } + + @Override + public void postRender() { + panel.removeListener(this); + + try { + P3DUtil.finalizeDBLoad2(rootNode); + if (nodeMap.getMapping().isRangeModified()) + nodeMap.commit("Load sync"); + } catch (Exception e) { + ExceptionUtils.logAndShowError("Failed to load model correctly", e); + } + + onEditorInitializationComplete(); + + List props = new ArrayList<>(); + collectProps(rootNode, props); + fitToWindow(props); + } + }); } }); - + } + /** + * This can be overridden by clients to perform extra initialization tasks + */ + protected void onEditorInitializationComplete() { + } + protected IMappingSchema getSchema(ReadGraph graph) throws DatabaseException { IMappingSchema schema = SchemaBuilder.getSchema(graph); return schema;