Search in sources :

Example 1 with ResourceInfo

use of com.cas.sim.tis.vo.ResourceInfo 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 2 with ResourceInfo

use of com.cas.sim.tis.vo.ResourceInfo in project TeachingInSimulation by ScOrPiOzzy.

the class ResourceServiceImpl method findResourceInfoByID.

@Override
public ResourceInfo findResourceInfoByID(int id) {
    ResourceMapper resourceMapper = (ResourceMapper) mapper;
    ResourceInfo result = resourceMapper.selectResourceInfoByID(id);
    return result;
}
Also used : ResourceInfo(com.cas.sim.tis.vo.ResourceInfo) ResourceMapper(com.cas.sim.tis.mapper.ResourceMapper)

Aggregations

ResourceInfo (com.cas.sim.tis.vo.ResourceInfo)2 ResourceAction (com.cas.sim.tis.action.ResourceAction)1 ResourceMapper (com.cas.sim.tis.mapper.ResourceMapper)1 SVGGlyph (com.cas.sim.tis.svg.SVGGlyph)1