36 |
import javax.swing.JLabel; |
import javax.swing.JLabel; |
37 |
import javax.swing.JPanel; |
import javax.swing.JPanel; |
38 |
import javax.swing.JProgressBar; |
import javax.swing.JProgressBar; |
39 |
|
import javax.swing.SwingUtilities; |
40 |
|
|
41 |
import org.jsampler.CC; |
import org.jsampler.CC; |
42 |
import org.jsampler.HF; |
import org.jsampler.HF; |
61 |
/** Creates a new instance of ProgressDlg */ |
/** Creates a new instance of ProgressDlg */ |
62 |
public |
public |
63 |
ProgressDlg() { |
ProgressDlg() { |
64 |
super(CC.getMainFrame(), "", true); |
super((Frame)null, "", true); |
65 |
|
|
66 |
pb.setIndeterminate(true); |
pb.setIndeterminate(true); |
67 |
//pb.setStringPainted(true); |
//pb.setStringPainted(true); |
124 |
public void |
public void |
125 |
setString(String s) { l.setText(s); } |
setString(String s) { l.setText(s); } |
126 |
|
|
127 |
|
private void |
128 |
|
initProgressDlg() { |
129 |
|
pack(); |
130 |
|
Dimension d = getPreferredSize(); |
131 |
|
d.width = d.width > 300 ? d.width : 300; |
132 |
|
setSize(d); |
133 |
|
setResizable(false); |
134 |
|
|
135 |
|
setLocation(JuifeUtils.centerLocation(this, CC.getMainFrame())); |
136 |
|
} |
137 |
|
|
138 |
/** Starts to indicate that an operation is ongoing. */ |
/** Starts to indicate that an operation is ongoing. */ |
139 |
public void |
public void |
140 |
start() { |
start() { |
141 |
setLocation(JuifeUtils.centerLocation(this, CC.getMainFrame())); |
setLocation(JuifeUtils.centerLocation(this, CC.getMainFrame())); |
142 |
setVisible(true); |
|
143 |
|
SwingUtilities.invokeLater(new Runnable() { |
144 |
|
public void |
145 |
|
run() { |
146 |
|
initProgressDlg(); |
147 |
|
setVisible(true); |
148 |
|
} |
149 |
|
}); |
150 |
} |
} |
151 |
|
|
152 |
/** Stops the indication that an operation is ongoing. */ |
/** Stops the indication that an operation is ongoing. */ |
153 |
public void |
public void |
154 |
stop() { setVisible(false); } |
stop() { |
155 |
|
SwingUtilities.invokeLater(new Runnable() { |
156 |
|
public void |
157 |
|
run() { dispose(); } |
158 |
|
}); |
159 |
|
} |
160 |
} |
} |