X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.diagram%2Fsrc%2Forg%2Fsimantics%2Fdiagram%2Fadapter%2FSpawnRequest.java;h=c7100dc397ea5bf8dfe52c2ce2b58f70aaf8ec0d;hp=c17e33a24f634964d12809988610979cd13c3b56;hb=HEAD;hpb=969bd23cab98a79ca9101af33334000879fb60c5 diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/SpawnRequest.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/SpawnRequest.java index c17e33a24..c7100dc39 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/SpawnRequest.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/SpawnRequest.java @@ -1,43 +1,43 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * 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.diagram.adapter; - -import org.simantics.db.AsyncReadGraph; -import org.simantics.db.Resource; -import org.simantics.db.procedure.AsyncProcedure; -import org.simantics.g2d.canvas.ICanvasContext; -import org.simantics.g2d.element.ElementClass; -import org.simantics.g2d.element.ElementHints; -import org.simantics.g2d.element.IElement; -import org.simantics.g2d.element.impl.Element; - -/** - * @author Antti Villberg - */ -class SpawnRequest extends BaseRequest2 { - - private final ElementClass clazz; - - public SpawnRequest(ICanvasContext canvas, ElementClass clazz, Resource resource) { - super(canvas, resource); - this.clazz = clazz; - } - - @Override - public void perform(AsyncReadGraph graph, final AsyncProcedure procedure) { - IElement e = Element.spawnNew(clazz); - e.setHint(ElementHints.KEY_OBJECT, data); - //System.out.println("Spawn " + e); - procedure.execute(graph, e); - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * 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.diagram.adapter; + +import org.simantics.db.AsyncReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.procedure.AsyncProcedure; +import org.simantics.g2d.canvas.ICanvasContext; +import org.simantics.g2d.element.ElementClass; +import org.simantics.g2d.element.ElementHints; +import org.simantics.g2d.element.IElement; +import org.simantics.g2d.element.impl.Element; + +/** + * @author Antti Villberg + */ +class SpawnRequest extends BaseRequest2 { + + private final ElementClass clazz; + + public SpawnRequest(ICanvasContext canvas, ElementClass clazz, Resource resource) { + super(canvas, resource); + this.clazz = clazz; + } + + @Override + public void perform(AsyncReadGraph graph, final AsyncProcedure procedure) { + IElement e = Element.spawnNew(clazz); + e.setHint(ElementHints.KEY_OBJECT, data); + //System.out.println("Spawn " + e); + procedure.execute(graph, e); + } + +}