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


Java ObservableListWrapper类代码示例

本文整理汇总了Java中com.sun.javafx.collections.ObservableListWrapper的典型用法代码示例。如果您正苦于以下问题:Java ObservableListWrapper类的具体用法?Java ObservableListWrapper怎么用?Java ObservableListWrapper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: createCollection

import com.sun.javafx.collections.ObservableListWrapper; //导入依赖的package包/类
@Override
protected Object createCollection(Class type) {
    if (type == ObservableListWrapper.class) {
        return FXCollections.observableArrayList();
    }
    if (type.getName().indexOf("$") > 0) {
        if (type.getName().equals("javafx.collections.FXCollections$SynchronizedObservableList")) {
            return FXCollections.synchronizedObservableList(FXCollections.observableArrayList());
        }
    }
    return new SimpleListProperty<>(FXCollections.observableArrayList());
}
 
开发者ID:tomrom95,项目名称:GameAuthoringEnvironment,代码行数:13,代码来源:ObservableListConverter.java

示例2: loadData

import com.sun.javafx.collections.ObservableListWrapper; //导入依赖的package包/类
private void loadData(List<Map<String, String>> data) {
    batchDataTable.getColumns().clear();

    TableColumn<Map<String, String>, String> numberCol = new TableColumn("");
    numberCol.setCellValueFactory(row -> new ReadOnlyObjectWrapper(
            (row.getTableView().getItems().indexOf(row.getValue()) + 1) + ""));
    batchDataTable.getColumns().add(numberCol);
    numberCol.setMinWidth(50);

    data.get(0).keySet().forEach(varName -> {
        TableColumn<Map<String, String>, String> varCol = new TableColumn(varName);
        varCol.setCellValueFactory(row -> new ReadOnlyObjectWrapper(row.getValue().get(varName)));
        batchDataTable.getColumns().add(varCol);
    });

    batchDataTable.setItems(new ObservableListWrapper<>(data));
}
 
开发者ID:Adobe-Consulting-Services,项目名称:curly,代码行数:18,代码来源:AppController.java

示例3: updateBatchSize

import com.sun.javafx.collections.ObservableListWrapper; //导入依赖的package包/类
private void updateBatchSize(String newValue) {
    try {
        batchSizeValue = Integer.parseInt(newValue);
    } catch (NumberFormatException ex) {
        batchSizeValue = -1;
    }
    if (batchSizeValue <= 0 || batchSizeValue >= batchDataTable.getItems().size()) {
        batchNumberChoice.setValue(null);
        batchNumberChoice.setDisable(true);
        batchSize.clear();
        batchSizeValue = -1;
        if (newValue != null && !newValue.isEmpty()) {
            Platform.runLater(()->batchSize.setText(null));
        }
        return;
    } else {
        batchNumberChoice.setDisable(false);
        int numBatches = (batchDataTable.getItems().size() + batchSizeValue - 1) / batchSizeValue;
        numBatches = Math.min(numBatches, 50);
        List<Integer> selections = IntStream.range(1, numBatches+1).boxed().collect(Collectors.toList());
        batchNumberChoice.setItems(new ObservableListWrapper<>(selections));
        batchNumberChoice.setValue(1);
    }
}
 
开发者ID:Adobe-Consulting-Services,项目名称:curly,代码行数:25,代码来源:AppController.java

示例4: setTableData

import com.sun.javafx.collections.ObservableListWrapper; //导入依赖的package包/类
private void setTableData(List<List<String>> data) {
    tableData = new ObservableListWrapper<>(data);
    int numberOfColumns = data.stream().map(List::size).reduce(Math::max).orElse(0);
    contentTable.getColumns().clear();
    colMapping = new ArrayList<>();
    for (int i = 0; i < numberOfColumns; i++) {
        colMapping.add(DONT_USE);
        TableColumn<List<String>, String> column = new TableColumn<>();
        final int index = i;
        ComboBox<String> selector = generateVariableSelector();
        selector.getSelectionModel().selectedItemProperty().
                addListener((prop, oldValue, newValue) -> colMapping.set(index, newValue));
        column.setGraphic(selector);
        column.setCellValueFactory((TableColumn.CellDataFeatures<List<String>, String> param) -> {
            List<String> row = param.getValue();
            String value = row.size() > index ? row.get(index) : null;
            return new SimpleStringProperty(value);
        });
        contentTable.getColumns().add(column);
    }
    contentTable.setItems(tableData);
}
 
开发者ID:Adobe-Consulting-Services,项目名称:curly,代码行数:23,代码来源:DataImporterController.java

示例5: createObservableList

