X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.diagram%2Fsrc%2Forg%2Fsimantics%2Fdiagram%2Fquery%2FDiagramLoadQuery.java;h=31668ffb4c4b5f43e7d47ba3c01eeedf86f033b9;hb=3e877b48594c98cff85f4db64964f86fe14c0f03;hp=b7e83ef9bb6be16c4662958f558d8a2a6d2a3294;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/query/DiagramLoadQuery.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/query/DiagramLoadQuery.java index b7e83ef9b..31668ffb4 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/query/DiagramLoadQuery.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/query/DiagramLoadQuery.java @@ -1,66 +1,66 @@ -/******************************************************************************* - * 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.query; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.simantics.db.ReadGraph; -import org.simantics.db.Resource; -import org.simantics.db.common.ResourceArray; -import org.simantics.db.common.request.ResourceRead; -import org.simantics.db.exception.DatabaseException; -import org.simantics.diagram.adapter.IDiagramLoader; -import org.simantics.g2d.diagram.IDiagram; -import org.simantics.utils.datastructures.hints.IHintObservable; - -/** - * @author Tuukka Lehtonen - */ -public class DiagramLoadQuery extends ResourceRead { - - Resource model; - Resource runtime; - IProgressMonitor monitor; - ResourceArray structuralPath; - IDiagramLoader loader; - IHintObservable initialHints; - - public DiagramLoadQuery(IProgressMonitor monitor, Resource model, Resource resource, Resource runtime, ResourceArray structuralPath, IDiagramLoader loader, IHintObservable initialHints) { - super(resource); - -// if (runtime == null) -// throw new IllegalArgumentException("null runtime diagram resource"); - - this.model = model; - this.runtime = runtime; - this.monitor = monitor; - this.structuralPath = structuralPath != null ? structuralPath : ResourceArray.EMPTY; - this.loader = loader; - this.initialHints = initialHints; - } - - @Override - public IDiagram perform(ReadGraph graph) throws DatabaseException { - return loader.loadDiagram(monitor, graph, graph.getPossibleURI(model), resource, runtime, structuralPath, initialHints); - } - - @Override - public boolean equals(Object other) { - // Make sure that we always receive a new result - return this == other; - } - - @Override - public int hashCode() { - return super.hashCode() + 31 * getClass().hashCode(); - } - -} +/******************************************************************************* + * 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.query; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.common.ResourceArray; +import org.simantics.db.common.request.ResourceRead; +import org.simantics.db.exception.DatabaseException; +import org.simantics.diagram.adapter.IDiagramLoader; +import org.simantics.g2d.diagram.IDiagram; +import org.simantics.utils.datastructures.hints.IHintObservable; + +/** + * @author Tuukka Lehtonen + */ +public class DiagramLoadQuery extends ResourceRead { + + Resource model; + Resource runtime; + IProgressMonitor monitor; + ResourceArray structuralPath; + IDiagramLoader loader; + IHintObservable initialHints; + + public DiagramLoadQuery(IProgressMonitor monitor, Resource model, Resource resource, Resource runtime, ResourceArray structuralPath, IDiagramLoader loader, IHintObservable initialHints) { + super(resource); + +// if (runtime == null) +// throw new IllegalArgumentException("null runtime diagram resource"); + + this.model = model; + this.runtime = runtime; + this.monitor = monitor; + this.structuralPath = structuralPath != null ? structuralPath : ResourceArray.EMPTY; + this.loader = loader; + this.initialHints = initialHints; + } + + @Override + public IDiagram perform(ReadGraph graph) throws DatabaseException { + return loader.loadDiagram(monitor, graph, graph.getPossibleURI(model), resource, runtime, structuralPath, initialHints); + } + + @Override + public boolean equals(Object other) { + // Make sure that we always receive a new result + return this == other; + } + + @Override + public int hashCode() { + return super.hashCode() + 31 * getClass().hashCode(); + } + +}