本文整理汇总了Java中javafx.scene.control.cell.PropertyValueFactory类的典型用法代码示例。如果您正苦于以下问题:Java PropertyValueFactory类的具体用法?Java PropertyValueFactory怎么用?Java PropertyValueFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PropertyValueFactory类属于javafx.scene.control.cell包,在下文中一共展示了PropertyValueFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TableSample
import javafx.scene.control.cell.PropertyValueFactory; //导入依赖的package包/类
public TableSample() {
final ObservableList<Person> data = FXCollections.observableArrayList(
new Person("Jacob", "Smith", "[email protected]" ),
new Person("Isabella", "Johnson", "[email protected]" ),
new Person("Ethan", "Williams", "[email protected]" ),
new Person("Emma", "Jones", "[email protected]" ),
new Person("Michael", "Brown", "[email protected]" )
);
TableColumn firstNameCol = new TableColumn();
firstNameCol.setText("First");
firstNameCol.setCellValueFactory(new PropertyValueFactory("firstName"));
TableColumn lastNameCol = new TableColumn();
lastNameCol.setText("Last");
lastNameCol.setCellValueFactory(new PropertyValueFactory("lastName"));
TableColumn emailCol = new TableColumn();
emailCol.setText("Email");
emailCol.setMinWidth(200);
emailCol.setCellValueFactory(new PropertyValueFactory("email"));
TableView tableView = new TableView();
tableView.setItems(data);
tableView.getColumns().addAll(firstNameCol, lastNameCol, emailCol);
getChildren().add(tableView);
}
示例2: initializeTable
import javafx.scene.control.cell.PropertyValueFactory; //导入依赖的package包/类
public void initializeTable() {
dateColumn.setCellValueFactory(new PropertyValueFactory<Sale, String>("date"));
billNumberColumn.setCellValueFactory(new PropertyValueFactory<Sale, Long>("billNumber"));
patientNameColumn.setCellValueFactory(new PropertyValueFactory<Sale, String>("patientName"));
doctorNameColumn.setCellValueFactory(new PropertyValueFactory<Sale, String>("doctorName"));
companyNameColumn.setCellValueFactory(new PropertyValueFactory<Sale, String>("companyName"));
modeColumn.setCellValueFactory(new PropertyValueFactory<Sale, String>("mode"));
amountColumn.setCellValueFactory(new PropertyValueFactory<Sale, Float>("amount"));
saleList = getSale();
if (saleList.size() < 1) {
Calendar dateToday = Calendar.getInstance();
int year, day, month;
year = dateToday.get(Calendar.YEAR);
month = dateToday.get(Calendar.MONTH) + 1;
day = dateToday.get(Calendar.DAY_OF_MONTH);
String date = year + "-" + month + "-" + day;
saleList.add(new Sale(date, (long) 0, "-", "-", "-", "-", 0.0f));
}
saleTableView.setItems(saleList);
}
示例3: initialize
import javafx.scene.control.cell.PropertyValueFactory; //导入依赖的package包/类
@Override
public void initialize(URL url, ResourceBundle rb) {
cbTypes.getItems().addAll(OPT_2K3DES, OPT_3K3DES, OPT_AES);
cbTypes.setValue(OPT_2K3DES);
disableTextControl4Key();
//configuration for table AppIDs
appIdCol.setCellValueFactory(new PropertyValueFactory<>("id"));
selCol.setCellValueFactory(new PropertyValueFactory<>("type"));
//configuration for table view History
statusCol.setCellValueFactory(new PropertyValueFactory<>("status"));
cmdCol.setCellValueFactory(new PropertyValueFactory<>("command"));
uidCol.setCellValueFactory(new PropertyValueFactory<>("uid"));
receivedDataCol.setCellValueFactory(new PropertyValueFactory<>("receivedData"));
tbViewHistory.setItems(historyData);
setupUI();
}
示例4: searchDrugs
import javafx.scene.control.cell.PropertyValueFactory; //导入依赖的package包/类
private void searchDrugs(String query) {
drugDefault = false;
totalSearchDrug = drugGetway.totalSearchDrug(query);
paginate.setTotal(totalSearchDrug);
paginate.setStart(0);
paginate.setPerPage(10);
paginate.setEnd(10);
drugTable.getItems().clear();
drugs = drugGetway.searchDrug(paginate, query);
clmSl.setCellValueFactory(new PropertyValueFactory<>("sl"));
clmDrugName.setCellValueFactory(new PropertyValueFactory<>("name"));
clmGenericName.setCellValueFactory(new PropertyValueFactory<>("genricName"));
clmNote.setCellValueFactory(new PropertyValueFactory<>("note"));
clmUseInPrescription.setCellValueFactory(new PropertyValueFactory<>("useInPrescription"));
clmUseInTemplate.setCellValueFactory(new PropertyValueFactory<>("useInTemplate"));
clmAction.setCellFactory(action);
drugTable.setItems(drugs);
}
示例5: initialize
import javafx.scene.control.cell.PropertyValueFactory; //导入依赖的package包/类
@Override
public void initialize(URL url, ResourceBundle rb) {
makeFadeInTransition();
tblClmNome.setResizable(false);
tblClmPosicao.setResizable(false);
tblClmPontuacao.setResizable(false);
tblClmPosicao.setCellValueFactory(new PropertyValueFactory<ModelJogadorTable, Integer>("linhaTable"));
tblClmNome.setCellValueFactory(new PropertyValueFactory<ModelJogadorTable, String>("nomeTable"));
tblClmPontuacao.setCellValueFactory(new PropertyValueFactory<ModelJogadorTable, Integer>("pontuacaoTable"));
ObservableList<ModelJogadorTable> jogadorTable = FXCollections.observableArrayList(mostrarRankingView());
tblRanking.setItems(jogadorTable);
}
示例6: initialize
import javafx.scene.control.cell.PropertyValueFactory; //导入依赖的package包/类
@Override
public void initialize(URL location, ResourceBundle resources) {
registerFile.addObserver(this);
pc.addObserver(this);
lr.addObserver(this);
navigator.addObserver(this);
property.setCellValueFactory(new PropertyValueFactory<>("property"));
property.setComparator(new NavigatorRowComparator());
value.setCellValueFactory(new PropertyValueFactory<>("value"));
for(int i = 0; i < 13; i++) {
String registerName = "r" + Integer.toString(i);
data.add(new NavigatorRow(registerName, registerFile.getValue(registerName)));
}
data.add(new NavigatorRow("LR", lr.getValue()));
data.add(new NavigatorRow("PC", pc.getValue()));
table.setItems(data);
}
示例7: initialize
import javafx.scene.control.cell.PropertyValueFactory; //导入依赖的package包/类
@Override
public void initialize(URL url, ResourceBundle rb) {
itemVColumn.setCellValueFactory(new PropertyValueFactory("value"));
itemWColumn.setCellValueFactory(new PropertyValueFactory("weight"));
GAitemVColumn.setCellValueFactory(new PropertyValueFactory("value"));
GAitemWColumn.setCellValueFactory(new PropertyValueFactory("weight"));
SAitemVColumn.setCellValueFactory(new PropertyValueFactory("value"));
SAitemWColumn.setCellValueFactory(new PropertyValueFactory("weight"));
DPitemVColumn.setCellValueFactory(new PropertyValueFactory("value"));
DPitemWColumn.setCellValueFactory(new PropertyValueFactory("weight"));
HCitemVColumn.setCellValueFactory(new PropertyValueFactory("value"));
HCitemWColumn.setCellValueFactory(new PropertyValueFactory("weight"));
TSitemVColumn.setCellValueFactory(new PropertyValueFactory("value"));
TSitemWColumn.setCellValueFactory(new PropertyValueFactory("weight"));
HCVersionBox.getItems().addAll("Standard", "Stochastic", "Best First", "HC with Sideways Moves");
HCVersionBox.getSelectionModel().select(0);
}
示例8: defineTable
import javafx.scene.control.cell.PropertyValueFactory; //导入依赖的package包/类
private void defineTable() {
tableView = new TableView<>();
TableColumn<JWKItem, String> idCol = new TableColumn<>("ID");
TableColumn<JWKItem, String> typeCol = new TableColumn<>("Type");
TableColumn<JWKItem, Boolean> privateCol = new TableColumn<>("Private");
TableColumn<JWKItem, String> keyUseCol = new TableColumn<>("Key Usage");
idCol.setCellValueFactory(new PropertyValueFactory<>("kid"));
typeCol.setCellValueFactory(new PropertyValueFactory<>("keyType"));
privateCol.setCellValueFactory(new PropertyValueFactory<>("privatePart"));
keyUseCol.setCellValueFactory(new PropertyValueFactory<>("keyUse"));
tableView.getColumns().addAll(idCol, typeCol, privateCol, keyUseCol);
ObservableList<JWKItem> list = getItemList();
tableView.setItems(list);
}
示例9: defineTable
import javafx.scene.control.cell.PropertyValueFactory; //导入依赖的package包/类
private void defineTable() {
tableView = new TableView<>();
TableColumn<JWKItem, String> idCol = new TableColumn<>("ID");
TableColumn<JWKItem, String> typeCol = new TableColumn<>("Type");
TableColumn<JWKItem, Boolean> privateCol = new TableColumn<>("Private");
TableColumn<JWKItem, String> keyUseCol = new TableColumn<>("Key Usage");
idCol.setCellValueFactory(new PropertyValueFactory<>("kid"));
typeCol.setCellValueFactory(new PropertyValueFactory<>("keyType"));
privateCol.setCellValueFactory(new PropertyValueFactory<>("privatePart"));
keyUseCol.setCellValueFactory(new PropertyValueFactory<>("keyUse"));
tableView.getColumns().addAll(idCol, typeCol, privateCol, keyUseCol);
ObservableList<JWKItem> list = getItemList();
tableView.setItems(list);
/*
tableView.getSelectionModel().selectedItemProperty().addListener((obs, oldSelection, newSelection) -> {
if (newSelection != null) {
System.out.println(newSelection);
}
});
*/
}
示例10: initTable
import javafx.scene.control.cell.PropertyValueFactory; //导入依赖的package包/类
/**
* 初始化配置table
*/
public void initTable() {
LOG.debug("初始化配置信息表格...");
ObservableList<HistoryConfigCVF> data = null;
try {
data = getHistoryConfig();
} catch (Exception e) {
tblConfigInfo.setPlaceholder(new Label("加载配置文件失败!失败原因:\r\n" + e.getMessage()));
LOG.error("初始化配置信息表格出现异常!!!" + e);
}
TableColumn<HistoryConfigCVF, String> tdInfo = new TableColumn<HistoryConfigCVF, String>("配置信息文件名");
TableColumn<HistoryConfigCVF, String> tdOperation = new TableColumn<HistoryConfigCVF, String>("操作");
tdInfo.setPrefWidth(320);
tdInfo.setCellValueFactory(new PropertyValueFactory<>("name"));
tdOperation.setPrefWidth(198);
tdOperation.setCellValueFactory(new PropertyValueFactory<>("hbox"));
tblConfigInfo.getColumns().add(tdInfo);
tblConfigInfo.getColumns().add(tdOperation);
tblConfigInfo.setItems(data);
LOG.debug("初始化配置信息完成!");
}
示例11: RankingsController
import javafx.scene.control.cell.PropertyValueFactory; //导入依赖的package包/类
public RankingsController(DataSyncController instance) {
this.controller = instance;
this.teamRankings = FXCollections.observableArrayList();
this.controller.btnRankUpload.setDisable(true);
this.controller.colRank.setCellValueFactory(new PropertyValueFactory<>("rank"));
this.controller.colRankTeam.setCellValueFactory(new PropertyValueFactory<>("teamKey"));
this.controller.colRankWins.setCellValueFactory(new PropertyValueFactory<>("wins"));
this.controller.colRankLosses.setCellValueFactory(new PropertyValueFactory<>("losses"));
this.controller.colRankTies.setCellValueFactory(new PropertyValueFactory<>("ties"));
this.controller.colRankQP.setCellValueFactory(new PropertyValueFactory<>("qualPoints"));
this.controller.colRankRP.setCellValueFactory(new PropertyValueFactory<>("rankPoints"));
this.controller.colRankScore.setCellValueFactory(new PropertyValueFactory<>("highestScore"));
this.controller.colRankPlayed.setCellValueFactory(new PropertyValueFactory<>("played"));
this.controller.tableRankings.setItems(this.teamRankings);
}
示例12: initializeTable
import javafx.scene.control.cell.PropertyValueFactory; //导入依赖的package包/类
public void initializeTable() {
codeColumn.setCellValueFactory(new PropertyValueFactory<Medicine, Integer>("code"));
nameColumn.setCellValueFactory(new PropertyValueFactory<Medicine, String>("name"));
saltColumn.setCellValueFactory(new PropertyValueFactory<Medicine, String>("salt"));
companyColumn.setCellValueFactory(new PropertyValueFactory<Medicine, String>("company"));
typeColumn.setCellValueFactory(new PropertyValueFactory<Medicine, String>("type"));
hsnColumn.setCellValueFactory(new PropertyValueFactory<Medicine, String>("hsn"));
batchColumn.setCellValueFactory(new PropertyValueFactory<Medicine, String>("batch"));
expiryColumn.setCellValueFactory(new PropertyValueFactory<Medicine, String>("expiry"));
quantityColumn.setCellValueFactory(new PropertyValueFactory<Medicine, Integer>("quantity"));
mrpColumn.setCellValueFactory(new PropertyValueFactory<Medicine, Float>("mrp"));
costColumn.setCellValueFactory(new PropertyValueFactory<Medicine, Float>("cost"));
sgstColumn.setCellValueFactory(new PropertyValueFactory<Medicine, Integer>("sgst"));
cgstColumn.setCellValueFactory(new PropertyValueFactory<Medicine, Integer>("cgst"));
igstColumn.setCellValueFactory(new PropertyValueFactory<Medicine, Integer>("igst"));
medicineTableView.setItems(getMedicine());
}
示例13: MovieTableView
import javafx.scene.control.cell.PropertyValueFactory; //导入依赖的package包/类
public MovieTableView() {
TableColumn<Movie, String> titleColumn = new TableColumn<>("Title");
titleColumn.setPrefWidth(300);
titleColumn.setCellValueFactory(new PropertyValueFactory<>("title"));
TableColumn<Movie, Integer> yearColumn = new TableColumn<>("Year");
yearColumn.setPrefWidth(80);
yearColumn.setCellValueFactory(new PropertyValueFactory<>("year"));
TableColumn<Movie, String> genreColumn = new TableColumn<>("Genre");
genreColumn.setPrefWidth(140);
genreColumn.setCellValueFactory(new PropertyValueFactory<>("genre"));
TableColumn<Movie, Integer> directorColumn = new TableColumn<>("Director");
directorColumn.setPrefWidth(140);
directorColumn.setCellValueFactory(new PropertyValueFactory<>("director"));
TableColumn<Movie, Integer> ratingColumn = new TableColumn<>("Rating");
ratingColumn.setPrefWidth(120);
ratingColumn.setCellValueFactory(new PropertyValueFactory<>("rating"));
getColumns().setAll(titleColumn, yearColumn, genreColumn, directorColumn, ratingColumn);
}
示例14: initialize
import javafx.scene.control.cell.PropertyValueFactory; //导入依赖的package包/类
@Override
public void initialize(URL location, ResourceBundle resources) {
title = resources.getString(R.Translate.GUIDE_NEW_HERO_3_TITLE);
tableItems.setItems(items);
selectedItem.bind(tableItems.getSelectionModel().selectedIndexProperty());
columnImage.setCellValueFactory(new PropertyValueFactory<>("image"));
columnImage.setCellFactory(param -> CellUtils.forImage());
columnName.setCellValueFactory(new PropertyValueFactory<>("name"));
columnWeight.setCellValueFactory(new PropertyValueFactory<>("weight"));
columnAmmount.setCellValueFactory(new PropertyValueFactory<>("ammount"));
columnAmmount.setCellFactory(param -> CellUtils.forMaxActValue());
ObservableMergers.mergeList(databaseItem -> new ChoiceEntry(databaseItem), item_registry,
ItemRegistry.getINSTANCE().getRegistry());
btnRemoveItem.disableProperty().bind(selectedItem.lessThan(0));
}
示例15: initialize
import javafx.scene.control.cell.PropertyValueFactory; //导入依赖的package包/类
@Override
public void initialize(URL location, ResourceBundle resources) {
this.resources = resources;
tableGeneralItems.setItems(generalItems);
tableGeneralItems.getSelectionModel().selectedIndexProperty()
.addListener((observable, oldValue, newValue) -> selectedRowIndex.setValue(newValue));
columnImage.setCellValueFactory(new PropertyValueFactory<>("image"));
columnImage.setCellFactory(param -> CellUtils.forImage());
columnName.setCellValueFactory(new PropertyValueFactory<>("name"));
columnAuthor.setCellValueFactory(new PropertyValueFactory<>("author"));
columnWeight.setCellValueFactory(new PropertyValueFactory<>("weight"));
columnPrice.setCellValueFactory(new PropertyValueFactory<>("price"));
columnAmmount.setCellValueFactory(new PropertyValueFactory<>("ammount"));
columnAmmount.setCellFactory(param -> CellUtils.forMaxActValue());
ObservableMergers.mergeList(GeneralEntry::new, generalItems, manager.selectAll());
}