X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.processeditor%2Fsrc%2Forg%2Fsimantics%2Fprocesseditor%2Fviews%2FEquipmentEditorPart.java;fp=org.simantics.processeditor%2Fsrc%2Forg%2Fsimantics%2Fprocesseditor%2Fviews%2FEquipmentEditorPart.java;h=0000000000000000000000000000000000000000;hb=6b6fcff5d6c326feef07ccf8401f97911778fffe;hp=93723e48d3cf573e767445537439ee9826704fa5;hpb=504c111db40d78f4913badddd126b283b5504dbb;p=simantics%2F3d.git diff --git a/org.simantics.processeditor/src/org/simantics/processeditor/views/EquipmentEditorPart.java b/org.simantics.processeditor/src/org/simantics/processeditor/views/EquipmentEditorPart.java deleted file mode 100644 index 93723e48..00000000 --- a/org.simantics.processeditor/src/org/simantics/processeditor/views/EquipmentEditorPart.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007- VTT Technical Research Centre of Finland. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.processeditor.views; - -import java.util.Collection; - -import org.eclipse.swt.widgets.Display; -import org.simantics.db.Graph; -import org.simantics.db.Resource; -import org.simantics.db.management.ISessionContext; -import org.simantics.processeditor.ProcessResource; -import org.simantics.processeditor.tools.NozzleContribution; -import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase; -import org.simantics.proconf.g3d.base.ThreeDimensionalEditorPart; -import org.simantics.proconf.g3d.shapeeditor.views.ShapeEditorBase; - - -public class EquipmentEditorPart extends ThreeDimensionalEditorPart { - - @Override - protected ThreeDimensionalEditorBase createEditor(ISessionContext session) { - ShapeEditorBase base = new ShapeEditorBase(session); - base.addEditorContribution(new NozzleContribution(base)); - return base; - } - - @Override - public void reload(Graph g) { - Resource inputResource = getInputResource(); - Collection model = g.getObjects(inputResource, ProcessResource.plant3Dresource.HasGraphics); - if (model.size() != 1) - throw new RuntimeException("Cannot find model for equipment " + inputResource); - Resource modelResource = model.iterator().next(); - if (modelResource != null) { - editor.reload(g,modelResource); - } else { - - Display d = getSite().getShell().getDisplay(); - d.asyncExec(new Runnable() { - public void run() { - editor.showMessage("Failed to load model."); - getSite().getPage().closeEditor(EquipmentEditorPart.this,false); - } - }); - } - } - -}