1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2012 Association for Decentralized Information Management in
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.modeling.typicals;
\r
14 import java.util.Map;
\r
15 import java.util.Set;
\r
17 import org.simantics.databoard.Bindings;
\r
18 import org.simantics.databoard.annotations.Identifier;
\r
19 import org.simantics.databoard.annotations.Optional;
\r
20 import org.simantics.databoard.binding.Binding;
\r
21 import org.simantics.databoard.util.Bean;
\r
22 import org.simantics.db.Resource;
\r
25 * Information structure for a single typical diagram instance diagram.
\r
27 * @author Tuukka Lehtonen
\r
29 public class TypicalInfoBean extends Bean.Id {
\r
31 public static final Binding BINDING = Bindings.getBindingUnchecked(TypicalInfoBean.class);
\r
34 * All DIA.Elements in the typical diagram instance.
\r
36 @Identifier public Set<Resource> instanceElements;
\r
39 * Maps all typical diagram instance elements to template elements where
\r
40 * a MOD.HasElementSource mapping exists.
\r
42 @Identifier public Map<Resource, Resource> instanceToTemplate;
\r
45 * Inverse map of {@link #instanceToTemplate}
\r
47 public Map<Resource, Resource> templateToInstance;
\r
50 * Describes the set of DIA.Elements that are marked with
\r
51 * MOD.IsTemplatized tag.
\r
53 @Identifier public Set<Resource> isTemplatized;
\r
56 * Current set of template diagram elements.
\r
58 @Optional public transient Set<Resource> templateElements;
\r
61 * Auxiliary transient data passed on during synchronization.
\r
63 @Optional public transient Map<Object, Object> auxiliary;
\r
65 public TypicalInfoBean() {
\r
69 @SuppressWarnings("unchecked")
\r
70 public <T> T getAux(Object key) {
\r
71 return auxiliary == null ? null : (T) auxiliary.get(key);
\r