private ExtractProgressDialog(Frame owner, boolean modal) { super(owner, "Extracting...", modal); final JPanel backgroundPanel = new JPanel(); extractProperties = new ExtractProperties(); progressPanel = new ExtractProgressPanel(); settingsPanel = new ExtractSettingsPanel(extractProperties); cancelButton = progressPanel.cancelButton; cancelButton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent ae) { signalCancel(); } }); progressPanel.addShowSettingsButtonListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { boolean selected = progressPanel.getShowSettingsButtonSelected(); if (selected) backgroundPanel.add(settingsPanel); else backgroundPanel.remove(settingsPanel); pack(); } }); backgroundPanel.setLayout(new BoxLayout(backgroundPanel, BoxLayout.PAGE_AXIS)); backgroundPanel.add(progressPanel); setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); addWindowListener( new WindowAdapter() { @Override public void windowClosing(WindowEvent we) { requestCloseWindow(); } }); add(backgroundPanel); pack(); setLocationRelativeTo(null); setResizable(false); }
@Override public void updateCalculateDir(String dirname) { progressPanel.updateCalculateDir(dirname); }
@Override public void updateCurrentDir(String dirname) { progressPanel.updateCurrentDir(dirname); }
@Override public void updateCurrentFile(String filename, long fileSize) { progressPanel.updateCurrentFile(filename, fileSize); }
@Override public void updateTotalProgress(double fraction, String message) { progressPanel.updateTotalProgress(fraction, message); }