source: trunk/gli/src/org/greenstone/gatherer/shell/GShellProgressMonitor.java@ 8243

Last change on this file since 8243 was 8243, checked in by mdewsnip, 20 years ago

Removed all occurrences of classes explicitly importing other classes in the same package.

  • Property svn:keywords set to Author Date Id Revision
File size: 4.2 KB
Line 
1/**
2 *#########################################################################
3 *
4 * A component of the Gatherer application, part of the Greenstone digital
5 * library suite from the New Zealand Digital Library Project at the
6 * University of Waikato, New Zealand.
7 *
8 * <BR><BR>
9 *
10 * Author: John Thompson, Greenstone Digital Library, University of Waikato
11 *
12 * <BR><BR>
13 *
14 * Copyright (C) 1999 New Zealand Digital Library Project
15 *
16 * <BR><BR>
17 *
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 2 of the License, or
21 * (at your option) any later version.
22 *
23 * <BR><BR>
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
29 *
30 * <BR><BR>
31 *
32 * You should have received a copy of the GNU General Public License
33 * along with this program; if not, write to the Free Software
34 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
35 *########################################################################
36 */
37package org.greenstone.gatherer.shell;
38
39/**
40 * Title: The Gatherer<br>
41 * Description: The Gatherer: a tool for gathering and enriching digital collections.<br>
42 * Copyright: Copyright (c) 2001<br>
43 * Company: The University of Waikato<br>
44 * Written: / /01<br>
45 * Revised: 12/05/02 - Commented<br>
46 * 29/05/02 - Moved into correct package<br>
47 * @author John Thompson, Greenstone Digital Libraries
48 * @version 2.1
49 */
50import java.awt.Component;
51import java.util.ArrayList;
52import javax.swing.JProgressBar;
53
54/** 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.
55 */
56public interface GShellProgressMonitor {
57 /** Method to register a new progress bar with this monitor.
58 * @param progress_bar The new <strong>JProgressBar</strong>.
59 */
60 public void addProgressBar(JProgressBar progress_bar);
61
62 /** 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.
63 * @return A <i>int</i> with a value of zero if and only if the script was successful.
64 */
65 public int exitValue();
66
67 public JProgressBar getSharedProgress();
68
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.
70 * @return A <strong>Component</strong> on which the progress of the process is being displayed.
71 */
72 public Component getProgress();
73
74 public void messageOnProgressBar(String message);
75
76 /** Method to determine the state of the stop flag, which may be set by the visual component that created this monitor.
77 * @return A <strong>boolean</strong> indicating if the process has been asked to stop.
78 */
79 public boolean hasSignalledStop();
80
81 /** Inform the progress bar that it should programatically increment progress by one step. */
82 public void increment();
83
84 /** This method is used to 'feed in' a line of text captured from the process.
85 * @param queue what will be used as a queue of events, but what, at the moment, should only have one event in it
86 */
87 public void process(ArrayList queue);
88
89 public void reset();
90
91 public void saving();
92
93 /** Since the creator of this process monitor is actually in the GUI, this class provides the simpliest way to send a cancel process message between the two.
94 * @param state The desired state of the stop flag as a <strong>boolean</strong>.
95 */
96 public void setStop(boolean state);
97
98 /** This method resets this monitor to the start, reseting the process parsing and progress bar.
99 */
100 public void start();
101
102 /** This method indicates the process is complete.
103 */
104 public void stop();
105}
Note: See TracBrowser for help on using the repository browser.