当前位置: 首页>>代码示例>>Java>>正文


Java TimeLogic类代码示例

本文整理汇总了Java中logbook.gui.logic.TimeLogic的典型用法代码示例。如果您正苦于以下问题:Java TimeLogic类的具体用法?Java TimeLogic怎么用?Java TimeLogic使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TimeLogic类属于logbook.gui.logic包,在下文中一共展示了TimeLogic类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toBean

import logbook.gui.logic.TimeLogic; //导入依赖的package包/类
/**
 * ShipDto -> BathwaterBean 変換
 *
 * @param e ShipDto
 * @return BathwaterBean
 */
public static BathwaterBean toBean(ShipDto e) {
    BathwaterBean b = new BathwaterBean();
    // 状態
    if (e.isBadlyDamage()) {
        b.setStatus("大破");
    } else if (e.isHalfDamage()) {
        b.setStatus("中破");
    } else if (e.isSlightDamage()) {
        b.setStatus("小破");
    } else {
        b.setStatus("");
    }
    SimpleDateFormat format = new SimpleDateFormat(AppConstants.DATE_SHORT_FORMAT);
    // 整形
    b.setId(e.getId());
    b.setFleet(e.getFleetid());
    b.setCond(e.getCond());
    b.setName(e.getName());
    b.setLv(e.getLv());
    b.setHp(e.getNowhp() + "/" + e.getMaxhp());
    b.setTime(TimeLogic.toDateRestString(e.getDocktime() / 1000));
    b.setFromNow(format.format(new Date(System.currentTimeMillis() + e.getDocktime())));
    b.setFuel(e.getDockfuel());
    b.setMetal(e.getDockmetal());
    // HP1あたりの時間
    String oneHp = TimeLogic.toDateRestString((long) (e.getDocktime()
            / (float) (e.getMaxhp() - e.getNowhp()) / 1000));
    b.setOneHp(oneHp);
    return b;
}
 
开发者ID:sanaehirotaka,项目名称:logbook,代码行数:37,代码来源:BathwaterBean.java

示例2: updateDeck

import logbook.gui.logic.TimeLogic; //导入依赖的package包/类
/**
 * 遠征を更新する
 *
 * @param now
 * @param notice
 * @return
 */
private boolean updateDeck(Date now, List<String> notice) {
    boolean noticeflg = false;

    Label[] deckNameLabels = { this.main.getDeck1name(), this.main.getDeck2name(), this.main.getDeck3name() };
    Text[] deckTimeTexts = { this.main.getDeck1time(), this.main.getDeck2time(), this.main.getDeck3time() };

    DeckMissionDto[] deckMissions = GlobalContext.getDeckMissions();

    for (int i = 0; i < deckMissions.length; i++) {
        String time = "";
        String dispname = "";
        if (deckMissions[i].getMission() != null) {
            dispname = deckMissions[i].getName() + " (" + deckMissions[i].getMission() + ")";

            if (deckMissions[i].getTime() != null) {
                long rest = getRest(now, deckMissions[i].getTime());

                // ツールチップテキストで時刻を表示する
                deckTimeTexts[i].setToolTipText(this.format.format(deckMissions[i].getTime()));

                // 20分前、10分前、5分前になったら背景色を変更する
                if (rest <= (ONE_MINUTES * 5)) {
                    deckTimeTexts[i].setBackground(SWTResourceManager
                            .getColor(AppConstants.TIME_IN_5_MIN));
                } else if (rest <= (ONE_MINUTES * 10)) {
                    deckTimeTexts[i].setBackground(SWTResourceManager
                            .getColor(AppConstants.TIME_IN_10_MIN));
                } else if (rest <= (ONE_MINUTES * 20)) {
                    deckTimeTexts[i].setBackground(SWTResourceManager
                            .getColor(AppConstants.TIME_IN_20_MIN));
                } else {
                    deckTimeTexts[i].setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
                }
                if (this.main.getDeckNotice().getSelection()) {
                    if ((rest <= ONE_MINUTES) && !FLAG_NOTICE_DECK[i]) {
                        notice.add(dispname + " がまもなく帰投します");
                        noticeflg = true;
                        FLAG_NOTICE_DECK[i] = true;
                    } else if (AppConfig.get().isMissionRemind() && (rest < -1)
                            && ((rest % AppConfig.get().getRemindInterbal()) == 0)) {
                        // 定期的にリマインドする
                        notice.add(dispname + " がまもなく帰投します");
                        noticeflg = true;
                    } else if (rest > ONE_MINUTES) {
                        FLAG_NOTICE_DECK[i] = false;
                    }
                } else {
                    FLAG_NOTICE_DECK[i] = false;
                }
                time = TimeLogic.toDateRestString(rest);
                if (time == null) {
                    time = "まもなく帰投します";
                }
            }
        } else {
            deckTimeTexts[i].setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
            deckTimeTexts[i].setToolTipText(null);
        }
        deckNameLabels[i].setText(dispname);
        deckTimeTexts[i].setText(time);
    }
    return noticeflg;
}
 