import com.sun.javafx.collections.ObservableListWrapper; //导入依赖的package包/类
private ObservableList<Object> createObservableList(RfxTableView tableView) {
	try {
		 Object methodOwner=tableView.getMethodOwner();
			ActionMethodInfo actionMethodInfo=tableView.getMethodInfo();
					Object methodParameterValue=tableView.getMethodParameter();
		Object result = actionMethodInfo.invoke(methodOwner, methodParameterValue);
		List<Object> list = (List<Object>) result;
		// TODO create a createObservableList for all types, and that can be
		// updated when needed
		return new ObservableListWrapper<Object>(list);
	} catch (Exception e) {
		UserInterfaceController userInterfaceController = tableView.getuserInterfaceContainer()
				.get(UserInterfaceController.class);
		userInterfaceController.showErrorDialog(tableView.getViewTitle(), "Error getting table values.",
				e);
		return null;
	}
}
 
开发者ID:ntenhoeve,项目名称:Introspect-Framework,代码行数:19,代码来源:RfxTable.java

示例6: buildAssemblageConceptList

import com.sun.javafx.collections.ObservableListWrapper; //导入依赖的package包/类
private ObservableList<SimpleDisplayConcept> buildAssemblageConceptList()
{
	ObservableList<SimpleDisplayConcept> assemblageConcepts = new ObservableListWrapper<>(new ArrayList<SimpleDisplayConcept>());
	try
	{
		ConceptVersionBI colCon = OTFUtility.getConceptVersion(RefexDynamic.REFEX_DYNAMIC_IDENTITY.getNid());
		Set<ConceptVersionBI> colCons = OTFUtility.getAllChildrenOfConcept(colCon, false);

		for (ConceptVersionBI col : colCons) {
			assemblageConcepts.add(new SimpleDisplayConcept(col));
		}
	}
	catch (Exception e)
	{
		logger_.error("Unexpected error reading existing assemblage concepts", e);
	}

	return assemblageConcepts;
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:20,代码来源:AddRefexPopup.java

示例7: initialize

import com.sun.javafx.collections.ObservableListWrapper; //导入依赖的package包/类
public void initialize() {
    categoryList.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
    categoryList.setItems(new ObservableListWrapper(Viewer.log.getCategories()));
    categoryList.getSelectionModel().clearSelection();

    levelList.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
    levelList.setItems(new ObservableListWrapper(CollectionHelper.setToList(Viewer.log.levelSet)));
    levelList.getSelectionModel().clearSelection();

    reloadLog();
}
 
开发者ID:dmillerw,项目名称:MCLogViewer,代码行数:12,代码来源:ViewerController.java

示例8: openWorkbook

import com.sun.javafx.collections.ObservableListWrapper; //导入依赖的package包/类
private void openWorkbook(Workbook workbook) {
    ObservableList<String> sheets = new ObservableListWrapper<>(new ArrayList<>());
    for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
        worksheetSelector.getItems().add(workbook.getSheetName(i));
    }

    sheetReader = (String sheetName) -> readSheet(workbook.getSheet(sheetName));

    Platform.runLater(() -> worksheetSelector.getSelectionModel().selectFirst());
}
 
开发者ID:Adobe-Consulting-Services,项目名称:curly,代码行数:11,代码来源:DataImporterController.java

示例9: Benchmark

import com.sun.javafx.collections.ObservableListWrapper; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public Benchmark() {
	values = new ObservableList[Type.values().length];
	for (int i = 0; i < values.length; i++)
		values[i] = new ObservableListWrapper<>(new ArrayList<>());
		
	vertices = new ArrayList<>();
	edges = new ArrayList<>();
}
 
开发者ID:Dakror,项目名称:WSeminar,代码行数:10,代码来源:Benchmark.java

示例10: inputMethodEventComposed

import com.sun.javafx.collections.ObservableListWrapper; //导入依赖的package包/类
private ObservableList<InputMethodTextRun> inputMethodEventComposed(String text, int commitCount)
{
    List<InputMethodTextRun> composed = new ArrayList<>();
    if (commitCount < text.length())
    {
        composed.add(new InputMethodTextRun(
                text.substring(commitCount), InputMethodHighlight.UNSELECTED_RAW));
    }
    return new ObservableListWrapper<>(composed);
}
 
开发者ID:SkyLandTW,项目名称:JXTN,代码行数:11,代码来源:FXCanvas2.java

示例11: prepareList

import com.sun.javafx.collections.ObservableListWrapper; //导入依赖的package包/类
public void prepareList(String password) throws IOException {
    if (!ConfigurationUtil.exist()) {
        return;
    }

    websiteList.setCellFactory(new Callback<ListView<Configuration>, ListCell<Configuration>>() {

        @Override
        public ListCell<Configuration> call(ListView<Configuration> param) {
            return new ConfigListCell();
        }
    });
    websiteList.setItems(new ObservableListWrapper<>(ConfigurationUtil.readConfig(password.getBytes("UTF-8"))));

}
 
开发者ID:Serverfrog,项目名称:FrogPw,代码行数:16,代码来源:ConfigLoadDialogController.java

示例12: getSaves

import com.sun.javafx.collections.ObservableListWrapper; //导入依赖的package包/类
/**
 * Get the list of saves from the server for load from server.
 */
