X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.modeling%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Ftypicals%2FTypicalInfoBean.java;fp=bundles%2Forg.simantics.modeling%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Ftypicals%2FTypicalInfoBean.java;h=e17ae8a24eb5736d44f5e9809911f3e7b0f6bf07;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/TypicalInfoBean.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/TypicalInfoBean.java new file mode 100644 index 000000000..e17ae8a24 --- /dev/null +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/TypicalInfoBean.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * Copyright (c) 2007, 2012 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.modeling.typicals; + +import java.util.Map; +import java.util.Set; + +import org.simantics.databoard.Bindings; +import org.simantics.databoard.annotations.Identifier; +import org.simantics.databoard.annotations.Optional; +import org.simantics.databoard.binding.Binding; +import org.simantics.databoard.util.Bean; +import org.simantics.db.Resource; + +/** + * Information structure for a single typical diagram instance diagram. + * + * @author Tuukka Lehtonen + */ +public class TypicalInfoBean extends Bean.Id { + + public static final Binding BINDING = Bindings.getBindingUnchecked(TypicalInfoBean.class); + + /** + * All DIA.Elements in the typical diagram instance. + */ + @Identifier public Set instanceElements; + + /** + * Maps all typical diagram instance elements to template elements where + * a MOD.HasElementSource mapping exists. + */ + @Identifier public Map instanceToTemplate; + + /** + * Inverse map of {@link #instanceToTemplate} + */ + public Map templateToInstance; + + /** + * Describes the set of DIA.Elements that are marked with + * MOD.IsTemplatized tag. + */ + @Identifier public Set isTemplatized; + + /** + * Current set of template diagram elements. + */ + @Optional public transient Set templateElements; + + /** + * Auxiliary transient data passed on during synchronization. + */ + @Optional public transient Map auxiliary; + + public TypicalInfoBean() { + super(BINDING); + } + + @SuppressWarnings("unchecked") + public T getAux(Object key) { + return auxiliary == null ? null : (T) auxiliary.get(key); + } + +} \ No newline at end of file