From e8c408a7989c124d361f2c2eafcd562ac5c7f32c Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Tue, 14 Jun 2016 15:11:35 -0400 Subject: [PATCH 01/17] Started ingest job module ui. --- .../casemodule/IngestJobInfoPanel.form | 28 ++++++++++++ .../casemodule/IngestJobInfoPanel.java | 45 +++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100755 Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form create mode 100755 Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form new file mode 100755 index 0000000000..4f9abb50dc --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form @@ -0,0 +1,28 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java new file mode 100755 index 0000000000..6a28e00ef3 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java @@ -0,0 +1,45 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.sleuthkit.autopsy.casemodule; + +/** + * + * @author oliver + */ +public class IngestJobInfoPanel extends javax.swing.JPanel { + + /** + * Creates new form IngestJobInfoPanel + */ + public IngestJobInfoPanel() { + 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() { + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 400, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 300, Short.MAX_VALUE) + ); + }// //GEN-END:initComponents + + + // Variables declaration - do not modify//GEN-BEGIN:variables + // End of variables declaration//GEN-END:variables +} From 531f103e4a328945f8c8e92186bd9021b7738700 Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Wed, 15 Jun 2016 08:40:39 -0400 Subject: [PATCH 02/17] Updated UI to expand better. --- .../autopsy/casemodule/Bundle.properties | 6 + .../casemodule/CaseInformationPanel.java | 1 + .../casemodule/IngestJobInfoPanel.form | 92 +++++++++++++- .../casemodule/IngestJobInfoPanel.java | 113 +++++++++++++++++- 4 files changed, 207 insertions(+), 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index f0a42c0fd6..1e59816e6d 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -243,3 +243,9 @@ CasePropertiesForm.crDateField.text= CasePropertiesForm.caseDirField.text= CasePropertiesForm.caseTypeField.text= CasePropertiesForm.dbNameField.text= +IngestJobInfoPanel.jButton1.text=Refresh +IngestJobInfoPanel.jTable1.columnModel.title1=Start Time +IngestJobInfoPanel.jTable1.columnModel.title0=Content +IngestJobInfoPanel.jTable1.columnModel.title4=Ingest Modules +IngestJobInfoPanel.jTable1.columnModel.title3=Ingest Status +IngestJobInfoPanel.jTable1.columnModel.title2=End Time diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java index 2e7711d8de..e67d6a5df5 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java @@ -34,6 +34,7 @@ public class CaseInformationPanel extends javax.swing.JPanel { CasePropertiesForm cpf = new CasePropertiesForm(currentCase, crDate, caseDir, imgPaths); cpf.setSize(cpf.getPreferredSize()); this.tabbedPane.addTab(Bundle.CaseInformationPanel_caseDetails_header(), cpf); + this.tabbedPane.addTab("TEST", new IngestJobInfoPanel()); } catch (CaseMetadata.CaseMetadataException ex) { //TOLOG } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form index 4f9abb50dc..152473b518 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form @@ -1,6 +1,6 @@ -
+ @@ -16,13 +16,99 @@ - + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.jTable1.columnModel.title0" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> + + + + + + + <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.jTable1.columnModel.title1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> + + + + + + + <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.jTable1.columnModel.title2" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> + + + + + + + <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.jTable1.columnModel.title3" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> + + + + + + + <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.jTable1.columnModel.title4" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> + + + + + + + + + +
+
+
+
+ + + + + + + + + + +
diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java index 6a28e00ef3..ec9ca67aec 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java @@ -5,17 +5,63 @@ */ package org.sleuthkit.autopsy.casemodule; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.JOptionPane; +import javax.swing.table.DefaultTableModel; +import org.openide.util.NbBundle.Messages; +import org.sleuthkit.datamodel.IngestJobInfo; +import org.sleuthkit.datamodel.IngestModuleInfo; +import org.sleuthkit.datamodel.SleuthkitCase; +import org.sleuthkit.datamodel.TskCoreException; + /** * * @author oliver */ public class IngestJobInfoPanel extends javax.swing.JPanel { + + private static final Logger logger = Logger.getLogger(IngestJobInfoPanel.class.getName()); /** * Creates new form IngestJobInfoPanel */ public IngestJobInfoPanel() { initComponents(); + customizeComponents(); + } + + @Messages({"IngestJobInfoPanel.loadIngestJob.error.text=Failed to load ingest jobs.", + "IngestJobInfoPanel.loadIngestJob.error.title=Load Failure"}) + private void customizeComponents() { + SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase(); + DateFormat datetimeFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); + try { + List ingestJobs = skCase.getIngestJobs(); + for (IngestJobInfo ingestJob : ingestJobs) { + Object[] row = new Object[5]; + row[0] = skCase.getContentById(ingestJob.getObjectId()).getName(); + row[1] = datetimeFormat.format(ingestJob.getStartDateTime()); + row[2] = datetimeFormat.format(ingestJob.getEndDateTime()); + row[3] = ingestJob.getStatus().getDisplayName(); + String ingestModules = ""; + for (IngestModuleInfo ingestModule : ingestJob.getIngestModuleInfo()) { + ingestModules += ingestModule.getDisplayName() + ", "; + } + if (ingestModules.length() > 2) { + ingestModules = ingestModules.substring(0, ingestModules.length() - 2); + } + row[4] = ingestModules; + DefaultTableModel model = (DefaultTableModel) this.jTable1.getModel(); + model.addRow(row); + } + } catch (TskCoreException ex) { + logger.log(Level.SEVERE, "Failed to load ingest jobs.", ex); + JOptionPane.showMessageDialog(null, Bundle.IngestJobInfoPanel_loadIngestJob_error_text(), Bundle.IngestJobInfoPanel_loadIngestJob_error_title(), JOptionPane.ERROR_MESSAGE); + } } /** @@ -27,19 +73,82 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { // //GEN-BEGIN:initComponents private void initComponents() { + jScrollPane1 = new javax.swing.JScrollPane(); + jTable1 = new javax.swing.JTable(); + jButton1 = new javax.swing.JButton(); + + jTable1.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + + }, + new String [] { + "Content", "Start Time", "End Time", "Ingest Status", "Ingest Modules" + } + ) { + Class[] types = new Class [] { + java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class + }; + boolean[] canEdit = new boolean [] { + false, false, false, false, false + }; + + public Class getColumnClass(int columnIndex) { + return types [columnIndex]; + } + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + jScrollPane1.setViewportView(jTable1); + if (jTable1.getColumnModel().getColumnCount() > 0) { + jTable1.getColumnModel().getColumn(0).setMinWidth(100); + jTable1.getColumnModel().getColumn(0).setHeaderValue(org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.jTable1.columnModel.title0")); // NOI18N + jTable1.getColumnModel().getColumn(1).setMinWidth(100); + jTable1.getColumnModel().getColumn(1).setHeaderValue(org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.jTable1.columnModel.title1")); // NOI18N + jTable1.getColumnModel().getColumn(2).setMinWidth(100); + jTable1.getColumnModel().getColumn(2).setHeaderValue(org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.jTable1.columnModel.title2")); // NOI18N + jTable1.getColumnModel().getColumn(3).setMinWidth(100); + jTable1.getColumnModel().getColumn(3).setHeaderValue(org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.jTable1.columnModel.title3")); // NOI18N + jTable1.getColumnModel().getColumn(4).setMinWidth(150); + jTable1.getColumnModel().getColumn(4).setPreferredWidth(250); + jTable1.getColumnModel().getColumn(4).setHeaderValue(org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.jTable1.columnModel.title4")); // NOI18N + } + + org.openide.awt.Mnemonics.setLocalizedText(jButton1, org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.jButton1.text")); // NOI18N + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 400, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jButton1) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 686, Short.MAX_VALUE)) + .addGap(0, 0, 0)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 300, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 403, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jButton1)) ); }// //GEN-END:initComponents + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jButton1ActionPerformed + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButton1; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTable jTable1; // End of variables declaration//GEN-END:variables } From 0d2befc158cbbae84e4380954f3a19a0a77ef50a Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Wed, 15 Jun 2016 09:22:40 -0400 Subject: [PATCH 03/17] Attempted to add scrollability. --- .../casemodule/CaseInformationPanel.form | 2 +- .../casemodule/CaseInformationPanel.java | 2 +- .../casemodule/IngestJobInfoPanel.form | 20 +++++++++++++------ .../casemodule/IngestJobInfoPanel.java | 15 +++++++++----- 4 files changed, 26 insertions(+), 13 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.form b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.form index 755d1dca70..a4c9690b20 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.form @@ -25,7 +25,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java index e67d6a5df5..834468315c 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java @@ -79,7 +79,7 @@ public class CaseInformationPanel extends javax.swing.JPanel { ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); }// //GEN-END:initComponents diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form index 152473b518..282851f644 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form @@ -1,6 +1,6 @@ -
+ @@ -16,10 +16,13 @@ - + - - + + + + + @@ -28,8 +31,8 @@ - - + + @@ -37,6 +40,11 @@ + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java index ec9ca67aec..ca735364d9 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java @@ -39,6 +39,7 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { private void customizeComponents() { SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase(); DateFormat datetimeFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); + this.jScrollPane1.setViewportView(this.jTable1); try { List ingestJobs = skCase.getIngestJobs(); for (IngestJobInfo ingestJob : ingestJobs) { @@ -77,6 +78,8 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { jTable1 = new javax.swing.JTable(); jButton1 = new javax.swing.JButton(); + jScrollPane1.setBorder(null); + jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { @@ -126,17 +129,19 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(jButton1) - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 686, Short.MAX_VALUE)) + .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() + .addContainerGap(617, Short.MAX_VALUE) + .addComponent(jButton1))) .addGap(0, 0, 0)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 403, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 416, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton1)) ); }// //GEN-END:initComponents From d8ded1806c4e6fef53c02c1741547ed4792a6b66 Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Wed, 15 Jun 2016 11:26:15 -0400 Subject: [PATCH 04/17] Reworked ingest module UI. --- .../autopsy/casemodule/Bundle.properties | 10 +- .../casemodule/CaseInformationPanel.form | 2 +- .../casemodule/CaseInformationPanel.java | 30 +++-- .../casemodule/IngestJobInfoPanel.form | 92 +++++++++----- .../casemodule/IngestJobInfoPanel.java | 119 +++++++++++++----- 5 files changed, 181 insertions(+), 72 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index 1e59816e6d..f3e1305a94 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -244,8 +244,8 @@ CasePropertiesForm.caseDirField.text= CasePropertiesForm.caseTypeField.text= CasePropertiesForm.dbNameField.text= IngestJobInfoPanel.jButton1.text=Refresh -IngestJobInfoPanel.jTable1.columnModel.title1=Start Time -IngestJobInfoPanel.jTable1.columnModel.title0=Content -IngestJobInfoPanel.jTable1.columnModel.title4=Ingest Modules -IngestJobInfoPanel.jTable1.columnModel.title3=Ingest Status -IngestJobInfoPanel.jTable1.columnModel.title2=End Time +IngestJobInfoPanel.ingestJobTable.columnModel.title3=Ingest Status +IngestJobInfoPanel.ingestJobTable.columnModel.title2=End Time +IngestJobInfoPanel.ingestJobTable.columnModel.title1=Start Time +IngestJobInfoPanel.ingestJobTable.columnModel.title0=Content +IngestJobInfoPanel.jLabel1.text=Ingest Modules diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.form b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.form index a4c9690b20..1bb24b57c5 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.form @@ -41,7 +41,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java index 834468315c..74a491932e 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java @@ -6,6 +6,11 @@ package org.sleuthkit.autopsy.casemodule; import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.JOptionPane; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import org.openide.util.NbBundle.Messages; /** @@ -14,6 +19,8 @@ import org.openide.util.NbBundle.Messages; */ public class CaseInformationPanel extends javax.swing.JPanel { + private static final Logger logger = Logger.getLogger(CaseInformationPanel.class.getName()); + /** * Creates new form CaseInformationPanel */ @@ -21,25 +28,34 @@ public class CaseInformationPanel extends javax.swing.JPanel { initComponents(); customizeComponents(); } - - @Messages({"CaseInformationPanel.caseDetails.header=Case Details"}) + + @Messages({"CaseInformationPanel.caseDetails.header=Case Details", + "CaseInformationPanel.ingestJobInfo.header=Ingest Job Information", + "CaseInformationPanel.loadMetadataFail.message=Failed to load case metadata.", + "CaseInformationPanel.loadMetadataFail.title=Metadata load failure",}) private void customizeComponents() { try { Case currentCase = Case.getCurrentCase(); String crDate = currentCase.getCreatedDate(); String caseDir = currentCase.getCaseDirectory(); - + // put the image paths information into hashmap Map imgPaths = Case.getImagePaths(currentCase.getSleuthkitCase()); CasePropertiesForm cpf = new CasePropertiesForm(currentCase, crDate, caseDir, imgPaths); cpf.setSize(cpf.getPreferredSize()); this.tabbedPane.addTab(Bundle.CaseInformationPanel_caseDetails_header(), cpf); - this.tabbedPane.addTab("TEST", new IngestJobInfoPanel()); + this.tabbedPane.addTab(Bundle.CaseInformationPanel_ingestJobInfo_header(), new IngestJobInfoPanel()); + this.tabbedPane.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + tabbedPane.getSelectedComponent().setSize(tabbedPane.getSelectedComponent().getPreferredSize()); + } + }); } catch (CaseMetadata.CaseMetadataException ex) { - //TOLOG + logger.log(Level.SEVERE, "Failed to load case metadata.", ex); + JOptionPane.showMessageDialog(null, Bundle.IngestJobInfoPanel_loadIngestJob_error_text(), Bundle.IngestJobInfoPanel_loadIngestJob_error_title(), JOptionPane.ERROR_MESSAGE); } } - /** * This method is called from within the constructor to initialize the form. @@ -64,7 +80,7 @@ public class CaseInformationPanel extends javax.swing.JPanel { jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 228, Short.MAX_VALUE) + .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 231, Short.MAX_VALUE) .addGap(0, 0, 0)) ); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form index 282851f644..6e64131b97 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form @@ -1,6 +1,11 @@ + + + + + @@ -17,22 +22,32 @@ - - - - - - + + + + + + + + + - - - + + + + + + + + + + @@ -51,58 +66,51 @@ - + - +
-
- - + + - <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.jTable1.columnModel.title0" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> + <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.ingestJobTable.columnModel.title0" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> - + - <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.jTable1.columnModel.title1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> + <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.ingestJobTable.columnModel.title1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> - + - <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.jTable1.columnModel.title2" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> + <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.ingestJobTable.columnModel.title2" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> - + - <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.jTable1.columnModel.title3" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> - - - - - - - <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.jTable1.columnModel.title4" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> + <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.ingestJobTable.columnModel.title3" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> + - +
@@ -118,5 +126,31 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java index ca735364d9..32596ef06e 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java @@ -10,7 +10,10 @@ import java.text.SimpleDateFormat; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; +import javax.swing.AbstractListModel; import javax.swing.JOptionPane; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; import javax.swing.table.DefaultTableModel; import org.openide.util.NbBundle.Messages; import org.sleuthkit.datamodel.IngestJobInfo; @@ -23,8 +26,9 @@ import org.sleuthkit.datamodel.TskCoreException; * @author oliver */ public class IngestJobInfoPanel extends javax.swing.JPanel { - + private static final Logger logger = Logger.getLogger(IngestJobInfoPanel.class.getName()); + private List ingestJobs; /** * Creates new form IngestJobInfoPanel @@ -33,15 +37,53 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { initComponents(); customizeComponents(); } - + @Messages({"IngestJobInfoPanel.loadIngestJob.error.text=Failed to load ingest jobs.", "IngestJobInfoPanel.loadIngestJob.error.title=Load Failure"}) private void customizeComponents() { SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase(); DateFormat datetimeFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); - this.jScrollPane1.setViewportView(this.jTable1); + DefaultTableModel model = (DefaultTableModel) this.ingestJobTable.getModel(); + this.ingestJobTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { + @Override + public void valueChanged(ListSelectionEvent e) { + int selectedIndex = ingestJobTable.getSelectedRow(); + if (selectedIndex != -1) { + IngestJobInfo selectedJob = ingestJobs.get(selectedIndex); + List ingestModules = selectedJob.getIngestModuleInfo(); + ingestModuleList.setModel(new AbstractListModel() { + IngestModuleInfo[] ingestModuleInfo = ingestModules.toArray(new IngestModuleInfo[ingestModules.size()]); + + @Override + public int getSize() { + return ingestModuleInfo.length; + } + + @Override + public String getElementAt(int index) { + return ingestModuleInfo[index].getDisplayName() + " - " + ingestModuleInfo[index].getVersion(); + } + }); + } else { + ingestModuleList.setModel(new AbstractListModel() { + + @Override + public int getSize() { + return 0; + } + + @Override + public String getElementAt(int index) { + return ""; + } + }); + } + } + }); + try { List ingestJobs = skCase.getIngestJobs(); + this.ingestJobs = ingestJobs; for (IngestJobInfo ingestJob : ingestJobs) { Object[] row = new Object[5]; row[0] = skCase.getContentById(ingestJob.getObjectId()).getName(); @@ -56,9 +98,10 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { ingestModules = ingestModules.substring(0, ingestModules.length() - 2); } row[4] = ingestModules; - DefaultTableModel model = (DefaultTableModel) this.jTable1.getModel(); + model.addRow(row); } + } catch (TskCoreException ex) { logger.log(Level.SEVERE, "Failed to load ingest jobs.", ex); JOptionPane.showMessageDialog(null, Bundle.IngestJobInfoPanel_loadIngestJob_error_text(), Bundle.IngestJobInfoPanel_loadIngestJob_error_title(), JOptionPane.ERROR_MESSAGE); @@ -75,24 +118,29 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); - jTable1 = new javax.swing.JTable(); + ingestJobTable = new javax.swing.JTable(); jButton1 = new javax.swing.JButton(); + jScrollPane2 = new javax.swing.JScrollPane(); + ingestModuleList = new javax.swing.JList<>(); + jLabel1 = new javax.swing.JLabel(); + + setMinimumSize(new java.awt.Dimension(691, 451)); jScrollPane1.setBorder(null); - jTable1.setModel(new javax.swing.table.DefaultTableModel( + ingestJobTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { }, new String [] { - "Content", "Start Time", "End Time", "Ingest Status", "Ingest Modules" + "Content", "Start Time", "End Time", "Ingest Status" } ) { Class[] types = new Class [] { - java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class + java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class }; boolean[] canEdit = new boolean [] { - false, false, false, false, false + false, false, false, false }; public Class getColumnClass(int columnIndex) { @@ -103,19 +151,15 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { return canEdit [columnIndex]; } }); - jScrollPane1.setViewportView(jTable1); - if (jTable1.getColumnModel().getColumnCount() > 0) { - jTable1.getColumnModel().getColumn(0).setMinWidth(100); - jTable1.getColumnModel().getColumn(0).setHeaderValue(org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.jTable1.columnModel.title0")); // NOI18N - jTable1.getColumnModel().getColumn(1).setMinWidth(100); - jTable1.getColumnModel().getColumn(1).setHeaderValue(org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.jTable1.columnModel.title1")); // NOI18N - jTable1.getColumnModel().getColumn(2).setMinWidth(100); - jTable1.getColumnModel().getColumn(2).setHeaderValue(org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.jTable1.columnModel.title2")); // NOI18N - jTable1.getColumnModel().getColumn(3).setMinWidth(100); - jTable1.getColumnModel().getColumn(3).setHeaderValue(org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.jTable1.columnModel.title3")); // NOI18N - jTable1.getColumnModel().getColumn(4).setMinWidth(150); - jTable1.getColumnModel().getColumn(4).setPreferredWidth(250); - jTable1.getColumnModel().getColumn(4).setHeaderValue(org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.jTable1.columnModel.title4")); // NOI18N + ingestJobTable.setColumnSelectionAllowed(true); + ingestJobTable.getTableHeader().setReorderingAllowed(false); + jScrollPane1.setViewportView(ingestJobTable); + ingestJobTable.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); + if (ingestJobTable.getColumnModel().getColumnCount() > 0) { + ingestJobTable.getColumnModel().getColumn(0).setHeaderValue(org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.ingestJobTable.columnModel.title0")); // NOI18N + ingestJobTable.getColumnModel().getColumn(1).setHeaderValue(org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.ingestJobTable.columnModel.title1")); // NOI18N + ingestJobTable.getColumnModel().getColumn(2).setHeaderValue(org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.ingestJobTable.columnModel.title2")); // NOI18N + ingestJobTable.getColumnModel().getColumn(3).setHeaderValue(org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.ingestJobTable.columnModel.title3")); // NOI18N } org.openide.awt.Mnemonics.setLocalizedText(jButton1, org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.jButton1.text")); // NOI18N @@ -125,22 +169,34 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { } }); + jScrollPane2.setViewportView(ingestModuleList); + + org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.jLabel1.text")); // NOI18N + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() - .addContainerGap(617, Short.MAX_VALUE) - .addComponent(jButton1))) - .addGap(0, 0, 0)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jButton1)) + .addGroup(layout.createSequentialGroup() + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 470, Short.MAX_VALUE) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 203, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel1))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 416, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 422, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addGap(8, 8, 8) + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane2))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton1)) ); @@ -152,8 +208,11 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JTable ingestJobTable; + private javax.swing.JList ingestModuleList; private javax.swing.JButton jButton1; + private javax.swing.JLabel jLabel1; private javax.swing.JScrollPane jScrollPane1; - private javax.swing.JTable jTable1; + private javax.swing.JScrollPane jScrollPane2; // End of variables declaration//GEN-END:variables } From 4701a418ce4fb0b9f9cdc8e29fa553746a82498c Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Wed, 15 Jun 2016 12:55:03 -0400 Subject: [PATCH 05/17] Updated case properties window. --- .../autopsy/casemodule/Bundle.properties | 1 + .../casemodule/CaseInformationPanel.form | 2 +- .../casemodule/CaseInformationPanel.java | 2 +- .../casemodule/CasePropertiesAction.java | 35 +++++----- .../casemodule/IngestJobInfoPanel.form | 64 +++++++++++++------ .../casemodule/IngestJobInfoPanel.java | 49 +++++++++----- 6 files changed, 100 insertions(+), 53 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index f3e1305a94..55d2ec5fdd 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -249,3 +249,4 @@ IngestJobInfoPanel.ingestJobTable.columnModel.title2=End Time IngestJobInfoPanel.ingestJobTable.columnModel.title1=Start Time IngestJobInfoPanel.ingestJobTable.columnModel.title0=Content IngestJobInfoPanel.jLabel1.text=Ingest Modules +IngestJobInfoPanel.jLabel2.text=Ingest Jobs diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.form b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.form index 1bb24b57c5..a4f392d3f4 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.form @@ -35,7 +35,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java index 74a491932e..ea5926fa9d 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java @@ -75,7 +75,7 @@ public class CaseInformationPanel extends javax.swing.JPanel { jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 691, Short.MAX_VALUE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java index b54d342a44..72b21a565c 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java @@ -54,31 +54,34 @@ final class CasePropertiesAction extends CallableSystemAction { */ @Override public void performAction() { - try { + if (popUpWindow == null) { // create the popUp window for it String title = NbBundle.getMessage(this.getClass(), "CasePropertiesAction.window.title"); final JFrame frame = new JFrame(title); popUpWindow = new JDialog(frame, title, false); // to make the popUp Window to be modal + try { - // create the case properties form - CaseInformationPanel caseInformationPanel = new CaseInformationPanel(); + // create the case properties form + CaseInformationPanel caseInformationPanel = new CaseInformationPanel(); - // add the case properties form / panel to the popup window - popUpWindow.add(caseInformationPanel); - popUpWindow.setResizable(true); - popUpWindow.pack(); - + // add the case properties form / panel to the popup window + popUpWindow.add(caseInformationPanel); + popUpWindow.setResizable(true); + popUpWindow.pack(); - // set the location of the popUp Window on the center of the screen - Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize(); - double w = popUpWindow.getSize().getWidth(); - double h = popUpWindow.getSize().getHeight(); - popUpWindow.setLocation((int) ((screenDimension.getWidth() - w) / 2), (int) ((screenDimension.getHeight() - h) / 2)); + // set the location of the popUp Window on the center of the screen + Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize(); + double w = popUpWindow.getSize().getWidth(); + double h = popUpWindow.getSize().getHeight(); + popUpWindow.setLocation((int) ((screenDimension.getWidth() - w) / 2), (int) ((screenDimension.getHeight() - h) / 2)); - popUpWindow.setVisible(true); - } catch (Exception ex) { - Logger.getLogger(CasePropertiesAction.class.getName()).log(Level.WARNING, "Error displaying Case Properties window.", ex); //NON-NLS + popUpWindow.setVisible(true); + } catch (Exception ex) { + Logger.getLogger(CasePropertiesAction.class.getName()).log(Level.WARNING, "Error displaying Case Properties window.", ex); //NON-NLS + } } + popUpWindow.setVisible(true); + popUpWindow.toFront(); } /** diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form index 6e64131b97..f7829d0be0 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form @@ -3,7 +3,7 @@
- + @@ -21,34 +21,45 @@ - - - - - - - + + - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + @@ -59,6 +70,9 @@ + + + @@ -108,7 +122,9 @@ - + + + @@ -127,6 +143,11 @@ + + + + + @@ -152,5 +173,12 @@ + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java index 32596ef06e..b85d5b220e 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java @@ -123,10 +123,12 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { jScrollPane2 = new javax.swing.JScrollPane(); ingestModuleList = new javax.swing.JList<>(); jLabel1 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); - setMinimumSize(new java.awt.Dimension(691, 451)); + setMinimumSize(null); jScrollPane1.setBorder(null); + jScrollPane1.setPreferredSize(null); ingestJobTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { @@ -151,7 +153,7 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { return canEdit [columnIndex]; } }); - ingestJobTable.setColumnSelectionAllowed(true); + ingestJobTable.setPreferredSize(null); ingestJobTable.getTableHeader().setReorderingAllowed(false); jScrollPane1.setViewportView(ingestJobTable); ingestJobTable.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); @@ -169,36 +171,48 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { } }); + jScrollPane2.setPreferredSize(null); + jScrollPane2.setViewportView(ingestModuleList); org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.jLabel1.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.jLabel2.text")); // NOI18N + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jButton1)) .addGroup(layout.createSequentialGroup() - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 470, Short.MAX_VALUE) - .addGap(18, 18, 18) + .addGap(15, 15, 15) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 203, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel1))) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 465, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel2) + .addGap(0, 0, Short.MAX_VALUE))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 203, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel1))) + .addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING)) + .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 422, Short.MAX_VALUE) - .addGroup(layout.createSequentialGroup() - .addGap(8, 8, 8) - .addComponent(jLabel1) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jScrollPane2))) + .addGap(8, 8, 8) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel1) + .addComponent(jLabel2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jButton1)) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) + .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 224, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton1) + .addContainerGap()) ); }// //GEN-END:initComponents @@ -212,6 +226,7 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { private javax.swing.JList ingestModuleList; private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; // End of variables declaration//GEN-END:variables From 3df2c41893106559185a18e1eeb7e7b2289520bb Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Wed, 15 Jun 2016 13:41:32 -0400 Subject: [PATCH 06/17] Made ingest modules display as a table. --- .../autopsy/casemodule/Bundle.properties | 6 + .../casemodule/IngestJobInfoPanel.form | 102 ++++++++-------- .../casemodule/IngestJobInfoPanel.java | 112 ++++++++++-------- 3 files changed, 124 insertions(+), 96 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index 55d2ec5fdd..99e90cc8b0 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -250,3 +250,9 @@ IngestJobInfoPanel.ingestJobTable.columnModel.title1=Start Time IngestJobInfoPanel.ingestJobTable.columnModel.title0=Content IngestJobInfoPanel.jLabel1.text=Ingest Modules IngestJobInfoPanel.jLabel2.text=Ingest Jobs +IngestJobInfoPanel.jTable1.columnModel.title3=Title 4 +IngestJobInfoPanel.jTable1.columnModel.title2=Title 3 +IngestJobInfoPanel.jTable2.columnModel.title3=Title 4 +IngestJobInfoPanel.jTable2.columnModel.title2=Title 3 +IngestJobInfoPanel.ingestModuleTable.columnModel.title1=Module Version +IngestJobInfoPanel.ingestModuleTable.columnModel.title0=Module Name diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form index f7829d0be0..ed68a4ddb6 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form @@ -1,11 +1,6 @@
- - - - - @@ -22,25 +17,25 @@ - - + + - - - - - + + - + - + - + + + + - + @@ -54,12 +49,12 @@ - - + + - + - + @@ -70,9 +65,6 @@ - - - @@ -142,30 +134,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -180,5 +148,45 @@ + + + + + + + + + + + + + +
+
+ + + + + <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.ingestModuleTable.columnModel.title0" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> + + + + + + + <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.ingestModuleTable.columnModel.title1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> + + + + + + + + + +
+
+
+
diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java index b85d5b220e..0011b7b5ca 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java @@ -10,7 +10,6 @@ import java.text.SimpleDateFormat; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; -import javax.swing.AbstractListModel; import javax.swing.JOptionPane; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; @@ -48,35 +47,23 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { @Override public void valueChanged(ListSelectionEvent e) { int selectedIndex = ingestJobTable.getSelectedRow(); + DefaultTableModel ingestModuleModel = (DefaultTableModel) ingestModuleTable.getModel(); if (selectedIndex != -1) { IngestJobInfo selectedJob = ingestJobs.get(selectedIndex); List ingestModules = selectedJob.getIngestModuleInfo(); - ingestModuleList.setModel(new AbstractListModel() { - IngestModuleInfo[] ingestModuleInfo = ingestModules.toArray(new IngestModuleInfo[ingestModules.size()]); - - @Override - public int getSize() { - return ingestModuleInfo.length; - } - - @Override - public String getElementAt(int index) { - return ingestModuleInfo[index].getDisplayName() + " - " + ingestModuleInfo[index].getVersion(); - } - }); + for (int i = 0; i < ingestModuleModel.getRowCount(); i++) { + ingestModuleModel.removeRow(0); + } + for (IngestModuleInfo ingestModule : ingestModules) { + Object[] row = new Object[2]; + row[0] = ingestModule.getDisplayName(); + row[1] = ingestModule.getVersion(); + ingestModuleModel.addRow(row); + } } else { - ingestModuleList.setModel(new AbstractListModel() { - - @Override - public int getSize() { - return 0; - } - - @Override - public String getElementAt(int index) { - return ""; - } - }); + for (int i = 0; i < ingestModuleModel.getRowCount(); i++) { + ingestModuleModel.removeRow(0); + } } } }); @@ -120,15 +107,12 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { jScrollPane1 = new javax.swing.JScrollPane(); ingestJobTable = new javax.swing.JTable(); jButton1 = new javax.swing.JButton(); - jScrollPane2 = new javax.swing.JScrollPane(); - ingestModuleList = new javax.swing.JList<>(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); - - setMinimumSize(null); + jScrollPane2 = new javax.swing.JScrollPane(); + ingestModuleTable = new javax.swing.JTable(); jScrollPane1.setBorder(null); - jScrollPane1.setPreferredSize(null); ingestJobTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { @@ -171,32 +155,62 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { } }); - jScrollPane2.setPreferredSize(null); - - jScrollPane2.setViewportView(ingestModuleList); - org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.jLabel1.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.jLabel2.text")); // NOI18N + ingestModuleTable.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + {null, null}, + {null, null}, + {null, null}, + {null, null} + }, + new String [] { + "Module Name", "Module Version" + } + ) { + Class[] types = new Class [] { + java.lang.String.class, java.lang.String.class + }; + boolean[] canEdit = new boolean [] { + false, false + }; + + public Class getColumnClass(int columnIndex) { + return types [columnIndex]; + } + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + jScrollPane2.setViewportView(ingestModuleTable); + if (ingestModuleTable.getColumnModel().getColumnCount() > 0) { + ingestModuleTable.getColumnModel().getColumn(0).setPreferredWidth(100); + ingestModuleTable.getColumnModel().getColumn(0).setHeaderValue(org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.ingestModuleTable.columnModel.title0")); // NOI18N + ingestModuleTable.getColumnModel().getColumn(1).setPreferredWidth(50); + ingestModuleTable.getColumnModel().getColumn(1).setHeaderValue(org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.ingestModuleTable.columnModel.title1")); // 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() - .addGap(15, 15, 15) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGroup(layout.createSequentialGroup() + .addGap(15, 15, 15) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 465, Short.MAX_VALUE) - .addGroup(layout.createSequentialGroup() - .addComponent(jLabel2) - .addGap(0, 0, Short.MAX_VALUE))) + .addComponent(jLabel2) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 492, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 203, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel1))) - .addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING)) + .addComponent(jLabel1) + .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 233, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addContainerGap() + .addComponent(jButton1))) .addContainerGap()) ); layout.setVerticalGroup( @@ -208,11 +222,11 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { .addComponent(jLabel2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) - .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 224, Short.MAX_VALUE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 162, Short.MAX_VALUE) + .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jButton1) - .addContainerGap()) + .addGap(6, 6, 6)) ); }// //GEN-END:initComponents @@ -223,7 +237,7 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTable ingestJobTable; - private javax.swing.JList ingestModuleList; + private javax.swing.JTable ingestModuleTable; private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; From 578a98d5ff525c54bca044067f023aaa8fcf4c80 Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Wed, 15 Jun 2016 16:05:31 -0400 Subject: [PATCH 07/17] Got rid of warnings in ingest module ui. --- .../autopsy/casemodule/Bundle.properties | 7 - .../casemodule/CaseInformationPanel.java | 10 +- .../casemodule/CasePropertiesAction.java | 4 +- .../casemodule/IngestJobInfoPanel.form | 107 +------ .../casemodule/IngestJobInfoPanel.java | 273 +++++++++--------- .../autopsy/ingest/IngestMessagePanel.form | 3 + .../autopsy/ingest/IngestMessagePanel.java | 11 +- 7 files changed, 167 insertions(+), 248 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index 99e90cc8b0..7bcb9d08e7 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -243,16 +243,9 @@ CasePropertiesForm.crDateField.text= CasePropertiesForm.caseDirField.text= CasePropertiesForm.caseTypeField.text= CasePropertiesForm.dbNameField.text= -IngestJobInfoPanel.jButton1.text=Refresh -IngestJobInfoPanel.ingestJobTable.columnModel.title3=Ingest Status -IngestJobInfoPanel.ingestJobTable.columnModel.title2=End Time -IngestJobInfoPanel.ingestJobTable.columnModel.title1=Start Time -IngestJobInfoPanel.ingestJobTable.columnModel.title0=Content IngestJobInfoPanel.jLabel1.text=Ingest Modules IngestJobInfoPanel.jLabel2.text=Ingest Jobs IngestJobInfoPanel.jTable1.columnModel.title3=Title 4 IngestJobInfoPanel.jTable1.columnModel.title2=Title 3 IngestJobInfoPanel.jTable2.columnModel.title3=Title 4 IngestJobInfoPanel.jTable2.columnModel.title2=Title 3 -IngestJobInfoPanel.ingestModuleTable.columnModel.title1=Module Version -IngestJobInfoPanel.ingestModuleTable.columnModel.title0=Module Name diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java index ea5926fa9d..3e4cb07856 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java @@ -10,7 +10,6 @@ import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JOptionPane; import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; import org.openide.util.NbBundle.Messages; /** @@ -30,7 +29,7 @@ public class CaseInformationPanel extends javax.swing.JPanel { } @Messages({"CaseInformationPanel.caseDetails.header=Case Details", - "CaseInformationPanel.ingestJobInfo.header=Ingest Job Information", + "CaseInformationPanel.ingestJobInfo.header=Ingest History", "CaseInformationPanel.loadMetadataFail.message=Failed to load case metadata.", "CaseInformationPanel.loadMetadataFail.title=Metadata load failure",}) private void customizeComponents() { @@ -45,11 +44,8 @@ public class CaseInformationPanel extends javax.swing.JPanel { cpf.setSize(cpf.getPreferredSize()); this.tabbedPane.addTab(Bundle.CaseInformationPanel_caseDetails_header(), cpf); this.tabbedPane.addTab(Bundle.CaseInformationPanel_ingestJobInfo_header(), new IngestJobInfoPanel()); - this.tabbedPane.addChangeListener(new ChangeListener() { - @Override - public void stateChanged(ChangeEvent e) { - tabbedPane.getSelectedComponent().setSize(tabbedPane.getSelectedComponent().getPreferredSize()); - } + this.tabbedPane.addChangeListener((ChangeEvent e) -> { + tabbedPane.getSelectedComponent().setSize(tabbedPane.getSelectedComponent().getPreferredSize()); }); } catch (CaseMetadata.CaseMetadataException ex) { logger.log(Level.SEVERE, "Failed to load case metadata.", ex); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java index 72b21a565c..220edfeacc 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java @@ -80,8 +80,8 @@ final class CasePropertiesAction extends CallableSystemAction { Logger.getLogger(CasePropertiesAction.class.getName()).log(Level.WARNING, "Error displaying Case Properties window.", ex); //NON-NLS } } - popUpWindow.setVisible(true); - popUpWindow.toFront(); + popUpWindow.setVisible(true); + popUpWindow.toFront(); } /** diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form index ed68a4ddb6..a67b768492 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.form @@ -17,25 +17,17 @@ + - - - - - - - - - - - - - - - - + + - + + + + + + @@ -52,9 +44,7 @@ - - - +
@@ -74,48 +64,11 @@ - - - - - - -
+ + - - - - <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.ingestJobTable.columnModel.title0" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> - - - - - - - <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.ingestJobTable.columnModel.title1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> - - - - - - - <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.ingestJobTable.columnModel.title2" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> - - - - - - - <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.ingestJobTable.columnModel.title3" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> - - - - - - - - + @@ -124,16 +77,6 @@
- - - - - - - - - - @@ -157,29 +100,11 @@ - - - - -
+ + - - - - <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.ingestModuleTable.columnModel.title0" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> - - - - - - - <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="IngestJobInfoPanel.ingestModuleTable.columnModel.title1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> - - - - - + diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java index 0011b7b5ca..090a19545a 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java @@ -5,16 +5,19 @@ */ package org.sleuthkit.autopsy.casemodule; +import java.beans.PropertyChangeEvent; import java.text.DateFormat; import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JOptionPane; import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import javax.swing.table.DefaultTableModel; +import javax.swing.table.AbstractTableModel; import org.openide.util.NbBundle.Messages; +import org.sleuthkit.autopsy.ingest.IngestManager; import org.sleuthkit.datamodel.IngestJobInfo; import org.sleuthkit.datamodel.IngestModuleInfo; import org.sleuthkit.datamodel.SleuthkitCase; @@ -28,6 +31,9 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { private static final Logger logger = Logger.getLogger(IngestJobInfoPanel.class.getName()); private List ingestJobs; + private IngestJobTableModel ingestJobTableModel = new IngestJobTableModel(); + private IngestModuleTableModel ingestModuleTableModel = new IngestModuleTableModel(null); + private final DateFormat datetimeFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); /** * Creates new form IngestJobInfoPanel @@ -40,61 +46,136 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { @Messages({"IngestJobInfoPanel.loadIngestJob.error.text=Failed to load ingest jobs.", "IngestJobInfoPanel.loadIngestJob.error.title=Load Failure"}) private void customizeComponents() { - SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase(); - DateFormat datetimeFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); - DefaultTableModel model = (DefaultTableModel) this.ingestJobTable.getModel(); - this.ingestJobTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { - @Override - public void valueChanged(ListSelectionEvent e) { - int selectedIndex = ingestJobTable.getSelectedRow(); - DefaultTableModel ingestModuleModel = (DefaultTableModel) ingestModuleTable.getModel(); - if (selectedIndex != -1) { - IngestJobInfo selectedJob = ingestJobs.get(selectedIndex); - List ingestModules = selectedJob.getIngestModuleInfo(); - for (int i = 0; i < ingestModuleModel.getRowCount(); i++) { - ingestModuleModel.removeRow(0); - } - for (IngestModuleInfo ingestModule : ingestModules) { - Object[] row = new Object[2]; - row[0] = ingestModule.getDisplayName(); - row[1] = ingestModule.getVersion(); - ingestModuleModel.addRow(row); - } - } else { - for (int i = 0; i < ingestModuleModel.getRowCount(); i++) { - ingestModuleModel.removeRow(0); - } - } - } + refresh(); + this.ingestJobTable.getSelectionModel().addListSelectionListener((ListSelectionEvent e) -> { + this.ingestModuleTableModel = new IngestModuleTableModel(this.ingestJobs.get(ingestJobTable.getSelectedRow())); + this.ingestModuleTable.setModel(this.ingestModuleTableModel); }); + IngestManager.getInstance().addIngestJobEventListener((PropertyChangeEvent evt) -> { + if (evt.getPropertyName().equals(IngestManager.IngestJobEvent.STARTED.toString()) + || evt.getPropertyName().equals(IngestManager.IngestJobEvent.CANCELLED.toString()) + || evt.getPropertyName().equals(IngestManager.IngestJobEvent.COMPLETED.toString())) { + refresh(); + } + }); + } + + private void refresh() { + SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase(); try { List ingestJobs = skCase.getIngestJobs(); this.ingestJobs = ingestJobs; - for (IngestJobInfo ingestJob : ingestJobs) { - Object[] row = new Object[5]; - row[0] = skCase.getContentById(ingestJob.getObjectId()).getName(); - row[1] = datetimeFormat.format(ingestJob.getStartDateTime()); - row[2] = datetimeFormat.format(ingestJob.getEndDateTime()); - row[3] = ingestJob.getStatus().getDisplayName(); - String ingestModules = ""; - for (IngestModuleInfo ingestModule : ingestJob.getIngestModuleInfo()) { - ingestModules += ingestModule.getDisplayName() + ", "; - } - if (ingestModules.length() > 2) { - ingestModules = ingestModules.substring(0, ingestModules.length() - 2); - } - row[4] = ingestModules; - - model.addRow(row); - } - } catch (TskCoreException ex) { logger.log(Level.SEVERE, "Failed to load ingest jobs.", ex); JOptionPane.showMessageDialog(null, Bundle.IngestJobInfoPanel_loadIngestJob_error_text(), Bundle.IngestJobInfoPanel_loadIngestJob_error_title(), JOptionPane.ERROR_MESSAGE); } } + @Messages({"IngestJobInfoPanel.IngestJobTableModel.DataSource.header=Data Source", + "IngestJobInfoPanel.IngestJobTableModel.StartTime.header=Start Time", + "IngestJobInfoPanel.IngestJobTableModel.EndTime.header=End Time", + "IngestJobInfoPanel.IngestJobTableModel.IngestStatus.header=Ingest Status"}) + private class IngestJobTableModel extends AbstractTableModel { + + private List columnHeaders = new ArrayList<>(); + + IngestJobTableModel() { + columnHeaders.add(Bundle.IngestJobInfoPanel_IngestJobTableModel_DataSource_header()); + columnHeaders.add(Bundle.IngestJobInfoPanel_IngestJobTableModel_StartTime_header()); + columnHeaders.add(Bundle.IngestJobInfoPanel_IngestJobTableModel_EndTime_header()); + columnHeaders.add(Bundle.IngestJobInfoPanel_IngestJobTableModel_IngestStatus_header()); + } + + @Override + public int getRowCount() { + return ingestJobs.size(); + } + + @Override + public int getColumnCount() { + return columnHeaders.size(); + } + + @Override + public Object getValueAt(int rowIndex, int columnIndex) { + IngestJobInfo currIngestJob = ingestJobs.get(rowIndex); + SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase(); + if (columnIndex == 0) { + try { + return skCase.getContentById(currIngestJob.getObjectId()).getName(); + } catch (TskCoreException ex) { + logger.log(Level.SEVERE, "Failed to get content from db", ex); + return ""; + } + } else if (columnIndex == 1) { + return datetimeFormat.format(currIngestJob.getStartDateTime()); + } else if (columnIndex == 2) { + Date endDate = currIngestJob.getEndDateTime(); + if (endDate.getTime() == 0) { + return "N/A"; + } + return datetimeFormat.format(currIngestJob.getEndDateTime()); + } else if (columnIndex == 3) { + return currIngestJob.getStatus().getDisplayName(); + } + return null; + } + + @Override + public String getColumnName(int column) { + return columnHeaders.get(column); + } + + } + + @Messages({"IngestJobInfoPanel.IngestModuleTableModel.ModuleName.header=Module Name", + "IngestJobInfoPanel.IngestModuleTableModel.ModuleVersion.header=Module Version"}) + private class IngestModuleTableModel extends AbstractTableModel { + + private List columnHeaders = new ArrayList<>(); + private IngestJobInfo currJob; + + IngestModuleTableModel(IngestJobInfo currJob) { + columnHeaders.add(Bundle.IngestJobInfoPanel_IngestModuleTableModel_ModuleName_header()); + columnHeaders.add(Bundle.IngestJobInfoPanel_IngestModuleTableModel_ModuleVersion_header()); + this.currJob = currJob; + } + + @Override + public int getRowCount() { + if (currJob == null) { + return 0; + } + return currJob.getIngestModuleInfo().size(); + } + + @Override + public int getColumnCount() { + return columnHeaders.size(); + } + + @Override + public Object getValueAt(int rowIndex, int columnIndex) { + if (currJob != null) { + IngestModuleInfo currIngestModule = currJob.getIngestModuleInfo().get(rowIndex); + if (columnIndex == 0) { + return currIngestModule.getDisplayName(); + } else if (columnIndex == 1) { + return currIngestModule.getVersion(); + } + return null; + } + return null; + } + + @Override + public String getColumnName(int column) { + return columnHeaders.get(column); + } + + } + /** * 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 @@ -106,7 +187,6 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { jScrollPane1 = new javax.swing.JScrollPane(); ingestJobTable = new javax.swing.JTable(); - jButton1 = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jScrollPane2 = new javax.swing.JScrollPane(); @@ -114,103 +194,31 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { jScrollPane1.setBorder(null); - ingestJobTable.setModel(new javax.swing.table.DefaultTableModel( - new Object [][] { - - }, - new String [] { - "Content", "Start Time", "End Time", "Ingest Status" - } - ) { - Class[] types = new Class [] { - java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class - }; - boolean[] canEdit = new boolean [] { - false, false, false, false - }; - - public Class getColumnClass(int columnIndex) { - return types [columnIndex]; - } - - public boolean isCellEditable(int rowIndex, int columnIndex) { - return canEdit [columnIndex]; - } - }); - ingestJobTable.setPreferredSize(null); + ingestJobTable.setModel(ingestJobTableModel); ingestJobTable.getTableHeader().setReorderingAllowed(false); jScrollPane1.setViewportView(ingestJobTable); ingestJobTable.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); - if (ingestJobTable.getColumnModel().getColumnCount() > 0) { - ingestJobTable.getColumnModel().getColumn(0).setHeaderValue(org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.ingestJobTable.columnModel.title0")); // NOI18N - ingestJobTable.getColumnModel().getColumn(1).setHeaderValue(org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.ingestJobTable.columnModel.title1")); // NOI18N - ingestJobTable.getColumnModel().getColumn(2).setHeaderValue(org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.ingestJobTable.columnModel.title2")); // NOI18N - ingestJobTable.getColumnModel().getColumn(3).setHeaderValue(org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.ingestJobTable.columnModel.title3")); // NOI18N - } - - org.openide.awt.Mnemonics.setLocalizedText(jButton1, org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.jButton1.text")); // NOI18N - jButton1.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - jButton1ActionPerformed(evt); - } - }); org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.jLabel1.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.jLabel2.text")); // NOI18N - ingestModuleTable.setModel(new javax.swing.table.DefaultTableModel( - new Object [][] { - {null, null}, - {null, null}, - {null, null}, - {null, null} - }, - new String [] { - "Module Name", "Module Version" - } - ) { - Class[] types = new Class [] { - java.lang.String.class, java.lang.String.class - }; - boolean[] canEdit = new boolean [] { - false, false - }; - - public Class getColumnClass(int columnIndex) { - return types [columnIndex]; - } - - public boolean isCellEditable(int rowIndex, int columnIndex) { - return canEdit [columnIndex]; - } - }); + ingestModuleTable.setModel(ingestModuleTableModel); jScrollPane2.setViewportView(ingestModuleTable); - if (ingestModuleTable.getColumnModel().getColumnCount() > 0) { - ingestModuleTable.getColumnModel().getColumn(0).setPreferredWidth(100); - ingestModuleTable.getColumnModel().getColumn(0).setHeaderValue(org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.ingestModuleTable.columnModel.title0")); // NOI18N - ingestModuleTable.getColumnModel().getColumn(1).setPreferredWidth(50); - ingestModuleTable.getColumnModel().getColumn(1).setHeaderValue(org.openide.util.NbBundle.getMessage(IngestJobInfoPanel.class, "IngestJobInfoPanel.ingestModuleTable.columnModel.title1")); // 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() + .addGap(15, 15, 15) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(15, 15, 15) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel2) - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 492, Short.MAX_VALUE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel1) - .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 233, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addContainerGap() - .addComponent(jButton1))) + .addComponent(jLabel2) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 485, Short.MAX_VALUE)) + .addGap(8, 8, 8) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 254, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel1)) .addContainerGap()) ); layout.setVerticalGroup( @@ -224,21 +232,14 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 162, Short.MAX_VALUE) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(jButton1) - .addGap(6, 6, 6)) + .addGap(10, 10, 10)) ); }// //GEN-END:initComponents - private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed - // TODO add your handling code here: - }//GEN-LAST:event_jButton1ActionPerformed - // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTable ingestJobTable; private javax.swing.JTable ingestModuleTable; - private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JScrollPane jScrollPane1; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.form b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.form index 719e9d6ce7..932ef4c075 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.form +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.form @@ -67,6 +67,9 @@ + + + diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.java index c06f91a497..b90844c538 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.java @@ -35,10 +35,9 @@ import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.logging.Level; import javax.swing.JLabel; import javax.swing.JPanel; -import org.openide.util.NbBundle; -import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.JTable; import javax.swing.ListSelectionModel; import javax.swing.SwingConstants; @@ -49,10 +48,12 @@ import javax.swing.event.TableModelListener; import javax.swing.table.AbstractTableModel; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableCellRenderer; -import org.sleuthkit.autopsy.ingest.IngestMessage.*; -import org.sleuthkit.datamodel.BlackboardArtifact; +import org.openide.util.NbBundle; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; -import java.util.logging.Level; +import org.sleuthkit.autopsy.ingest.IngestMessage.*; +import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType; +import org.sleuthkit.datamodel.BlackboardArtifact; /** * Notification window showing messages from modules to user From a51cefde35c75308af5e06ffddfb2ce0b8cb72cc Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Thu, 16 Jun 2016 09:27:47 -0400 Subject: [PATCH 08/17] got rid of errant documentation, documented, and repainted UI on load of new information. --- .../autopsy/casemodule/Bundle.properties | 11 -------- .../casemodule/CasePropertiesForm.form | 28 ++----------------- .../casemodule/CasePropertiesForm.java | 11 +------- .../casemodule/IngestJobInfoPanel.java | 1 + 4 files changed, 4 insertions(+), 47 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index 7bcb9d08e7..5b70a17495 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -236,16 +236,5 @@ CasePropertiesForm.imagesTable.columnModel.title1=Remove CasePropertiesForm.imagesTable.columnModel.title0=Path LocalFilesPanel.jButton1.text=Change LocalFilesPanel.displayNameLabel.text=Logical File Set Display Name: Default -CaseInformationPanel.jPanel1.TabConstraints.tabTitle=tab1 -CasePropertiesForm.caseNumberField.text= -CasePropertiesForm.examinerField.text= -CasePropertiesForm.crDateField.text= -CasePropertiesForm.caseDirField.text= -CasePropertiesForm.caseTypeField.text= -CasePropertiesForm.dbNameField.text= IngestJobInfoPanel.jLabel1.text=Ingest Modules IngestJobInfoPanel.jLabel2.text=Ingest Jobs -IngestJobInfoPanel.jTable1.columnModel.title3=Title 4 -IngestJobInfoPanel.jTable1.columnModel.title2=Title 3 -IngestJobInfoPanel.jTable2.columnModel.title3=Title 4 -IngestJobInfoPanel.jTable2.columnModel.title2=Title 3 diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.form b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.form index 9ceccdad62..e2b4940105 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.form @@ -126,9 +126,9 @@ - + - + @@ -283,31 +283,13 @@
- - - - - - - - - - - - - - - - - - @@ -315,9 +297,6 @@ - - - @@ -325,9 +304,6 @@ - - - diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.java b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.java index 80605bc8c1..f4cc9cb24e 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.java @@ -196,19 +196,10 @@ class CasePropertiesForm extends javax.swing.JPanel { lbDbName.setFont(lbDbName.getFont().deriveFont(lbDbName.getFont().getStyle() & ~java.awt.Font.BOLD, 11)); lbDbName.setText(org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.lbDbName.text")); // NOI18N - caseNumberField.setText(org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.caseNumberField.text")); // NOI18N - - examinerField.setText(org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.examinerField.text")); // NOI18N - - crDateField.setText(org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.crDateField.text")); // NOI18N - - caseDirField.setText(org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.caseDirField.text")); // NOI18N caseDirField.setMinimumSize(new java.awt.Dimension(25, 14)); - dbNameField.setText(org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.dbNameField.text")); // NOI18N dbNameField.setMinimumSize(new java.awt.Dimension(25, 14)); - caseTypeField.setText(org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.caseTypeField.text")); // NOI18N caseTypeField.setMaximumSize(new java.awt.Dimension(1, 0)); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); @@ -276,7 +267,7 @@ class CasePropertiesForm extends javax.swing.JPanel { .addComponent(caseDirLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(caseDirField, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(caseTypeField, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbDbType)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java index 090a19545a..6fd90bf969 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java @@ -66,6 +66,7 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { try { List ingestJobs = skCase.getIngestJobs(); this.ingestJobs = ingestJobs; + this.repaint(); } catch (TskCoreException ex) { logger.log(Level.SEVERE, "Failed to load ingest jobs.", ex); JOptionPane.showMessageDialog(null, Bundle.IngestJobInfoPanel_loadIngestJob_error_text(), Bundle.IngestJobInfoPanel_loadIngestJob_error_title(), JOptionPane.ERROR_MESSAGE); From b5c56a5f95954ef63d661f14127ad44b1a23ce16 Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Wed, 22 Jun 2016 08:38:10 -0400 Subject: [PATCH 09/17] Final changes to UI of ingest job tracking. --- .../casemodule/CaseInformationPanel.java | 27 ++- .../casemodule/CasePropertiesAction.java | 4 +- .../casemodule/IngestJobInfoPanel.java | 22 ++- .../autopsy/images/information-frame.png | Bin 0 -> 897 bytes .../autopsy/images/warning_triangle.png | Bin 0 -> 1689 bytes .../autopsy/ingest/Bundle.properties | 1 + .../ingest/IngestJobSettingsPanel.form | 55 +++--- .../ingest/IngestJobSettingsPanel.java | 170 +++++++++++++++--- .../ingest/RunIngestModulesDialog.java | 5 +- .../FileExtMismatchDetectorModuleFactory.java | 7 +- 10 files changed, 223 insertions(+), 68 deletions(-) create mode 100755 Core/src/org/sleuthkit/autopsy/images/information-frame.png create mode 100755 Core/src/org/sleuthkit/autopsy/images/warning_triangle.png diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java index 3e4cb07856..08ba9dcd58 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Autopsy Forensic Browser + * + * Copyright 2011-2016 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; @@ -13,8 +26,8 @@ import javax.swing.event.ChangeEvent; import org.openide.util.NbBundle.Messages; /** - * - * @author oliver + * Panel for displaying the case information, including both case details and + * ingest job history. */ public class CaseInformationPanel extends javax.swing.JPanel { @@ -52,6 +65,10 @@ public class CaseInformationPanel extends javax.swing.JPanel { JOptionPane.showMessageDialog(null, Bundle.IngestJobInfoPanel_loadIngestJob_error_text(), Bundle.IngestJobInfoPanel_loadIngestJob_error_title(), JOptionPane.ERROR_MESSAGE); } } + + public void setSelectedTab(int tab) { + this.tabbedPane.setSelectedComponent(this.tabbedPane.getComponent(1)); + } /** * This method is called from within the constructor to initialize the form. diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java index 220edfeacc..81f4a05d5f 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java @@ -58,13 +58,11 @@ final class CasePropertiesAction extends CallableSystemAction { // create the popUp window for it String title = NbBundle.getMessage(this.getClass(), "CasePropertiesAction.window.title"); final JFrame frame = new JFrame(title); - popUpWindow = new JDialog(frame, title, false); // to make the popUp Window to be modal + popUpWindow = new JDialog(frame, title, false); try { - // create the case properties form CaseInformationPanel caseInformationPanel = new CaseInformationPanel(); - // add the case properties form / panel to the popup window popUpWindow.add(caseInformationPanel); popUpWindow.setResizable(true); popUpWindow.pack(); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java index 6fd90bf969..cfcd875835 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Autopsy Forensic Browser + * + * Copyright 2011-2016 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; @@ -24,8 +37,7 @@ import org.sleuthkit.datamodel.SleuthkitCase; import org.sleuthkit.datamodel.TskCoreException; /** - * - * @author oliver + * Panel for displaying ingest job history. */ public class IngestJobInfoPanel extends javax.swing.JPanel { diff --git a/Core/src/org/sleuthkit/autopsy/images/information-frame.png b/Core/src/org/sleuthkit/autopsy/images/information-frame.png new file mode 100755 index 0000000000000000000000000000000000000000..a7b53a7f6277b8e82fb4612f55c31782033a5295 GIT binary patch literal 897 zcmV-{1AhF8P)VA_VTb`mQIJR^-uCzR_a&3br_}X=r1O~E z+}zBoGQ6d;vvY4a96mn$0p94t46feNaO+79@njx~P4({C*|v#xD#v0mhLfbS90&w> zE9<+uy7q=bp?#+>Phj+0HL7MUKy9rTZnqmnQ^hM{9=%Ls|MtKNS(Xhl`N1Yqxm@=8 z{r(N@?Hj|VE=@qL_QK_IVQlO>&K**5{;-NKQx7oj;*_yRp_VA=ko>o9(;w<=@Bp& z>PKK}lxkB1k-xdr)p;-yFJsNN1wm%nz?IGB@NUe&!bTIiUP5L%hy2exB4_;~wYyGz zfkn0ngIvBub1NtmifrmqC{=t67)BXdj1( zgRD%0i+vQ*Oo@_S4VfmIhAv>I(+SB+CW>7cm@vd#Kw^U|ul_9_|2Vp=$&Rd+fkT}Q z*+!5u1FNbk+T6z~|0*E3$VOTEG|DU+yop32(ao#fnCHmBC{Dv_r^(hT0rN4qEn5lJ zv#56!5Ne%+n>V9TW@V4Zlbf2Fw9=^^#}0;;-hUFqcq&6DnTzWW635A1gPy_%Yuf_TCI86cm}qf{#S=zBFW3rX|-@O-;I5in%4**4nJ za0`Jj+tIX_n~5oC^DMQ#CujeSKy zVsdtBi9%9pdS;%jl7fPQl0s&Rtx~wDuYqrYb81GWM^#a3aFt(3a#eP+Wr~u$9hXgo z6;N|-YDuC(MQ%=Bu~mhw64*>DAR8pCucQE0Qj%?}1aWkPZ-9bxeo?A|iJqZuvVpOQ zf{B@)k-3qjxtWeaaAJvqS7M%mk-37AfdP;(vNANZGBE@?1`L$!xPY`xQA(Oskc%7C zP9V=#DWjyMz)D}gyu4hm+*mKaC|%#s($Z4jz)0W7NEfI=x41H|B(Xv_uUHvk2+SOp z)Z*l#%mQ$5fy_-z$}cUkRZ;?31P4&hB^JOf$}5Hj9xxd7D-sLz4fPE4;U)t$+5iQu zz!8yO6q28xV}~WqY(P3u6d`Oy=udS?EJ?KkhKGf&fswAEd5D3Lm9d$XiD?v)euyG8 z?Y{XbnQ4_s+KqLMOhODTtqcsTOpKt~krY9-+vtM=0x4j?p$_sBnz#ai082@RhgU&q zQ4Tm-Qj+ykb5e6t^Gb?=VP=RLW+};5Y57IDi6wTKxryni`UQFEHu?xbyzYaz8kj7A z$x64whkEl)35EBwlN>pAqA*@G(LzzRm^O)X}3tmAS)0_@y zB`7X36bgTT=FQ`Xl*N4Kqz=mam7e>1{(qs~pLQ3P+pAvI1iLJ6W6W@Q{FeFa#`?0d zeVVTNRj!AYD;>1$oR=@~e0ER})7%#ef}OuzsGN{~Kzq;O>5Oec?voc)|30^L>MB8> zDV%EZ%=15fO22f@{OHw1&kxOPR*FBas*#@J>R7qAWA?Oys{I!CpF}CGIG4NlUgK(k zyKaa4_eUIN{ZS`7`@M7N({-v!7Wa8>&8=njvTZDQcfR6bcFFPRH{UM*J!jr*$ozcv zly{mvFMQZTmMxfeAe>n%_{F`vlJg%0pU=MH&wO>;yJdGv%~m%Vg&e-dc2Vh+?V)G- zDI2r%88p5dlwNwb(tkLZLh11lg zZ8y=LVLHQ!IXFY$%&hxWyjP|JL%iB?d+ZeFVdQ&MBb@039q8P5=M^ literal 0 HcmV?d00001 diff --git a/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties b/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties index 59f23b4239..d5193a98d7 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties @@ -114,3 +114,4 @@ IngestJobSettingsPanel.globalSettingsButton.text=Global Settings gest IngestJobSettingsPanel.globalSettingsButton.actionCommand=Advanced IngestJobSettingsPanel.globalSettingsButton.text=Global Settings +IngestJobSettingsPanel.pastJobsButton.text=View Past Jobs diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.form b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.form index cb6eb5bf9d..73417252a4 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.form +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.form @@ -35,44 +35,39 @@ - - - - - - - - - - - - - - + + + + + + - - + + + - + - + - + - + + + - - + + @@ -135,8 +130,8 @@ - - + + @@ -150,7 +145,7 @@ - + @@ -244,5 +239,15 @@ + + + + + + + + + +
diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java index f80add0512..cf0fbc66a3 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java @@ -19,22 +19,37 @@ package org.sleuthkit.autopsy.ingest; import java.awt.Component; +import java.awt.Dimension; +import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.util.ArrayList; import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JTable; import javax.swing.ListSelectionModel; +import javax.swing.SwingUtilities; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.table.AbstractTableModel; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableColumn; import org.openide.util.NbBundle.Messages; +import org.sleuthkit.autopsy.casemodule.Case; +import org.sleuthkit.autopsy.casemodule.CaseInformationPanel; import org.sleuthkit.autopsy.corecomponents.AdvancedConfigurationDialog; +import org.sleuthkit.datamodel.Content; +import org.sleuthkit.datamodel.IngestJobInfo; +import org.sleuthkit.datamodel.IngestModuleInfo; +import org.sleuthkit.datamodel.SleuthkitCase; +import org.sleuthkit.datamodel.TskCoreException; /** * User interface component to allow a user to make ingest job settings. @@ -44,6 +59,10 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { private final IngestJobSettings settings; private final List modules; private IngestModuleModel selectedModule; + private IngestModulesTableModel tableModel = new IngestModulesTableModel(); + private List ingestJobs; + private List dataSources; + private static final Logger logger = Logger.getLogger(IngestJobSettingsPanel.class.getName()); /** * Construct a user interface component to allow a user to make ingest job @@ -57,6 +76,39 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { for (IngestModuleTemplate moduleTemplate : settings.getIngestModuleTemplates()) { this.modules.add(new IngestModuleModel(moduleTemplate)); } + SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase(); + try { + ingestJobs = skCase.getIngestJobs(); + } catch (TskCoreException ex) { + logger.log(Level.SEVERE, "Failed to load ingest job information.", ex); + ingestJobs = new ArrayList<>(); + } + this.dataSources = new ArrayList<>(); + initComponents(); + customizeComponents(); + } + + /** + * Construct a user interface component to allow a user to make ingest job + * settings. + * + * @param settings The initial settings for the ingest job. + * @param dataSources The data sources ingest is being run on. + */ + IngestJobSettingsPanel(IngestJobSettings settings, List dataSources) { + this.settings = settings; + this.modules = new ArrayList<>(); + for (IngestModuleTemplate moduleTemplate : settings.getIngestModuleTemplates()) { + this.modules.add(new IngestModuleModel(moduleTemplate)); + } + SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase(); + try { + ingestJobs = skCase.getIngestJobs(); + } catch (TskCoreException ex) { + logger.log(Level.SEVERE, "Failed to load ingest job information.", ex); + ingestJobs = new ArrayList<>(); + } + this.dataSources = dataSources; initComponents(); customizeComponents(); } @@ -82,7 +134,7 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { @Messages({"IngestJobSettingsPanel.noPerRunSettings=The selected module has no per-run settings."}) private void customizeComponents() { - modulesTable.setModel(new IngestModulesTableModel()); + modulesTable.setModel(tableModel); modulesTable.setTableHeader(null); modulesTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); @@ -127,6 +179,10 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { }); modulesTable.setRowSelectionInterval(0, 0); processUnallocCheckbox.setSelected(this.settings.getProcessUnallocatedSpace()); + this.modulesTable.getColumnModel().getColumn(0).setMaxWidth(22); + this.modulesTable.getColumnModel().getColumn(1).setMaxWidth(20); + this.modulesTable.getColumnModel().getColumn(1).setMinWidth(20); + modulesTable.setRowHeight(20); } /** @@ -150,6 +206,7 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { jButtonSelectAll = new javax.swing.JButton(); jButtonDeselectAll = new javax.swing.JButton(); processUnallocCheckbox = new javax.swing.JCheckBox(); + pastJobsButton = new javax.swing.JButton(); setMaximumSize(new java.awt.Dimension(5750, 3000)); setMinimumSize(new java.awt.Dimension(0, 0)); @@ -201,8 +258,8 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(descriptionLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 302, Short.MAX_VALUE) - .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(descriptionLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) + .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 337, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(globalSettingsButton))) @@ -212,7 +269,7 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap() - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 330, Short.MAX_VALUE) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE) .addGap(18, 18, 18) .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(8, 8, 8) @@ -244,6 +301,13 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { } }); + pastJobsButton.setText(org.openide.util.NbBundle.getMessage(IngestJobSettingsPanel.class, "IngestJobSettingsPanel.pastJobsButton.text")); // NOI18N + pastJobsButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + pastJobsButtonActionPerformed(evt); + } + }); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( @@ -252,18 +316,14 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addComponent(modulesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 271, Short.MAX_VALUE) - .addGap(10, 10, 10)) - .addGroup(layout.createSequentialGroup() - .addGap(24, 24, 24) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(processUnallocCheckbox) - .addGroup(layout.createSequentialGroup() - .addComponent(jButtonSelectAll, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, 18) - .addComponent(jButtonDeselectAll))) - .addGap(32, 32, 32))) - .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE) + .addComponent(jButtonSelectAll, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButtonDeselectAll)) + .addComponent(pastJobsButton) + .addComponent(processUnallocCheckbox) + .addComponent(modulesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 261, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 359, Short.MAX_VALUE) .addContainerGap()) ); layout.setVerticalGroup( @@ -275,12 +335,14 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { .addComponent(modulesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jButtonDeselectAll) - .addComponent(jButtonSelectAll)) + .addComponent(jButtonSelectAll) + .addComponent(jButtonDeselectAll)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(pastJobsButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(processUnallocCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 428, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 445, Short.MAX_VALUE) .addContainerGap()))) ); }// //GEN-END:initComponents @@ -319,6 +381,21 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { private void processUnallocCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_processUnallocCheckboxActionPerformed this.settings.setProcessUnallocatedSpace(processUnallocCheckbox.isSelected()); }//GEN-LAST:event_processUnallocCheckboxActionPerformed + @Messages({"IngestJobSettingsPanel.pastJobsButton.action.frame.title=Case Properties"}) + private void pastJobsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pastJobsButtonActionPerformed + JDialog topFrame = (JDialog) SwingUtilities.getWindowAncestor(this); + JDialog dialog = new JDialog(topFrame, Bundle.IngestJobSettingsPanel_pastJobsButton_action_frame_title(), false); + CaseInformationPanel caseInfo = new CaseInformationPanel(); + caseInfo.setSelectedTab(1); + dialog.add(caseInfo); + Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize(); + double w = dialog.getSize().getWidth(); + double h = dialog.getSize().getHeight(); + dialog.setLocation((int) ((screenDimension.getWidth() - w) / 2), (int) ((screenDimension.getHeight() - h) / 2)); + dialog.setResizable(true); + dialog.pack(); + dialog.setVisible(true); + }//GEN-LAST:event_pastJobsButtonActionPerformed private void SelectAllModules(boolean set) { for (IngestModuleModel module : modules) { @@ -338,6 +415,7 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { private javax.swing.JSeparator jSeparator2; private javax.swing.JScrollPane modulesScrollPane; private javax.swing.JTable modulesTable; + private javax.swing.JButton pastJobsButton; private javax.swing.JCheckBox processUnallocCheckbox; private javax.swing.ButtonGroup timeGroup; // End of variables declaration//GEN-END:variables @@ -410,6 +488,9 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { */ private class IngestModulesTableModel extends AbstractTableModel { + ImageIcon warningIcon = new ImageIcon("Core\\src\\org\\sleuthkit\\autopsy\\images\\warning_triangle.png"); + ImageIcon infoIcon = new ImageIcon("Core\\src\\org\\sleuthkit\\autopsy\\images\\information-frame.png"); + @Override public int getRowCount() { return modules.size(); @@ -417,7 +498,7 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { @Override public int getColumnCount() { - return 2; + return 3; } @Override @@ -425,6 +506,8 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { IngestModuleModel module = modules.get(rowIndex); if (columnIndex == 0) { return module.isEnabled(); + } else if (columnIndex == 1) { + return getIcon(module); } else { return module.getName(); } @@ -446,12 +529,46 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { public Class getColumnClass(int c) { return getValueAt(0, c).getClass(); } + + private ImageIcon getIcon(IngestModuleModel module) { + if (dataSources.isEmpty()) { + return null; + } + boolean previousVersionRun = false; + for (IngestJobInfo ingestJob : ingestJobs) { + if (ingestJob.getStatus() == IngestJobInfo.IngestJobStatusType.CANCELLED) { + continue; + } + long objectId = ingestJob.getObjectId(); + boolean isSameDataSource = false; + for (Content dataSource : dataSources) { + isSameDataSource = isSameDataSource || dataSource.getId() == objectId; + } + if (isSameDataSource) { + for (IngestModuleInfo ingestModuleInfo : ingestJob.getIngestModuleInfo()) { + boolean sameModule = ingestModuleInfo.getDisplayName().equals(module.getName()); + if (sameModule) { + if (ingestModuleInfo.getVersion().equals(module.getIngestModuleTemplate().getModuleFactory().getModuleVersionNumber())) { + return warningIcon; + } + } + previousVersionRun = previousVersionRun || sameModule; + } + } + } + if (previousVersionRun) { + return infoIcon; + } + return null; + } } /** * Custom cell renderer to create tool tips displaying ingest module * descriptions. */ + @Messages({"IngestJobSettingsPanel.IngestModulesTableRenderer.warning.message=This ingest module has been run before on this data source.", + "IngestJobSettingsPanel.IngestModulesTableRenderer.info.message=A previous version of this ingest module has been run before on this data source."}) private class IngestModulesTableRenderer extends DefaultTableCellRenderer { List tooltips = new ArrayList<>(); @@ -465,8 +582,17 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); - if (1 == column) { + if (2 == column) { + setIcon(null); setToolTipText(tooltips.get(row)); + } else if (1 == column) { + setIcon((Icon) value); + setText(""); + if (tableModel.warningIcon.equals(value)) { + setToolTipText(Bundle.IngestJobSettingsPanel_IngestModulesTableRenderer_warning_message()); + } else if (tableModel.infoIcon.equals(value)) { + setToolTipText(Bundle.IngestJobSettingsPanel_IngestModulesTableRenderer_info_message()); + } } return this; } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/RunIngestModulesDialog.java b/Core/src/org/sleuthkit/autopsy/ingest/RunIngestModulesDialog.java index 0cf8aac221..f2cab6ecd1 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/RunIngestModulesDialog.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/RunIngestModulesDialog.java @@ -26,17 +26,14 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; -import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.List; import javax.swing.BorderFactory; -import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JPanel; -import javax.swing.border.EmptyBorder; import org.openide.util.NbBundle; import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.ingest.IngestJobSettings.IngestType; @@ -110,7 +107,7 @@ public final class RunIngestModulesDialog extends JDialog { */ IngestJobSettings ingestJobSettings = new IngestJobSettings(RunIngestModulesDialog.class.getCanonicalName(), this.ingestType); RunIngestModulesDialog.showWarnings(ingestJobSettings); - this.ingestJobSettingsPanel = new IngestJobSettingsPanel(ingestJobSettings); + this.ingestJobSettingsPanel = new IngestJobSettingsPanel(ingestJobSettings, dataSources); setPreferredSize(this.ingestJobSettingsPanel.getPreferredSize()); add(this.ingestJobSettingsPanel, BorderLayout.CENTER); diff --git a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchDetectorModuleFactory.java b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchDetectorModuleFactory.java index 0840f24296..ba285ae3c0 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchDetectorModuleFactory.java +++ b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchDetectorModuleFactory.java @@ -20,13 +20,12 @@ package org.sleuthkit.autopsy.modules.fileextmismatch; import org.openide.util.NbBundle; import org.openide.util.lookup.ServiceProvider; -import org.sleuthkit.autopsy.coreutils.Version; -import org.sleuthkit.autopsy.ingest.IngestModuleFactoryAdapter; import org.sleuthkit.autopsy.ingest.FileIngestModule; import org.sleuthkit.autopsy.ingest.IngestModuleFactory; +import org.sleuthkit.autopsy.ingest.IngestModuleFactoryAdapter; +import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSettingsPanel; import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings; import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettingsPanel; -import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSettingsPanel; /** * An factory that creates file ingest modules that detect mismatches between @@ -53,7 +52,7 @@ public class FileExtMismatchDetectorModuleFactory extends IngestModuleFactoryAda @Override public String getModuleVersionNumber() { - return Version.getVersion(); + return "TEST"; } @Override From 3d7b40ca98591304e539c5224b32ebca9a9ae031 Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Mon, 27 Jun 2016 13:40:26 -0400 Subject: [PATCH 10/17] Updates to UI. --- .../autopsy/casemodule/Bundle.properties | 1 + .../casemodule/CaseInformationPanel.form | 25 +++++++++++--- .../casemodule/CaseInformationPanel.java | 33 ++++++++++++++++--- .../casemodule/CasePropertiesAction.java | 4 +++ .../autopsy/ingest/Bundle.properties | 2 +- .../ingest/IngestJobSettingsPanel.form | 27 +++++++++------ .../ingest/IngestJobSettingsPanel.java | 24 ++++++++------ 7 files changed, 86 insertions(+), 30 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index 5b70a17495..229ffe5cdb 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -238,3 +238,4 @@ LocalFilesPanel.jButton1.text=Change LocalFilesPanel.displayNameLabel.text=Logical File Set Display Name: Default IngestJobInfoPanel.jLabel1.text=Ingest Modules IngestJobInfoPanel.jLabel2.text=Ingest Jobs +CaseInformationPanel.closeButton.text=Close diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.form b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.form index a4f392d3f4..74892fe40d 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.form @@ -35,14 +35,21 @@ - + + + + + + - - - + + + + + @@ -57,6 +64,16 @@ + + + + + + + + + +
diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java index 08ba9dcd58..49728fa93c 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java @@ -18,6 +18,7 @@ */ package org.sleuthkit.autopsy.casemodule; +import java.awt.event.ActionListener; import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; @@ -69,7 +70,10 @@ public class CaseInformationPanel extends javax.swing.JPanel { public void setSelectedTab(int tab) { this.tabbedPane.setSelectedComponent(this.tabbedPane.getComponent(1)); } - + + void addCloseButtonAction(ActionListener action) { + this.closeButton.addActionListener(action); + } /** * 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 @@ -81,20 +85,34 @@ public class CaseInformationPanel extends javax.swing.JPanel { jPanel1 = new javax.swing.JPanel(); tabbedPane = new javax.swing.JTabbedPane(); + closeButton = new javax.swing.JButton(); tabbedPane.setPreferredSize(new java.awt.Dimension(420, 200)); + org.openide.awt.Mnemonics.setLocalizedText(closeButton, org.openide.util.NbBundle.getMessage(CaseInformationPanel.class, "CaseInformationPanel.closeButton.text")); // NOI18N + closeButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + closeButtonActionPerformed(evt); + } + }); + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 691, Short.MAX_VALUE) + .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 709, Short.MAX_VALUE) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(closeButton) + .addGap(5, 5, 5)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 231, Short.MAX_VALUE) - .addGap(0, 0, 0)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 223, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(closeButton) + .addGap(5, 5, 5)) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); @@ -112,8 +130,13 @@ public class CaseInformationPanel extends javax.swing.JPanel { ); }// //GEN-END:initComponents + private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closeButtonActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_closeButtonActionPerformed + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton closeButton; private javax.swing.JPanel jPanel1; private javax.swing.JTabbedPane tabbedPane; // End of variables declaration//GEN-END:variables diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java index 81f4a05d5f..424ca20f82 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java @@ -20,6 +20,7 @@ package org.sleuthkit.autopsy.casemodule; import java.awt.Dimension; import java.awt.Toolkit; +import java.awt.event.ActionEvent; import java.util.logging.Level; import javax.swing.Action; import javax.swing.JDialog; @@ -62,6 +63,9 @@ final class CasePropertiesAction extends CallableSystemAction { try { CaseInformationPanel caseInformationPanel = new CaseInformationPanel(); + caseInformationPanel.addCloseButtonAction((ActionEvent e) -> { + popUpWindow.dispose(); + }); popUpWindow.add(caseInformationPanel); popUpWindow.setResizable(true); diff --git a/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties b/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties index d5193a98d7..f8c1816e85 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties @@ -114,4 +114,4 @@ IngestJobSettingsPanel.globalSettingsButton.text=Global Settings gest IngestJobSettingsPanel.globalSettingsButton.actionCommand=Advanced IngestJobSettingsPanel.globalSettingsButton.text=Global Settings -IngestJobSettingsPanel.pastJobsButton.text=View Past Jobs +IngestJobSettingsPanel.pastJobsButton.text=View Ingest History diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.form b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.form index 73417252a4..8c98480783 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.form +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.form @@ -34,17 +34,24 @@ + - - - + + + + + + + + + + + + - - - - + @@ -67,7 +74,7 @@ - + @@ -131,7 +138,7 @@ - + @@ -145,7 +152,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java index cf0fbc66a3..6244461e42 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java @@ -259,7 +259,7 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(descriptionLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) - .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 337, Short.MAX_VALUE) + .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 321, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(globalSettingsButton))) @@ -269,7 +269,7 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap() - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 330, Short.MAX_VALUE) .addGap(18, 18, 18) .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(8, 8, 8) @@ -315,15 +315,19 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(modulesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 256, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() - .addComponent(jButtonSelectAll, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jButtonDeselectAll)) - .addComponent(pastJobsButton) - .addComponent(processUnallocCheckbox) - .addComponent(modulesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 261, Short.MAX_VALUE)) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(processUnallocCheckbox) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(jButtonSelectAll, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(pastJobsButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGap(5, 5, 5) + .addComponent(jButtonDeselectAll))) + .addGap(0, 0, Short.MAX_VALUE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 359, Short.MAX_VALUE) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE) .addContainerGap()) ); layout.setVerticalGroup( @@ -342,7 +346,7 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(processUnallocCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() - .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 445, Short.MAX_VALUE) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 428, Short.MAX_VALUE) .addContainerGap()))) ); }// //GEN-END:initComponents From f06952b80a8e2865db214f11e63cc788c7e7a664 Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Tue, 28 Jun 2016 15:47:43 -0400 Subject: [PATCH 11/17] Fixed showing if still running. --- .../org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java index 6244461e42..75e30d7213 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java @@ -540,7 +540,7 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { } boolean previousVersionRun = false; for (IngestJobInfo ingestJob : ingestJobs) { - if (ingestJob.getStatus() == IngestJobInfo.IngestJobStatusType.CANCELLED) { + if (ingestJob.getStatus() != IngestJobInfo.IngestJobStatusType.COMPLETED) { continue; } long objectId = ingestJob.getObjectId(); From a173922976114951c3927a9b81751fdee7d39c8d Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Wed, 29 Jun 2016 11:05:45 -0400 Subject: [PATCH 12/17] Visibility fix, version fix. --- .../org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java | 4 ++-- .../fileextmismatch/FileExtMismatchDetectorModuleFactory.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java index cfcd875835..55c5e8eb3a 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java @@ -39,7 +39,7 @@ import org.sleuthkit.datamodel.TskCoreException; /** * Panel for displaying ingest job history. */ -public class IngestJobInfoPanel extends javax.swing.JPanel { +class IngestJobInfoPanel extends javax.swing.JPanel { private static final Logger logger = Logger.getLogger(IngestJobInfoPanel.class.getName()); private List ingestJobs; @@ -50,7 +50,7 @@ public class IngestJobInfoPanel extends javax.swing.JPanel { /** * Creates new form IngestJobInfoPanel */ - public IngestJobInfoPanel() { + IngestJobInfoPanel() { initComponents(); customizeComponents(); } diff --git a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchDetectorModuleFactory.java b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchDetectorModuleFactory.java index ba285ae3c0..9cb9fb9e55 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchDetectorModuleFactory.java +++ b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchDetectorModuleFactory.java @@ -20,6 +20,7 @@ package org.sleuthkit.autopsy.modules.fileextmismatch; import org.openide.util.NbBundle; import org.openide.util.lookup.ServiceProvider; +import org.sleuthkit.autopsy.coreutils.Version; import org.sleuthkit.autopsy.ingest.FileIngestModule; import org.sleuthkit.autopsy.ingest.IngestModuleFactory; import org.sleuthkit.autopsy.ingest.IngestModuleFactoryAdapter; @@ -52,7 +53,7 @@ public class FileExtMismatchDetectorModuleFactory extends IngestModuleFactoryAda @Override public String getModuleVersionNumber() { - return "TEST"; + return Version.getVersion(); } @Override From a2528631574a26c81edfbf601452fcd1e30b0821 Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Wed, 29 Jun 2016 11:33:58 -0400 Subject: [PATCH 13/17] Changed panel shown via run ingest modules dialog. --- .../autopsy/casemodule/CaseInformationPanel.java | 8 ++------ .../sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java | 4 ++-- .../sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java | 7 +++---- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java index 49728fa93c..15370e5d45 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java @@ -30,14 +30,14 @@ import org.openide.util.NbBundle.Messages; * Panel for displaying the case information, including both case details and * ingest job history. */ -public class CaseInformationPanel extends javax.swing.JPanel { +class CaseInformationPanel extends javax.swing.JPanel { private static final Logger logger = Logger.getLogger(CaseInformationPanel.class.getName()); /** * Creates new form CaseInformationPanel */ - public CaseInformationPanel() { + CaseInformationPanel() { initComponents(); customizeComponents(); } @@ -67,10 +67,6 @@ public class CaseInformationPanel extends javax.swing.JPanel { } } - public void setSelectedTab(int tab) { - this.tabbedPane.setSelectedComponent(this.tabbedPane.getComponent(1)); - } - void addCloseButtonAction(ActionListener action) { this.closeButton.addActionListener(action); } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java index 55c5e8eb3a..ac9e55b277 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java @@ -39,7 +39,7 @@ import org.sleuthkit.datamodel.TskCoreException; /** * Panel for displaying ingest job history. */ -class IngestJobInfoPanel extends javax.swing.JPanel { +public final class IngestJobInfoPanel extends javax.swing.JPanel { private static final Logger logger = Logger.getLogger(IngestJobInfoPanel.class.getName()); private List ingestJobs; @@ -50,7 +50,7 @@ class IngestJobInfoPanel extends javax.swing.JPanel { /** * Creates new form IngestJobInfoPanel */ - IngestJobInfoPanel() { + public IngestJobInfoPanel() { initComponents(); customizeComponents(); } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java index 75e30d7213..0126b3c443 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java @@ -43,7 +43,7 @@ import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableColumn; import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.casemodule.Case; -import org.sleuthkit.autopsy.casemodule.CaseInformationPanel; +import org.sleuthkit.autopsy.casemodule.IngestJobInfoPanel; import org.sleuthkit.autopsy.corecomponents.AdvancedConfigurationDialog; import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.IngestJobInfo; @@ -389,9 +389,8 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { private void pastJobsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pastJobsButtonActionPerformed JDialog topFrame = (JDialog) SwingUtilities.getWindowAncestor(this); JDialog dialog = new JDialog(topFrame, Bundle.IngestJobSettingsPanel_pastJobsButton_action_frame_title(), false); - CaseInformationPanel caseInfo = new CaseInformationPanel(); - caseInfo.setSelectedTab(1); - dialog.add(caseInfo); + IngestJobInfoPanel ingestInfo = new IngestJobInfoPanel(); + dialog.add(ingestInfo); Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize(); double w = dialog.getSize().getWidth(); double h = dialog.getSize().getHeight(); From 4bf51e1953e5c520efd70255953f4c0050192f43 Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Wed, 29 Jun 2016 12:01:30 -0400 Subject: [PATCH 14/17] Updated frame title. --- .../org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java index 0126b3c443..ad3967efaa 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java @@ -385,7 +385,7 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { private void processUnallocCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_processUnallocCheckboxActionPerformed this.settings.setProcessUnallocatedSpace(processUnallocCheckbox.isSelected()); }//GEN-LAST:event_processUnallocCheckboxActionPerformed - @Messages({"IngestJobSettingsPanel.pastJobsButton.action.frame.title=Case Properties"}) + @Messages({"IngestJobSettingsPanel.pastJobsButton.action.frame.title=Ingest History"}) private void pastJobsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pastJobsButtonActionPerformed JDialog topFrame = (JDialog) SwingUtilities.getWindowAncestor(this); JDialog dialog = new JDialog(topFrame, Bundle.IngestJobSettingsPanel_pastJobsButton_action_frame_title(), false); From 3236c45074ce5dd0704852673a9085c11abdc600 Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Wed, 29 Jun 2016 12:15:10 -0400 Subject: [PATCH 15/17] Made dog icon show for case properties. --- .../sleuthkit/autopsy/casemodule/CasePropertiesAction.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java index 424ca20f82..e9478fa542 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java @@ -28,6 +28,7 @@ import javax.swing.JFrame; import org.openide.util.HelpCtx; import org.openide.util.NbBundle; import org.openide.util.actions.CallableSystemAction; +import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.coreutils.Logger; /** @@ -58,8 +59,7 @@ final class CasePropertiesAction extends CallableSystemAction { if (popUpWindow == null) { // create the popUp window for it String title = NbBundle.getMessage(this.getClass(), "CasePropertiesAction.window.title"); - final JFrame frame = new JFrame(title); - popUpWindow = new JDialog(frame, title, false); + popUpWindow = new JDialog((JFrame) WindowManager.getDefault().getMainWindow(), title, false); try { CaseInformationPanel caseInformationPanel = new CaseInformationPanel(); From b64bc6d69e73f7323bd6526a98022a0694f3e41c Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Wed, 29 Jun 2016 12:57:49 -0400 Subject: [PATCH 16/17] Fixed lack case switch behavior on case properties panel. --- .../autopsy/casemodule/CasePropertiesAction.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java index e9478fa542..462a60d96a 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java @@ -21,6 +21,8 @@ package org.sleuthkit.autopsy.casemodule; import java.awt.Dimension; import java.awt.Toolkit; import java.awt.event.ActionEvent; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; import java.util.logging.Level; import javax.swing.Action; import javax.swing.JDialog; @@ -48,6 +50,12 @@ final class CasePropertiesAction extends CallableSystemAction { CasePropertiesAction() { putValue(Action.NAME, NbBundle.getMessage(CasePropertiesAction.class, "CTL_CasePropertiesAction")); // put the action Name this.setEnabled(false); + Case.addEventSubscriber(Case.Events.CURRENT_CASE.toString(), new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + popUpWindow = null; + } + }); } /** From ed36fbb5feec3073d61b714c94b53acbb94e2a45 Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Wed, 29 Jun 2016 14:25:25 -0400 Subject: [PATCH 17/17] Fixed icon behavior. --- .../ingest/IngestJobSettingsPanel.java | 34 +++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java index ad3967efaa..0a368a635e 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java @@ -548,14 +548,36 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { isSameDataSource = isSameDataSource || dataSource.getId() == objectId; } if (isSameDataSource) { - for (IngestModuleInfo ingestModuleInfo : ingestJob.getIngestModuleInfo()) { - boolean sameModule = ingestModuleInfo.getDisplayName().equals(module.getName()); - if (sameModule) { - if (ingestModuleInfo.getVersion().equals(module.getIngestModuleTemplate().getModuleFactory().getModuleVersionNumber())) { - return warningIcon; + IngestModuleFactory factory = module.getIngestModuleTemplate().getModuleFactory(); + if (factory.isDataSourceIngestModuleFactory()) { + String uniqueName = FactoryClassNameNormalizer.normalize(factory.getClass().getCanonicalName()) + "-" + + factory.getModuleDisplayName() + "-" + + IngestModuleInfo.IngestModuleType.DATA_SOURCE_LEVEL.toString() + "-" + + factory.getModuleVersionNumber(); + for (IngestModuleInfo ingestModuleInfo : ingestJob.getIngestModuleInfo()) { + boolean sameModule = ingestModuleInfo.getUniqueName().equals(uniqueName); + if (sameModule) { + if (ingestModuleInfo.getVersion().equals(module.getIngestModuleTemplate().getModuleFactory().getModuleVersionNumber())) { + return warningIcon; + } } + previousVersionRun = previousVersionRun || sameModule; + } + } + if (factory.isFileIngestModuleFactory()) { + String uniqueName = FactoryClassNameNormalizer.normalize(factory.getClass().getCanonicalName()) + "-" + + factory.getModuleDisplayName() + "-" + + IngestModuleInfo.IngestModuleType.FILE_LEVEL.toString() + "-" + + factory.getModuleVersionNumber(); + for (IngestModuleInfo ingestModuleInfo : ingestJob.getIngestModuleInfo()) { + boolean sameModule = ingestModuleInfo.getUniqueName().equals(uniqueName); + if (sameModule) { + if (ingestModuleInfo.getVersion().equals(module.getIngestModuleTemplate().getModuleFactory().getModuleVersionNumber())) { + return warningIcon; + } + } + previousVersionRun = previousVersionRun || sameModule; } - previousVersionRun = previousVersionRun || sameModule; } } }