开发者ID:sanaehirotaka,项目名称:logbook,代码行数:71,代码来源:AsyncExecApplicationMain.java

示例3: updateNdock

import logbook.gui.logic.TimeLogic; //导入依赖的package包/类
/**
 * 入渠を更新する
 *
 * @param now
 * @param notice
 * @return
 */
private boolean updateNdock(Date now, List<String> notice) {
    boolean noticeflg = false;

    Map<Long, ShipDto> shipMap = ShipContext.get();

    Label[] ndockNameLabels = { this.main.getNdock1name(), this.main.getNdock2name(),
            this.main.getNdock3name(), this.main.getNdock4name() };
    Text[] ndockTimeTexts = { this.main.getNdock1time(), this.main.getNdock2time(), this.main.getNdock3time(),
            this.main.getNdock4time() };

    NdockDto[] ndocks = GlobalContext.getNdocks();

    for (int i = 0; i < ndocks.length; i++) {
        String name = "";
        String time = "";

        if (ndocks[i].getNdockid() != 0) {
            ShipDto ship = shipMap.get(Long.valueOf(ndocks[i].getNdockid()));
            if (ship != null) {
                name = ship.getName() + " (Lv" + ship.getLv() + ")";
                long rest = getRest(now, ndocks[i].getNdocktime());

                // ツールチップテキストで時刻を表示する
                ndockTimeTexts[i].setToolTipText(this.format.format(ndocks[i].getNdocktime()));

                // 20分前、10分前、5分前になったら背景色を変更する
                if (rest <= (ONE_MINUTES * 5)) {
                    ndockTimeTexts[i].setBackground(SWTResourceManager
                            .getColor(AppConstants.TIME_IN_5_MIN));
                } else if (rest <= (ONE_MINUTES * 10)) {
                    ndockTimeTexts[i].setBackground(SWTResourceManager
                            .getColor(AppConstants.TIME_IN_10_MIN));
                } else if (rest <= (ONE_MINUTES * 20)) {
                    ndockTimeTexts[i].setBackground(SWTResourceManager
                            .getColor(AppConstants.TIME_IN_20_MIN));
                } else {
                    ndockTimeTexts[i].setBackground(SWTResourceManager
                            .getColor(SWT.COLOR_WHITE));
                }
                if (this.main.getNdockNotice().getSelection()) {

                    if ((rest <= ONE_MINUTES) && !FLAG_NOTICE_NDOCK[i]) {
                        notice.add(name + " がまもなくお風呂からあがります");
                        noticeflg = true;
                        FLAG_NOTICE_NDOCK[i] = true;
                    } else if (rest > ONE_MINUTES) {
                        FLAG_NOTICE_NDOCK[i] = false;
                    }
                } else {
                    FLAG_NOTICE_NDOCK[i] = false;
                }
                time = TimeLogic.toDateRestString(rest);
                if (time == null) {
                    time = "まもなくお風呂からあがります";
                }
            }
        } else {
            ndockTimeTexts[i].setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
            ndockTimeTexts[i].setToolTipText(null);
        }
        ndockNameLabels[i].setText(name);
        ndockTimeTexts[i].setText(time);
    }
    return noticeflg;
}
 
开发者ID:sanaehirotaka,项目名称:logbook,代码行数:73,代码来源:AsyncExecApplicationMain.java

示例4: updateDeck

