Search in sources :

Example 26 with TextInputDialog

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;
                }
            }
        }
    }
}
Also used : ZijinInfo(com.kendy.entity.ZijinInfo) TextInputDialog(javafx.scene.control.TextInputDialog)

Example 27 with TextInputDialog

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);
    // }
    }
}
Also used : TextInputDialog(javafx.scene.control.TextInputDialog)

Example 28 with TextInputDialog

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();//不作记录
    // }
    }
}
Also used : TextInputDialog(javafx.scene.control.TextInputDialog)

Example 29 with TextInputDialog

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);
            }
        }
    }
}
Also used : Palette(fractal.Palette) FileChooser(javafx.stage.FileChooser) Point(java.awt.Point) IOException(java.io.IOException) File(java.io.File) IOException(java.io.IOException) TextInputDialog(javafx.scene.control.TextInputDialog)

Example 30 with TextInputDialog

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()));
    });
}
Also used : Css(eu.ggnet.dwoss.rules.Css) AccessableAction(eu.ggnet.saft.core.auth.AccessableAction) CREATE_ONE_PRICE(eu.ggnet.dwoss.rights.api.AtomicRight.CREATE_ONE_PRICE) Ui(eu.ggnet.saft.Ui) ActionEvent(java.awt.event.ActionEvent) StringUtils(org.apache.commons.lang3.StringUtils) Dl(eu.ggnet.saft.Dl) ReplyUtil(eu.ggnet.dwoss.common.ReplyUtil) TextInputDialog(javafx.scene.control.TextInputDialog) Reply(eu.ggnet.saft.api.Reply) WINDOW_MODAL(javafx.stage.Modality.WINDOW_MODAL) HtmlPane(eu.ggnet.dwoss.util.HtmlPane) PriceEngineResultFormater(eu.ggnet.dwoss.price.engine.support.PriceEngineResultFormater) HtmlPane(eu.ggnet.dwoss.util.HtmlPane) TextInputDialog(javafx.scene.control.TextInputDialog)

Aggregations

TextInputDialog (javafx.scene.control.TextInputDialog)38 Alert (javafx.scene.control.Alert)12 FXML (javafx.fxml.FXML)9 ActionEvent (javafx.event.ActionEvent)8 EventHandler (javafx.event.EventHandler)8 KeyFrame (javafx.animation.KeyFrame)7 Timeline (javafx.animation.Timeline)7 Stage (javafx.stage.Stage)7 ReplyUtil (eu.ggnet.dwoss.common.ReplyUtil)6 AccessableAction (eu.ggnet.saft.core.auth.AccessableAction)6 ActionEvent (java.awt.event.ActionEvent)6 Dl (eu.ggnet.saft.Dl)5 Ui (eu.ggnet.saft.Ui)5 Reply (eu.ggnet.saft.api.Reply)5 IOException (java.io.IOException)4 Guardian (eu.ggnet.saft.core.auth.Guardian)3 Point (java.awt.Point)3 Optional (java.util.Optional)3 StringUtils (org.apache.commons.lang3.StringUtils)3 CircuitState (com.cas.sim.tis.app.state.CircuitState)2