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());
}
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"));
}
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);
});
}
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);
}
Aggregations