import logbook.gui.logic.TimeLogic; //导入依赖的package包/类
/**
 * 遠征を更新する
 * 
 * @param now
 * @param notice
 * @return
 */
private boolean updateDeck(Date now, List<String> notice) {
    boolean noticeflg = false;

    Label[] deckNameLabels = { this.main.getDeck1name(), this.main.getDeck2name(), this.main.getDeck3name() };
    Text[] deckTimeTexts = { this.main.getDeck1time(), this.main.getDeck2time(), this.main.getDeck3time() };

    DeckMissionDto[] deckMissions = GlobalContext.getDeckMissions();

    for (int i = 0; i < deckMissions.length; i++) {
        String time = "";
        String dispname = "";
        if (deckMissions[i].getMission() != null) {
            dispname = deckMissions[i].getName() + " (" + deckMissions[i].getMission() + ")";

            if (deckMissions[i].getTime() != null) {
                long rest = getRest(now, deckMissions[i].getTime());

                // ツールチップテキストで時刻を表示する
                deckTimeTexts[i].setToolTipText(this.format.format(deckMissions[i].getTime()));

                // 20分前、10分前、5分前になったら背景色を変更する
                if (rest <= (ONE_MINUTES * 5)) {
                    deckTimeTexts[i].setBackground(SWTResourceManager
                            .getColor(AppConstants.TIME_IN_5_MIN));
                } else if (rest <= (ONE_MINUTES * 10)) {
                    deckTimeTexts[i].setBackground(SWTResourceManager
                            .getColor(AppConstants.TIME_IN_10_MIN));
                } else if (rest <= (ONE_MINUTES * 20)) {
                    deckTimeTexts[i].setBackground(SWTResourceManager
                            .getColor(AppConstants.TIME_IN_20_MIN));
                } else {
                    deckTimeTexts[i].setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
                }
                if (this.main.getDeckNotice().getSelection()) {
                    if ((rest <= ONE_MINUTES) && !FLAG_NOTICE_DECK[i]) {
                        notice.add(dispname + " がまもなく帰投します");
                        noticeflg = true;
                        FLAG_NOTICE_DECK[i] = true;
                    } else if (AppConfig.get().isMissionRemind() && (rest < -1)
                            && ((rest % AppConfig.get().getRemindInterbal()) == 0)) {
                        // 定期的にリマインドする
                        notice.add(dispname + " がまもなく帰投します");
                        noticeflg = true;
                    } else if (rest > ONE_MINUTES) {
                        FLAG_NOTICE_DECK[i] = false;
                    }
                } else {
                    FLAG_NOTICE_DECK[i] = false;
                }
                time = TimeLogic.toDateRestString(rest);
                if (time == null) {
                    time = "まもなく帰投します";
                }
            }
        } else {
            deckTimeTexts[i].setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
            deckTimeTexts[i].setToolTipText(null);
        }
        deckNameLabels[i].setText(dispname);
        deckTimeTexts[i].setText(time);
    }
    return noticeflg;
}
 
开发者ID:kyuntx,项目名称:logbookpn,代码行数:71,代码来源:AsyncExecApplicationMain.java

示例5: updateNdock

import logbook.gui.logic.TimeLogic; //导入依赖的package包/类
/**
 * 入渠を更新する
 * 
 * @param now
 * @param notice
 * @return
 */
