Search in sources :

Example 1 with Catalog

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

the class PreparationMenu method initializeContent.

private void initializeContent(TitledPane pane, Catalog project) {
    List<Catalog> tasks = SpringUtil.getBean(CatalogAction.class).findCatalogsByParentId(project.getId());
    VBox box = new VBox(10);
    for (Catalog task : tasks) {
        ToggleButton taskBtn = new ToggleButton(task.getName());
        taskBtn.setGraphic(createGraphicTitle(task));
        taskBtn.getStyleClass().add("titled-content-btn");
        taskBtn.setOnAction(e -> {
            // TODO 加载备课详情
            PageController controller = SpringUtil.getBean(PageController.class);
            controller.loadContent(new PreparationDetail(task), PageLevel.Level1);
        });
        box.getChildren().add(taskBtn);
        group.getToggles().add(taskBtn);
    }
    pane.setContent(box);
}
Also used : ToggleButton(javafx.scene.control.ToggleButton) PageController(com.cas.sim.tis.view.controller.PageController) CatalogAction(com.cas.sim.tis.action.CatalogAction) VBox(javafx.scene.layout.VBox) Catalog(com.cas.sim.tis.entity.Catalog)

Example 2 with Catalog

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

the class PreparationMenu method initialize.

/**
 * 界面初始化
 * @param catalog
 */
private void initialize(Catalog subject) {
    this.subject.setText(subject.getName());
    this.projects.getPanes().clear();
    this.group.getToggles().clear();
    List<Catalog> projects = SpringUtil.getBean(CatalogAction.class).findCatalogsByParentId(subject.getId());
    for (Catalog project : projects) {
        TitledPane pane = new TitledPane();
        pane.setOnMousePressed(e -> {
            if (pane.getContent() == null) {
                initializeContent(pane, project);
                pane.setOnMousePressed(null);
            }
        });
        pane.setGraphic(createGraphicTitle(project));
        this.projects.getPanes().add(pane);
    }
}
Also used : TitledPane(javafx.scene.control.TitledPane) CatalogAction(com.cas.sim.tis.action.CatalogAction) Catalog(com.cas.sim.tis.entity.Catalog)

Example 3 with Catalog

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

the class CatalogServiceImpl method findCatalogsByParentId.

@Override
public List<Catalog> findCatalogsByParentId(Integer rid) {
    Condition condition = new Condition(Catalog.class);
    Criteria criteria = condition.createCriteria();
    criteria.andEqualTo("rid", rid);
    criteria.andEqualTo("del", 0);
    CatalogMapper catalogMapper = (CatalogMapper) mapper;
    catalogMapper.selectByCondition(condition);
    List<Catalog> catalogs = null;
    try {
        catalogs = catalogMapper.selectByCondition(condition);
        LOG.debug("查询到子节点数量:{}", catalogs.size());
    } catch (Exception e) {
        LOG.error("查询ID{}下子节点失败!", rid);
        catalogs = Collections.emptyList();
    }
    return catalogs;
}
Also used : Condition(tk.mybatis.mapper.entity.Condition) CatalogMapper(com.cas.sim.tis.mapper.CatalogMapper) Criteria(tk.mybatis.mapper.entity.Example.Criteria) Catalog(com.cas.sim.tis.entity.Catalog)

Aggregations

Catalog (com.cas.sim.tis.entity.Catalog)3 CatalogAction (com.cas.sim.tis.action.CatalogAction)2 CatalogMapper (com.cas.sim.tis.mapper.CatalogMapper)1 PageController (com.cas.sim.tis.view.controller.PageController)1 TitledPane (javafx.scene.control.TitledPane)1 ToggleButton (javafx.scene.control.ToggleButton)1 VBox (javafx.scene.layout.VBox)1 Condition (tk.mybatis.mapper.entity.Condition)1 Criteria (tk.mybatis.mapper.entity.Example.Criteria)1