- if (progressBars == null)
- {
- progressBars = new Hashtable();
- progressBarHandlers = new Hashtable();
- }
-
- JPanel progressPanel;
- Long lId = new Long(id);
- GridLayout layout = (GridLayout) statusPanel.getLayout();
- if (progressBars.get(lId) != null)
- {
- progressPanel = (JPanel) progressBars.get(new Long(id));
- statusPanel.remove(progressPanel);
- progressBars.remove(lId);
- progressPanel = null;
- if (message != null)
- {
- statusBar.setText(message);
- }
- if (progressBarHandlers.contains(lId))
- {
- progressBarHandlers.remove(lId);
- }
- layout.setRows(layout.getRows() - 1);
- }
- else
- {
- progressPanel = new JPanel(new BorderLayout(10, 5));
-
- JProgressBar progressBar = new JProgressBar();
- progressBar.setIndeterminate(true);
-
- progressPanel.add(new JLabel(message), BorderLayout.WEST);
- progressPanel.add(progressBar, BorderLayout.CENTER);
-
- layout.setRows(layout.getRows() + 1);
- statusPanel.add(progressPanel);
-
- progressBars.put(lId, progressPanel);
- }
- // update GUI
- // setMenusForViewport();
- validate();
+ progressBar.setProgressBar(message, id);
+ // if (progressBars == null)
+ // {
+ // progressBars = new Hashtable();
+ // progressBarHandlers = new Hashtable();
+ // }
+ //
+ // JPanel progressPanel;
+ // Long lId = new Long(id);
+ // GridLayout layout = (GridLayout) statusPanel.getLayout();
+ // if (progressBars.get(lId) != null)
+ // {
+ // progressPanel = (JPanel) progressBars.get(new Long(id));
+ // statusPanel.remove(progressPanel);
+ // progressBars.remove(lId);
+ // progressPanel = null;
+ // if (message != null)
+ // {
+ // statusBar.setText(message);
+ // }
+ // if (progressBarHandlers.contains(lId))
+ // {
+ // progressBarHandlers.remove(lId);
+ // }
+ // layout.setRows(layout.getRows() - 1);
+ // }
+ // else
+ // {
+ // progressPanel = new JPanel(new BorderLayout(10, 5));
+ //
+ // JProgressBar progressBar = new JProgressBar();
+ // progressBar.setIndeterminate(true);
+ //
+ // progressPanel.add(new JLabel(message), BorderLayout.WEST);
+ // progressPanel.add(progressBar, BorderLayout.CENTER);
+ //
+ // layout.setRows(layout.getRows() + 1);
+ // statusPanel.add(progressPanel);
+ //
+ // progressBars.put(lId, progressPanel);
+ // }
+ // // update GUI
+ // // setMenusForViewport();
+ // validate();