private boolean updateNdock(Date now, List<String> notice) {
    boolean noticeflg = false;

    Map<Long, ShipDto> shipMap = GlobalContext.getShipMap();

    Label[] ndockNameLabels = { this.main.getNdock1name(), this.main.getNdock2name(),
            this.main.getNdock3name(), this.main.getNdock4name() };
    Text[] ndockTimeTexts = { this.main.getNdock1time(), this.main.getNdock2time(), this.main.getNdock3time(),
            this.main.getNdock4time() };

    NdockDto[] ndocks = GlobalContext.getNdocks();

    for (int i = 0; i < ndocks.length; i++) {
        String name = "";
        String time = "";

        if (ndocks[i].getNdockid() != 0) {
            ShipDto ship = shipMap.get(Long.valueOf(ndocks[i].getNdockid()));
            if (ship != null) {
                name = ship.getName() + " (Lv" + ship.getLv() + ")";
                long rest = getRest(now, ndocks[i].getNdocktime());

                // ツールチップテキストで時刻を表示する
                ndockTimeTexts[i].setToolTipText(this.format.format(ndocks[i].getNdocktime()));

                // 20分前、10分前、5分前になったら背景色を変更する
                if (rest <= (ONE_MINUTES * 5)) {
                    ndockTimeTexts[i].setBackground(SWTResourceManager
                            .getColor(AppConstants.TIME_IN_5_MIN));
                } else if (rest <= (ONE_MINUTES * 10)) {
                    ndockTimeTexts[i].setBackground(SWTResourceManager
                            .getColor(AppConstants.TIME_IN_10_MIN));
                } else if (rest <= (ONE_MINUTES * 20)) {
                    ndockTimeTexts[i].setBackground(SWTResourceManager
                            .getColor(AppConstants.TIME_IN_20_MIN));
                } else {
                    ndockTimeTexts[i].setBackground(SWTResourceManager
                            .getColor(SWT.COLOR_WHITE));
                }
                if (this.main.getNdockNotice().getSelection()) {

                    if ((rest <= ONE_MINUTES) && !FLAG_NOTICE_NDOCK[i]) {
                        notice.add(name + " がまもなくお風呂からあがります");
                        noticeflg = true;
                        FLAG_NOTICE_NDOCK[i] = true;
                    } else if (rest > ONE_MINUTES) {
                        FLAG_NOTICE_NDOCK[i] = false;
                    }
                } else {
                    FLAG_NOTICE_NDOCK[i] = false;
                }
                time = TimeLogic.toDateRestString(rest);
                if (time == null) {
                    time = "まもなくお風呂からあがります";
                }
            }
        } else {
            ndockTimeTexts[i].setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
            ndockTimeTexts[i].setToolTipText(null);
        }
        ndockNameLabels[i].setText(name);
        ndockTimeTexts[i].setText(time);
    }
    return noticeflg;
}
 
开发者ID:kyuntx,项目名称:logbookpn,代码行数:73,代码来源:AsyncExecApplicationMain.java

示例6: updateDeck

import logbook.gui.logic.TimeLogic; //导入依赖的package包/类
/**
 * 遠征を更新する
 * 
 * @param now
 * @param notice
 * @return
 */
private boolean updateDeck(Date now, List<String> notice) {
    boolean noticeflg = false;

    Label[] deckNameLabels = { this.main.getDeck1name(), this.main.getDeck2name(), this.main.getDeck3name() };
    Text[] deckTimeTexts = { this.main.getDeck1time(), this.main.getDeck2time(), this.main.getDeck3time() };

    DeckMissionDto[] deckMissions = GlobalContext.getDeckMissions();

    for (int i = 0; i < deckMissions.length; i++) {
        String time = "";
        String dispname = "";
        if (deckMissions[i].getMission() != null) {
            dispname = deckMissions[i].getName() + " (" + deckMissions[i].getMission() + ")";

            if (deckMissions[i].getTime() != null) {
                long rest = getRest(now, deckMissions[i].getTime());

                // ツールチップテキストで時刻を表示する
                deckTimeTexts[i].setToolTipText(this.format.format(deckMissions[i].getTime()));

                // 20分前、10分前、5分前になったら背景色を変更する
                if (rest <= (ONE_MINUTES * 5)) {
                    deckTimeTexts[i].setBackground(SWTResourceManager
                            .getColor(AppConstants.TIME_IN_5_MIN));
                } else if (rest <= (ONE_MINUTES * 10)) {
                    deckTimeTexts[i].setBackground(SWTResourceManager
                            .getColor(AppConstants.TIME_IN_10_MIN));
                } else if (rest <= (ONE_MINUTES * 20)) {
                    deckTimeTexts[i].setBackground(SWTResourceManager
                            .getColor(AppConstants.TIME_IN_20_MIN));
                } else {
                    deckTimeTexts[i].setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
                }
                if (this.main.getDeckNotice().getSelection()) {
                    if ((rest <= ONE_MINUTES) && !FLAG_NOTICE_DECK[i]) {
                        notice.add(deckMissions[i].getName() + " has returned from " + deckMissions[i].getMission());
                        noticeflg = true;
                        FLAG_NOTICE_DECK[i] = true;
                    } else if (AppConfig.get().isMissionRemind() && (rest < -1)
                            && ((rest % AppConfig.get().getRemindInterbal()) == 0)) {
                        // 定期的にリマインドする
                        notice.add(dispname + "  will arrive soon.");
                        noticeflg = true;
                    } else if (rest > ONE_MINUTES) {
                        FLAG_NOTICE_DECK[i] = false;
                    }
                } else {
                    FLAG_NOTICE_DECK[i] = false;
                }
                time = TimeLogic.toDateRestString(rest);
                if (time == null) {
                    time = "Done";
                }
            }
        } else {
            deckTimeTexts[i].setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
            deckTimeTexts[i].setToolTipText(null);
        }
        deckNameLabels[i].setText(dispname);
        deckTimeTexts[i].setText(time);
    }
    return noticeflg;
}
 
