public TagsModel() { TAG_TYPES_PROPERTY = new ReadOnlyMapWrapper<>(FXCollections.observableHashMap()); PREDEFINED_TAGS_PROPERTY = new ReadOnlyMapWrapper<>(FXCollections.observableHashMap()); CUSTOM_TAGS_PROPERTY = new ReadOnlyListWrapper<>(FXCollections.observableArrayList()); // for (PredefinedTagType predefinedTag : PredefinedTagType.values()) { final TagType tagType = predefinedTag.get(); final int tagId = tagType.getId(); if (null != TAG_TYPES_PROPERTY.putIfAbsent(tagId, tagType)) { System.out.println(String.format("%s already exists (id=%d)", TagType.class.getSimpleName(), tagId)); } if (null != PREDEFINED_TAGS_PROPERTY.put(tagId, new TagModel(tagType.getName(), StringType.empty()))) { System.out.println(String.format("%s already exists (id=%d)", PredefinedTagType.class.getSimpleName(), tagId)); } } }
public PhysLayout(Pane root) { this.root = root; nodes = new ReadOnlySetWrapper<>(FXCollections.observableSet()); connections = new HashMap<>(); tethers = new HashMap<>(); neighbors = new HashMap<>(); masses = new ReadOnlyMapWrapper(FXCollections.observableMap(new HashMap<>())); fields = new HashSet<>(); }
@Override public ObservableMap<String, Analyzer<?>> getAllCustomAnalyzers() { return new ReadOnlyMapWrapper<>(this.customAnalyzersMap); }