001    /*
002     * The contents of this file are subject to the Mozilla Public License
003     * Version 1.1 (the "License");  you may not use this file except in 
004     * compliance with the License.  You may obtain a copy of the License at
005     * http://www.mozilla.org/MPL/
006     *
007     * Software distributed under the License is distributed on an "AS IS" basis,
008     * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
009     * the specific language governing rights and limitations under the License.
010     *
011     * The Original Code is Protege-2000.
012     *
013     * The Initial Developer of the Original Code is Stanford University. Portions
014     * created by Stanford University are Copyright (C) 2007.  All Rights Reserved.
015     *
016     * Protege was developed by Stanford Medical Informatics
017     * (http://www.smi.stanford.edu) at the Stanford University School of Medicine
018     * with support from the National Library of Medicine, the National Science
019     * Foundation, and the Defense Advanced Research Projects Agency.  Current
020     * information about Protege can be obtained at http://protege.stanford.edu.
021     *
022     */
023    
024    package edu.stanford.smi.protegex.owl.model;
025    
026    /**
027     * User: matthewhorridge<br>
028     * The University Of Manchester<br>
029     * Medical Informatics Group<br>
030     * Date: Sep 11, 2005<br><br>
031     * <p/>
032     * matthew.horridge@cs.man.ac.uk<br>
033     * www.cs.man.ac.uk/~horridgm<br><br>
034     */
035    public interface TaskProgressDisplay {
036    
037        /**
038         * Runs the task and starts the display of progress to the user.
039         * @param task The <code>Task</code> that will be run and
040         * whose progress will be monitored and displayed.
041         */
042        public void run(Task task) throws Exception;
043    
044    
045        /**
046         * Updates the value of the progress that is
047         * displayed to the user.
048         *
049         * @param task The task which the progress relates to
050         * @param progress The progress that will
051         *                 be between the min and max progress for
052         *                 the <code>Task</code>
053         */
054        public void setProgress(Task task, int progress);
055    
056    
057        /**
058         * Sets the progress display to indicate that the
059         * progress cannot be determined, but the task is
060         * proceding as normal.
061         *
062         * @param b <code>true</code> if the progress is
063         *          indeterminate, or <code>false</code> if the progress
064         *          is not indeterminate.
065         */
066        public void setProgressIndeterminate(Task task, boolean b);
067    
068    
069        /**
070         * Sets the message that will be displayed to the user.
071         */
072        public void setMessage(Task task, String message);
073    
074    
075        /**
076         * Stops (hides) the progress display. This methods is
077         * generally called when the task is complete.
078         */
079        public void end(Task task);
080    }
081