From f2b0098955f0b3127b9f9ac8af96d97227666247 Mon Sep 17 00:00:00 2001 From: jmillman Date: Tue, 17 Sep 2013 12:34:04 -0400 Subject: [PATCH 1/9] modifed FileManaget to use the new transaction based methods in SleuthkitCase for methods in the call tree of addLocalFilesDirs() --- .../casemodule/services/FileManager.java | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/FileManager.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/FileManager.java index 66d0089f6b..cd7e024fad 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/services/FileManager.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/FileManager.java @@ -38,6 +38,7 @@ import org.sleuthkit.datamodel.LocalFile; import org.sleuthkit.datamodel.VirtualDirectory; import org.sleuthkit.datamodel.LayoutFile; import org.sleuthkit.datamodel.SleuthkitCase; +import org.sleuthkit.datamodel.Transaction; import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskFileRange; @@ -244,12 +245,13 @@ public class FileManager implements Closeable { rootsToAdd.add(localFile); } + Transaction trans = tskCase.createTransaction(); // make a virtual top-level directory for this set of files/dirs - final VirtualDirectory fileSetRootDir = addLocalFileSetRootDir(); + final VirtualDirectory fileSetRootDir = addLocalFileSetRootDir(trans); // recursively add each item in the set for (java.io.File localRootToAdd : rootsToAdd) { - AbstractFile localFileAdded = addLocalDirInt(fileSetRootDir, localRootToAdd, addProgressUpdater); + AbstractFile localFileAdded = addLocalDirInt(trans ,fileSetRootDir, localRootToAdd, addProgressUpdater); if (localFileAdded == null) { String msg = "One of the local files/dirs could not be added: " + localRootToAdd.getAbsolutePath(); @@ -263,6 +265,7 @@ public class FileManager implements Closeable { } } + trans.commit(); return fileSetRootDir; } @@ -273,7 +276,7 @@ public class FileManager implements Closeable { * @return the virtual dir root container created * @throws TskCoreException */ - private VirtualDirectory addLocalFileSetRootDir() throws TskCoreException { + private VirtualDirectory addLocalFileSetRootDir(Transaction trans) throws TskCoreException { VirtualDirectory created = null; @@ -281,7 +284,7 @@ public class FileManager implements Closeable { final String fileSetName = VirtualDirectoryNode.LOGICAL_FILE_SET_PREFIX + newFileSetCount; try { - created = tskCase.addVirtualDirectory(0, fileSetName); + created = tskCase.addVirtualDirectory(0, fileSetName, trans); curNumFileSets = newFileSetCount; } catch (TskCoreException ex) { String msg = "Error creating local file set dir: " + fileSetName; @@ -303,7 +306,7 @@ public class FileManager implements Closeable { * @returns File object of file added or new virtualdirectory for the directory. * @throws TskCoreException */ - private AbstractFile addLocalDirInt(VirtualDirectory parentVd, + private AbstractFile addLocalDirInt( Transaction trans,VirtualDirectory parentVd, java.io.File localFile, FileAddProgressUpdater addProgressUpdater) throws TskCoreException { if (tskCase == null) { @@ -321,7 +324,7 @@ public class FileManager implements Closeable { if (localFile.isDirectory()) { //create virtual folder - final VirtualDirectory childVd = tskCase.addVirtualDirectory(parentVd.getId(), localFile.getName()); + final VirtualDirectory childVd = tskCase.addVirtualDirectory(parentVd.getId(), localFile.getName(), trans); if (childVd != null && addProgressUpdater != null) { addProgressUpdater.fileAdded(childVd); } @@ -329,13 +332,13 @@ public class FileManager implements Closeable { final java.io.File[] childrenFiles = localFile.listFiles(); if (childrenFiles != null) { for (java.io.File childFile : childrenFiles) { - addLocalDirInt(childVd, childFile, addProgressUpdater); + addLocalDirInt(trans, childVd, childFile, addProgressUpdater); } } return childVd; } else { //add leaf file, base case - return this.addLocalFileInt(parentVd, localFile); + return this.addLocalFileInt(parentVd, localFile, trans); } } @@ -352,7 +355,7 @@ public class FileManager implements Closeable { * due to a critical system error or of the file manager has already been * closed */ - private synchronized LocalFile addLocalFileInt(AbstractFile parentFile, java.io.File localFile) throws TskCoreException { + private synchronized LocalFile addLocalFileInt(AbstractFile parentFile, java.io.File localFile, Transaction trans) throws TskCoreException { if (tskCase == null) { throw new TskCoreException("Attempted to use FileManager after it was closed."); @@ -370,7 +373,7 @@ public class FileManager implements Closeable { LocalFile lf = tskCase.addLocalFile(fileName, localFile.getAbsolutePath(), size, ctime, crtime, atime, mtime, - isFile, parentFile); + isFile, parentFile, trans); return lf; } From 36854b9048c103f103da8fc5f5c3205a2c4e127b Mon Sep 17 00:00:00 2001 From: jmillman Date: Tue, 17 Sep 2013 15:23:40 -0400 Subject: [PATCH 2/9] added exception handling to new transaction usage. --- .../casemodule/services/FileManager.java | 189 ++++++++++-------- 1 file changed, 109 insertions(+), 80 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/FileManager.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/FileManager.java index cd7e024fad..56ed85bf12 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/services/FileManager.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/FileManager.java @@ -78,13 +78,15 @@ public class FileManager implements Closeable { } /** - * Finds a set of files that meets the name criteria. - * @param dataSource Root data source to limit search results to (Image, - * VirtualDirectory, etc.). - * @param fileName Pattern of the name of the file or directory to match (case - * insensitive, used in LIKE SQL statement). + * Finds a set of files that meets the name criteria. + * + * @param dataSource Root data source to limit search results to (Image, + * VirtualDirectory, etc.). + * @param fileName Pattern of the name of the file or directory to match + * (case insensitive, used in LIKE SQL statement). + * * @return a list of AbstractFile for files/directories whose name matches - * the given fileName + * the given fileName */ public synchronized List findFiles(Content dataSource, String fileName) throws TskCoreException { if (tskCase == null) { @@ -93,17 +95,19 @@ public class FileManager implements Closeable { return tskCase.findFiles(dataSource, fileName); } - /** - * Finds a set of files that meets the name criteria. - * @param dataSource Root data source to limit search results to (Image, - * VirtualDirectory, etc.). - * @param fileName Pattern of the name of the file or directory to match (case - * insensitive, used in LIKE SQL statement). - * @param dirName Pattern of the name of the parent directory to use as the root - * of the search (case insensitive, used in LIKE SQL statement). + * Finds a set of files that meets the name criteria. + * + * @param dataSource Root data source to limit search results to (Image, + * VirtualDirectory, etc.). + * @param fileName Pattern of the name of the file or directory to match + * (case insensitive, used in LIKE SQL statement). + * @param dirName Pattern of the name of the parent directory to use as + * the root of the search (case insensitive, used in LIKE + * SQL statement). + * * @return a list of AbstractFile for files/directories whose name matches - * fileName and whose parent directory contains dirName. + * fileName and whose parent directory contains dirName. */ public synchronized List findFiles(Content dataSource, String fileName, String dirName) throws TskCoreException { if (tskCase == null) { @@ -113,14 +117,17 @@ public class FileManager implements Closeable { } /** - * Finds a set of files that meets the name criteria. - * @param dataSource Root data source to limit search results to (Image, - * VirtualDirectory, etc.). - * @param fileName Pattern of the name of the file or directory to match (case - * insensitive, used in LIKE SQL statement). - * @param parentFile Object of root/parent directory to restrict search to. + * Finds a set of files that meets the name criteria. + * + * @param dataSource Root data source to limit search results to (Image, + * VirtualDirectory, etc.). + * @param fileName Pattern of the name of the file or directory to match + * (case insensitive, used in LIKE SQL statement). + * @param parentFile Object of root/parent directory to restrict search to. + * * @return a list of AbstractFile for files/directories whose name matches - * fileName and that were inside a directory described by parentFsContent. + * fileName and that were inside a directory described by + * parentFsContent. */ public synchronized List findFiles(Content dataSource, String fileName, AbstractFile parentFile) throws TskCoreException { if (tskCase == null) { @@ -131,9 +138,10 @@ public class FileManager implements Closeable { /** * @param dataSource data source Content (Image, parent-less - * VirtualDirectory) where to find files - * @param filePath The full path to the file(s) of interest. This can - * optionally include the image and volume names. + * VirtualDirectory) where to find files + * @param filePath The full path to the file(s) of interest. This can + * optionally include the image and volume names. + * * @return a list of AbstractFile that have the given file path. */ public synchronized List openFiles(Content dataSource, String filePath) throws TskCoreException { @@ -146,26 +154,31 @@ public class FileManager implements Closeable { /** * Creates a derived file, adds it to the database and returns it. * - * @param fileName file name the derived file - * @param localPath local path of the derived file, including the file name. - * The path is relative to the database path. - * @param size size of the derived file in bytes + * @param fileName file name the derived file + * @param localPath local path of the derived file, including the file + * name. The path is relative to the database path. + * @param size size of the derived file in bytes * @param ctime * @param crtime * @param atime * @param mtime - * @param isFile whether a file or directory, true if a file - * @param parentFile the parent file object this the new file was derived - * from, either a fs file or parent derived file/dikr\\r + * @param isFile whether a file or directory, true if a file + * @param parentFile the parent file object this the new file was + * derived from, either a fs file or parent derived + * file/dikr\\r * @param rederiveDetails details needed to re-derive file (will be specific - * to the derivation method), currently unused - * @param toolName name of derivation method/tool, currently unused - * @param toolVersion version of derivation method/tool, currently unused - * @param otherDetails details of derivation method/tool, currently unused + * to the derivation method), currently unused + * @param toolName name of derivation method/tool, currently unused + * @param toolVersion version of derivation method/tool, currently + * unused + * @param otherDetails details of derivation method/tool, currently + * unused + * * @return newly created derived file object added to the database + * * @throws TskCoreException exception thrown if the object creation failed - * due to a critical system error or of the file manager has already been - * closed + * due to a critical system error or of the file + * manager has already been closed * */ public synchronized DerivedFile addDerivedFile(String fileName, String localPath, long size, @@ -187,13 +200,14 @@ public class FileManager implements Closeable { * or file system given by systemId. * * @param carvedFileName the name of the carved file (containing appropriate - * extension) + * extension) * @param carvedFileSize size of the carved file to add - * @param systemId the ID of the parent volume or file system - * @param sectors a list of SectorGroups giving this sectors that make up - * this carved file. + * @param systemId the ID of the parent volume or file system + * @param sectors a list of SectorGroups giving this sectors that + * make up this carved file. + * * @throws TskCoreException exception thrown when critical tsk error - * occurred and carved file could not be added + * occurred and carved file could not be added */ public synchronized LayoutFile addCarvedFile(String carvedFileName, long carvedFileSize, long systemId, List sectors) throws TskCoreException { @@ -222,15 +236,19 @@ public class FileManager implements Closeable { /** * Add a set of local/logical files and dirs. * - * @param localAbsPaths list of absolute paths to local files and dirs + * @param localAbsPaths list of absolute paths to local files and dirs * @param addProgressUpdater notifier to receive progress notifications on - * folders added, or null if not used + * folders added, or null if not used + * * @return file set root VirtualDirectory contained containing all - * AbstractFile objects added + * AbstractFile objects added + * * @throws TskCoreException exception thrown if the object creation failed - * due to a critical system error or of the file manager has already been - * closed. There is no "revert" logic if one of the additions fails. The - * addition stops with the first error encountered. + * due to a critical system error or of the file + * manager has already been closed. There is no + * "revert" logic if one of the additions fails. + * The addition stops with the first error + * encountered. */ public synchronized VirtualDirectory addLocalFilesDirs(List localAbsPaths, FileAddProgressUpdater addProgressUpdater) throws TskCoreException { final List rootsToAdd = new ArrayList<>(); @@ -249,23 +267,29 @@ public class FileManager implements Closeable { // make a virtual top-level directory for this set of files/dirs final VirtualDirectory fileSetRootDir = addLocalFileSetRootDir(trans); - // recursively add each item in the set - for (java.io.File localRootToAdd : rootsToAdd) { - AbstractFile localFileAdded = addLocalDirInt(trans ,fileSetRootDir, localRootToAdd, addProgressUpdater); - - if (localFileAdded == null) { - String msg = "One of the local files/dirs could not be added: " + localRootToAdd.getAbsolutePath(); - logger.log(Level.SEVERE, msg); - throw new TskCoreException(msg); - } else { - //added.add(localFileAdded); - //send new content event - //for now reusing ingest events, in future this will be replaced by datamodel / observer sending out events - IngestServices.getDefault().fireModuleContentEvent(new ModuleContentEvent(localFileAdded)); - } - } + try { + // recursively add each item in the set + for (java.io.File localRootToAdd : rootsToAdd) { + AbstractFile localFileAdded = addLocalDirInt(trans, fileSetRootDir, localRootToAdd, addProgressUpdater); - trans.commit(); + if (localFileAdded == null) { + String msg = "One of the local files/dirs could not be added: " + localRootToAdd.getAbsolutePath(); + logger.log(Level.SEVERE, msg); + throw new TskCoreException(msg); + } else { + //added.add(localFileAdded); + //send new content event + //for now reusing ingest events, in future this will be replaced by datamodel / observer sending out events + IngestServices.getDefault().fireModuleContentEvent(new ModuleContentEvent(localFileAdded)); + } + } + + trans.commit(); + } catch (TskCoreException ex) { + trans.rollback(); + } finally { + trans.close(); + } return fileSetRootDir; } @@ -274,6 +298,7 @@ public class FileManager implements Closeable { * consecutive sequence number characteristic to every add operation * * @return the virtual dir root container created + * * @throws TskCoreException */ private VirtualDirectory addLocalFileSetRootDir(Transaction trans) throws TskCoreException { @@ -296,17 +321,19 @@ public class FileManager implements Closeable { } /** - * Helper (internal) method to recursively add contents of a folder. Node passed in can be a file or directory. - * Children of directories are added. + * Helper (internal) method to recursively add contents of a folder. Node + * passed in can be a file or directory. Children of directories are added. * - * @param parentVd Dir that is the parent of localFile - * @param localFile File/Dir that we are adding + * @param parentVd Dir that is the parent of localFile + * @param localFile File/Dir that we are adding * @param addProgressUpdater notifier to receive progress notifications on - * folders added, or null if not used - * @returns File object of file added or new virtualdirectory for the directory. + * folders added, or null if not used + * + * @returns File object of file added or new virtualdirectory for the + * directory. * @throws TskCoreException */ - private AbstractFile addLocalDirInt( Transaction trans,VirtualDirectory parentVd, + private AbstractFile addLocalDirInt(Transaction trans, VirtualDirectory parentVd, java.io.File localFile, FileAddProgressUpdater addProgressUpdater) throws TskCoreException { if (tskCase == null) { @@ -320,7 +347,7 @@ public class FileManager implements Closeable { if (!localFile.canRead()) { throw new TskCoreException("Attempted to add a local dir that is not readable: " + localFile.getAbsolutePath()); } - + if (localFile.isDirectory()) { //create virtual folder @@ -343,17 +370,19 @@ public class FileManager implements Closeable { } /** - * Adds a single local/logical file to the case. Adds it to the database. - * Does not refresh the views of data. Assumes that the local file exists and - * can be read. This checking is done by addLocalDirInt(). + * Adds a single local/logical file to the case. Adds it to the database. + * Does not refresh the views of data. Assumes that the local file exists + * and can be read. This checking is done by addLocalDirInt(). * * @param parentFile parent file object container (such as virtual - * directory, another local file, or fscontent File), - * @param localFile File that we are adding + * directory, another local file, or fscontent File), + * @param localFile File that we are adding + * * @return newly created local file object added to the database + * * @throws TskCoreException exception thrown if the object creation failed - * due to a critical system error or of the file manager has already been - * closed + * due to a critical system error or of the file + * manager has already been closed */ private synchronized LocalFile addLocalFileInt(AbstractFile parentFile, java.io.File localFile, Transaction trans) throws TskCoreException { From a773bb628246f6b7822beb7eb7c39bec8bd259aa Mon Sep 17 00:00:00 2001 From: jmillman Date: Wed, 18 Sep 2013 13:48:27 -0400 Subject: [PATCH 3/9] restored add image error display. renamed add image wizard classes to have more meaningful names. cleanup up add image wizard code some. --- .../autopsy/casemodule/AddImageDonePanel.form | 66 ---- .../autopsy/casemodule/AddImageDonePanel.java | 76 ----- .../casemodule/AddImageLoadingPanel.form | 144 --------- .../casemodule/AddImageLoadingPanel.java | 230 -------------- .../casemodule/AddImageVisualPanel2.form | 45 --- .../casemodule/AddImageVisualPanel2.java | 166 ---------- ...=> AddImageWizardAddingProgressPanel.java} | 17 +- .../AddImageWizardAddingProgressVisual.form | 240 ++++++++++++++ .../AddImageWizardAddingProgressVisual.java | 293 ++++++++++++++++++ ... AddImageWizardChooseDataSourcePanel.java} | 10 +- ...AddImageWizardChooseDataSourceVisual.form} | 16 +- ...AddImageWizardChooseDataSourceVisual.java} | 26 +- ...a => AddImageWizardIngestConfigPanel.java} | 114 ++++--- ... => AddImageWizardIngestConfigVisual.form} | 4 +- ... => AddImageWizardIngestConfigVisual.java} | 8 +- .../casemodule/AddImageWizardIterator.java | 6 +- .../autopsy/casemodule/ImageFilePanel.java | 14 +- .../autopsy/casemodule/LocalDiskPanel.java | 2 +- .../autopsy/casemodule/LocalFilesPanel.java | 4 +- .../casemodule/MissingImageDialog.java | 4 +- 20 files changed, 646 insertions(+), 839 deletions(-) delete mode 100644 Core/src/org/sleuthkit/autopsy/casemodule/AddImageDonePanel.form delete mode 100644 Core/src/org/sleuthkit/autopsy/casemodule/AddImageDonePanel.java delete mode 100644 Core/src/org/sleuthkit/autopsy/casemodule/AddImageLoadingPanel.form delete mode 100644 Core/src/org/sleuthkit/autopsy/casemodule/AddImageLoadingPanel.java delete mode 100644 Core/src/org/sleuthkit/autopsy/casemodule/AddImageVisualPanel2.form delete mode 100644 Core/src/org/sleuthkit/autopsy/casemodule/AddImageVisualPanel2.java rename Core/src/org/sleuthkit/autopsy/casemodule/{AddImageWizardPanel2.java => AddImageWizardAddingProgressPanel.java} (91%) create mode 100644 Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressVisual.form create mode 100644 Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressVisual.java rename Core/src/org/sleuthkit/autopsy/casemodule/{AddImageWizardPanel1.java => AddImageWizardChooseDataSourcePanel.java} (96%) rename Core/src/org/sleuthkit/autopsy/casemodule/{AddImageVisualPanel1.form => AddImageWizardChooseDataSourceVisual.form} (88%) rename Core/src/org/sleuthkit/autopsy/casemodule/{AddImageVisualPanel1.java => AddImageWizardChooseDataSourceVisual.java} (91%) rename Core/src/org/sleuthkit/autopsy/casemodule/{AddImageWizardPanel3.java => AddImageWizardIngestConfigPanel.java} (87%) rename Core/src/org/sleuthkit/autopsy/casemodule/{AddImageVisualPanel3.form => AddImageWizardIngestConfigVisual.form} (92%) rename Core/src/org/sleuthkit/autopsy/casemodule/{AddImageVisualPanel3.java => AddImageWizardIngestConfigVisual.java} (92%) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageDonePanel.form b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageDonePanel.form deleted file mode 100644 index 204b5a3c02..0000000000 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageDonePanel.form +++ /dev/null @@ -1,66 +0,0 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageDonePanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageDonePanel.java deleted file mode 100644 index 45a511e6b6..0000000000 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageDonePanel.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Autopsy Forensic Browser - * - * Copyright 2012 Basis Technology Corp. - * Contact: carrier sleuthkit org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.sleuthkit.autopsy.casemodule; - -public class AddImageDonePanel extends javax.swing.JPanel { - - /** - * Creates new form AddImageDonePanel - */ - public AddImageDonePanel() { - initComponents(); - } - - /** - * This method is called from within the constructor to initialize the form. - * WARNING: Do NOT modify this code. The content of this method is always - * regenerated by the Form Editor. - */ - @SuppressWarnings("unchecked") - // //GEN-BEGIN:initComponents - private void initComponents() { - - statusLabel = new javax.swing.JLabel(); - crDbLabel = new javax.swing.JLabel(); - - org.openide.awt.Mnemonics.setLocalizedText(statusLabel, org.openide.util.NbBundle.getMessage(AddImageDonePanel.class, "AddImageDonePanel.statusLabel.text")); // NOI18N - - crDbLabel.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N - org.openide.awt.Mnemonics.setLocalizedText(crDbLabel, org.openide.util.NbBundle.getMessage(AddImageDonePanel.class, "AddImageDonePanel.crDbLabel.text")); // NOI18N - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(10, 10, 10) - .addComponent(statusLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 472, Short.MAX_VALUE)) - .addGroup(layout.createSequentialGroup() - .addComponent(crDbLabel) - .addGap(0, 0, Short.MAX_VALUE))) - .addContainerGap()) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(crDbLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(statusLabel) - .addContainerGap(67, Short.MAX_VALUE)) - ); - }// //GEN-END:initComponents - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JLabel crDbLabel; - private javax.swing.JLabel statusLabel; - // End of variables declaration//GEN-END:variables -} diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageLoadingPanel.form b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageLoadingPanel.form deleted file mode 100644 index 806323e9e8..0000000000 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageLoadingPanel.form +++ /dev/null @@ -1,144 +0,0 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageLoadingPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageLoadingPanel.java deleted file mode 100644 index 0ba466f7bd..0000000000 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageLoadingPanel.java +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Autopsy Forensic Browser - * - * Copyright 2012 Basis Technology Corp. - * Contact: carrier sleuthkit org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.sleuthkit.autopsy.casemodule; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import javax.swing.Box; -import javax.swing.BoxLayout; -import javax.swing.JButton; -import javax.swing.JLabel; -import javax.swing.JProgressBar; - -public class AddImageLoadingPanel extends javax.swing.JPanel { - private JLabel progressLabel = null; - private JButton errorButton = null; - - /** - * Creates new form AddImageLoadingPanel - */ - public AddImageLoadingPanel() { - initComponents(); - customizeComponents(); - } - - private void customizeComponents() { - progressLabel = new JLabel(); - infoPanel.setLayout(new BoxLayout(infoPanel, BoxLayout.PAGE_AXIS)); - infoPanel.add(progressLabel); - infoPanel.add(Box.createRigidArea(new Dimension(10, 10))); //spacer - this.jScrollPane1.setBorder(null); - this.TextArea_CurrentDirectory.setBackground(this.getBackground()); - } - - void resetInfoPanel() { - if (errorButton != null) { - infoPanel.remove(errorButton); - errorButton = null; - } - progressLabel.setText(""); - } - - public JProgressBar getCrDbProgressBar() { - return this.crDbProgressBar; - } - - public JLabel getProgressLabel() { - return this.progressLabel; - } - - /** - * Changes the progress bar text and color. - * - * @param text the text to be shown - * @param value the current value of the progress bar - * @param color the color of the progress bar text - */ - public void changeProgressBarTextAndColor(String text, int value, Color color) { - progressLabel.setText(text); - progressLabel.setForeground(color); - crDbProgressBar.setValue(value); - } - - /** - * append progress text to progress label - * @param text - */ - public void appendProgressText(String text) { - progressLabel.setText(progressLabel.getText() + " " + text); - } - - /** - * Updates the currently processing directory - * @param dir the text to update with - */ - public void changeCurrentDir(String dir){ - this.TextArea_CurrentDirectory.setText(dir); - } - - - /** - * Sets the CurrentlyProcessing tag and text area to be invisible - */ - public void setProcessInvis(){ - this.Label_CurrentDirectory_Static.setVisible(false); - this.TextArea_CurrentDirectory.setText(""); - this.TextArea_CurrentDirectory.setVisible(false); - } - - void setErrors(final String errors, boolean critical) { - crDbProgressBar.setValue(100); //always invoked when process completed - if (critical) { - progressLabel.setText("*Failed to add image (critical errors encountered). Click below to view the log."); - } - else { - progressLabel.setText("*Data Source added (non-critical errors encountered). Click below to view the log."); - } - errorButton = new JButton(); - errorButton.setText("View Log"); - infoPanel.add(errorButton); - errorButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - //JOptionPane.showMessageDialog(null, errors, "Add image non-critical errors", JOptionPane.WARNING_MESSAGE); - AddImageErrorsDialog dialog = new AddImageErrorsDialog(null, true); - dialog.setErrors(errors); - dialog.setVisible(true); - } - }); - - } - - /** - * This method is called from within the constructor to initialize the form. - * WARNING: Do NOT modify this code. The content of this method is always - * regenerated by the Form Editor. - */ - @SuppressWarnings("unchecked") - // //GEN-BEGIN:initComponents - private void initComponents() { - - crDbLabel = new javax.swing.JLabel(); - jLabel1 = new javax.swing.JLabel(); - jLabel5 = new javax.swing.JLabel(); - crDbProgressBar = new javax.swing.JProgressBar(); - infoPanel = new javax.swing.JPanel(); - Label_CurrentDirectory_Static = new javax.swing.JLabel(); - jScrollPane1 = new javax.swing.JScrollPane(); - TextArea_CurrentDirectory = new javax.swing.JTextArea(); - - crDbLabel.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N - org.openide.awt.Mnemonics.setLocalizedText(crDbLabel, org.openide.util.NbBundle.getMessage(AddImageLoadingPanel.class, "AddImageLoadingPanel.crDbLabel.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(AddImageLoadingPanel.class, "AddImageLoadingPanel.jLabel1.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(jLabel5, org.openide.util.NbBundle.getMessage(AddImageLoadingPanel.class, "AddImageLoadingPanel.jLabel5.text")); // NOI18N - - javax.swing.GroupLayout infoPanelLayout = new javax.swing.GroupLayout(infoPanel); - infoPanel.setLayout(infoPanelLayout); - infoPanelLayout.setHorizontalGroup( - infoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 707, Short.MAX_VALUE) - ); - infoPanelLayout.setVerticalGroup( - infoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 15, Short.MAX_VALUE) - ); - - org.openide.awt.Mnemonics.setLocalizedText(Label_CurrentDirectory_Static, org.openide.util.NbBundle.getMessage(AddImageLoadingPanel.class, "AddImageLoadingPanel.Label_CurrentDirectory_Static.text")); // NOI18N - - jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); - jScrollPane1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); - - TextArea_CurrentDirectory.setEditable(false); - TextArea_CurrentDirectory.setBackground(new java.awt.Color(240, 240, 240)); - TextArea_CurrentDirectory.setColumns(20); - TextArea_CurrentDirectory.setLineWrap(true); - TextArea_CurrentDirectory.setRows(5); - TextArea_CurrentDirectory.setWrapStyleWord(true); - TextArea_CurrentDirectory.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); - TextArea_CurrentDirectory.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR)); - jScrollPane1.setViewportView(TextArea_CurrentDirectory); - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(crDbProgressBar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jScrollPane1) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(crDbLabel) - .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 552, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel5) - .addComponent(Label_CurrentDirectory_Static)) - .addGap(0, 0, Short.MAX_VALUE)) - .addComponent(infoPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addContainerGap()) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(crDbLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(jLabel1) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(crDbProgressBar, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(infoPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(Label_CurrentDirectory_Static) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - }// //GEN-END:initComponents - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JLabel Label_CurrentDirectory_Static; - private javax.swing.JTextArea TextArea_CurrentDirectory; - private javax.swing.JLabel crDbLabel; - private javax.swing.JProgressBar crDbProgressBar; - private javax.swing.JPanel infoPanel; - private javax.swing.JLabel jLabel1; - private javax.swing.JLabel jLabel5; - private javax.swing.JScrollPane jScrollPane1; - // End of variables declaration//GEN-END:variables -} diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageVisualPanel2.form b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageVisualPanel2.form deleted file mode 100644 index c088959c9e..0000000000 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageVisualPanel2.form +++ /dev/null @@ -1,45 +0,0 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageVisualPanel2.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageVisualPanel2.java deleted file mode 100644 index 3460f7bb39..0000000000 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageVisualPanel2.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Autopsy Forensic Browser - * - * Copyright 2011 Basis Technology Corp. - * Contact: carrier sleuthkit org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.sleuthkit.autopsy.casemodule; - -import java.awt.BorderLayout; -import java.awt.Color; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JProgressBar; - -/** - * The "Add Image" wizard panel 2. Provides checkbox to enable indexing, button - * to start process, and progress bar. - */ -final class AddImageVisualPanel2 extends JPanel { - - private AddImageLoadingPanel loadingPanel; - private AddImageDonePanel donePanel; - - /** - * Creates new form AddImageVisualPanel2 - */ - AddImageVisualPanel2() { - loadingPanel = new AddImageLoadingPanel(); - donePanel = new AddImageDonePanel(); - initComponents(); - customizeComponents(); - } - - private void customizeComponents() { - mainPanel.setLayout(new BorderLayout()); - mainPanel.removeAll(); - mainPanel.add(loadingPanel, BorderLayout.CENTER); - mainPanel.validate(); - mainPanel.repaint(); - } - - AddImageLoadingPanel getLoadingPanel() { - return loadingPanel; - } - - AddImageDonePanel getDonePanel() { - return donePanel; - } - - void done() { - mainPanel.removeAll(); - mainPanel.add(donePanel, BorderLayout.CENTER); - mainPanel.validate(); - mainPanel.repaint(); - } - - void resetInfoPanel() { - loadingPanel.resetInfoPanel(); - } - - /** - * Returns the name of the this panel. This name will be shown on the left - * panel of the "Add Image" wizard panel. - * - * @return name the name of this panel - */ - @Override - public String getName() { - return "Add Data Source"; - } - - public JProgressBar getCrDbProgressBar() { - return loadingPanel.getCrDbProgressBar(); - } - - public JLabel getProgressLabel() { - return loadingPanel.getProgressLabel(); - } - - /** - * Changes the progress bar text and color. - * - * @param text the text to be shown - * @param value the current value of the progress bar - * @param color the color of the progress bar text - */ - public void changeProgressBarTextAndColor(String text, int value, Color color) { - loadingPanel.changeProgressBarTextAndColor(text, value, color); - } - - /** - * append progress text to progress label - * @param text - */ - public void appendProgressText(String text) { - loadingPanel.appendProgressText(text); - } - - /** - * Updates the currently processing directory - * @param dir the text to update with - */ - public void changeCurrentDir(String dir){ - loadingPanel.changeCurrentDir(dir); - } - - /** - * Sets the CurrentlyProcessing tag and text area to be invisible - */ - public void setProcessInvis(){ - loadingPanel.setProcessInvis(); - } - - void setErrors(final String errors, boolean critical) { - loadingPanel.setErrors(errors, critical); - - } - - /** - * This method is called from within the constructor to initialize the form. - * WARNING: Do NOT modify this code. The content of this method is always - * regenerated by the Form Editor. - */ - // //GEN-BEGIN:initComponents - private void initComponents() { - - mainPanel = new javax.swing.JPanel(); - - javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel); - mainPanel.setLayout(mainPanelLayout); - mainPanelLayout.setHorizontalGroup( - mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 334, Short.MAX_VALUE) - ); - mainPanelLayout.setVerticalGroup( - mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 277, Short.MAX_VALUE) - ); - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(mainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(mainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - ); - }// //GEN-END:initComponents - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JPanel mainPanel; - // End of variables declaration//GEN-END:variables -} diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel2.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressPanel.java similarity index 91% rename from Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel2.java rename to Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressPanel.java index dcd58dd201..0471e6f81e 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel2.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressPanel.java @@ -32,14 +32,15 @@ import org.openide.util.Lookup; * The "Add Data Source" wizard panel2. Handles processing the image in a worker * thread, and any errors that may occur during the add process. */ -class AddImageWizardPanel2 implements WizardDescriptor.Panel { +class AddImageWizardAddingProgressPanel implements WizardDescriptor.Panel { private boolean imgAdded = false; /** * The visual component that displays this panel. If you need to access the * component from this class, just use getComponent(). */ - private AddImageVisualPanel2 component; + private AddImageWizardAddingProgressVisual component; + private final Set listeners = new HashSet(1); // or can use ChangeSupport in NB 6.0 /** * Get the visual component for the panel. In this template, the component @@ -50,9 +51,9 @@ class AddImageWizardPanel2 implements WizardDescriptor.Panel { * @return component the UI component of this wizard panel */ @Override - public AddImageVisualPanel2 getComponent() { + public AddImageWizardAddingProgressVisual getComponent() { if (component == null) { - component = new AddImageVisualPanel2(); + component = new AddImageWizardAddingProgressVisual(); } return component; } @@ -89,7 +90,7 @@ class AddImageWizardPanel2 implements WizardDescriptor.Panel { * Updates the UI to display the add image process has begun. */ void setStateStarted() { - component.getCrDbProgressBar().setIndeterminate(true); + component.getProgressBar().setIndeterminate(true); component.changeProgressBarTextAndColor("*This process take some time for large data sources.", 0, Color.black); } @@ -98,9 +99,9 @@ class AddImageWizardPanel2 implements WizardDescriptor.Panel { */ void setStateFinished() { imgAdded = true; + getComponent().done(); fireChangeEvent(); } - private final Set listeners = new HashSet(1); // or can use ChangeSupport in NB 6.0 /** * Adds a listener to changes of the panel's validity. @@ -164,6 +165,10 @@ class AddImageWizardPanel2 implements WizardDescriptor.Panel { getComponent().resetInfoPanel(); } + void setErrors(String errorString, boolean b) { + getComponent().setErrors(errorString, b); + } + diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressVisual.form b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressVisual.form new file mode 100644 index 0000000000..10bba8b3f7 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressVisual.form @@ -0,0 +1,240 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressVisual.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressVisual.java new file mode 100644 index 0000000000..a5a686556d --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressVisual.java @@ -0,0 +1,293 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2012 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sleuthkit.autopsy.casemodule; + +import java.awt.Color; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import javax.swing.JProgressBar; + +public class AddImageWizardAddingProgressVisual extends javax.swing.JPanel { + + /** + * Returns the name of the this panel. This name will be shown on the left + * panel of the "Add Image" wizard panel. + * + * @return name the name of this panel + */ + @Override + public String getName() { + return "Add Data Source"; + } + + void done() { + + loadingPanel.setVisible(false); + donePanel.setVisible(true); +// add(donePanel, BorderLayout.CENTER); + validate(); + repaint(); + } + + /** + * Creates new form AddImageLoadingPanel + */ + public AddImageWizardAddingProgressVisual() { + initComponents(); + customizeComponents(); + } + + private void customizeComponents() { + donePanel.setVisible(false); + viewLogButton.setVisible(false); + this.TextArea_CurrentDirectory.setBackground(this.getBackground()); + + } + + void resetInfoPanel() { + viewLogButton.setVisible(false); +// if (errorButton != null) { +// infoPanel.remove(errorButton); +// errorButton = null; +// } + progressLabel.setText(""); + } + + public JProgressBar getProgressBar() { + return this.progressBar; + } + + /** + * Changes the progress bar text and color. + * + * @param text the text to be shown + * @param value the current value of the progress bar + * @param color the color of the progress bar text + */ + public void changeProgressBarTextAndColor(String text, int value, Color color) { + progressLabel.setText(text); + progressLabel.setForeground(color); + progressBar.setValue(value); + } + + /** + * Updates the currently processing directory + * + * @param dir the text to update with + */ + public void setCurrentDirText(String dir) { + this.TextArea_CurrentDirectory.setText(dir); + } + +// /** +// * Sets the CurrentlyProcessing tag and text area to be invisible +// */ +// public void setProcessInvis() { +// this.TextArea_CurrentDirectory.setText(""); +// this.TextArea_CurrentDirectory.setVisible(false); +// } + void setErrors(final String errors, boolean critical) { + progressBar.setValue(100); //always invoked when process completed + if (critical) { + statusLabel.setText("*Failed to add image (critical errors encountered). Click below to view the log."); + } else { + statusLabel.setText("*Data Source added (non-critical errors encountered). Click below to view the log."); + } + + viewLogButton.setVisible(true); + + + viewLogButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + //JOptionPane.showMessageDialog(null, errors, "Add image non-critical errors", JOptionPane.WARNING_MESSAGE); + AddImageErrorsDialog dialog = new AddImageErrorsDialog(null, true); + dialog.setErrors(errors); + dialog.setVisible(true); + } + }); + + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + donePanel = new javax.swing.JPanel(); + statusLabel = new javax.swing.JLabel(); + crDbLabel = new javax.swing.JLabel(); + viewLogButton = new javax.swing.JButton(); + loadingPanel = new javax.swing.JPanel(); + addingDataSourceLabel = new javax.swing.JLabel(); + progressLabel = new javax.swing.JLabel(); + jLabel1 = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); + progressBar = new javax.swing.JProgressBar(); + infoPanel = new javax.swing.JPanel(); + TextArea_CurrentDirectory = new javax.swing.JTextArea(); + + org.openide.awt.Mnemonics.setLocalizedText(statusLabel, org.openide.util.NbBundle.getMessage(AddImageWizardAddingProgressVisual.class, "AddImageWizardAddingProgressVisual.statusLabel.text")); // NOI18N + + crDbLabel.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(crDbLabel, org.openide.util.NbBundle.getMessage(AddImageWizardAddingProgressVisual.class, "AddImageWizardAddingProgressVisual.crDbLabel.text")); // NOI18N + + org.openide.awt.Mnemonics.setLocalizedText(viewLogButton, org.openide.util.NbBundle.getMessage(AddImageWizardAddingProgressVisual.class, "AddImageWizardAddingProgressVisual.viewLogButton.text")); // NOI18N + + javax.swing.GroupLayout donePanelLayout = new javax.swing.GroupLayout(donePanel); + donePanel.setLayout(donePanelLayout); + donePanelLayout.setHorizontalGroup( + donePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(donePanelLayout.createSequentialGroup() + .addContainerGap() + .addGroup(donePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(donePanelLayout.createSequentialGroup() + .addGap(0, 0, 0) + .addComponent(viewLogButton)) + .addComponent(crDbLabel) + .addComponent(statusLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 463, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + donePanelLayout.setVerticalGroup( + donePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(donePanelLayout.createSequentialGroup() + .addContainerGap() + .addComponent(crDbLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(statusLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(viewLogButton) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + addingDataSourceLabel.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(addingDataSourceLabel, org.openide.util.NbBundle.getMessage(AddImageWizardAddingProgressVisual.class, "AddImageWizardAddingProgressVisual.addingDataSourceLabel.text")); // NOI18N + + org.openide.awt.Mnemonics.setLocalizedText(progressLabel, org.openide.util.NbBundle.getMessage(AddImageWizardAddingProgressVisual.class, "AddImageWizardAddingProgressVisual.progressLabel.text")); // NOI18N + progressLabel.setPreferredSize(null); + + org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(AddImageWizardAddingProgressVisual.class, "AddImageWizardAddingProgressVisual.jLabel1.text")); // NOI18N + + org.openide.awt.Mnemonics.setLocalizedText(jLabel5, org.openide.util.NbBundle.getMessage(AddImageWizardAddingProgressVisual.class, "AddImageWizardAddingProgressVisual.jLabel5.text")); // NOI18N + + javax.swing.GroupLayout infoPanelLayout = new javax.swing.GroupLayout(infoPanel); + infoPanel.setLayout(infoPanelLayout); + infoPanelLayout.setHorizontalGroup( + infoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 73, Short.MAX_VALUE) + ); + infoPanelLayout.setVerticalGroup( + infoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 25, Short.MAX_VALUE) + ); + + TextArea_CurrentDirectory.setEditable(false); + TextArea_CurrentDirectory.setBackground(new java.awt.Color(240, 240, 240)); + TextArea_CurrentDirectory.setLineWrap(true); + TextArea_CurrentDirectory.setRows(5); + TextArea_CurrentDirectory.setWrapStyleWord(true); + TextArea_CurrentDirectory.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), org.openide.util.NbBundle.getMessage(AddImageWizardAddingProgressVisual.class, "AddImageWizardAddingProgressVisual.TextArea_CurrentDirectory.border.title"))); // NOI18N + TextArea_CurrentDirectory.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR)); + TextArea_CurrentDirectory.setFocusable(false); + + javax.swing.GroupLayout loadingPanelLayout = new javax.swing.GroupLayout(loadingPanel); + loadingPanel.setLayout(loadingPanelLayout); + loadingPanelLayout.setHorizontalGroup( + loadingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(loadingPanelLayout.createSequentialGroup() + .addContainerGap() + .addGroup(loadingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, loadingPanelLayout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addGroup(loadingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(addingDataSourceLabel) + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 552, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel5) + .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, 489, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(loadingPanelLayout.createSequentialGroup() + .addGroup(loadingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(loadingPanelLayout.createSequentialGroup() + .addComponent(progressLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(infoPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(TextArea_CurrentDirectory, javax.swing.GroupLayout.PREFERRED_SIZE, 487, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(0, 0, Short.MAX_VALUE)))) + ); + loadingPanelLayout.setVerticalGroup( + loadingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(loadingPanelLayout.createSequentialGroup() + .addContainerGap() + .addComponent(addingDataSourceLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(TextArea_CurrentDirectory, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(loadingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(loadingPanelLayout.createSequentialGroup() + .addComponent(infoPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, Short.MAX_VALUE)) + .addComponent(progressLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap()) + ); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(0, 0, 0) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(loadingPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(donePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(0, 0, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(0, 0, 0) + .addComponent(loadingPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(donePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap()) + ); + }// //GEN-END:initComponents + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JTextArea TextArea_CurrentDirectory; + private javax.swing.JLabel addingDataSourceLabel; + private javax.swing.JLabel crDbLabel; + private javax.swing.JPanel donePanel; + private javax.swing.JPanel infoPanel; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel5; + private javax.swing.JPanel loadingPanel; + private javax.swing.JProgressBar progressBar; + private javax.swing.JLabel progressLabel; + private javax.swing.JLabel statusLabel; + private javax.swing.JButton viewLogButton; + // End of variables declaration//GEN-END:variables +} diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel1.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardChooseDataSourcePanel.java similarity index 96% rename from Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel1.java rename to Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardChooseDataSourcePanel.java index f84861f650..39a00baacc 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel1.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardChooseDataSourcePanel.java @@ -37,13 +37,13 @@ import org.sleuthkit.autopsy.coreutils.ModuleSettings; * The "Add Image" wizard panel1 handling the logic of selecting image file(s) * to add to Case, and pick the time zone. */ -class AddImageWizardPanel1 implements WizardDescriptor.Panel, PropertyChangeListener { +class AddImageWizardChooseDataSourcePanel implements WizardDescriptor.Panel, PropertyChangeListener { /** * The visual component that displays this panel. If you need to access the * component from this class, just use getComponent(). */ - private AddImageVisualPanel1 component; + private AddImageWizardChooseDataSourceVisual component; private boolean isNextEnable = false; private static final String PROP_LASTDATASOURCE_PATH = "LBL_LastDataSource_PATH"; private static final String PROP_LASTDATASOURCE_TYPE = "LBL_LastDataSource_TYPE"; @@ -59,9 +59,9 @@ class AddImageWizardPanel1 implements WizardDescriptor.Panel, * @return component the UI component of this wizard panel */ @Override - public AddImageVisualPanel1 getComponent() { + public AddImageWizardChooseDataSourceVisual getComponent() { if (component == null) { - component = new AddImageVisualPanel1(this); + component = new AddImageWizardChooseDataSourceVisual(this); } component.addPropertyChangeListener(this); return component; @@ -194,7 +194,7 @@ class AddImageWizardPanel1 implements WizardDescriptor.Panel, try { cleanupTask.cleanup(); } catch (Exception ex) { - Logger logger = Logger.getLogger(AddImageWizardPanel1.class.getName()); + Logger logger = Logger.getLogger(AddImageWizardChooseDataSourcePanel.class.getName()); logger.log(Level.WARNING, "Error cleaning up image task", ex); } finally { cleanupTask.disable(); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageVisualPanel1.form b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardChooseDataSourceVisual.form similarity index 88% rename from Core/src/org/sleuthkit/autopsy/casemodule/AddImageVisualPanel1.form rename to Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardChooseDataSourceVisual.form index 1042b934b3..04ada814bf 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageVisualPanel1.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardChooseDataSourceVisual.form @@ -7,7 +7,7 @@ - + @@ -85,14 +85,14 @@ - + - + @@ -110,17 +110,17 @@ - + - + - + @@ -170,7 +170,7 @@ - + @@ -215,7 +215,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageVisualPanel1.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardChooseDataSourceVisual.java similarity index 91% rename from Core/src/org/sleuthkit/autopsy/casemodule/AddImageVisualPanel1.java rename to Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardChooseDataSourceVisual.java index 498b6b9771..0dae5d4c6e 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageVisualPanel1.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardChooseDataSourceVisual.java @@ -38,7 +38,7 @@ import org.sleuthkit.autopsy.casemodule.ContentTypePanel.ContentType; * the panel 1 for "Add Image" wizard panel. * */ -final class AddImageVisualPanel1 extends JPanel { +final class AddImageWizardChooseDataSourceVisual extends JPanel { enum EVENT {UPDATE_UI, FOCUS_NEXT}; static final List rawExt = Arrays.asList(new String[]{".img", ".dd", ".001", ".aa", ".raw"}); @@ -54,7 +54,7 @@ final class AddImageVisualPanel1 extends JPanel { } static final String allDesc = "All Supported Types"; static GeneralFilter allFilter = new GeneralFilter(allExt, allDesc); - private AddImageWizardPanel1 wizPanel; + private AddImageWizardChooseDataSourcePanel wizPanel; private ContentTypeModel model; private ContentTypePanel currentPanel; @@ -63,7 +63,7 @@ final class AddImageVisualPanel1 extends JPanel { * Creates new form AddImageVisualPanel1 * @param wizPanel corresponding WizardPanel to handle logic of wizard step */ - AddImageVisualPanel1(AddImageWizardPanel1 wizPanel) { + AddImageWizardChooseDataSourceVisual(AddImageWizardChooseDataSourcePanel wizPanel) { initComponents(); this.wizPanel = wizPanel; createTimeZoneList(); @@ -92,10 +92,10 @@ final class AddImageVisualPanel1 extends JPanel { @Override public void propertyChange(PropertyChangeEvent evt) { - if(evt.getPropertyName().equals(AddImageVisualPanel1.EVENT.UPDATE_UI.toString())) { + if(evt.getPropertyName().equals(AddImageWizardChooseDataSourceVisual.EVENT.UPDATE_UI.toString())) { updateUI(null); } - if(evt.getPropertyName().equals(AddImageVisualPanel1.EVENT.FOCUS_NEXT.toString())) { + if(evt.getPropertyName().equals(AddImageWizardChooseDataSourceVisual.EVENT.FOCUS_NEXT.toString())) { wizPanel.moveFocusToNext(); } } @@ -240,24 +240,24 @@ final class AddImageVisualPanel1 extends JPanel { typeComboBox = new javax.swing.JComboBox(); imgInfoLabel = new javax.swing.JLabel(); - org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class, "AddImageVisualPanel1.jLabel2.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(AddImageWizardChooseDataSourceVisual.class, "AddImageWizardChooseDataSourceVisual.jLabel2.text")); // NOI18N setPreferredSize(new java.awt.Dimension(588, 328)); - org.openide.awt.Mnemonics.setLocalizedText(nextLabel, org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class, "AddImageVisualPanel1.nextLabel.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(nextLabel, org.openide.util.NbBundle.getMessage(AddImageWizardChooseDataSourceVisual.class, "AddImageWizardChooseDataSourceVisual.nextLabel.text")); // NOI18N - org.openide.awt.Mnemonics.setLocalizedText(timeZoneLabel, org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class, "AddImageVisualPanel1.timeZoneLabel.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(timeZoneLabel, org.openide.util.NbBundle.getMessage(AddImageWizardChooseDataSourceVisual.class, "AddImageWizardChooseDataSourceVisual.timeZoneLabel.text")); // NOI18N timeZoneComboBox.setMaximumRowCount(30); - org.openide.awt.Mnemonics.setLocalizedText(noFatOrphansCheckbox, org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class, "AddImageVisualPanel1.noFatOrphansCheckbox.text")); // NOI18N - noFatOrphansCheckbox.setToolTipText(org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class, "AddImageVisualPanel1.noFatOrphansCheckbox.toolTipText")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(noFatOrphansCheckbox, org.openide.util.NbBundle.getMessage(AddImageWizardChooseDataSourceVisual.class, "AddImageWizardChooseDataSourceVisual.noFatOrphansCheckbox.text")); // NOI18N + noFatOrphansCheckbox.setToolTipText(org.openide.util.NbBundle.getMessage(AddImageWizardChooseDataSourceVisual.class, "AddImageWizardChooseDataSourceVisual.noFatOrphansCheckbox.toolTipText")); // NOI18N - org.openide.awt.Mnemonics.setLocalizedText(descLabel, org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class, "AddImageVisualPanel1.descLabel.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(descLabel, org.openide.util.NbBundle.getMessage(AddImageWizardChooseDataSourceVisual.class, "AddImageWizardChooseDataSourceVisual.descLabel.text")); // NOI18N inputPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder()); - org.openide.awt.Mnemonics.setLocalizedText(typeTabel, org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class, "AddImageVisualPanel1.typeTabel.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(typeTabel, org.openide.util.NbBundle.getMessage(AddImageWizardChooseDataSourceVisual.class, "AddImageWizardChooseDataSourceVisual.typeTabel.text")); // NOI18N typePanel.setMinimumSize(new java.awt.Dimension(0, 65)); typePanel.setPreferredSize(new java.awt.Dimension(521, 65)); @@ -301,7 +301,7 @@ final class AddImageVisualPanel1 extends JPanel { ); imgInfoLabel.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N - org.openide.awt.Mnemonics.setLocalizedText(imgInfoLabel, org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class, "AddImageVisualPanel1.imgInfoLabel.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(imgInfoLabel, org.openide.util.NbBundle.getMessage(AddImageWizardChooseDataSourceVisual.class, "AddImageWizardChooseDataSourceVisual.imgInfoLabel.text")); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel3.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIngestConfigPanel.java similarity index 87% rename from Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel3.java rename to Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIngestConfigPanel.java index f8d2529fbf..bc566743d8 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel3.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIngestConfigPanel.java @@ -41,7 +41,6 @@ import org.sleuthkit.autopsy.casemodule.ContentTypePanel.ContentType; import org.sleuthkit.autopsy.casemodule.services.FileManager; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.PlatformUtil; -import org.sleuthkit.autopsy.ingest.IngestDialog; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.Image; @@ -55,9 +54,9 @@ import org.sleuthkit.datamodel.TskException; * The "Add Image" wizard panel3. Presents the options to finish/cancel * image-add and run ingest. */ -class AddImageWizardPanel3 implements WizardDescriptor.Panel { +class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel { - private static final Logger logger = Logger.getLogger(AddImageWizardPanel3.class.getName()); + private static final Logger logger = Logger.getLogger(AddImageWizardIngestConfigPanel.class.getName()); private IngestConfigurator ingestConfig; /** * The visual component that displays this panel. If you need to access the @@ -76,27 +75,25 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { private boolean noFatOrphans; // task that will clean up the created database file if the wizard is cancelled before it finishes private AddImageAction.CleanupTask cleanupImage; // initialized to null in readSettings() - // flag to control the availiablity of next action - private boolean imgAdded; // initalized to false in readSettings() private CurrentDirectoryFetcher fetcher; private AddImageProcess process; private AddImageAction action; private AddImageTask addImageTask; private AddLocalFilesTask addLocalFilesTask; - private AddImageWizardPanel2 wizPanel; + private AddImageWizardAddingProgressPanel progressPanel; - AddImageWizardPanel3(AddImageAction action, AddImageWizardPanel2 wizPanel) { + AddImageWizardIngestConfigPanel(AddImageAction action, AddImageWizardAddingProgressPanel proPanel) { this.action = action; - this.wizPanel = wizPanel; + this.progressPanel = proPanel; ingestConfig = Lookup.getDefault().lookup(IngestConfigurator.class); - List messages = ingestConfig.setContext(AddImageWizardPanel3.class.getCanonicalName()); + List messages = ingestConfig.setContext(AddImageWizardIngestConfigPanel.class.getCanonicalName()); if (messages.isEmpty() == false) { StringBuilder warning = new StringBuilder(); for (String message : messages) { warning.append(message).append("\n"); } JOptionPane.showMessageDialog(null, warning.toString()); - } + } } /** @@ -110,7 +107,7 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { @Override public Component getComponent() { if (component == null) { - component = new AddImageVisualPanel3(ingestConfig.getIngestConfigPanel()); + component = new AddImageWizardIngestConfigVisual(ingestConfig.getIngestConfigPanel()); } return component; } @@ -183,7 +180,7 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { settings.setOptions(new Object[]{WizardDescriptor.PREVIOUS_OPTION, WizardDescriptor.NEXT_OPTION, WizardDescriptor.FINISH_OPTION, cancel}); cleanupImage = null; readyToIngest = false; - imgAdded = false; + newContents.clear(); dataSourcePath = (String) settings.getProperty(AddImageAction.DATASOURCEPATH_PROP); dataSourceType = (ContentType) settings.getProperty(AddImageAction.DATASOURCETYPE_PROP); @@ -228,7 +225,8 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { ingested = true; ingestConfig.setContent(newContents); ingestConfig.start(); - wizPanel.getComponent().appendProgressText(" Ingest started."); + progressPanel.setStateFinished(); + } } @@ -240,10 +238,10 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { AddImageTask task; JProgressBar prog; - AddImageVisualPanel2 wiz; + AddImageWizardAddingProgressVisual wiz; AddImageProcess proc; - CurrentDirectoryFetcher(JProgressBar prog, AddImageVisualPanel2 wiz, AddImageProcess proc) { + CurrentDirectoryFetcher(JProgressBar prog, AddImageWizardAddingProgressVisual wiz, AddImageProcess proc) { this.wiz = wiz; this.proc = proc; this.prog = prog; @@ -260,7 +258,7 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { EventQueue.invokeLater(new Runnable() { @Override public void run() { - wiz.changeCurrentDir(proc.currentDirectory()); + wiz.setCurrentDirText(proc.currentDirectory()); } }); @@ -271,14 +269,6 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { return -1; } } - - /** - * When done, set the Wizards processing tags to be invisible - */ - @Override - protected void done() { - wiz.setProcessInvis(); - } } /** @@ -301,7 +291,7 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { private Logger logger = Logger.getLogger(AddLocalFilesTask.class.getName()); protected AddLocalFilesTask(WizardDescriptor settings) { - this.progressBar = wizPanel.getComponent().getCrDbProgressBar(); + this.progressBar = progressPanel.getComponent().getProgressBar(); currentCase = Case.getCurrentCase(); this.settings = settings; } @@ -310,6 +300,7 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { * Starts the addImage process, but does not commit the results. * * @return + * * @throws Exception */ @Override @@ -326,10 +317,10 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { }; cancelledWhileRunning.enable(); - final LocalFilesAddProgressUpdater progUpdater = new LocalFilesAddProgressUpdater(this.progressBar, wizPanel.getComponent()); + final LocalFilesAddProgressUpdater progUpdater = new LocalFilesAddProgressUpdater(this.progressBar, progressPanel.getComponent()); try { final FileManager fileManager = currentCase.getServices().getFileManager(); - wizPanel.setStateStarted(); + progressPanel.setStateStarted(); String[] paths = dataSourcePath.split(LocalFilesPanel.FILES_SEP); List absLocalPaths = new ArrayList(); for (String path : paths) { @@ -361,31 +352,33 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { protected void postProcess() { progressBar.setIndeterminate(false); setProgress(100); - + //clear updates - wizPanel.getComponent().setProcessInvis(); + // progressPanel.getComponent().setProcessInvis(); if (interrupted || hasCritError) { logger.log(Level.INFO, "Handling errors or interruption that occured in logical files process"); if (hasCritError) { //core error - wizPanel.getComponent().setErrors(errorString, true); + progressPanel.getComponent().setErrors(errorString, true); } return; - } else if (errorString != null) { - //data error (non-critical) - logger.log(Level.INFO, "Handling non-critical errors that occured in logical files process"); - wizPanel.getComponent().setErrors(errorString, false); + } else { + if (errorString != null) { + //data error (non-critical) + logger.log(Level.INFO, "Handling non-critical errors that occured in logical files process"); + progressPanel.getComponent().setErrors(errorString, false); + } } try { // When everything happens without an error: if (errorString == null) { // complete progress bar - wizPanel.getComponent().changeProgressBarTextAndColor("*Logical Files added.", 100, Color.black); + progressPanel.getComponent().changeProgressBarTextAndColor("*Logical Files added.", 100, Color.black); } // Get attention for the process finish java.awt.Toolkit.getDefaultToolkit().beep(); //BEEP! - AddImageVisualPanel2 panel = wizPanel.getComponent(); + AddImageWizardAddingProgressVisual panel = progressPanel.getComponent(); if (panel != null) { Window w = SwingUtilities.getWindowAncestor(panel); if (w != null) { @@ -393,7 +386,7 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { } } - wizPanel.setStateFinished(); + progressPanel.setStateFinished(); //notify the case if (!newContents.isEmpty()) { @@ -406,7 +399,7 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { } catch (Exception ex) { //handle unchecked exceptions logger.log(Level.WARNING, "Unexpected errors occurred while running post add image cleanup. ", ex); - wizPanel.getComponent().changeProgressBarTextAndColor("*Failed to add image.", 0, Color.black); // set error message + progressPanel.getComponent().changeProgressBarTextAndColor("*Failed to add image.", 0, Color.black); // set error message logger.log(Level.SEVERE, "Error adding image to case", ex); } } @@ -418,9 +411,9 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { private int count = 0; private JProgressBar prog; - private AddImageVisualPanel2 wiz; + private AddImageWizardAddingProgressVisual wiz; - LocalFilesAddProgressUpdater(JProgressBar prog, AddImageVisualPanel2 wiz) { + LocalFilesAddProgressUpdater(JProgressBar prog, AddImageWizardAddingProgressVisual wiz) { this.wiz = wiz; this.prog = prog; } @@ -431,7 +424,7 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { EventQueue.invokeLater(new Runnable() { @Override public void run() { - wiz.changeCurrentDir(newFile.getParentPath() + "/" + newFile.getName()); + wiz.setCurrentDirText(newFile.getParentPath() + "/" + newFile.getName()); } }); @@ -452,25 +445,25 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { private boolean interrupted = false; private boolean hasCritError = false; private String errorString = null; - private long start; - private WizardDescriptor settings; + private WizardDescriptor wizDescriptor; private Logger logger = Logger.getLogger(AddImageTask.class.getName()); protected AddImageTask(WizardDescriptor settings) { - this.progressBar = wizPanel.getComponent().getCrDbProgressBar(); + this.progressBar = progressPanel.getComponent().getProgressBar(); currentCase = Case.getCurrentCase(); - this.settings = settings; + this.wizDescriptor = settings; } /** * Starts the addImage process, but does not commit the results. * * @return + * * @throws Exception */ @Override protected Integer doInBackground() { - start = System.currentTimeMillis(); + this.setProgress(0); @@ -504,10 +497,10 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { } process = currentCase.makeAddImageProcess(timeZone, true, noFatOrphans); - fetcher = new CurrentDirectoryFetcher(this.progressBar, wizPanel.getComponent(), process); + fetcher = new CurrentDirectoryFetcher(this.progressBar, progressPanel.getComponent(), process); cancelledWhileRunning.enable(); try { - wizPanel.setStateStarted(); + progressPanel.setStateStarted(); fetcher.execute(); process.run(new String[]{dataSourcePath}); } catch (TskCoreException ex) { @@ -540,7 +533,8 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { * would have reverted it. * * @param settings property set to get AddImageProcess and CleanupTask - * from + * from + * * @throws Exception if commit or adding the image to the case failed */ private void commitImage(WizardDescriptor settings) throws Exception { @@ -591,13 +585,15 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { revert(); if (hasCritError) { //core error - wizPanel.getComponent().setErrors(errorString, true); + progressPanel.getComponent().setErrors(errorString, true); } return; - } else if (errorString != null) { - //data error (non-critical) - logger.log(Level.INFO, "Handling non-critical errors that occured in add image process"); - wizPanel.getComponent().setErrors(errorString, false); + } else { + if (errorString != null) { + //data error (non-critical) + logger.log(Level.INFO, "Handling non-critical errors that occured in add image process"); + progressPanel.setErrors(errorString, false); + } } @@ -617,12 +613,12 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { cleanupImage.enable(); if (errorString == null) { // complete progress bar - wizPanel.getComponent().changeProgressBarTextAndColor("*Data Source added.", 100, Color.black); + progressPanel.getComponent().changeProgressBarTextAndColor("*Data Source added.", 100, Color.black); } // Get attention for the process finish java.awt.Toolkit.getDefaultToolkit().beep(); //BEEP! - AddImageVisualPanel2 panel = wizPanel.getComponent(); + AddImageWizardAddingProgressVisual panel = progressPanel.getComponent(); if (panel != null) { Window w = SwingUtilities.getWindowAncestor(panel); if (w != null) { @@ -631,7 +627,7 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { } // Tell the panel we're done - wizPanel.setStateFinished(); + progressPanel.setStateFinished(); // Commit the image if (!newContents.isEmpty()) //already commited @@ -643,7 +639,7 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { if (process != null) { // and if we're done configuring ingest // commit anything try { - commitImage(settings); + commitImage(wizDescriptor); } catch (Exception ex) { // Log error/display warning logger.log(Level.SEVERE, "Error adding image to case.", ex); @@ -660,7 +656,7 @@ class AddImageWizardPanel3 implements WizardDescriptor.Panel { logger.log(Level.WARNING, "Unexpected errors occurred while running post add image cleanup. ", ex); - wizPanel.getComponent().changeProgressBarTextAndColor("*Failed to add image.", 0, Color.black); // set error message + progressPanel.getComponent().changeProgressBarTextAndColor("*Failed to add image.", 0, Color.black); // set error message // Log error/display warning diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageVisualPanel3.form b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIngestConfigVisual.form similarity index 92% rename from Core/src/org/sleuthkit/autopsy/casemodule/AddImageVisualPanel3.form rename to Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIngestConfigVisual.form index 2353d10f44..2ba2f5fbb7 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageVisualPanel3.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIngestConfigVisual.form @@ -53,14 +53,14 @@ - + - + diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageVisualPanel3.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIngestConfigVisual.java similarity index 92% rename from Core/src/org/sleuthkit/autopsy/casemodule/AddImageVisualPanel3.java rename to Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIngestConfigVisual.java index 678b1700d3..55a08b0bb1 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageVisualPanel3.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIngestConfigVisual.java @@ -25,11 +25,11 @@ import javax.swing.JPanel; /** * Data Source added, ingest configure wizard visual panel 3 */ -public class AddImageVisualPanel3 extends javax.swing.JPanel { +public class AddImageWizardIngestConfigVisual extends javax.swing.JPanel { private JPanel ingestPanel = null; /** Creates new form AddImageVisualPanel3 */ - public AddImageVisualPanel3(JPanel ingestPanel) { + public AddImageWizardIngestConfigVisual(JPanel ingestPanel) { this.ingestPanel = ingestPanel; initComponents(); customizeComponents(); @@ -68,9 +68,9 @@ public class AddImageVisualPanel3 extends javax.swing.JPanel { setPreferredSize(new java.awt.Dimension(569, 300)); titleLabel.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N - titleLabel.setText(org.openide.util.NbBundle.getMessage(AddImageVisualPanel3.class, "AddImageVisualPanel3.titleLabel.text")); // NOI18N + titleLabel.setText(org.openide.util.NbBundle.getMessage(AddImageWizardIngestConfigVisual.class, "AddImageWizardIngestConfigVisual.titleLabel.text")); // NOI18N - subtitleLabel.setText(org.openide.util.NbBundle.getMessage(AddImageVisualPanel3.class, "AddImageVisualPanel3.subtitleLabel.text")); // NOI18N + subtitleLabel.setText(org.openide.util.NbBundle.getMessage(AddImageWizardIngestConfigVisual.class, "AddImageWizardIngestConfigVisual.subtitleLabel.text")); // NOI18N configPanel.setPreferredSize(new java.awt.Dimension(569, 255)); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIterator.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIterator.java index c2d5b6f73a..2528f0b582 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIterator.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIterator.java @@ -47,10 +47,10 @@ class AddImageWizardIterator implements WizardDescriptor.Iterator> getPanels() { if (panels == null) { - AddImageWizardPanel2 wizPanel = new AddImageWizardPanel2(); + AddImageWizardAddingProgressPanel wizPanel = new AddImageWizardAddingProgressPanel(); panels = new ArrayList>(); - panels.add(new AddImageWizardPanel1()); - panels.add(new AddImageWizardPanel3(action, wizPanel)); + panels.add(new AddImageWizardChooseDataSourcePanel()); + panels.add(new AddImageWizardIngestConfigPanel(action, wizPanel)); panels.add(wizPanel); String[] steps = new String[panels.size()]; diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java index e25582a47d..a71ad31681 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java @@ -43,9 +43,9 @@ public class ImageFilePanel extends ContentTypePanel implements DocumentListener fc.setDragEnabled(false); fc.setFileSelectionMode(JFileChooser.FILES_ONLY); fc.setMultiSelectionEnabled(false); - fc.addChoosableFileFilter(AddImageVisualPanel1.rawFilter); - fc.addChoosableFileFilter(AddImageVisualPanel1.encaseFilter); - fc.setFileFilter(AddImageVisualPanel1.allFilter); + fc.addChoosableFileFilter(AddImageWizardChooseDataSourceVisual.rawFilter); + fc.addChoosableFileFilter(AddImageWizardChooseDataSourceVisual.encaseFilter); + fc.setFileFilter(AddImageWizardChooseDataSourceVisual.allFilter); } /** @@ -131,7 +131,7 @@ public class ImageFilePanel extends ContentTypePanel implements DocumentListener String path = fc.getSelectedFile().getPath(); pathTextField.setText(path); } - pcs.firePropertyChange(AddImageVisualPanel1.EVENT.FOCUS_NEXT.toString(), false, true); + pcs.firePropertyChange(AddImageWizardChooseDataSourceVisual.EVENT.FOCUS_NEXT.toString(), false, true); }//GEN-LAST:event_browseButtonActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables @@ -194,17 +194,17 @@ public class ImageFilePanel extends ContentTypePanel implements DocumentListener */ @Override public void insertUpdate(DocumentEvent e) { - pcs.firePropertyChange(AddImageVisualPanel1.EVENT.UPDATE_UI.toString(), false, true); + pcs.firePropertyChange(AddImageWizardChooseDataSourceVisual.EVENT.UPDATE_UI.toString(), false, true); } @Override public void removeUpdate(DocumentEvent e) { - pcs.firePropertyChange(AddImageVisualPanel1.EVENT.UPDATE_UI.toString(), false, true); + pcs.firePropertyChange(AddImageWizardChooseDataSourceVisual.EVENT.UPDATE_UI.toString(), false, true); } @Override public void changedUpdate(DocumentEvent e) { - pcs.firePropertyChange(AddImageVisualPanel1.EVENT.UPDATE_UI.toString(), false, true); + pcs.firePropertyChange(AddImageWizardChooseDataSourceVisual.EVENT.UPDATE_UI.toString(), false, true); } /** diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java index 9c9c3f5fe6..6a51382940 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java @@ -234,7 +234,7 @@ public class LocalDiskPanel extends ContentTypePanel { if(ready) { selected = anItem; enableNext = true; - pcs.firePropertyChange(AddImageVisualPanel1.EVENT.UPDATE_UI.toString(), false, true); + pcs.firePropertyChange(AddImageWizardChooseDataSourceVisual.EVENT.UPDATE_UI.toString(), false, true); } } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesPanel.java index 2357151d2b..7d07033ac1 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesPanel.java @@ -98,7 +98,7 @@ public class LocalFilesPanel extends ContentTypePanel { currentFiles.clear(); selectedPaths.setText(""); enableNext = false; - pcs.firePropertyChange(AddImageVisualPanel1.EVENT.UPDATE_UI.toString(), false, true); + pcs.firePropertyChange(AddImageWizardChooseDataSourceVisual.EVENT.UPDATE_UI.toString(), false, true); } @Override @@ -231,7 +231,7 @@ public class LocalFilesPanel extends ContentTypePanel { else { enableNext = false; } - pcs.firePropertyChange(AddImageVisualPanel1.EVENT.UPDATE_UI.toString(), false, true); + pcs.firePropertyChange(AddImageWizardChooseDataSourceVisual.EVENT.UPDATE_UI.toString(), false, true); }//GEN-LAST:event_selectButtonActionPerformed private void clearButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clearButtonActionPerformed diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/MissingImageDialog.java b/Core/src/org/sleuthkit/autopsy/casemodule/MissingImageDialog.java index 86af8905d0..22d9f11a2f 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/MissingImageDialog.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/MissingImageDialog.java @@ -108,10 +108,10 @@ public class MissingImageDialog extends javax.swing.JDialog { @Override public void propertyChange(PropertyChangeEvent evt) { - if(evt.getPropertyName().equals(AddImageVisualPanel1.EVENT.UPDATE_UI.toString())) { + if(evt.getPropertyName().equals(AddImageWizardChooseDataSourceVisual.EVENT.UPDATE_UI.toString())) { updateSelectButton(); } - if(evt.getPropertyName().equals(AddImageVisualPanel1.EVENT.FOCUS_NEXT.toString())) { + if(evt.getPropertyName().equals(AddImageWizardChooseDataSourceVisual.EVENT.FOCUS_NEXT.toString())) { moveFocusToSelect(); } } From a91ced8ea822b6c82ed5258afbe16f88245f7119 Mon Sep 17 00:00:00 2001 From: Jeff Wallace Date: Wed, 18 Sep 2013 14:12:11 -0400 Subject: [PATCH 4/9] FX Video Player resets properly if another node is selected. --- .../sleuthkit/autopsy/corecomponents/FXVideoPanel.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/FXVideoPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/FXVideoPanel.java index fc228ee623..f1180754a1 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/FXVideoPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/FXVideoPanel.java @@ -400,8 +400,13 @@ public class FXVideoPanel extends MediaViewVideoPanel { * @param mediaUri the URI of the media */ public void prepareMedia(String mediaUri) { - mediaPlayer = createMediaPlayer(mediaUri); - mediaView.setMediaPlayer(mediaPlayer); + try { + mediaPlayer = createMediaPlayer(mediaUri); + mediaView.setMediaPlayer(mediaPlayer); + } catch (MediaException ex) { + this.setProgressLabelText(""); + this.setInfoLabelText("Unsupported Format."); + } } /** @@ -414,6 +419,7 @@ public class FXVideoPanel extends MediaViewVideoPanel { mediaPlayer.stop(); } mediaPlayer = null; + mediaView.setMediaPlayer(null); } resetProgress(); } From cf8874d558cb4083122c830bac8c967cf501d2d3 Mon Sep 17 00:00:00 2001 From: jmillman Date: Wed, 18 Sep 2013 14:13:32 -0400 Subject: [PATCH 5/9] added/clarified comments --- .../AddImageWizardAddingProgressPanel.java | 48 ++++++++---- .../AddImageWizardAddingProgressVisual.java | 47 ++++++----- .../AddImageWizardChooseDataSourceVisual.java | 77 +++++++++---------- .../AddImageWizardIngestConfigPanel.java | 24 +++--- .../AddImageWizardIngestConfigVisual.java | 28 ++++--- .../autopsy/casemodule/Bundle.properties | 32 ++++---- 6 files changed, 146 insertions(+), 110 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressPanel.java index 0471e6f81e..78380082b7 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressPanel.java @@ -29,18 +29,26 @@ import org.openide.util.HelpCtx; import org.openide.util.Lookup; /** - * The "Add Data Source" wizard panel2. Handles processing the image in a worker - * thread, and any errors that may occur during the add process. + * The final panel of the add image wizard. It displays a progress bar and + * status updates. + * + * All the real work is kicked off in the previous panel: + * {@link AddImageWizardIngestConfigPanel} (which is a bit weird if you ask m + * -jm) */ class AddImageWizardAddingProgressPanel implements WizardDescriptor.Panel { + + /** + * flag to indicate that the image adding process is finished and this panel + * is completed(valid) + */ private boolean imgAdded = false; - /** * The visual component that displays this panel. If you need to access the * component from this class, just use getComponent(). */ private AddImageWizardAddingProgressVisual component; - private final Set listeners = new HashSet(1); // or can use ChangeSupport in NB 6.0 + private final Set listeners = new HashSet<>(1); // or can use ChangeSupport in NB 6.0 /** * Get the visual component for the panel. In this template, the component @@ -48,6 +56,8 @@ class AddImageWizardAddingProgressPanel implements WizardDescriptor.Panel