Class ExportZipDialog
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
org.opensourcephysics.cabrillo.tracker.ExportZipDialog
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,PropertyChangeListener
,Serializable
,EventListener
,Accessible
,RootPaneContainer
,WindowConstants
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
A DocumentListener adapter.protected static class
A JTextField for editing ZipResourceDialog fields.protected class
Nested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialog
Nested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.Type
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JButton
protected boolean
protected JButton
protected Box
protected JLabel
protected JLabel
protected JPanel
protected Box
protected ExportZipDialog.EntryField
protected JLabel
protected ArrayList<ParticleModel>
protected JCheckBox
protected JButton
protected ExportZipDialog.EntryField
protected JLabel
protected XMLControl
protected JButton
protected JLabel
protected JLabel
protected JTextArea
protected JPanel
protected Box
protected DefaultListModel<String>
protected JTextArea
protected JButton
protected ExportZipDialog.EntryField
protected JLabel
protected static String
protected static String
protected boolean
protected boolean
protected ExportZipDialog.EntryField
protected JLabel
protected static Color
protected JButton
protected static int
protected JButton
protected Box
protected JLabel
protected JLabel
protected JPanel
protected Box
protected static int
protected Icon
protected static String
protected FileFilter
protected JButton
protected JButton
protected JCheckBox
protected Box
protected JButton
protected JLabel
protected JLabel
protected JPanel
protected Box
protected JButton
protected JLabel
protected JLabel
protected JPanel
protected Box
protected ArrayList<ExportZipDialog.EntryField>
protected String
protected String
protected String
protected String
protected JButton
protected JLabel
protected JLabel
protected JButton
protected JLabel
protected JPanel
protected JPanel
protected Box
protected ExportZipDialog.EntryField
protected JLabel
protected JPanel
protected Box
protected static boolean
protected ExportZipDialog.EntryField
protected JLabel
protected JButton
protected ExportVideoDialog
protected ExportZipDialog.VideoListener
protected JLabel
protected String
protected JLabel
protected JPanel
protected static String
protected Box
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
Fields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPE
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
clear
(TrackerPanel panel) Disposes of a zip dialog for a TrackerPanel.protected boolean
createTarget
(String path, File target) Uses a file chooser to define a new target name and directory.protected void
static ExportZipDialog
getDialog
(TrackerPanel panel) Returns an ExportZipDialog for a TrackerPanel.static boolean
hasDialog
(TrackerPanel panel) Returns true if an ExportZipDialog exists for a TrackerPanel.protected void
nextExport
(ArrayList<File> zipList) void
Responds to property change events from TrackerPanel.protected void
Refreshes the Thumbnail GUIprotected void
Saves a zip resource to a target defined with a file chooservoid
setFontLevel
(int level) Sets the font level of a single ExportZipDialog.static void
setFontLevels
(int level) Sets the font level of all ExportZipDialogs.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.protected static int
Why the difference? The coordinate system MUST have data for frame 0 plus any later frames where the coordinate system changes.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.static int
Why the difference? Tapes also use keyframes.void
setVisible
(boolean vis) static void
thumbnailDialogClosed
(TrackerPanel trackerPanel) protected static void
updateRange
(VideoClip realClip, XMLControl trackControl, String start, String end) Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBack
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
videoSubdirectory
-
htmlSubdirectory
-
imageSubdirectory
-
labelColor
-
preferredExtension
-
trimToClip
protected static boolean trimToClip -
maxLineLength
protected static int maxLineLength -
minWidth
protected static int minWidth -
videoExporter
-
openIcon
-
titlePanel
-
descriptionPanel
-
tabsPanel
-
videoPanel
-
metaPanel
-
thumbnailPanel
-
supportFilesPanel
-
advancedPanel
-
thumbnailImagePanel
-
titleTitleBox
-
descriptionTitleBox
-
tabsTitleBox
-
videoTitleBox
-
metaTitleBox
-
thumbTitleBox
-
supportFilesTitleBox
-
advancedTitleBox
-
metaFieldsBox
-
advancedFieldsBox
-
supportFilesBox
-
titleLabel
-
descriptionLabel
-
descriptionInfoLabel
-
tabsLabel
-
tabsInfoLabel
-
videoLabel
-
videoInfoLabel
-
metaLabel
-
metaInfoLabel
-
thumbLabel
-
thumbInfoLabel
-
supportFilesLabel
-
supportFilesInfoLabel
-
advancedLabel
-
advancedInfoLabel
-
descriptionButton
-
tabsButton
-
videoButton
-
metaButton
-
thumbButton
-
supportFilesButton
-
advancedButton
-
saveButton
-
closeButton
-
thumbnailButton
-
loadHTMLButton
-
helpButton
-
formatDropdown
-
tabTitleFields
-
tabCheckboxes
-
authorLabel
-
contactLabel
-
keywordsLabel
-
thumbnailDisplay
-
urlLabel
-
htmlLabel
-
clipCheckbox
-
showThumbnailCheckbox
-
labels
-
titleField
-
authorField
-
contactField
-
keywordsField
-
urlField
-
htmlField
-
targetName
-
targetDirectory
-
targetVideo
-
targetExtension
-
filelistPane
-
descriptionPane
-
addedFiles
-
fileNames
-
fileList
-
addButton
-
removeButton
-
fileListModel
-
recentAddFilesFilter
-
videoExportListener
-
control
-
addThumbnail
protected boolean addThumbnail -
badModels
-
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
-
exportCanceled
protected void exportCanceled() -
getDialog
Returns an ExportZipDialog for a TrackerPanel.- Parameters:
panel
- the TrackerPanel- Returns:
- the ExportZipDialog
-
hasDialog
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 classDialog
-
getPreferredSize
- Overrides:
getPreferredSize
in classContainer
-
propertyChange
Responds to property change events from TrackerPanel.- Specified by:
propertyChange
in interfacePropertyChangeListener
- Parameters:
e
- the property change event
-
clear
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
-
saveZipAs
protected void saveZipAs()Saves a zip resource to a target defined with a file chooser -
defineTarget
Uses a file chooser to define a new target name and directory.- Returns:
- empty List
to fill with files to be zipped
-
thumbnailDialogClosed
-