當前位置: 首頁>>代碼示例>>Java>>正文


Java ProgressObserver.notifyEnd方法代碼示例

本文整理匯總了Java中net.ssehub.easy.basics.progress.ProgressObserver.notifyEnd方法的典型用法代碼示例。如果您正苦於以下問題:Java ProgressObserver.notifyEnd方法的具體用法?Java ProgressObserver.notifyEnd怎麽用?Java ProgressObserver.notifyEnd使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.ssehub.easy.basics.progress.ProgressObserver的用法示例。


在下文中一共展示了ProgressObserver.notifyEnd方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: scanAll

import net.ssehub.easy.basics.progress.ProgressObserver; //導入方法依賴的package包/類
/**
 * Scans the entire environment starting at <code>root</code>.
 * 
 * @param observer the observer to be notified in case of progress, use 
 *   {@link ProgressObserver#NO_OBSERVER} if progress shall not be monitored
 * @throws VilException in case that creating / obtaining artifacts fails
 */
public void scanAll(ProgressObserver observer) throws VilException {
    if (null != base) {
        ITask task = observer.registerTask("creating complete artifact model for " + base.getAbsolutePath());
        int count = 0;
        if (ProgressObserver.NO_OBSERVER != observer) {
            count = scanAll(base, 0, null, null, null);
        }
        observer.notifyProgress(task, 0, count);
        List<VilException> errors = new ArrayList<VilException>();
        scanAll(base, 0, observer, task, errors);
        observer.notifyEnd(task);
        if (errors.size() > 0) {
            throw new VilException(errors);
        }
    }
}
 
開發者ID:SSEHUB,項目名稱:EASyProducer,代碼行數:24,代碼來源:ArtifactModel.java

示例2: progress

import net.ssehub.easy.basics.progress.ProgressObserver; //導入方法依賴的package包/類
/**
 * Notifies the tracer about the actual progress in order to inform the user.
 * 
 * @param actual the actual step (negative disables display)
 * @param max the maximum number of steps (may vary over time, negative disables display)
 * @param description an optional description of the step (may be <b>null</b>)
 */
public static void progress(int actual, int max, String description) {
    for (Map.Entry<ProgressObserver, TaskData> entry : PROGRESS_OBSERVERS.entrySet()) {
        ProgressObserver obs = entry.getKey();
        TaskData task = entry.getValue();
        boolean newTask = false;
        if (null == task) {
            newTask = true;
        } else if (null != description && !task.taskDescription.equals(description)) {
            // null == description -> keep task
            // not same description -> new task
            obs.notifyEnd(task.task);
            newTask = true;
        }
        if (newTask) {
            task = new TaskData();
            task.taskDescription = null == description ? "..." : description;
            task.task = obs.registerTask(task.taskDescription);
            entry.setValue(task);
        }
        obs.notifyProgress(task.task, actual, max);
    }
}
 
開發者ID:SSEHUB,項目名稱:EASyProducer,代碼行數:30,代碼來源:TracerFactory.java

示例3: unregisterProgressObserver

import net.ssehub.easy.basics.progress.ProgressObserver; //導入方法依賴的package包/類
/**
 * Unregisters the given progress observer.
 * 
 * @param observer the progress observer (ignored if <b>null</b>)
 */
public static void unregisterProgressObserver(ProgressObserver observer) {
    if (null != observer) {
        TaskData task = PROGRESS_OBSERVERS.remove(observer);
        if (null != task && null != task.task) {
            observer.notifyEnd(task.task);
        }
    }
}
 
開發者ID:SSEHUB,項目名稱:EASyProducer,代碼行數:14,代碼來源:TracerFactory.java

示例4: updateModelInformation

import net.ssehub.easy.basics.progress.ProgressObserver; //導入方法依賴的package包/類
/**
 * Updates the model information in all known locations.
 * 
 * @param observer an optional progress observer (use {@link ProgressObserver#NO_OBSERVER} but 
 *   not <b>null</b> in case that no observation is intended)
 * @throws ModelManagementException in case that the available information
 *   may be come inconsistent due to this update
 */
public synchronized void updateModelInformation(ProgressObserver observer) throws ModelManagementException {
    ModelInfoHolder<M> holder = new ModelInfoHolder<M>(availableModels);
    ITask task = observer.registerTask("update model model information");
    observer.notifyStart(task, locations.getLocationCount());
    Set<Location> done = new HashSet<Location>();
    for (int l = 0; l < locations.getLocationCount(); l++) {
        updateModelInformation(locations.getLocation(l), holder, observer, task, done);
        observer.notifyProgress(task, l);
    }
    observer.notifyEnd(task);
}
 
開發者ID:SSEHUB,項目名稱:EASyProducer,代碼行數:20,代碼來源:ModelManagement.java


注:本文中的net.ssehub.easy.basics.progress.ProgressObserver.notifyEnd方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。