开发者ID:silfumus,项目名称:logbook-EN,代码行数:71,代码来源:AsyncExecApplicationMain.java

示例7: updateNdock

import logbook.gui.logic.TimeLogic; //导入依赖的package包/类
/**
 * 入渠を更新する
 * 
 * @param now
 * @param notice
 * @return
 */
private boolean updateNdock(Date now, List<String> notice) {
    boolean noticeflg = false;

    Map<Long, ShipDto> shipMap = GlobalContext.getShipMap();

    Label[] ndockNameLabels = { this.main.getNdock1name(), this.main.getNdock2name(),
            this.main.getNdock3name(), this.main.getNdock4name() };
    Text[] ndockTimeTexts = { this.main.getNdock1time(), this.main.getNdock2time(), this.main.getNdock3time(),
            this.main.getNdock4time() };

    NdockDto[] ndocks = GlobalContext.getNdocks();

    for (int i = 0; i < ndocks.length; i++) {
        String name = "";
        String time = "";

        if (ndocks[i].getNdockid() != 0) {
            ShipDto ship = shipMap.get(Long.valueOf(ndocks[i].getNdockid()));
            if (ship != null) {
                name = ship.getName() + " (Lv" + ship.getLv() + ")";
                long rest = getRest(now, ndocks[i].getNdocktime());

                // ツールチップテキストで時刻を表示する
                ndockTimeTexts[i].setToolTipText(this.format.format(ndocks[i].getNdocktime()));

                // 20分前、10分前、5分前になったら背景色を変更する
                if (rest <= (ONE_MINUTES * 5)) {
                    ndockTimeTexts[i].setBackground(SWTResourceManager
                            .getColor(AppConstants.TIME_IN_5_MIN));
                } else if (rest <= (ONE_MINUTES * 10)) {
                    ndockTimeTexts[i].setBackground(SWTResourceManager
                            .getColor(AppConstants.TIME_IN_10_MIN));
                } else if (rest <= (ONE_MINUTES * 20)) {
                    ndockTimeTexts[i].setBackground(SWTResourceManager
                            .getColor(AppConstants.TIME_IN_20_MIN));
                } else {
                    ndockTimeTexts[i].setBackground(SWTResourceManager
                            .getColor(SWT.COLOR_WHITE));
                }
                if (this.main.getNdockNotice().getSelection()) {

                    if ((rest <= ONE_MINUTES) && !FLAG_NOTICE_NDOCK[i]) {
                        notice.add("Repair Dock has finished repairing " + name);
                        noticeflg = true;
                        FLAG_NOTICE_NDOCK[i] = true;
                    } else if (rest > ONE_MINUTES) {
                        FLAG_NOTICE_NDOCK[i] = false;
                    }
                } else {
                    FLAG_NOTICE_NDOCK[i] = false;
                }
                time = TimeLogic.toDateRestString(rest);
                if (time == null) {
                    time = "Done";
                }
            }
        } else {
            ndockTimeTexts[i].setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
            ndockTimeTexts[i].setToolTipText(null);
        }
        ndockNameLabels[i].setText(name);
        ndockTimeTexts[i].setText(time);
    }
    return noticeflg;
}
 
开发者ID:silfumus,项目名称:logbook-EN,代码行数:73,代码来源:AsyncExecApplicationMain.java


注:本文中的logbook.gui.logic.TimeLogic类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。