use of javafx.scene.control.TableView in project jvarkit by lindenb.
the class VcfStage method buildAlleleTable.
/**
* build INFO table
*/
private TableView<Allele> buildAlleleTable() {
final TableView<Allele> table = new TableView<>();
table.getColumns().add(makeColumn("REF", A -> A.isReference() ? "*" : null));
table.getColumns().add(makeColumn("Sym.", A -> A.isSymbolic() ? "*" : null));
table.getColumns().add(makeColumn("Bases.", A -> allele2stringConverter.apply(A)));
table.getColumns().add(makeColumn("Length.", A -> {
if (A.isSymbolic())
return (Integer) null;
return A.length();
}));
table.setPlaceholder(new Label("No Allele."));
return table;
}
use of javafx.scene.control.TableView in project jvarkit by lindenb.
the class VcfStage method buildTrioTable.
/**
* build Trio table
*/
private TableView<PedFile.TrioGenotype> buildTrioTable() {
final TableView<PedFile.TrioGenotype> table = new TableView<>();
if (getVcfFile().getHeader().getNGenotypeSamples() > 0 && !getPedigree().isEmpty()) {
final Function<Genotype, String> gt2str = new Function<Genotype, String>() {
@Override
public String apply(final Genotype gt) {
if (gt == null || !gt.isCalled())
return null;
return gt.getAlleles().stream().map(S -> allele2stringConverter.apply(S)).collect(Collectors.joining(gt.isPhased() ? "|" : "/"));
}
};
table.getColumns().add(makeColumn("Child", T -> T.getChildren() == null ? null : T.getChildren().getSampleName()));
table.getColumns().add(makeColumn("Child-GT", T -> gt2str.apply(T.getChildren())));
table.getColumns().add(makeColumn("Father", T -> T.getFather() == null ? null : T.getFather().getSampleName()));
table.getColumns().add(makeColumn("Father-GT", T -> gt2str.apply(T.getFather())));
table.getColumns().add(makeColumn("Mother", T -> T.getMother() == null ? null : T.getMother().getSampleName()));
table.getColumns().add(makeColumn("Mother-GT", T -> gt2str.apply(T.getMother())));
table.getColumns().add(makeColumn("Violation", T -> T.isMendelianIncompatibility()));
}
table.setPlaceholder(new Label("No Trio."));
return table;
}
use of javafx.scene.control.TableView in project jvarkit by lindenb.
the class JvarkitCentral method start.
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.setTitle("Jvarkit-Central");
StackPane root = new StackPane();
root.setPadding(new Insets(2));
final TableView<Class<?>> tableView = new TableView<>();
final TableColumn<Class<?>, String> nameCol = new TableColumn<>("Name");
nameCol.setCellValueFactory(CB -> {
final String value;
Class<?> clazz = CB.getValue();
final Program program = clazz.getAnnotation(Program.class);
if (!Launcher.class.isAssignableFrom(clazz) || program == null) {
value = null;
} else {
value = program.name();
}
return new SimpleStringProperty(value);
});
final TableColumn<Class<?>, String> descCol = new TableColumn<>("Description");
descCol.setCellValueFactory(CB -> {
final String value;
Class<?> clazz = CB.getValue();
final Program program = clazz.getAnnotation(Program.class);
if (!Launcher.class.isAssignableFrom(clazz) || program == null) {
value = null;
} else {
value = program.description();
}
return new SimpleStringProperty(value);
});
tableView.getColumns().addAll(nameCol, descCol);
final BorderPane borderPane1 = new BorderPane(tableView);
borderPane1.setPadding(new Insets(10));
final Button but = new Button("New Instance...");
but.setOnAction(AE -> {
final Class<?> clazz = tableView.getSelectionModel().getSelectedItem();
if (clazz == null)
return;
final Program program = clazz.getAnnotation(Program.class);
if (!Launcher.class.isAssignableFrom(clazz) || program == null)
return;
createNewInstanceOf(clazz);
});
FlowPane bottom = new FlowPane(but);
borderPane1.setBottom(bottom);
tableView.getItems().addAll(String.class, Integer.class, VCFFilterJS.class, BioAlcidae.class);
root.getChildren().add(borderPane1);
// root.getChildren().add(btn);
primaryStage.setScene(new Scene(root, 300, 250));
primaryStage.show();
}
use of javafx.scene.control.TableView in project financial by greatkendy123.
the class LMController method viewAllClubAction.
/**
* 查看所有俱乐部总帐单
*
* @time 2017年11月22日
* @param event
*/
public void viewAllClubAction(ActionEvent event) {
// 无数据就返回
int size = allClubMap.size();
if (allClubMap == null || allClubMap.size() == 0) {
ShowUtil.show("无数据可以导出");
return;
}
Map<String, List<Record>> current_LM_Map = LMTotalList.get(getCurrentLMType() - 1);
if (MapUtil.isNullOrEmpty(current_LM_Map)) {
ShowUtil.show("该联盟无数据可以导出");
return;
}
// 组装当前要展示的联盟的相应俱乐部
Map<String, Club> lmClubMap = getLMClub(current_LM_Map);
// 设置合计桌费(这个没多大影响)
setNewSumOfZF();
// 隐藏单个所有信息
showAllView();
// 点击所有俱乐部总帐按钮后的单个聪明数据统计 {俱乐部ID : 表内容}
Map<String, List<LMSumInfo>> allClubSumMap = getAllClubSumMap(current_LM_Map);
FlowPane flow = new FlowPane();
flow.setId(FLOW_PANE_ID);
flow.setMinWidth(668);
flow.setBorder(new Border(new BorderStroke(Color.BLUE, BorderStrokeStyle.SOLID, null, new BorderWidths(3))));
flow.setVgap(20);
flow.setHgap(20);
flow.setPadding(new Insets(10, 10, 10, 30));
// int size = allClubMap.size();
// if(allClubMap == null || allClubMap.size() ==0) {
// ShowUtil.show("无数据可以导出");
// return;
// }
// 表示第一列的宽度
final int talbeWidth = 300;
// 表示第一列的宽度
final int With1 = 80;
// 表示第二列的宽度
final int With2 = 70;
final int With3 = 70;
final int With4 = 60;
final int height = 115;
final String style = "-fx-alignment: CENTER;";
final String clubNameStyle = "-fx-background-color: #FFFFE0;";
// for(Map.Entry<String, Club> entry : allClubMap.entrySet()) {
for (Map.Entry<String, Club> entry : lmClubMap.entrySet()) {
Club club = entry.getValue();
String clubId = entry.getKey();
TableView table = new TableView();
table.setPrefHeight(height);
table.setPrefWidth(talbeWidth);
// 设置列
TableColumn col1 = new TableColumn(club.getName());
col1.setPrefWidth(With1);
col1.setStyle(style);
col1.setSortable(false);
col1.setCellValueFactory(new PropertyValueFactory<LMSumInfo, String>("lmSumName"));
TableColumn col2 = new TableColumn("总战绩");
col2.setSortable(false);
col2.setStyle(style);
col2.setPrefWidth(With2);
col2.setCellValueFactory(new PropertyValueFactory<LMSumInfo, String>("lmSumZJ"));
// 红色注释
col2.setCellFactory(MyController.getColorCellFactory(new LMSumInfo()));
TableColumn col3 = new TableColumn("总保险");
col3.setSortable(false);
col3.setStyle(style);
col3.setPrefWidth(With3);
col3.setCellValueFactory(new PropertyValueFactory<LMSumInfo, String>("lmSumInsure"));
// 红色注释
col3.setCellFactory(MyController.getColorCellFactory(new LMSumInfo()));
TableColumn col4 = new TableColumn("总人数");
col4.setSortable(false);
col4.setStyle(style);
col4.setPrefWidth(With4);
col4.setCellValueFactory(new PropertyValueFactory<LMSumInfo, String>("lmSumPersonCount"));
table.getColumns().addAll(col1, col2, col3, col4);
// 设置数据
setDynamicTableData(table, clubId, allClubSumMap);
flow.getChildren().add(table);
}
;
bigAnchorPane.getChildren().add(0, flow);
}
use of javafx.scene.control.TableView in project financial by greatkendy123.
the class MyController method initialize.
/**
* 节点加载完后需要进行的一些初始化操作
* Initializes the controller class. This method is automatically called
* after the fxml file has been loaded.
*/
@SuppressWarnings("unchecked")
@Override
public void initialize(URL location, ResourceBundle resources) {
table_Profit = this.tableProfit;
// 第一次打开主窗口时设置当前俱乐部ID值
String clubIdValue = PropertiesUtil.readProperty("clubId");
currentClubId = lable_currentClubId;
if (clubIdValue != null)
lable_currentClubId.setText(clubIdValue);
// 第一次打开主窗口时显示所有股东
// //股东
String gudongs = PropertiesUtil.readProperty("gudong");
DataConstans.gudongList = new ArrayList<>();
if (!StringUtil.isBlank(gudongs)) {
for (String gudong : gudongs.split(",")) {
DataConstans.gudongList.add(gudong);
}
}
for (String gd : DataConstans.gudongList) gudongListView.getItems().add(gd);
// 模拟初始化第一个tableView
// kendy:绑定数据域
// 支付按钮
pay.setCellFactory(cellFactory);
// 绑定玩家信息表
bindCellValue(tuan, wanjiaId, wanjia, jifen, shishou, baoxian, chuHuishui, baohui, shuihouxian, heLirun, shouHuishui);
jifen.setCellFactory(getColorCellFactory(new TotalInfo()));
shishou.setCellFactory(getColorCellFactory(new TotalInfo()));
baoxian.setCellFactory(getColorCellFactory(new TotalInfo()));
shuihouxian.setCellFactory(getColorCellFactory(new TotalInfo()));
chuHuishui.setCellFactory(getColorCellFactory(new TotalInfo()));
// 绑定牌局表
bindCellValue(paiju, wanjiaName, zhangji, yicunJifen, heji);
// 支付按钮:单独出来
pay.setCellFactory(cellFactory);
pay.setStyle("-fx-alignment: CENTER;");
// 复制按钮:单独出来
copy.setCellFactory(cellFactoryCopy);
copy.setStyle("-fx-alignment: CENTER;");
zhangji.setCellFactory(getColorCellFactory(new WanjiaInfo()));
yicunJifen.setCellFactory(getColorCellFactory(new WanjiaInfo()));
heji.setCellFactory(getColorCellFactory(new WanjiaInfo()));
// 绑定实时金额表
tableCurrentMoneyInfo.setEditable(true);
bindCellValue(cmSuperIdSum, mingzi, shishiJine, cmiEdu);
cmSuperIdSum.setStyle("-fx-alignment: CENTER;-fx-font-weight: bold;");
shishiJine.setCellFactory(TextFieldTableCell.forTableColumn());
// shishiJine.setCellFactory(redAndEditCellFactory);
shishiJine.setOnEditCommit(new EventHandler<CellEditEvent<CurrentMoneyInfo, String>>() {
@Override
public void handle(CellEditEvent<CurrentMoneyInfo, String> t) {
String oldValue = t.getOldValue();
// 修改原值
CurrentMoneyInfo cmInfo = (CurrentMoneyInfo) t.getTableView().getItems().get(t.getTablePosition().getRow());
if (cmInfo != null && !StringUtil.isBlank(cmInfo.getMingzi())) {
// 更新到已存积分
boolean isChangedOK = MoneyService.changeYicunJifen(tablePaiju, cmInfo.getMingzi(), t.getNewValue());
if (isChangedOK) {
cmInfo.setShishiJine(t.getNewValue());
} else {
cmInfo.setShishiJine(t.getOldValue());
String ss = t.getTableView().getItems().get(t.getTablePosition().getRow()).getShishiJine();
tableCurrentMoneyInfo.refresh();
}
// 最后刷新实时金额表
MoneyService.flush_SSJE_table();
} else if (cmInfo != null) {
cmInfo.setShishiJine(null);
ShowUtil.show("空行不能输入", 1);
tableCurrentMoneyInfo.refresh();
}
}
});
// 绑定资金表
tableZijin.setEditable(true);
bindCellValue(zijinType, zijinAccount);
// zijinAccount.setCellFactory(TextFieldTableCell.forTableColumn());
zijinType.setCellFactory(zijinCellFactory);
zijinAccount.setCellFactory(getColorCellFactory(new ZijinInfo()));
// 绑定利润表
bindCellValue(profitType, profitAccount);
profitAccount.setCellFactory(getColorCellFactory(new ProfitInfo()));
// 绑定实时开销表
bindCellValue(kaixiaoType, kaixiaoMoney);
kaixiaoMoney.setCellFactory(getColorCellFactory(new KaixiaoInfo()));
// 绑定实时当局表
bindCellValue(type, money);
money.setCellFactory(getColorCellFactory(new DangjuInfo()));
// 绑定交收表
bindCellValue(jiaoshouType, jiaoshouMoney);
jiaoshouMoney.setCellFactory(getColorCellFactory(new JiaoshouInfo()));
// 绑定平帐表
bindCellValue(pingzhangType, pingzhangMoney);
pingzhangMoney.setCellFactory(getColorCellFactory(new PingzhangInfo()));
// 绑定团队表
bindCellValue(teamID, teamZJ, teamHS, teamBS, teamSum);
teamJiesuan.setCellFactory(cellFactoryJiesuan);
teamJiesuan.setStyle("-fx-alignment: CENTER;");
teamZJ.setCellFactory(getColorCellFactory(new TeamInfo()));
teamBS.setCellFactory(getColorCellFactory(new TeamInfo()));
teamHS.setCellFactory(getColorCellFactory(new TeamInfo()));
teamSum.setCellFactory(getColorCellFactory(new TeamInfo()));
// 绑定代理查询表(团队当天查询)
bindCellValue(proxyPlayerId, proxyPlayerName, proxyYSZJ, proxyZJ, proxyBaoxian, proxyHuishui, proxyHuiBao, proxyTableId);
proxyYSZJ.setCellFactory(getColorCellFactory(new ProxyTeamInfo()));
proxyZJ.setCellFactory(getColorCellFactory(new ProxyTeamInfo()));
proxyBaoxian.setCellFactory(getColorCellFactory(new ProxyTeamInfo()));
// 绑定代理查询中的合计表
bindCellValue(proxySumType, proxySum);
proxySum.setCellFactory(getColorCellFactory(new ProxySumInfo()));
// 绑定汇总信息表(当天每一局的团队汇总查询)
bindCellValue(zonghuiTabelId, zonghuiFuwufei, zonghuiBaoxian, zonghuiHuishui, zonghuiHuiBao);
zonghuiBaoxian.setCellFactory(getColorCellFactory(new ZonghuiInfo()));
zonghuiHuishui.setCellFactory(getColorCellFactory(new ZonghuiInfo()));
zonghuiHuiBao.setCellFactory(getColorCellFactory(new ZonghuiInfo()));
// 绑定汇总查询中的当天汇总表
bindCellValue(huizongType, huizongMoney);
huizongMoney.setCellFactory(getColorCellFactory(new DangtianHuizongInfo()));
// 绑定汇总查询中的开销表表
bindCellValue(zonghuiKaixiaoType, zonghuiKaixiaoMoney);
zonghuiKaixiaoMoney.setCellFactory(getColorCellFactory(new ZonghuiKaixiaoInfo()));
// 绑定会员查询中的会员当天战绩表
bindCellValue(memberJu, memberZJ);
memberZJ.setCellFactory(getColorCellFactory(new MemberZJInfo()));
// 绑定实时上码表
// ,shangmaShishou,shangmaJu
bindCellValue(shangmaLianheEdu, shangmaName, shangmaEdu, shangmaAvailableEdu, shangmaYCJF, shangmaYiSM, shangmaSumOfZJ, shangmaPlayerId);
tableShangma.setRowFactory(new Callback<TableView<ShangmaInfo>, TableRow<ShangmaInfo>>() {
@Override
public TableRow<ShangmaInfo> call(TableView<ShangmaInfo> param) {
return new TableRowControl(tableShangma);
}
});
// shangmaPlayerId.setCellFactory(shangmaLeftNameCellFactory);
// shangmaName.setCellFactory(shangmaLeftNameCellFactory);
// shangmaEdu.setCellFactory(shangmaLeftNameCellFactory);
// shangmaSumOfZJ.setCellFactory(shangmaLeftNameCellFactory);
// shangmaYiSM.setCellFactory(shangmaLeftNameCellFactory);
// shangmaYCJF.setCellFactory(shangmaLeftNameCellFactory);
shangmaLianheEdu.setCellFactory(getColorCellFactory(new ShangmaInfo()));
// red_NotEdit_CellFactory
shangmaAvailableEdu.setCellFactory(getColorCellFactory(new ShangmaInfo()));
shangmaYCJF.setCellFactory(getColorCellFactory(new ShangmaInfo()));
// 绑定外债信息表
bindCellValue(waizhaiType, waizhaiMoney);
waizhaiMoney.setCellFactory(getColorCellFactory(new WaizhaiInfo()));
// 绑定上码个人信息表
tableShangmaDetail.setEditable(true);
bindCellValue(shangmaDetailName, shangmaJu, shangmaSM, shangmaShishou);
shangmaDetailName.setCellFactory(ShangmaNameCellFactory);
shangmaJu.setCellFactory(ShangmaNameCellFactory);
shangmaSM.setCellFactory(ShangmaNameCellFactory);
shangmaShishou.setCellFactory(ShangmaNameCellFactory);
tableShangma.getSelectionModel().selectedItemProperty().addListener(new ChangeListener() {
@Override
public void changed(ObservableValue observable, Object oldValue, Object newValue) {
ShangmaInfo smInfo = (ShangmaInfo) newValue;
// 加载右边的个人详情
if (smInfo != null) {
String playerId = smInfo.getShangmaPlayerId();
if (!StringUtil.isBlank(playerId)) {
ShangmaService.loadSMDetailTable(playerId);
ShangmaService.loadSMNextDayTable(playerId);
}
} else
tableShangmaDetail.setItems(null);
}
});
// 绑定次日信息表
shangmaNextDayName.setCellValueFactory(new PropertyValueFactory<ShangmaDetailInfo, String>("shangmaDetailName"));
shangmaNextDayName.setCellFactory(ShangmaNameNextdayCellFactory);
shangmaNextDayName.setStyle("-fx-alignment: CENTER;");
shangmaNextDayJu.setCellValueFactory(new PropertyValueFactory<ShangmaDetailInfo, String>("shangmaJu"));
shangmaNextDayJu.setCellFactory(ShangmaNameNextdayCellFactory);
shangmaNextDayJu.setStyle("-fx-alignment: CENTER;");
shangmaNextDaySM.setCellValueFactory(new PropertyValueFactory<ShangmaDetailInfo, String>("shangmaSM"));
shangmaNextDaySM.setCellFactory(ShangmaNameNextdayCellFactory);
shangmaNextDaySM.setStyle("-fx-alignment: CENTER;");
// 绑定积查询表
bindCellValue(jfRank, jfPlayerName, jfValue);
// ////初始化实时金额表
MoneyService.iniitMoneyInfo(tableCurrentMoneyInfo);
// tableTotalInfo.setItems(tableTotalInfoList);
// tableKaixiao.setItems(FXCollections.observableArrayList(
// new KaixiaoInfo("测试列","12")
// ));
// //////////////////总汇表中的初始化
juTypeListView.getItems().add("合局");
LMLabel.setTextFill(Color.web("#CD3700"));
// 设置Label 的文本颜色。
indexLabel.setTextFill(Color.web("#0076a3"));
indexLabel.setFont(new Font("Arial", 30));
// //////////////////代理查询中的团队回水选择
TeamProxyService.initTeamProxy(tableProxyTeam, proxySumHBox, teamIDCombox, isZjManage, proxyDateLabel, tableProxySum, proxyHSRate, proxyHBRate, proxyFWF, hasTeamBaoxian);
// //////////////////代理查询中的团队回水选择
TeamProxyService.initTeamSelectAction(teamIDCombox, isZjManage, tableProxyTeam, proxySumHBox);
// //////////////////会员服务类
MemberService.initMemberQuery(memberListView, tableMemberZJ, memberDateStr, memberPlayerId, memberPlayerName, memberSumOfZJ, memberTotalZJ);
tabsAction();
// //////////////////实时上马系统
initShanagma();
// /////////////合并ID
CombineIDController.initCombineIdController(tableCurrentMoneyInfo);
// //////////积分查询
JifenService.initJifenService(jfTeamIDCombox);
// 是否启动测试模式
initAutoTestMode();
// 选择导入白名单的版本
initWhiteVersion();
try {
FXMLLoader loader = new FXMLLoader();
Parent root = loader.load(getClass().getResource("/com/kendy/dialog/LM_Tab_Fram.fxml").openStream());
// loader.setController(lmController);
lmController = loader.getController();
Tab tab1 = new Tab();
tab1.setText("联盟对账");
tab1.setClosable(false);
tab1.setContent(root);
tabs.getTabs().add(tab1);
} catch (IOException e) {
ErrorUtil.err("联盟tab加载失败", e);
}
try {
FXMLLoader loader = new FXMLLoader();
Parent root = loader.load(getClass().getResource("/com/kendy/dialog/Quota_Tab_Fram.fxml").openStream());
loader.setController(new QuotaController());
Tab quotaTab = new Tab();
quotaTab.setText("联盟配账");
quotaTab.setClosable(false);
quotaTab.setContent(root);
tabs.getTabs().add(quotaTab);
} catch (IOException e) {
ErrorUtil.err("联盟配账tab加载失败", e);
}
try {
FXMLLoader loader = new FXMLLoader();
Parent root = loader.load(getClass().getResource("/com/kendy/dialog/gudong_contribution.fxml").openStream());
loader.setController(new GDController());
Tab gdTab = new Tab();
gdTab.setText("股东贡献值");
gdTab.setClosable(false);
gdTab.setContent(root);
tabs.getTabs().add(gdTab);
} catch (IOException e) {
ErrorUtil.err("股东贡献值tab加载失败", e);
}
try {
FXMLLoader loader = new FXMLLoader();
Parent root = loader.load(getClass().getResource("/com/kendy/dialog/TG_toolaa.fxml").openStream());
Tab gdTab = new Tab();
gdTab.setText("托管工具");
gdTab.setClosable(false);
gdTab.setContent(root);
tabs.getTabs().add(gdTab);
tgController = (TGController) loader.getController();
} catch (IOException e) {
ErrorUtil.err("托管小工具tab加载失败", e);
}
try {
FXMLLoader loader = new FXMLLoader();
Parent root = loader.load(getClass().getResource("/com/kendy/dialog/SM_Auto.fxml").openStream());
Tab gdTab = new Tab();
gdTab.setText("自动上码配置");
gdTab.setClosable(false);
gdTab.setContent(root);
tabs.getTabs().add(gdTab);
smAutoController = (SMAutoController) loader.getController();
} catch (IOException e) {
ErrorUtil.err("托管小工具tab加载失败", e);
}
}
Aggregations