/[svn]/jsampler/trunk/src/org/jsampler/view/classic/ProgressDlg.java
ViewVC logotype

Diff of /jsampler/trunk/src/org/jsampler/view/classic/ProgressDlg.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1203 by iliev, Mon Apr 2 21:18:31 2007 UTC revision 1204 by iliev, Thu May 24 21:43:45 2007 UTC
# Line 36  import javax.swing.JDialog; Line 36  import javax.swing.JDialog;
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;
# Line 60  public class ProgressDlg extends JDialog Line 61  public class ProgressDlg extends JDialog
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);
# Line 123  public class ProgressDlg extends JDialog Line 124  public class ProgressDlg extends JDialog
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  }  }

Legend:
Removed from v.1203  
changed lines
  Added in v.1204

  ViewVC Help
Powered by ViewVC