use of javafx.scene.control.TableColumn 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.TableColumn in project financial by greatkendy123.
the class MyController method payedAllAction.
/**
* 支付全部(有空再去实现吧)
*
* @time 2017年11月11日
* @param event
*/
public void payedAllAction(ActionEvent event) {
if (tablePaiju != null && tablePaiju.getItems() != null) {
TableColumn<WanjiaInfo, ?> col = tablePaiju.getColumns().get(tablePaiju.getColumns().size() - 1);
ObservableList<TableColumn<WanjiaInfo, ?>> columns = tablePaiju.getColumns();
for (WanjiaInfo info : tablePaiju.getItems()) {
System.out.println(info.toString());
}
} else {
ShowUtil.show("全支付失败:因为牌局表为空!");
}
}
use of javafx.scene.control.TableColumn in project financial by greatkendy123.
the class MyController method bindCellValue.
/**
* kendy:绑定数据域
* @param colums TableColumn 可变参数
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public static void bindCellValue(TableColumn<? extends Entity, String>... colums) {
try {
for (TableColumn column : colums) {
String fxId = column.getId();
column.setCellValueFactory(new PropertyValueFactory<Entity, String>(fxId));
column.setStyle("-fx-alignment: CENTER;");
// 禁止排序
column.setSortable(false);
}
} catch (Exception e) {
throw new RuntimeException("小林:绑定列值失败");
}
}
use of javafx.scene.control.TableColumn in project jgnash by ccavanaugh.
the class BudgetTableController method buildAccountPeriodResultsColumn.
private TableColumn<Account, BigDecimal> buildAccountPeriodResultsColumn(final int index) {
final BudgetPeriodDescriptor descriptor = budgetResultsModel.getDescriptorList().get(index);
// determine if the column is to be highlighted if the period is not yearly
final Boolean highlight = (descriptor.isBetween(LocalDate.now()) ? Boolean.TRUE : Boolean.FALSE) && budget.get().getBudgetPeriod() != Period.YEARLY;
final TableColumn<Account, BigDecimal> headerColumn = new TableColumn<>(descriptor.getPeriodDescription());
final TableColumn<Account, BigDecimal> budgetedColumn = new TableColumn<>(resources.getString("Column.Budgeted"));
budgetedColumn.getProperties().put(NOW, highlight);
budgetedColumn.setCellValueFactory(param -> {
if (param.getValue() != null) {
return new SimpleObjectProperty<>(budgetResultsModel.getResults(descriptor, param.getValue()).getBudgeted());
}
return new SimpleObjectProperty<>(BigDecimal.ZERO);
});
budgetedColumn.setCellFactory(param -> new AccountCommodityFormatTableCell());
lockColumnBehavior(budgetedColumn, columnWidth);
headerColumn.getColumns().add(budgetedColumn);
final TableColumn<Account, BigDecimal> actualColumn = new TableColumn<>(resources.getString("Column.Actual"));
actualColumn.getProperties().put(NOW, highlight);
actualColumn.setCellValueFactory(param -> {
if (param.getValue() != null) {
return new SimpleObjectProperty<>(budgetResultsModel.getResults(descriptor, param.getValue()).getChange());
}
return new SimpleObjectProperty<>(BigDecimal.ZERO);
});
actualColumn.setCellFactory(param -> new AccountCommodityFormatTableCell());
lockColumnBehavior(actualColumn, columnWidth);
headerColumn.getColumns().add(actualColumn);
final TableColumn<Account, BigDecimal> remainingColumn = new TableColumn<>(resources.getString("Column.Remaining"));
remainingColumn.getProperties().put(NOW, highlight);
remainingColumn.setCellValueFactory(param -> {
if (param.getValue() != null) {
return new SimpleObjectProperty<>(budgetResultsModel.getResults(descriptor, param.getValue()).getRemaining());
}
return new SimpleObjectProperty<>(BigDecimal.ZERO);
});
remainingColumn.setCellFactory(param -> new AccountCommodityFormatTableCell());
lockColumnBehavior(remainingColumn, remainingColumnWidth);
headerColumn.getColumns().add(remainingColumn);
headerColumn.resizableProperty().set(false);
return headerColumn;
}
use of javafx.scene.control.TableColumn in project jgnash by ccavanaugh.
the class BudgetTableController method buildAccountTypeTable.
private void buildAccountTypeTable() {
final TableColumn<AccountGroup, String> nameColumn = new TableColumn<>(resources.getString("Column.Type"));
nameColumn.setCellValueFactory(param -> new SimpleStringProperty(param.getValue().toString()));
accountTypeTable.getColumns().add(nameColumn);
}
Aggregations