本文整理汇总了Java中javafx.collections.FXCollections.observableHashMap方法的典型用法代码示例。如果您正苦于以下问题:Java FXCollections.observableHashMap方法的具体用法?Java FXCollections.observableHashMap怎么用?Java FXCollections.observableHashMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.collections.FXCollections
的用法示例。
在下文中一共展示了FXCollections.observableHashMap方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TagsModel
import javafx.collections.FXCollections; //导入方法依赖的package包/类
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));
}
}
}
示例2: findAllTermsWithTitle
import javafx.collections.FXCollections; //导入方法依赖的package包/类
ObservableList<Term> findAllTermsWithTitle(String title) {
final ObservableList<Term> allTermsWithTitle = FXCollections.observableArrayList();
final Map<String, Object> parameters = FXCollections.observableHashMap();
parameters.put(TERM__COLUMN_NAME__TITLE, title);
final List<Term> terms = DatabaseFacade.getDefault().getCrudService()
.findByNamedQuery(Term.class, NAMED_QUERY__NAME__FIND_ALL_WITH_TITLE, parameters);
allTermsWithTitle.addAll(terms);
Collections.sort(allTermsWithTitle);
return allTermsWithTitle;
}
示例3: findAllLinksInLinkMappingWithoutParent
import javafx.collections.FXCollections; //导入方法依赖的package包/类
ObservableList<LinkMapping> findAllLinksInLinkMappingWithoutParent() {
final ObservableList<LinkMapping> allLinkMappingsWithoutParent = FXCollections.observableArrayList();
final Map<String, Object> parameters = FXCollections.observableHashMap();
parameters.put(LINK_MAPPING__COLUMN_NAME__PARENT_TYPE, LinkMappingType.NOT_DEFINED);
parameters.put(LINK_MAPPING__COLUMN_NAME__CHILD_TYPE, LinkMappingType.LINK);
final List<LinkMapping> linkMappings = DatabaseFacade.getDefault().getCrudService()
.findByNamedQuery(LinkMapping.class, NAMED_QUERY__NAME__FIND_ALL_WITH_PARENTTYPE_AND_CHILDTYPE, parameters);
allLinkMappingsWithoutParent.addAll(linkMappings);
Collections.sort(allLinkMappingsWithoutParent);
return allLinkMappingsWithoutParent;
}
示例4: findAllLinksInLinkMappingWithParent
import javafx.collections.FXCollections; //导入方法依赖的package包/类
ObservableList<LinkMapping> findAllLinksInLinkMappingWithParent(final long parentId, final LinkMappingType parentType) {
final ObservableList<LinkMapping> allLinkMappingsWithParent = FXCollections.observableArrayList();
final Map<String, Object> parameters = FXCollections.observableHashMap();
parameters.put(LINK_MAPPING__COLUMN_NAME__PARENT_ID, parentId);
parameters.put(LINK_MAPPING__COLUMN_NAME__PARENT_TYPE, parentType);
final List<LinkMapping> linkMappings = DatabaseFacade.getDefault().getCrudService()
.findByNamedQuery(LinkMapping.class, NAMED_QUERY__NAME__FIND_ALL_WITH_PARENT, parameters);
allLinkMappingsWithParent.addAll(linkMappings);
Collections.sort(allLinkMappingsWithParent);
return allLinkMappingsWithParent;
}
示例5: findAllExerciseTermsWithExerciseId
import javafx.collections.FXCollections; //导入方法依赖的package包/类
ObservableList<ExerciseTerm> findAllExerciseTermsWithExerciseId(long exerciseId) {
final ObservableList<ExerciseTerm> allTermsWithExerciseId = FXCollections.observableArrayList();
final Map<String, Object> parameters = FXCollections.observableHashMap();
parameters.put(IExerciseTermConfiguration.EXERCISE_TERM__COLUMN_NAME__EXERCISE_ID, exerciseId);
final List<ExerciseTerm> exerciseTerms = DatabaseFacade.getDefault().getCrudService()
.findByNamedQuery(ExerciseTerm.class, IExerciseTermConfiguration.NAMED_QUERY__NAME__FIND_ALL_EXERCISE_TERMS_WITH_EXERCISE_ID, parameters);
allTermsWithExerciseId.addAll(exerciseTerms);
Collections.sort(allTermsWithExerciseId);
return allTermsWithExerciseId;
}
示例6: findAllExercisesWithTopicId
import javafx.collections.FXCollections; //导入方法依赖的package包/类
ObservableList<Exercise> findAllExercisesWithTopicId(long topicId) {
final ObservableList<Exercise> allExercisesWithTopicId = FXCollections.observableArrayList();
final Map<String, Object> parameters = FXCollections.observableHashMap();
parameters.put(EXERCISE__COLUMN_NAME__TOPIC_ID, topicId);
final List<Exercise> exercises = DatabaseFacade.getDefault().getCrudService()
.findByNamedQuery(Exercise.class, NAMED_QUERY__NAME__FIND_ALL_WITH_TOPIC_ID, parameters);
allExercisesWithTopicId.addAll(exercises);
Collections.sort(allExercisesWithTopicId);
return allExercisesWithTopicId;
}
示例7: GraphVisualizer
import javafx.collections.FXCollections; //导入方法依赖的package包/类
/**
* Create a new {@link GraphVisualizer} instance.
* <p>
* The passed {@link GraphStore} is observed by this class. If the {@link GraphStore}
* {@link org.dnacronym.hygene.parser.GfaFile} is updated, it will prompt a redraw. Changing the properties of this
* class will also prompt a redraw if the {@link org.dnacronym.hygene.parser.GfaFile} in {@link GraphStore} is not
* {@code null}.
*
* @param graphDimensionsCalculator {@link GraphDimensionsCalculator} used to calculate node positions
* @param query the {@link Query} used to get the currently queried nodes
* @param bookmarkStore the {@link BookmarkStore} used to draw bookmark indications
* @param graphAnnotation the {@link GraphAnnotation} used to draw annotations
*/
@Inject
public GraphVisualizer(final GraphDimensionsCalculator graphDimensionsCalculator, final Query query,
final BookmarkStore bookmarkStore, final GraphAnnotation graphAnnotation,
final GraphStore graphStore) {
HygeneEventBus.getInstance().register(this);
this.graphDimensionsCalculator = graphDimensionsCalculator;
this.query = query;
this.bookmarkStore = bookmarkStore;
this.colorRoulette = new ColorRoulette();
this.graphAnnotation = graphAnnotation;
this.graphStore = graphStore;
selectedSegmentProperty = new SimpleObjectProperty<>();
selectedSegmentProperty.addListener((observable, oldValue, newValue) -> draw());
hoveredSegmentProperty = new SimpleObjectProperty<>();
hoveredSegmentProperty.addListener((observable, oldValue, newValue) -> draw());
genomePaths = FXCollections.observableArrayList(new HashSet<>());
selectedGenomePaths = FXCollections.observableHashMap();
selectedGenomePaths.addListener((MapChangeListener<String, Color>) change -> draw());
edgeColorProperty = new SimpleObjectProperty<>(DEFAULT_EDGE_COLOR);
nodeHeightProperty = new SimpleDoubleProperty(DEFAULT_NODE_HEIGHT);
graphDimensionsCalculator.getNodeHeightProperty().bind(nodeHeightProperty);
edgeColorProperty.addListener((observable, oldValue, newValue) -> draw());
nodeHeightProperty.addListener((observable, oldValue, newValue) -> draw());
Node.setColorScheme(BasicSettingsViewController.NODE_COLOR_SCHEMES.get(0).getValue());
displayLaneBordersProperty = new SimpleBooleanProperty();
displayLaneBordersProperty.addListener((observable, oldValue, newValue) -> draw());
graphDimensionsCalculator.getGraphProperty()
.addListener((observable, oldValue, newValue) -> setGraph(newValue));
graphDimensionsCalculator.getObservableQueryNodes()
.addListener((ListChangeListener<Node>) change -> draw());
query.getQueriedNodes().addListener((ListChangeListener<Integer>) observable -> draw());
segmentDrawingToolkit = new SegmentDrawingToolkit();
snpDrawingToolkit = new SnpDrawingToolkit();
edgeDrawingToolkit = new EdgeDrawingToolkit();
graphAnnotationVisualizer = new GraphAnnotationVisualizer(graphDimensionsCalculator);
graphAnnotation.indexBuiltProperty().addListener((observable, oldValue, newValue) -> draw());
nodeHeightProperty.addListener((observable, oldValue, newValue) -> {
segmentDrawingToolkit.setNodeHeight(nodeHeightProperty.get());
snpDrawingToolkit.setNodeHeight(nodeHeightProperty.get());
draw();
});
segmentDrawingToolkit.setNodeHeight(nodeHeightProperty.get());
snpDrawingToolkit.setNodeHeight(nodeHeightProperty.get());
}