OSDN Git Service

0adc045b2393938fe2562e6a82c1ecc4bf086756
[coroid/inqubus.git] / frontend / src / saccubus / ConvertStopFlag.java
1 package saccubus;
2
3 import javax.swing.JButton;
4
5 /**
6  * <p>
7  * \83^\83C\83g\83\8b\82³\82«\82ã\82Î\82·
8  * </p>
9  * 
10  * <p>
11  * \90à\96¾: \83j\83R\83j\83R\93®\89æ\82Ì\93®\89æ\82ð\83R\83\81\83\93\83g\82Â\82«\82Å\95Û\91
12  * </p>
13  * 
14  * <p>
15  * \92\98\8dì\8c : Copyright (c) 2007 PSI
16  * </p>
17  * 
18  * <p>
19  * \89ï\8eÐ\96¼:
20  * </p>
21  * 
22  * @author \96¢\93ü\97Í
23  * @version 1.0
24  */
25 public class ConvertStopFlag {
26         private boolean Flag = false;
27
28         private boolean Finished = false;
29
30         private final JButton Button;
31
32         private final String WaitText;
33
34         private final String DoneText;
35
36         public ConvertStopFlag(final JButton button, final String stop_text,
37                         final String wait_text, final String done_text) {
38                 Flag = false;
39                 Finished = false;
40                 Button = button;
41                 if (button != null && stop_text != null) {
42                         button.setText(stop_text);
43                 }
44                 DoneText = done_text;
45                 WaitText = wait_text;
46         }
47
48         public void stop() {
49                 Flag = true;
50                 if (Button != null && WaitText != null) {
51                         Button.setText(WaitText);
52                         Button.setEnabled(false);
53                 }
54         }
55
56         public boolean needStop() {
57                 return Flag;
58         }
59
60         public boolean isConverted() {
61                 return Finished;
62         }
63
64         public void finished() {
65                 Finished = true;
66                 if (Button != null && DoneText != null) {
67                         Button.setText(DoneText);
68                         Button.setEnabled(true);
69                 }
70         }
71 }