Search in sources :

Example 1 with ActionState

use of org.bimserver.models.store.ActionState in project BIMserver by opensourceBIM.

the class LongAction method changeActionState.

protected void changeActionState(ActionState actiontState, String title, int progress) {
    ActionState oldState = this.actionState;
    if (actiontState == ActionState.FINISHED) {
        stop = new GregorianCalendar();
    }
    int oldProgress = this.progress.get();
    String oldTitle = this.title;
    this.title = title;
    this.progress.set(progress);
    this.actionState = actiontState;
    if (oldState != actiontState || progress != oldProgress || !oldTitle.equals(title)) {
        if (title != null && oldTitle != null && !title.equals(oldTitle)) {
            stage++;
        }
        bimServer.getNotificationsManager().notify(new ProgressNotification(bimServer, progressTopic, getState()));
    }
}
Also used : GregorianCalendar(java.util.GregorianCalendar) ProgressNotification(org.bimserver.notifications.ProgressNotification) ActionState(org.bimserver.models.store.ActionState) LongActionState(org.bimserver.models.store.LongActionState)

Aggregations

GregorianCalendar (java.util.GregorianCalendar)1 ActionState (org.bimserver.models.store.ActionState)1 LongActionState (org.bimserver.models.store.LongActionState)1 ProgressNotification (org.bimserver.notifications.ProgressNotification)1