Class SelectFileGUI

java.lang.Object
org.emrick.project.SelectFileGUI
All Implemented Interfaces:
ActionListener, EventListener

public class SelectFileGUI extends Object implements ActionListener
This class constructs a Swing GUI window for importing Coordinates PDF and Pyware Archive file (.3dz) when starting new projects. Coordinates PDF provides necessary performer data, and Pyware Archive (.3dz) provides additional Pyware drill components (e.g., floorCover, ground, surface, audio).
  • Field Details

    • IS_DEBUG

      private static final boolean IS_DEBUG
      See Also:
    • importListener

      private final ImportListener importListener
    • dialogWindow

      private final JDialog dialogWindow
    • ulCsvButton

      private final JButton ulCsvButton
    • ulCsvFilename

      private final JLabel ulCsvFilename
    • ulCoordsButton

      private final JButton ulCoordsButton
    • ulArchiveButton

      private final JButton ulArchiveButton
    • ulCoordsFilename

      private final JLabel ulCoordsFilename
    • ulArchiveFilename

      private final JLabel ulArchiveFilename
    • cancelButton

      private final JButton cancelButton
    • importButton

      private final JButton importButton
    • importArchive

      private final ImportArchive importArchive
    • coordsFile

      private File coordsFile
    • archiveFiles

      private ArrayList<File> archiveFiles
    • csvFile

      private File csvFile
  • Constructor Details

    • SelectFileGUI

      public SelectFileGUI(JFrame parent, ImportListener importListener)
      Prepare ImportArchive service object.
      Parameters:
      importListener - Passed down from a class that overrides ImportListener methods. Provides callback functionality (e.g., to repaint field after importing floorCover or surface images).
  • Method Details

    • autoImport

      private void autoImport(String coordsFilePath, String archiveFilePath)
    • getExtensionByStringHandling

      public Optional<String> getExtensionByStringHandling(String filename)
      Obtain the file extension programmatically in Java
      Parameters:
      filename - - We want the extension of this file
      Returns:
      A string representing the extension, if the extension exists
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Specified by:
      actionPerformed in interface ActionListener
    • copyFiles

      private void copyFiles(ArrayList<String> files, String dir)
    • getFileChooser

      static JFileChooser getFileChooser(String x, String suffix)