예제 #1
0
  private void createArchive() {

    System.out.println("Creating archive..");
    swapContainers(exportingProgressContainer);

    attachListenersForArchiveOutputUtil();
    archiveOutputUtil.setOutputLocation(outputFileLocation.getSelectedFilePath());
    archiveOutputUtil.setCompressionLevel(getCompressionLevel());
    final Thread archiveCreation = new Thread(archiveOutputUtil);
    archiveCreation.start();
  }
예제 #2
0
  private void attachListenersForArchiveOutputUtil() {
    archiveOutputUtil.addPropertyChangeListener(
        "archiveOutputFailed",
        new PropertyChangeListener() {
          public void propertyChange(PropertyChangeEvent propertyChangeEvent) {
            // if the output fails, tell the user why it failed and point to the error report
            SwingUtilities.invokeLater(
                new Runnable() {
                  public void run() {
                    OutputFailedUI failUI =
                        new OutputFailedUI(archiveOutputUtil.getArchiveOutputStatus().getText());

                    failUI.addPropertyChangeListener(
                        "viewErrors",
                        new PropertyChangeListener() {
                          public void propertyChange(PropertyChangeEvent propertyChangeEvent) {
                            ViewErrorUI enw =
                                new ViewErrorUI(archiveOutputUtil.getBrowseViewErrorPane());
                            enw.setLocation(getX(), getY());
                            dispose();
                          }
                        });
                    swapContainers(failUI);
                  }
                });
          }
        });

    archiveOutputUtil.addPropertyChangeListener(
        "archiveOutputCompleted",
        new PropertyChangeListener() {
          public void propertyChange(PropertyChangeEvent propertyChangeEvent) {
            // if the output completes, tell the user it has completed and where the files were
            // saved,
            // then automatically close the window after 3 seconds :)

            SwingUtilities.invokeLater(
                new Runnable() {
                  public void run() {
                    OutputSuccessUI successUI =
                        new OutputSuccessUI(
                            archiveOutputUtil.getStatistics().getStatisticsAsHTML());
                    swapContainers(successUI);
                  }
                });
            closeWindowTimer.start();
          }
        });
  }
예제 #3
0
  public void createProgressScreen() {
    exportingProgressContainer = new JPanel();
    exportingProgressContainer.setSize(new Dimension(this.getWidth(), this.getHeight()));
    exportingProgressContainer.setLayout(new BorderLayout());
    exportingProgressContainer.setBackground(UIHelper.BG_COLOR);

    exportingProgressContainer.add(
        UIHelper.wrapComponentInPanel(new JLabel(creatingArchiveAnimation, JLabel.CENTER)),
        BorderLayout.CENTER);
    exportingProgressContainer.add(
        UIHelper.wrapComponentInPanel(archiveOutputUtil.getArchiveOutputStatus()),
        BorderLayout.SOUTH);
  }