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