Search in sources :

Example 1 with SVGGlyph

use of com.cas.sim.tis.svg.SVGGlyph in project TeachingInSimulation by ScOrPiOzzy.

the class Decoration method maximize.

public void maximize() {
    if (GUIState.getStage().isMaximized()) {
        max.setGraphic(new SVGGlyph("iconfont.svg.revert", Color.web("#A2CBF3"), 10));
        maxTip.setText(MsgUtil.getMessage("button.revert"));
    } else {
        max.setGraphic(new SVGGlyph("iconfont.svg.max", Color.web("#A2CBF3"), 10));
        maxTip.setText(MsgUtil.getMessage("button.maximize"));
    }
}
Also used : SVGGlyph(com.cas.sim.tis.svg.SVGGlyph)

Example 2 with SVGGlyph

use of com.cas.sim.tis.svg.SVGGlyph in project TeachingInSimulation by ScOrPiOzzy.

the class LeftMenu method addMenuItem.

protected void addMenuItem(String name, String svg, EventHandler<ActionEvent> e) {
    SVGGlyph glyph = new SVGGlyph(svg, Color.WHITE, 22);
    ToggleButton button = new ToggleButton(name, glyph);
    button.setOnAction(e);
    button.getStyleClass().add("left-menu");
    menu.getChildren().add(button);
    items.getToggles().add(button);
}
Also used : ToggleButton(javafx.scene.control.ToggleButton) SVGGlyph(com.cas.sim.tis.svg.SVGGlyph)

Example 3 with SVGGlyph

use of com.cas.sim.tis.svg.SVGGlyph in project TeachingInSimulation by ScOrPiOzzy.

the class ResourceViewer method loadResourceInfo.

/**
 * 加载资源信息
 */
private void loadResourceInfo() {
    ResourceInfo info = SpringUtil.getBean(ResourceAction.class).findResourceInfoByID(resource.getId());
    if (info != null) {
        this.creator.setText(MsgUtil.getMessage("resource.creator", info.getCreator()));
        this.createDate.setText(MsgUtil.getMessage("resource.create.date", DateUtil.date2Str(info.getCreateDate(), DateUtil.DATE_SHT_PAT_10_)));
        this.browsedTimes.setText(MsgUtil.getMessage("resource.browse.times", String.valueOf(info.getBrowsedTimes())));
        this.collectedTimes.setText(MsgUtil.getMessage("resource.collection.times", String.valueOf(info.getCollectedTimes())));
    }
    collected = SpringUtil.getBean(CollectionAction.class).checkCollected(resource.getId());
    if (collected) {
        this.collectedBtn.setGraphic(new SVGGlyph("iconfont.svg.collected", Color.web("#ff9e2c"), 25));
        this.collectedBtn.setText(MsgUtil.getMessage("resource.collection.done"));
    } else {
        this.collectedBtn.setGraphic(new SVGGlyph("iconfont.svg.uncollect", Color.web("#ff9e2c"), 25));
        this.collectedBtn.setText(MsgUtil.getMessage("resource.collection.todo"));
    }
}
Also used : ResourceInfo(com.cas.sim.tis.vo.ResourceInfo) SVGGlyph(com.cas.sim.tis.svg.SVGGlyph) ResourceAction(com.cas.sim.tis.action.ResourceAction)

Example 4 with SVGGlyph

use of com.cas.sim.tis.svg.SVGGlyph in project TeachingInSimulation by ScOrPiOzzy.

the class ResourceViewer method collect.

@FXML
private void collect() {
    Integer rid = resource.getId();
    if (collected) {
        this.collectedBtn.setGraphic(new SVGGlyph("iconfont.svg.uncollect", Color.web("#ff9e2c"), 25));
        this.collectedBtn.setText(MsgUtil.getMessage("resource.collection.todo"));
        SpringUtil.getBean(ResourceAction.class).uncollect(rid);
        collected = false;
    } else {
        this.collectedBtn.setGraphic(new SVGGlyph("iconfont.svg.collected", Color.web("#ff9e2c"), 25));
        this.collectedBtn.setText(MsgUtil.getMessage("resource.collection.done"));
        SpringUtil.getBean(ResourceAction.class).collected(rid);
        collected = true;
    }
}
Also used : SVGGlyph(com.cas.sim.tis.svg.SVGGlyph) ResourceAction(com.cas.sim.tis.action.ResourceAction) FXML(javafx.fxml.FXML)

Example 5 with SVGGlyph

use of com.cas.sim.tis.svg.SVGGlyph in project TeachingInSimulation by ScOrPiOzzy.

the class DrawingController method toggle.

@FXML
private void toggle(ActionEvent event) {
    if (expanding) {
        expand.setMinHeight(40);
        expand.setMaxHeight(40);
        ((Button) event.getSource()).setGraphic(new SVGGlyph("iconfont.svg.up", Color.web("#19b0c6"), 10));
    } else {
        expand.setMinHeight(140);
        expand.setMaxHeight(140);
        ((Button) event.getSource()).setGraphic(new SVGGlyph("iconfont.svg.down", Color.web("#19b0c6"), 10));
    }
    expanding = !expanding;
}
Also used : SVGGlyph(com.cas.sim.tis.svg.SVGGlyph) Button(javafx.scene.control.Button) ToggleButton(javafx.scene.control.ToggleButton) FXML(javafx.fxml.FXML)

Aggregations

SVGGlyph (com.cas.sim.tis.svg.SVGGlyph)12 ResourceAction (com.cas.sim.tis.action.ResourceAction)5 FXML (javafx.fxml.FXML)5 Button (javafx.scene.control.Button)5 VBox (javafx.scene.layout.VBox)5 AlertUtil (com.cas.sim.tis.util.AlertUtil)4 MsgUtil (com.cas.sim.tis.util.MsgUtil)4 SpringUtil (com.cas.sim.tis.util.SpringUtil)4 PageController (com.cas.sim.tis.view.controller.PageController)4 Pos (javafx.geometry.Pos)4 Node (javafx.scene.Node)4 AlertType (javafx.scene.control.Alert.AlertType)4 HBox (javafx.scene.layout.HBox)4 Region (javafx.scene.layout.Region)4 JSONArray (com.alibaba.fastjson.JSONArray)3 ResourceType (com.cas.sim.tis.consts.ResourceType)3 Resource (com.cas.sim.tis.entity.Resource)3 IContent (com.cas.sim.tis.view.control.IContent)3 IOException (java.io.IOException)3 BrokenCaseAction (com.cas.sim.tis.action.BrokenCaseAction)2