Changeset 11076

Show
Ignore:
Timestamp:
20.01.2006 11:39:44 (14 years ago)
Author:
mdewsnip
Message:

Used GProgressBars instead of JProgressBars, because they're safer when setting indeterminate.

Location:
trunk/gli/src/org/greenstone/gatherer/shell
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/shell/GBuildProgressMonitor.java

    r10618 r11076  
    3939import java.awt.Component; 
    4040import java.util.ArrayList; 
    41 import javax.swing.JProgressBar; 
    4241import org.greenstone.gatherer.Configuration; 
    4342import org.greenstone.gatherer.DebugStream; 
     
    4544import org.greenstone.gatherer.Gatherer; 
    4645import org.greenstone.gatherer.cdm.CollectionDesignManager; 
     46import org.greenstone.gatherer.gui.GProgressBar; 
    4747import org.greenstone.gatherer.util.StaticStrings; 
    4848/** This implementation of <i>GShellProgressMonitor</i> is designed to parse and translate the progress of a buildcol.pl call. 
     
    126126    private int state = BASE; 
    127127    /** The progress bar this monitor updates. */ 
    128     private JProgressBar progress_bar; 
     128    private GProgressBar progress_bar; 
    129129    /** A progress bar that is shared between this this listener and the Import monitor. */ 
    130     private JProgressBar shared_progress_bar; 
     130    private GProgressBar shared_progress_bar; 
    131131 
    132132    /** Construct a new GBuildProgressMonitor. */ 
    133     public GBuildProgressMonitor(JProgressBar shared_progress_bar) { 
     133    public GBuildProgressMonitor(GProgressBar shared_progress_bar) { 
    134134    this.shared_progress_bar = shared_progress_bar; 
    135     progress_bar = new JProgressBar(); 
     135    progress_bar = new GProgressBar(); 
    136136    progress_bar.setMaximum(MAX); 
    137137    progress_bar.setMinimum(MIN); 
     
    142142 
    143143    /** Method to register a new progress bar with this monitor. 
    144      * @param progress_bar The new <strong>JProgressBar</strong>. 
     144     * @param progress_bar The new <strong>GProgressBar</strong>. 
    145145     */   
    146     public void addProgressBar(JProgressBar progress_bar) { 
     146    public void addProgressBar(GProgressBar progress_bar) { 
    147147    this.progress_bar = progress_bar; 
    148148    progress_bar.setMaximum(MAX); 
     
    162162    return 1; 
    163163    } 
    164     /** Method to retrieve whatever control is being used as the progress indicator. Usually a <strong>JProgressBar</strong> but there may be others implemented later. 
     164    /** Method to retrieve whatever control is being used as the progress indicator. Usually a <strong>GProgressBar</strong> but there may be others implemented later. 
    165165     * @return A <strong>Component</strong> on which the progress of the process is being displayed. 
    166166     */ 
     
    169169    } 
    170170 
    171     public JProgressBar getSharedProgress() { 
     171    public GProgressBar getSharedProgress() { 
    172172    return shared_progress_bar; 
    173173    } 
     
    533533    } 
    534534 
    535     public void setSharedProgressBar(JProgressBar shared_progress_bar) { 
     535    public void setSharedProgressBar(GProgressBar shared_progress_bar) { 
    536536    this.shared_progress_bar = shared_progress_bar; 
    537537    } 
  • trunk/gli/src/org/greenstone/gatherer/shell/GImportProgressMonitor.java

    r11068 r11076  
    3939import java.awt.Component; 
    4040import java.util.*; 
    41 import javax.swing.JProgressBar; 
    4241import org.greenstone.gatherer.Configuration; 
    4342import org.greenstone.gatherer.DebugStream; 
    4443import org.greenstone.gatherer.Dictionary; 
    4544import org.greenstone.gatherer.Gatherer; 
     45import org.greenstone.gatherer.gui.GProgressBar; 
    4646import org.greenstone.gatherer.util.StaticStrings; 
    4747 
     
    6969    private int threshold = Configuration.SYSTEMS_MODE; 
    7070    /** The progress bar this monitor updates. */ 
    71     private JProgressBar progress_bar; 
     71    private GProgressBar progress_bar; 
    7272 
    7373    /** The progress bar that is shared with build monitor. */ 
    74     private JProgressBar shared_progress_bar; 
     74    private GProgressBar shared_progress_bar; 
    7575 
    7676    /** */ 
     
    116116 
    117117    public GImportProgressMonitor() { 
    118     progress_bar = new JProgressBar(); 
     118    progress_bar = new GProgressBar(); 
    119119    progress_bar.setIndeterminate(false); 
    120120    progress_bar.setMaximum(MAXIMUM); 
     
    123123    progress_bar.setStringPainted(true); 
    124124    next_progress_value = CALCULATION; 
    125     shared_progress_bar = new JProgressBar(); 
     125    shared_progress_bar = new GProgressBar(); 
    126126    shared_progress_bar.setIndeterminate(false); 
    127127    shared_progress_bar.setMaximum(MAXIMUM * 2); 
     
    133133 
    134134    /** Method to register a new progress bar with this monitor. 
    135      * @param progress_bar The new <strong>JProgressBar</strong>. 
    136      */ 
    137     public void addProgressBar(JProgressBar progress_bar) { 
     135     * @param progress_bar The new <strong>GProgressBar</strong>. 
     136     */ 
     137    public void addProgressBar(GProgressBar progress_bar) { 
    138138    this.progress_bar = progress_bar; 
    139139    progress_bar.setMaximum(MAXIMUM); 
     
    160160    } 
    161161 
    162     /** Method to retrieve whatever control is being used as the progress indicator. Usually a <strong>JProgressBar</strong> but there may be others implemented later. 
     162    /** Method to retrieve whatever control is being used as the progress indicator. Usually a <strong>GProgressBar</strong> but there may be others implemented later. 
    163163     * @return A <strong>Component</strong> on which the progress of the process is being displayed. 
    164164     */ 
     
    167167    } 
    168168 
    169     public JProgressBar getSharedProgress() { 
     169    public GProgressBar getSharedProgress() { 
    170170    return shared_progress_bar; 
    171171    } 
  • trunk/gli/src/org/greenstone/gatherer/shell/GShellProgressMonitor.java

    r8243 r11076  
    5050import java.awt.Component; 
    5151import java.util.ArrayList; 
    52 import javax.swing.JProgressBar; 
     52import org.greenstone.gatherer.gui.GProgressBar; 
    5353 
    5454/** When implemented, this interface allows another class to monitor the progress of a <strong>GShell</strong> process. Specifically implementing classes should be designed to take the textual output from the process and then translate that message into some quanitive measure of progress which can then be shown on the progress bar. 
     
    5656public interface GShellProgressMonitor { 
    5757    /** Method to register a new progress bar with this monitor. 
    58      * @param progress_bar The new <strong>JProgressBar</strong>. 
     58     * @param progress_bar The new <strong>GProgressBar</strong>. 
    5959     */ 
    60     public void addProgressBar(JProgressBar progress_bar); 
     60    public void addProgressBar(GProgressBar progress_bar); 
    6161 
    6262    /** Determine the script exit value according to the progress monitor. This gets around a problem where several script failures actually result with a successful exit value. 
     
    6565    public int exitValue(); 
    6666 
    67     public JProgressBar getSharedProgress(); 
     67    public GProgressBar getSharedProgress(); 
    6868 
    69     /** Method to retrieve whatever control is being used as the progress indicator. Usually a <strong>JProgressBar</strong> but there may be others implemented later. 
     69    /** Method to retrieve whatever control is being used as the progress indicator. Usually a <strong>GProgressBar</strong> but there may be others implemented later. 
    7070     * @return A <strong>Component</strong> on which the progress of the process is being displayed. 
    7171     */