Java 类javafx.beans.property.ReadOnlyMapWrapper 实例源码

项目:core-domain-tags    文件:TagsModel.java   
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));
        }
    }
}
项目:PhysLayout    文件:PhysLayout.java   
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<>();
}
项目:story-inspector    文件:DirectoryBasedCustomAnalyzerRegistry.java   
@Override
public ObservableMap<String, Analyzer<?>> getAllCustomAnalyzers() {
    return new ReadOnlyMapWrapper<>(this.customAnalyzersMap);
}