]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/TypicalInfoBean.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.modeling / src / org / simantics / modeling / typicals / TypicalInfoBean.java
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 (file)
index 0000000..e17ae8a
--- /dev/null
@@ -0,0 +1,74 @@
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.modeling.typicals;\r
+\r
+import java.util.Map;\r
+import java.util.Set;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.databoard.annotations.Identifier;\r
+import org.simantics.databoard.annotations.Optional;\r
+import org.simantics.databoard.binding.Binding;\r
+import org.simantics.databoard.util.Bean;\r
+import org.simantics.db.Resource;\r
+\r
+/**\r
+ * Information structure for a single typical diagram instance diagram.\r
+ * \r
+ * @author Tuukka Lehtonen\r
+ */\r
+public class TypicalInfoBean extends Bean.Id {\r
+\r
+    public static final Binding BINDING = Bindings.getBindingUnchecked(TypicalInfoBean.class);\r
+\r
+    /**\r
+     * All DIA.Elements in the typical diagram instance.\r
+     */\r
+    @Identifier public Set<Resource>           instanceElements;\r
+\r
+    /**\r
+     * Maps all typical diagram instance elements to template elements where\r
+     * a MOD.HasElementSource mapping exists.\r
+     */\r
+    @Identifier public Map<Resource, Resource> instanceToTemplate;\r
+\r
+    /**\r
+     * Inverse map of {@link #instanceToTemplate}\r
+     */\r
+    public Map<Resource, Resource>             templateToInstance;\r
+\r
+    /**\r
+     * Describes the set of DIA.Elements that are marked with\r
+     * MOD.IsTemplatized tag.\r
+     */\r
+    @Identifier public Set<Resource>           isTemplatized;\r
+\r
+    /**\r
+     * Current set of template diagram elements.\r
+     */\r
+    @Optional public transient Set<Resource>   templateElements;\r
+\r
+    /**\r
+     * Auxiliary transient data passed on during synchronization.\r
+     */\r
+    @Optional public transient Map<Object, Object> auxiliary;\r
+\r
+    public TypicalInfoBean() {\r
+        super(BINDING);\r
+    }\r
+\r
+    @SuppressWarnings("unchecked")\r
+    public <T> T getAux(Object key) {\r
+        return auxiliary == null ? null : (T) auxiliary.get(key);\r
+    }\r
+\r
+}
\ No newline at end of file