Search in sources :

Example 6 with TypicalCase

use of com.cas.sim.tis.entity.TypicalCase in project TeachingInSimulation by ScOrPiOzzy.

the class TypicalCaseState method initializeLocal.

@Override
protected void initializeLocal() {
    // 布置场景
    arrangementScene();
    // 添加操作模式State
    cameraState = new SceneCameraState();
    stateManager.attach(cameraState);
    // 绑定事件
    bindEvents();
    // 默认新建案例
    IContent content = SpringUtil.getBean(PageController.class).getIContent();
    if (content instanceof TypicalCase3D) {
        ((TypicalCase3D) content).setupCase(new TypicalCase());
    }
    // 结束加载界面
    Platform.runLater(() -> SpringUtil.getBean(PageController.class).hideLoading());
}
Also used : PageController(com.cas.sim.tis.view.controller.PageController) IContent(com.cas.sim.tis.view.control.IContent) TypicalCase(com.cas.sim.tis.entity.TypicalCase) TypicalCase3D(com.cas.sim.tis.view.control.imp.jme.TypicalCase3D)

Example 7 with TypicalCase

use of com.cas.sim.tis.entity.TypicalCase in project TeachingInSimulation by ScOrPiOzzy.

the class TypicalCaseMenu method saveCase.

private void saveCase() {
    SpringUtil.getBean(PageController.class).showLoading();
    TypicalCase typicalCase = typicalCase3D.getTypicalCase();
    if (typicalCase.getId() == null) {
        TextInputDialog steamIdDialog = new TextInputDialog();
        steamIdDialog.setTitle(MsgUtil.getMessage("menu.button.save"));
        steamIdDialog.setHeaderText(null);
        steamIdDialog.setContentText(MsgUtil.getMessage("typical.case.prompt.input.case"));
        Optional<String> steamID = steamIdDialog.showAndWait();
        if (steamID.isPresent()) {
            typicalCase.setName(steamID.get());
        }
    }
    typicalCase3D.save();
    AlertUtil.showAlert(AlertType.INFORMATION, MsgUtil.getMessage("alert.information.data.save.success"));
}
Also used : PageController(com.cas.sim.tis.view.controller.PageController) TypicalCase(com.cas.sim.tis.entity.TypicalCase) TextInputDialog(javafx.scene.control.TextInputDialog)

Example 8 with TypicalCase

use of com.cas.sim.tis.entity.TypicalCase in project TeachingInSimulation by ScOrPiOzzy.

the class PreparationDetail method openTypicalCase.

private void openTypicalCase(Integer id) {
    TypicalCase typicalCase = SpringUtil.getBean(TypicalCaseAction.class).findTypicalCaseById(id);
    PageController controller = SpringUtil.getBean(PageController.class);
    TypicalCase3D content = new TypicalCase3D();
    controller.loadContent(content, PageLevel.Level2);
    controller.showLoading();
    controller.setEndHideLoading((v) -> {
        content.setupCase(typicalCase);
    });
}
Also used : PageController(com.cas.sim.tis.view.controller.PageController) TypicalCaseAction(com.cas.sim.tis.action.TypicalCaseAction) TypicalCase(com.cas.sim.tis.entity.TypicalCase) TypicalCase3D(com.cas.sim.tis.view.control.imp.jme.TypicalCase3D)

Example 9 with TypicalCase

use of com.cas.sim.tis.entity.TypicalCase in project TeachingInSimulation by ScOrPiOzzy.

the class TypicalCaseAction method delete.

public void delete(Integer id) {
    TypicalCase typicalCase = getService().findById(id);
    SpringUtil.getBean(FTPUtils.class).deleteFile("/archives", typicalCase.getArchivePath());
    typicalCase.setDel(true);
    typicalCase.setUpdater(Session.get(Session.KEY_LOGIN_ID));
    getService().update(typicalCase);
}
Also used : FTPUtils(com.cas.sim.tis.util.FTPUtils) TypicalCase(com.cas.sim.tis.entity.TypicalCase)

Aggregations

TypicalCase (com.cas.sim.tis.entity.TypicalCase)9 PageController (com.cas.sim.tis.view.controller.PageController)5 TypicalCaseAction (com.cas.sim.tis.action.TypicalCaseAction)3 TypicalCase3D (com.cas.sim.tis.view.control.imp.jme.TypicalCase3D)2 TextInputDialog (javafx.scene.control.TextInputDialog)2 JSONArray (com.alibaba.fastjson.JSONArray)1 ResourceAction (com.cas.sim.tis.action.ResourceAction)1 Resource (com.cas.sim.tis.entity.Resource)1 FTPUtils (com.cas.sim.tis.util.FTPUtils)1 IContent (com.cas.sim.tis.view.control.IContent)1 Dialog (com.cas.sim.tis.view.control.imp.dialog.Dialog)1 TypicalCaseSelectDialog (com.cas.sim.tis.view.control.imp.preparation.TypicalCaseSelectDialog)1