Search in sources :

Example 1 with TypicalCase

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

the class DrawingController method refresh.

private void refresh() {
    TypicalCase typicalCase = typicalCase3D.getTypicalCase();
    typicalCase.setDrawings(StringUtil.combine(drawings));
    // if (typicalCase.getId() != null) {
    // // 典型案例已经保存过,则直接更新新增图纸到数据库
    // TypicalCaseAction action = SpringUtil.getBean(TypicalCaseAction.class);
    // action.modify(typicalCase);
    // }
    initDrawings(typicalCase3D);
}
Also used : TypicalCase(com.cas.sim.tis.entity.TypicalCase)

Example 2 with TypicalCase

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

the class TypicalCaseMenu method showCaseDialog.

// open打开案例选择面板
private void showCaseDialog() {
    Dialog<Integer> dialog = new Dialog<>();
    dialog.setDialogPane(new TypicalCaseSelectDialog(true));
    dialog.setTitle(MsgUtil.getMessage("typical.case.title.list"));
    dialog.setPrefSize(640, 500);
    dialog.showAndWait().ifPresent(id -> {
        if (id == null) {
            return;
        }
        SpringUtil.getBean(PageController.class).showLoading();
        TypicalCaseAction action = SpringUtil.getBean(TypicalCaseAction.class);
        TypicalCase typicalCase = action.findTypicalCaseById(id);
        typicalCase3D.setupCase(typicalCase);
    });
}
Also used : TypicalCaseSelectDialog(com.cas.sim.tis.view.control.imp.preparation.TypicalCaseSelectDialog) PageController(com.cas.sim.tis.view.controller.PageController) TypicalCaseAction(com.cas.sim.tis.action.TypicalCaseAction) TextInputDialog(javafx.scene.control.TextInputDialog) Dialog(com.cas.sim.tis.view.control.imp.dialog.Dialog) TypicalCaseSelectDialog(com.cas.sim.tis.view.control.imp.preparation.TypicalCaseSelectDialog) TypicalCase(com.cas.sim.tis.entity.TypicalCase)

Example 3 with TypicalCase

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

the class TypicalCaseMenu method newCase.

private void newCase() {
    SpringUtil.getBean(PageController.class).showLoading();
    TypicalCase typicalCase = new TypicalCase();
    typicalCase3D.setupCase(typicalCase);
}
Also used : PageController(com.cas.sim.tis.view.controller.PageController) TypicalCase(com.cas.sim.tis.entity.TypicalCase)

Example 4 with TypicalCase

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

the class TypicalCaseSelectDialog method refresh.

private void refresh() {
    List<TypicalCase> cases = SpringUtil.getBean(TypicalCaseAction.class).getTypicalCaseList();
    JSONArray array = new JSONArray();
    array.addAll(cases);
    table.setItems(array);
    table.build();
}
Also used : TypicalCaseAction(com.cas.sim.tis.action.TypicalCaseAction) JSONArray(com.alibaba.fastjson.JSONArray) TypicalCase(com.cas.sim.tis.entity.TypicalCase)

Example 5 with TypicalCase

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

the class DrawingController method initDrawings.

private void initDrawings(TypicalCase3D typicalCase3D) {
    clean();
    TypicalCase typicalCase = typicalCase3D.getTypicalCase();
    String drawings = typicalCase.getDrawings();
    if (StringUtils.isEmpty(drawings)) {
        return;
    }
    this.drawings = StringUtil.split(drawings);
    List<Resource> resources = SpringUtil.getBean(ResourceAction.class).findResourcesByIds(this.drawings);
    for (Resource resource : resources) {
        addDrawingPreviewBtn(resource);
    }
    index = 0;
    group.selectToggle(group.getToggles().get(index));
}
Also used : Resource(com.cas.sim.tis.entity.Resource) TypicalCase(com.cas.sim.tis.entity.TypicalCase) ResourceAction(com.cas.sim.tis.action.ResourceAction)

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