Class ExportZipDialog

All Implemented Interfaces:
ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class ExportZipDialog extends JDialog implements PropertyChangeListener
A dialog for exporting/saving Tracker ZIP files. Steps are: 1. create temp folder in target directory which will contain all files to be zipped 2. write or copy the video clip(s) to a video subfolder 3. write or copy HTML pages, stylesheets and image files into html and image subfolders 4. write the converted Tracker data file(s) in the temp folder 5. zip the temp folder 6. delete temp folder
Author:
Douglas Brown
See Also:
  • Field Details

    • videoSubdirectory

      protected static String videoSubdirectory
    • htmlSubdirectory

      protected static String htmlSubdirectory
    • imageSubdirectory

      protected static String imageSubdirectory
    • labelColor

      protected static Color labelColor
    • preferredExtension

      protected static String preferredExtension
    • trimToClip

      protected static boolean trimToClip
    • maxLineLength

      protected static int maxLineLength
    • minWidth

      protected static int minWidth
    • videoExporter

      protected ExportVideoDialog videoExporter
    • openIcon

      protected Icon openIcon
    • titlePanel

      protected JPanel titlePanel
    • descriptionPanel

      protected JPanel descriptionPanel
    • tabsPanel

      protected JPanel tabsPanel
    • videoPanel

      protected JPanel videoPanel
    • metaPanel

      protected JPanel metaPanel
    • thumbnailPanel

      protected JPanel thumbnailPanel
    • supportFilesPanel

      protected JPanel supportFilesPanel
    • advancedPanel

      protected JPanel advancedPanel
    • thumbnailImagePanel

      protected JPanel thumbnailImagePanel
    • titleTitleBox

      protected Box titleTitleBox
    • descriptionTitleBox

      protected Box descriptionTitleBox
    • tabsTitleBox

      protected Box tabsTitleBox
    • videoTitleBox

      protected Box videoTitleBox
    • metaTitleBox

      protected Box metaTitleBox
    • thumbTitleBox

      protected Box thumbTitleBox
    • supportFilesTitleBox

      protected Box supportFilesTitleBox
    • advancedTitleBox

      protected Box advancedTitleBox
    • metaFieldsBox

      protected Box metaFieldsBox
    • advancedFieldsBox

      protected Box advancedFieldsBox
    • supportFilesBox

      protected Box supportFilesBox
    • titleLabel

      protected JLabel titleLabel
    • descriptionLabel

      protected JLabel descriptionLabel
    • descriptionInfoLabel

      protected JLabel descriptionInfoLabel
    • tabsLabel

      protected JLabel tabsLabel
    • tabsInfoLabel

      protected JLabel tabsInfoLabel
    • videoLabel

      protected JLabel videoLabel
    • videoInfoLabel

      protected JLabel videoInfoLabel
    • metaLabel

      protected JLabel metaLabel
    • metaInfoLabel

      protected JLabel metaInfoLabel
    • thumbLabel

      protected JLabel thumbLabel
    • thumbInfoLabel

      protected JLabel thumbInfoLabel
    • supportFilesLabel

      protected JLabel supportFilesLabel
    • supportFilesInfoLabel

      protected JLabel supportFilesInfoLabel
    • advancedLabel

      protected JLabel advancedLabel
    • advancedInfoLabel

      protected JLabel advancedInfoLabel
    • descriptionButton

      protected JButton descriptionButton
    • tabsButton

      protected JButton tabsButton
    • videoButton

      protected JButton videoButton
    • metaButton

      protected JButton metaButton
    • thumbButton

      protected JButton thumbButton
    • supportFilesButton

      protected JButton supportFilesButton
    • advancedButton

      protected JButton advancedButton
    • saveButton

      protected JButton saveButton
    • closeButton

      protected JButton closeButton
    • thumbnailButton

      protected JButton thumbnailButton
    • loadHTMLButton

      protected JButton loadHTMLButton
    • helpButton

      protected JButton helpButton
    • formatDropdown

      protected JComboBox<Object> formatDropdown
    • tabTitleFields

      protected ArrayList<ExportZipDialog.EntryField> tabTitleFields
    • tabCheckboxes

      protected ArrayList<JCheckBox> tabCheckboxes
    • authorLabel

      protected JLabel authorLabel
    • contactLabel

      protected JLabel contactLabel
    • keywordsLabel

      protected JLabel keywordsLabel
    • thumbnailDisplay

      protected JLabel thumbnailDisplay
    • urlLabel

      protected JLabel urlLabel
    • htmlLabel

      protected JLabel htmlLabel
    • clipCheckbox

      protected JCheckBox clipCheckbox
    • showThumbnailCheckbox

      protected JCheckBox showThumbnailCheckbox
    • labels

      protected ArrayList<JLabel> labels
    • titleField

      protected ExportZipDialog.EntryField titleField
    • authorField

      protected ExportZipDialog.EntryField authorField
    • contactField

      protected ExportZipDialog.EntryField contactField
    • keywordsField

      protected ExportZipDialog.EntryField keywordsField
    • urlField

      protected ExportZipDialog.EntryField urlField
    • htmlField

      protected ExportZipDialog.EntryField htmlField
    • targetName

      protected String targetName
    • targetDirectory

      protected String targetDirectory
    • targetVideo

      protected String targetVideo
    • targetExtension

      protected String targetExtension
    • filelistPane

      protected JTextArea filelistPane
    • descriptionPane

      protected JTextArea descriptionPane
    • addedFiles

      protected ArrayList<File> addedFiles
    • fileNames

      protected ArrayList<String> fileNames
    • fileList

      protected JList<String> fileList
    • addButton

      protected JButton addButton
    • removeButton

      protected JButton removeButton
    • fileListModel

      protected DefaultListModel<String> fileListModel
    • recentAddFilesFilter

      protected FileFilter recentAddFilesFilter
    • videoExportListener

      protected ExportZipDialog.VideoListener videoExportListener
    • control

      protected XMLControl control
    • addThumbnail

      protected boolean addThumbnail
    • badModels

      protected ArrayList<ParticleModel> badModels
    • videoIOPreferredExtension

      protected String videoIOPreferredExtension
    • isVisible

      protected boolean isVisible
    • isOpenInTracker

      protected boolean isOpenInTracker
  • Method Details

    • setNewFrameNumbersCoord

      protected static int setNewFrameNumbersCoord(VideoClip realClip, Object[] array, Map<Integer,Integer> newFrameNumbers)
      Why the difference? The coordinate system MUST have data for frame 0 plus any later frames where the coordinate system changes. This is essentially the same as the keyframe requirements for calibration points and tape below.
      Parameters:
      realClip -
      array -
      newFrameNumbers -
      Returns:
    • setNewFrameNumbersPointVector

      public static int setNewFrameNumbersPointVector(VideoClip realClip, Object[] array, Map<Integer,Integer> newFrameNumbers)
      why the difference here? PointMass and Vector can have non-null frameData elements anywhere without problem. So we only need to convert the frame numbers of each non-null element in the clip.
      Parameters:
      realClip -
      array -
      newFrameNumbers -
      Returns:
    • setNewFrameNumbersCalibration

      public static int setNewFrameNumbersCalibration(VideoClip realClip, Object[] array, Map<Integer,Integer> newFrameNumbers)
      why the difference? Calibration Points (when not fixed) use keyframes, meaning that each step is a copy of the previous step unless a new keyframe is defined at that step. So we have to make sure there is a keyFrame at step 0. It does seem like this, the tape and the coords could have the same end?
      Parameters:
      realClip -
      array -
      newFrameNumbers -
      Returns:
    • setNewFrameNumbersTape

      public static int setNewFrameNumbersTape(VideoClip realClip, Object[] array, Map<Integer,Integer> newFrameNumbers)
      Why the difference? Tapes also use keyframes. Not sure why I use nonNullIndex in this method!
      Parameters:
      realClip -
      array -
      newFrameNumbers -
      Returns:
    • updateRange

      protected static void updateRange(VideoClip realClip, XMLControl trackControl, String start, String end)
    • nextExport

      protected void nextExport(ArrayList<File> zipList)
    • exportCanceled

      protected void exportCanceled()
    • getDialog

      public static ExportZipDialog getDialog(TrackerPanel panel)
      Returns an ExportZipDialog for a TrackerPanel.
      Parameters:
      panel - the TrackerPanel
      Returns:
      the ExportZipDialog
    • hasDialog

      public static boolean hasDialog(TrackerPanel panel)
      Returns true if an ExportZipDialog exists for a TrackerPanel.
      Parameters:
      panel - the TrackerPanel
      Returns:
      true if the ExportZipDialog exists
    • setFontLevel

      public void setFontLevel(int level)
      Sets the font level of a single ExportZipDialog.
      Parameters:
      level - the desired font level
    • setVisible

      public void setVisible(boolean vis)
      Overrides:
      setVisible in class Dialog
    • getPreferredSize

      public Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class Container
    • propertyChange

      public void propertyChange(PropertyChangeEvent e)
      Responds to property change events from TrackerPanel.
      Specified by:
      propertyChange in interface PropertyChangeListener
      Parameters:
      e - the property change event
    • clear

      public static void clear(TrackerPanel panel)
      Disposes of a zip dialog for a TrackerPanel.
      Parameters:
      panel - the TrackerPanel
    • setFontLevels

      public static void setFontLevels(int level)
      Sets the font level of all ExportZipDialogs.
      Parameters:
      level - the font level
    • refreshThumbnailGUI

      protected void refreshThumbnailGUI()
      Refreshes the Thumbnail GUI
    • createTarget

      protected boolean createTarget(String path, File target)
    • saveZipAs

      protected void saveZipAs()
      Saves a zip resource to a target defined with a file chooser
    • defineTarget

      protected ArrayList<File> defineTarget()
      Uses a file chooser to define a new target name and directory.
      Returns:
      empty List to fill with files to be zipped
    • thumbnailDialogClosed

      public static void thumbnailDialogClosed(TrackerPanel trackerPanel)