当前位置: 首页>>代码示例>>Java>>正文


Java ObservableList.addAll方法代码示例

本文整理汇总了Java中javafx.collections.ObservableList.addAll方法的典型用法代码示例。如果您正苦于以下问题:Java ObservableList.addAll方法的具体用法?Java ObservableList.addAll怎么用?Java ObservableList.addAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.collections.ObservableList的用法示例。


在下文中一共展示了ObservableList.addAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findAllLinksInLinkMappingWithoutParent

import javafx.collections.ObservableList; //导入方法依赖的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;
}
 
开发者ID:Naoghuman,项目名称:ABC-List,代码行数:16,代码来源:LinkMappingSqlService.java

示例2: createAnisotropyControl

import javafx.collections.ObservableList; //导入方法依赖的package包/类
/**
 * Create the anisotropy control
 */
@FXThread
private void createAnisotropyControl(@NotNull final VBox root) {

    final HBox container = new HBox();
    container.setAlignment(Pos.CENTER_LEFT);

    final Label label = new Label(Messages.SETTINGS_DIALOG_ANISOTROPY + ":");

    anisotropyComboBox = new ComboBox<>();
    anisotropyComboBox.prefWidthProperty().bind(root.widthProperty());
    anisotropyComboBox.getSelectionModel()
            .selectedItemProperty()
            .addListener((observable, oldValue, newValue) -> validate());

    FXUtils.addToPane(label, container);
    FXUtils.addToPane(anisotropyComboBox, container);
    FXUtils.addToPane(container, root);

    FXUtils.addClassTo(label, CSSClasses.SETTINGS_DIALOG_LABEL);
    FXUtils.addClassTo(anisotropyComboBox, CSSClasses.SETTINGS_DIALOG_FIELD);

    final ObservableList<Integer> items = anisotropyComboBox.getItems();
    items.addAll(ANISOTROPYCS);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:28,代码来源:SettingsDialog.java

示例3: createOpenGLControl

import javafx.collections.ObservableList; //导入方法依赖的package包/类
/**
 * Create the open GL control
 */
@FXThread
private void createOpenGLControl(@NotNull final VBox root) {

    final HBox container = new HBox();
    container.setAlignment(Pos.CENTER_LEFT);

    final Label label = new Label(Messages.SETTINGS_DIALOG_OPEN_GL_LABEL + ":");

    openGLVersionComboBox = new ComboBox<>();
    openGLVersionComboBox.prefWidthProperty().bind(root.widthProperty());
    openGLVersionComboBox.getSelectionModel()
            .selectedItemProperty()
            .addListener((observable, oldValue, newValue) -> validate());

    FXUtils.addToPane(label, container);
    FXUtils.addToPane(openGLVersionComboBox, container);
    FXUtils.addToPane(container, root);

    FXUtils.addClassTo(label, CSSClasses.SETTINGS_DIALOG_LABEL);
    FXUtils.addClassTo(openGLVersionComboBox, CSSClasses.SETTINGS_DIALOG_FIELD);

    final ObservableList<OpenGLVersion> items = openGLVersionComboBox.getItems();
    items.addAll(GL_VERSIONS);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:28,代码来源:SettingsDialog.java

示例4: findAllExerciseTermsWithExerciseId

import javafx.collections.ObservableList; //导入方法依赖的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;
}
 
开发者ID:Naoghuman,项目名称:ABC-List,代码行数:14,代码来源:ExerciseTermSqlService.java

示例5: findAllTopics

import javafx.collections.ObservableList; //导入方法依赖的package包/类
ObservableList<Topic> findAllTopics() {
    final ObservableList<Topic> allTopics = FXCollections.observableArrayList();
    final List<Topic> topics = DatabaseFacade.getDefault().getCrudService()
            .findByNamedQuery(Topic.class, ITopicConfiguration.NAMED_QUERY__NAME__FIND_ALL);
    
    allTopics.addAll(topics);
    Collections.sort(allTopics);

    return allTopics;
}
 
开发者ID:Naoghuman,项目名称:ABC-List,代码行数:11,代码来源:TopicSqlService.java

示例6: reload

import javafx.collections.ObservableList; //导入方法依赖的package包/类
/**
 * Reload the material.
 */
@FXThread
private void reload(@NotNull final Material material) {
    setCurrentMaterial(material);
    setIgnoreListeners(true);
    try {

        final MaterialEditor3DState editor3DState = getEditor3DState();
        editor3DState.updateMaterial(material);

        getSettingsTree().fill(new RootMaterialSettings(material));

        final ComboBox<String> materialDefinitionBox = getMaterialDefinitionBox();
        final ObservableList<String> items = materialDefinitionBox.getItems();
        items.clear();
        items.addAll(RESOURCE_MANAGER.getAvailableResources(FileExtensions.JME_MATERIAL_DEFINITION));

        final MaterialDef materialDef = material.getMaterialDef();
        materialDefinitionBox.getSelectionModel().select(materialDef.getAssetName());

    } finally {
        setIgnoreListeners(false);
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:27,代码来源:MaterialFileEditor.java

示例7: createToolbar

import javafx.collections.ObservableList; //导入方法依赖的package包/类
@Override
@FXThread
protected void createToolbar(@NotNull final HBox container) {
    super.createToolbar(container);

    final Label fastSkyLabel = new Label(Messages.MODEL_FILE_EDITOR_FAST_SKY + ":");

    fastSkyComboBox = new ComboBox<>();
    fastSkyComboBox.getSelectionModel()
            .selectedItemProperty()
            .addListener((observable, oldValue, newValue) -> changeFastSky(newValue));

    final ObservableList<String> skyItems = fastSkyComboBox.getItems();
    skyItems.addAll(FAST_SKY_LIST);

    final ResourceManager resourceManager = ResourceManager.getInstance();
    final Array<Path> additionalEnvs = resourceManager.getAdditionalEnvs();
    additionalEnvs.forEach(path -> skyItems.add(path.toString()));

    FXUtils.addToPane(fastSkyLabel, container);
    FXUtils.addToPane(fastSkyComboBox, container);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:23,代码来源:ModelFileEditor.java

示例8: addEditorOptionSettings

import javafx.collections.ObservableList; //导入方法依赖的package包/类
private void addEditorOptionSettings(HashMap<OptionSection, Pane> model,
		List<Submittable> submittables)
{
	PLPOptions editorSection = new PLPOptions("Editor");
	ObservableList<String> fontNames = getAvailableFontNames();
	
	// TODO acquire editor modes
	ObservableList<String> editorModes = FXCollections.observableArrayList();
	editorModes.addAll("plp");
	
	EditorSettingsPanel editorPanel = new EditorSettingsPanel(fontNames, editorModes);
	submittables.add(editorPanel);
	
	model.put(editorSection, editorPanel);
}
 
开发者ID:dhawal9035,项目名称:WebPLP,代码行数:16,代码来源:Main.java

示例9: getChartData

import javafx.collections.ObservableList; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
private ObservableList<XYChart.Series<String, Double>> getChartData() {
       double aValue = 0;
       ObservableList<XYChart.Series<String, Double>> answer = FXCollections.observableArrayList();
       Series<String, Double> aSeries = new Series<String, Double>();
       aSeries.setName("dates");
       
       String qcount= "SELECT date, COUNT(date) FROM  officeentry GROUP BY date";
	DBConnect.connect();
	try 
	{
		ResultSet rec = DBConnect.stmt.executeQuery(qcount);
		while(rec.next())
		{
			String date = rec.getString("date");
			int count= rec.getInt("COUNT(date)");
			aSeries.getData().add(new XYChart.Data(date, count));
            aValue = aValue + Math.random() - .5;
		}
		
	} catch (SQLException e) 
	{
		ErrorMessage.display("SQL Error", e.getMessage()+"\n error");
		e.printStackTrace();
	}
       
       answer.addAll(aSeries);
       return answer;
   }
 
开发者ID:mikemacharia39,项目名称:gatepass,代码行数:30,代码来源:Officebar.java

示例10: getChartData

import javafx.collections.ObservableList; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
private ObservableList<XYChart.Series<String, Double>> getChartData() {
       double aValue = 0;
       ObservableList<XYChart.Series<String, Double>> answer = FXCollections.observableArrayList();
       Series<String, Double> aSeries = new Series<String, Double>();
       aSeries.setName("dates");
       
       String qcount= "SELECT date, COUNT(date) FROM  gateentry GROUP BY date";
	DBConnect.connect();
	try 
	{
		ResultSet rec = DBConnect.stmt.executeQuery(qcount);
		while(rec.next())
		{
			String date = rec.getString("date");
			int count= rec.getInt("COUNT(date)");
			aSeries.getData().add(new XYChart.Data(date, count));
            aValue = aValue + Math.random() - .5;
		}
		
	} catch (SQLException e) 
	{
		ErrorMessage.display("SQL Error", e.getMessage()+"\n error");
		e.printStackTrace();
	}
       
       answer.addAll(aSeries);
       return answer;
   }
 
开发者ID:mikemacharia39,项目名称:gatepass,代码行数:30,代码来源:StudentChart.java

示例11: EnumPropertyControl

import javafx.collections.ObservableList; //导入方法依赖的package包/类
public EnumPropertyControl(@Nullable final E propertyValue, @NotNull final String propertyName,
                           @NotNull final C changeConsumer, @NotNull final E[] availableValues,
                           @Nullable final SixObjectConsumer<C, T, String, E, E, BiConsumer<T, E>> changeHandler) {
    super(propertyValue, propertyName, changeConsumer, changeHandler);
    final ObservableList<E> items = getEnumComboBox().getItems();
    items.addAll(availableValues);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:8,代码来源:EnumPropertyControl.java

示例12: findAllTerms

import javafx.collections.ObservableList; //导入方法依赖的package包/类
ObservableList<Term> findAllTerms() {
    final ObservableList<Term> allTerms = FXCollections.observableArrayList();
    final List<Term> terms = DatabaseFacade.getDefault().getCrudService()
            .findByNamedQuery(Term.class, NAMED_QUERY__NAME__FIND_ALL);
    
    allTerms.addAll(terms);
    Collections.sort(allTerms);

    return allTerms;
}
 
开发者ID:Naoghuman,项目名称:ABC-List,代码行数:11,代码来源:TermSqlService.java

示例13: addElementsTest

import javafx.collections.ObservableList; //导入方法依赖的package包/类
@Test
public void addElementsTest()
{
    final ObservableList<Integer> list1 = FXCollections.observableArrayList(0, 1, 2);
    final ObservableList<Integer> list2 = FXCollections.observableArrayList(3);
    final ObservableList<Integer> list3 = FXCollections.observableArrayList(4, 5);

    final ObservableListAggregation<Integer> listAggregation = new ObservableListAggregation<>(list1, list2, list3);
    final AtomicReference<Change<? extends Integer>> change = new AtomicReference<>(null);
    listAggregation.addListener((ListChangeListener<Integer>) c -> {
        change.set(c);
    });

    list2.addAll(6, 7);

    assertNotNull("Change event", change.get());
    assertTrue("Has change", change.get().next());
    assertTrue("Was added", change.get().wasAdded());
    assertFalse("Was removed", change.get().wasRemoved());
    assertFalse("Was update", change.get().wasUpdated());
    assertFalse("Was permuted", change.get().wasPermutated());
    assertEquals("from", 4, change.get().getFrom());
    assertEquals("to", 6, change.get().getTo());
    assertEquals("Added sub-list", Arrays.asList(6, 7), change.get().getAddedSubList());
    assertFalse("Has more change", change.get().next());

    assertEquals("size", 8, listAggregation.size());
    assertEquals("get(0)", Integer.valueOf(0), listAggregation.get(0));
    assertEquals("get(1)", Integer.valueOf(1), listAggregation.get(1));
    assertEquals("get(2)", Integer.valueOf(2), listAggregation.get(2));
    assertEquals("get(3)", Integer.valueOf(3), listAggregation.get(3));
    assertEquals("get(4)", Integer.valueOf(6), listAggregation.get(4));
    assertEquals("get(5)", Integer.valueOf(7), listAggregation.get(5));
    assertEquals("get(6)", Integer.valueOf(4), listAggregation.get(6));
    assertEquals("get(7)", Integer.valueOf(5), listAggregation.get(7));
}
 
开发者ID:ben12,项目名称:infxnity,代码行数:37,代码来源:ObservableListAggregationTest.java

示例14: refreshMySong

import javafx.collections.ObservableList; //导入方法依赖的package包/类
@FXML
public static void refreshMySong() {

    ArrayList<String[]> songs = Functions.thirdList(HomeController.user);
    ObservableList<String[]> dataobv = FXCollections.observableArrayList();
    dataobv.addAll(songs);
    mylistStatic.setItems(dataobv);
}
 
开发者ID:prakamya-mishra,项目名称:Shield,代码行数:9,代码来源:HomeController.java

示例15: onActionShowAllLinksFromSelectedTerm

import javafx.collections.ObservableList; //导入方法依赖的package包/类
public void onActionShowAllLinksFromSelectedTerm() {
    // Is any [Term] in the [ComboBox] selected?
    if (cbFindLinksInTerms.getSelectionModel().isEmpty()) {
        lInfoFoundedLinks.setText(LinkPresentationConverter.getI18nMsgFoundedEntities(NO_ENTITY));
        return;
    }
    
    LoggerFacade.getDefault().debug(this.getClass(), "On action show all [Link]s from selected [Term]"); // NOI18N

    // Which [Link]s should be loaded
    final Term term = cbFindLinksInTerms.getSelectionModel().getSelectedItem();
    final long parentId = term.getId();
    
    // Load [Term]
    final ObservableList<Link> links = FXCollections.observableArrayList();
    if (Objects.equals(parentId, DEFAULT_ID__TERM__SHOW_ALL_EXISTING_LINKS)) {
        links.addAll(SqlProvider.getDefault().findAllLinks());
    }
    else if (Objects.equals(parentId, DEFAULT_ID__TERM__SHOW_ALL_LINKS_WITHOUT_PARENT)) {
        links.addAll(SqlProvider.getDefault().findAllLinksInLinkMappingWithoutParent());
    }
    else {
        links.addAll(SqlProvider.getDefault().findAllLinksInLinkMappingWithParent(parentId, LinkMappingType.TOPIC));
    }
    
    // Show them in gui
    lInfoFoundedLinks.setText(LinkPresentationConverter.getI18nMsgFoundedEntities(links.size()));
     
    lvFoundedLinks.getItems().clear();
    lvFoundedLinks.getItems().addAll(links);
}
 
开发者ID:Naoghuman,项目名称:ABC-List,代码行数:32,代码来源:ApplicationPresenter.java


注:本文中的javafx.collections.ObservableList.addAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。