use of javafx.scene.control.TextInputDialog in project financial by greatkendy123.
the class MoneyService method openAddZijinDiag.
// 右表:名称鼠标双击事件:打开对话框增加上码值
public static void openAddZijinDiag(TableView<ZijinInfo> tableZijin, ZijinInfo info) {
if (info != null && info.getZijinType() != null) {
String oddZijin = StringUtil.isBlank(info.getZijinAccount()) ? "0" : info.getZijinAccount();
String newSM = "";
TextInputDialog dialog = new TextInputDialog();
dialog.setTitle("添加");
dialog.setHeaderText(null);
dialog.setContentText("续增" + info.getZijinType() + "值(Enter):");
Optional<String> result = dialog.showAndWait();
if (result.isPresent()) {
try {
Integer.valueOf(result.get().trim());
} catch (Exception e) {
ShowUtil.show("非法数据!");
return;
}
info.setZijinAccount(MoneyService.digit0(MoneyService.getNum(oddZijin) + MoneyService.getNum(result.get().trim())));
}
if (tableZijin != null && tableZijin.getItems() != null) {
for (ZijinInfo zijin : tableZijin.getItems()) {
if (zijin.getZijinType().equals(info.getZijinType())) {
zijin.setZijinAccount(info.getZijinAccount());
break;
}
}
}
}
}
use of javafx.scene.control.TextInputDialog in project financial by greatkendy123.
the class ShangmaService method openAddNextdayShangSMDiag.
/**
* 右下表:名称鼠标双击事件:打开对话框增加上码值
*
* @time 2018年2月9日
* @param detail
*/
public static void openAddNextdayShangSMDiag(ShangmaDetailInfo detail) {
if (detail != null && detail.getShangmaDetailName() != null) {
String oddSM = StringUtil.isBlank(detail.getShangmaSM()) ? "0" : detail.getShangmaSM();
String newSM = "";
TextInputDialog dialog = new TextInputDialog();
dialog.setTitle("添加");
dialog.setHeaderText(null);
dialog.setContentText("续增上码值(Enter):");
Optional<String> result = dialog.showAndWait();
if (result.isPresent()) {
// detail.setShangmaSM(MoneyService.digit0(MoneyService.getNum(oddSM)+MoneyService.getNum(result.get())));
resetNextDayDetailInfo(detail, result.get());
}
// String playerId= detail.getShangmaPlayerId();
// String changci = detail.getShangmaJu();
//
// // 1保存到数据库
// ShangmaNextday nextday = new ShangmaNextday();
// nextday.setPlayerId(playerId);
// nextday.setPlayerName(detail.getShangmaDetailName());
// nextday.setChangci(detail.getShangmaJu());
// nextday.setShangma(detail.getShangmaSM());
// DBUtil.saveOrUpdate_SM_nextday(nextday);
//
// // 2保存到缓存
// List<ShangmaDetailInfo> currentNextdayList = SM_NextDay_Map.getOrDefault(playerId, new ArrayList<>());
// ShangmaDetailInfo shangmaDetailInfo = currentNextdayList.stream()
// .filter(info->changci.equals(info.getShangmaJu())).findFirst().get();
// shangmaDetailInfo.setShangmaSM(detail.getShangmaSM());
//
// // 3刷新到当前的玩家次日表
// tableND.refresh();
//
// //4 修改主表的可上码额度 TODO
// // refreshTableSM();
//
// //刷新左表对应记录
// try {
// updateRowByPlayerId(playerId,result.get());
// } catch (Exception e) {
// ErrorUtil.err("刷新左表对应记录失败",e);
// }
}
}
use of javafx.scene.control.TextInputDialog in project financial by greatkendy123.
the class ShangmaService method openAddShangSMDiag.
// 右表:名称鼠标双击事件:打开对话框增加上码值
public static void openAddShangSMDiag(ShangmaDetailInfo detail) {
if (detail != null && detail.getShangmaDetailName() != null) {
String oddSM = StringUtil.isBlank(detail.getShangmaSM()) ? "0" : detail.getShangmaSM();
String newSM = "";
TextInputDialog dialog = new TextInputDialog();
// dialog.setGraphic(null);
dialog.setTitle("添加");
dialog.setHeaderText(null);
dialog.setContentText("续增上码值(Enter):");
Optional<String> result = dialog.showAndWait();
if (result.isPresent()) {
// detail.setShangmaSM(MoneyService.digit0(MoneyService.getNum(oddSM)+MoneyService.getNum(result.get())));
addDuplicateSM(detail, result.get());
}
// tableSMD.refresh();
// String playerId= detail.getShangmaPlayerId();
// //save
// saveSMDetail(playerId);
// //刷新左表对应记录
// try {
// updateRowByPlayerId(playerId,result.get());
// } catch (Exception e) {
// e.printStackTrace();//不作记录
// }
}
}
use of javafx.scene.control.TextInputDialog in project DistributedFractalNetwork by Budder21.
the class Window method mouseClicked.
/**
* Called when the mouse has been clicked. It determines what to do with the
* event.
*/
public void mouseClicked(MouseEvent e) {
Point p = e.getPoint();
repaint();
if (selectedButton == null) {
if (bgButton.isClicked(p)) {
GradientMenus.displayColorMenus(bgButton, this);
} else if (saveButton.isClicked(p)) {
Platform.runLater(() -> {
TextInputDialog dialog = new TextInputDialog("");
dialog.setTitle("");
dialog.setHeaderText(null);
dialog.setContentText("Save Palette As:");
// Traditional way to get the response value.
try {
String result = dialog.showAndWait().get();
if (!result.equals(""))
palette.writeTo(result);
} catch (Exception e5) {
}
});
} else if (loadButton.isClicked(p)) {
Platform.runLater(new Runnable() {
public void run() {
FileChooser chooser = new FileChooser();
chooser.setTitle("Open Palette");
File f1 = new File("fractals/palettes");
if (!f1.exists()) {
f1.mkdirs();
try {
f1.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}
chooser.setInitialDirectory(f1);
FileChooser.ExtensionFilter filter = new FileChooser.ExtensionFilter("Palettes (*.palette)", "*.palette");
chooser.getExtensionFilters().add(filter);
File f = chooser.showOpenDialog(null);
if (f != null) {
palette = new Palette(f.getPath(), false);
bgButton.setData(palette.getBackground());
repaint();
layer.setColorPalette(palette);
}
}
});
} else if (colorRect.contains(p)) {
addColorButton(p.x);
repaint();
} else if (opacityRect.contains(p)) {
addOpacityButton(p.x);
repaint();
}
} else {
if (selectedButton.isSquareClicked(p)) {
if (selectedButton.isDown()) {
Platform.runLater(() -> {
double newVal = GradientMenus.displayOpacityMenu(selectedButton, this);
selectedButton.setData(newVal);
repaint();
});
} else {
GradientMenus.displayColorMenus(selectedButton, this);
}
}
}
}
use of javafx.scene.control.TextInputDialog in project dwoss by gg-net.
the class GenerateOnePriceAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
Ui.exec(() -> {
Ui.build().title("Bitte SopoNr eingeben :").dialog().eval(() -> {
TextInputDialog dialog = new TextInputDialog();
dialog.setContentText("Bitte SopoNr eingeben :");
return dialog;
}).opt().filter(s -> !StringUtils.isBlank(s)).map(r -> ReplyUtil.wrap(() -> Dl.remote().lookup(Exporter.class).onePrice(r))).filter(Ui.failure()::handle).map(Reply::getPayload).ifPresent(p -> Ui.build().modality(WINDOW_MODAL).title("SopoNr").fx().show(() -> Css.toHtml5WithStyle(PriceEngineResultFormater.toSimpleHtml(p)), () -> new HtmlPane()));
});
}
Aggregations