@FXML
public void getSaves() {
    Client client = new Client();
    if (isLoggedIn && client.isConnected()) {
        try {
            Thread saves = client.send("getsaves" + "-=-" + username);
            Thread quit = client.send("quit");

            saves.start();
            saves.join();

            quit.start();
            quit.join();

            String[] saveArray = client.getSaveArray();
            if (!saveArray[0].isEmpty()) {
                System.out.println();
                List<String> arrayList = Arrays.asList(saveArray);
                ObservableList<String> list = new ObservableListWrapper<>(arrayList);
                loadList.setItems(list);
                loadList.getSelectionModel().select(0);
                switchToLoadChoice();
            } else {
                dialogPane.createWarningDialog("No server saves found",
                        "It looks like you've never saved to the server before.\n" +
                                "Try saving to the server before loading from the server.");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    } else if (!isLoggedIn && client.isConnected()) {
        switchToLoginPage();
    } else {
        cancelLoadChoice();
    }
}
 
开发者ID:cis422s14team5,项目名称:WatchlistPro,代码行数:40,代码来源:Controller.java

示例13: setTvEditPane

import com.sun.javafx.collections.ObservableListWrapper; //导入依赖的package包/类
/**
 * Populates the tv edit pane based on passed in arguments. Called after fetch.
 */
protected void setTvEditPane(List<String> outputList) {
    tvTitleTextField.setText(outputList.get(0));
    if (outputList.get(1).equals("true")) {
        tvWatchedCheckBox.setSelected(true);
    }
    tvGenreTextField.setText(outputList.get(2));
    tvCreatorTextField.setText(outputList.get(3));
    tvNetworkTextField.setText(outputList.get(4));
    tvRuntimeTextField.setText(outputList.get(5));
    tvNumSeasonsTextField.setText(outputList.get(6));
    tvNumEpisodesTextField.setText(outputList.get(7));
    tvDescriptionTextField.setText(outputList.get(8));

    Type listType = new TypeToken<List<List<String>>>(){}.getType();
    List<List<String>> list = gson.fromJson(outputList.get(9), listType);

    ObservableList<List<Episode>> seasonList = FXCollections.observableArrayList();
    for (List<String> episodes : list) {
        List<Episode> episodeList = new ArrayList<>();
        for (String json : episodes) {
            Type mapType = new TypeToken<HashMap<String, String>>(){}.getType();
            HashMap<String, String> map = gson.fromJson(json, mapType);
            Episode episode = new Episode(map.get("seasonNum"), map.get("episodeName"), Boolean.parseBoolean(map.get("watched")));
            episodeList.add(episode);
        }
        seasonList.add(episodeList);
    }

    addEpisodesToTable(seasonList, tvEpisodeTable, seasonCol, episodeCol, watchedCol);

    masterSeasonList = new ObservableListWrapper<>(new ArrayList<>());

    episodeList.set(seasonList);

}
 
开发者ID:cis422s14team5,项目名称:WatchlistPro,代码行数:39,代码来源:Controller.java

示例14: createTvShow

import com.sun.javafx.collections.ObservableListWrapper; //导入依赖的package包/类
/**
 * Creates a new TvShow object.
 * @param titleString is the title of the TvShow object.
 * @return a new TvShow object.
 */
public TvShow createTvShow(String titleString) {
    StringProperty title = new SimpleStringProperty();
    title.set(titleString);

    StringProperty watched = new SimpleStringProperty();
    watched.set("false");

    StringProperty genre = new SimpleStringProperty();
    genre.set("");

    StringProperty runtime = new SimpleStringProperty();
    runtime.set("");

    StringProperty creator = new SimpleStringProperty();
    creator.set("");

    StringProperty network = new SimpleStringProperty();
    network.set("");

    StringProperty numSeasons = new SimpleStringProperty();
    numSeasons.set("0");

    StringProperty numEpisodes = new SimpleStringProperty();
    numEpisodes.set("0");

    StringProperty description = new SimpleStringProperty();
    description.set("");

    ListProperty<List<Episode>> episodeList = new SimpleListProperty<>();
    episodeList.set(new ObservableListWrapper<>(new ArrayList<>()));

    ListProperty<Boolean> seasonWatchedList = new SimpleListProperty<>();
    seasonWatchedList.set(new ObservableListWrapper<>(new ArrayList<>()));

    return new TvShow(title, watched, genre, runtime, description, creator, network, numSeasons, numEpisodes,
            episodeList, seasonWatchedList);
}
 
开发者ID:cis422s14team5,项目名称:WatchlistPro,代码行数:43,代码来源:MediaCreator.java

示例15: getGames

import com.sun.javafx.collections.ObservableListWrapper; //导入依赖的package包/类
public ObservableList<Game> getGames() {
    if (observableGames == null) {
        observableGames = new ObservableListWrapper<>(games);
        observableGames.addListener((ListChangeListener<? super Game>) c -> scoreProperty().set(calculateScore()));
    }
    return observableGames;
}
 
开发者ID:armanbilge,项目名称:ChessPairs,代码行数:8,代码来源:Player.java


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