diff --git a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonAttributePanel.form b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonAttributePanel.form index 02353d8835..9274e9ba29 100644 --- a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonAttributePanel.form +++ b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonAttributePanel.form @@ -7,7 +7,7 @@ - + @@ -27,7 +27,7 @@ - + @@ -35,13 +35,7 @@ - - - - - - - + @@ -57,14 +51,18 @@ - - - - + + - - + + + + + + + + @@ -73,30 +71,26 @@ + + + + + + + - - + + + - - - - + - - - - - - - - - - + @@ -109,15 +103,13 @@ - + - - - - + + @@ -125,48 +117,17 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -175,6 +136,14 @@ + + + + + + + + @@ -202,6 +171,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -236,45 +226,35 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonAttributePanel.java b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonAttributePanel.java index cb5c21b154..750ff73dbd 100644 --- a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonAttributePanel.java +++ b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonAttributePanel.java @@ -32,6 +32,7 @@ import java.util.Observable; import java.util.Observer; import java.util.concurrent.ExecutionException; import java.util.logging.Level; +import javax.swing.JPanel; import javax.swing.SwingWorker; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; @@ -80,9 +81,12 @@ final class CommonAttributePanel extends javax.swing.JDialog implements Observer private final UserInputErrorManager errorManager; private int percentageThresholdValue = 20; + + private final IntraCasePanel intraCasePanel; + private final InterCasePanel interCasePanel; /** - * Creates new form CommonFilesPanel + * Creates new form CommonAttributePanel */ @NbBundle.Messages({ "CommonAttributePanel.title=Common Property Panel", @@ -93,15 +97,29 @@ final class CommonAttributePanel extends javax.swing.JDialog implements Observer super(WindowManager.getDefault().getMainWindow(), Bundle.CommonAttributePanel_frame_title(), true); initComponents(); this.setLocationRelativeTo(WindowManager.getDefault().getMainWindow()); - this.setupDataSources(); + + interCasePanel = new InterCasePanel(); + interCasePanel.setVisible(true); + interCasePanel.setSize((int) containerPanel.getPreferredSize().getWidth(), (int) containerPanel.getPreferredSize().getHeight()); + + intraCasePanel = new IntraCasePanel(); intraCasePanel.setVisible(true); - interCasePanel.setVisible(false); + intraCasePanel.setSize((int) containerPanel.getPreferredSize().getWidth(), (int) containerPanel.getPreferredSize().getHeight()); + + this.setupDataSources(); + if (CommonAttributePanel.isEamDbAvailableForIntercaseSearch()) { this.setupCases(); this.interCasePanel.setupCorrelationTypeFilter(); + this.interCaseRadio.setSelected(true); + switchInnerPanel(interCasePanel); } else { this.disableIntercaseSearch(); + this.intraCaseRadio.setSelected(true); + switchInnerPanel(intraCasePanel); } + this.revalidate(); + this.repaint(); this.updatePercentageOptions(CommonAttributePanel.getNumberOfDataSourcesAvailable()); @@ -354,8 +372,6 @@ final class CommonAttributePanel extends javax.swing.JDialog implements Observer if (!this.caseHasMultipleSources()) { //disable intra case search when only 1 data source in current case intraCaseRadio.setEnabled(false); interCaseRadio.setSelected(true); - intraCasePanel.setVisible(false); - interCasePanel.setVisible(true); } CommonAttributePanel.this.updateErrorTextAndSearchButton(); } @@ -408,6 +424,18 @@ final class CommonAttributePanel extends javax.swing.JDialog implements Observer } }.execute(); } + + /** + * Display the provided panel inside the container panel. + * + * @param panel The panel to be shown. + */ + private void switchInnerPanel(JPanel panel) { + containerPanel.removeAll(); + containerPanel.add(panel); + this.revalidate(); + this.repaint(); + } @NbBundle.Messages({ "CommonAttributePanel.setupCases.done.interruptedException=Something went wrong building the Common Files Search dialog box.", @@ -492,20 +520,19 @@ final class CommonAttributePanel extends javax.swing.JDialog implements Observer interIntraButtonGroup = new javax.swing.ButtonGroup(); jPanel1 = new javax.swing.JPanel(); - scopeLabel = new javax.swing.JLabel(); - searchButton = new javax.swing.JButton(); - errorText = new javax.swing.JLabel(); commonItemSearchDescription = new javax.swing.JLabel(); + scopeLabel = new javax.swing.JLabel(); intraCaseRadio = new javax.swing.JRadioButton(); interCaseRadio = new javax.swing.JRadioButton(); + containerPanel = new javax.swing.JPanel(); percentageThresholdCheck = new javax.swing.JCheckBox(); percentageThresholdInputBox = new javax.swing.JTextField(); percentageThresholdTextTwo = new javax.swing.JLabel(); - intraCasePanel = new org.sleuthkit.autopsy.commonfilesearch.IntraCasePanel(); - interCasePanel = new org.sleuthkit.autopsy.commonfilesearch.InterCasePanel(); dataSourcesLabel = new javax.swing.JLabel(); + errorText = new javax.swing.JLabel(); + searchButton = new javax.swing.JButton(); - setMinimumSize(new java.awt.Dimension(450, 460)); + setMinimumSize(new java.awt.Dimension(450, 570)); setResizable(false); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosed(java.awt.event.WindowEvent evt) { @@ -513,30 +540,15 @@ final class CommonAttributePanel extends javax.swing.JDialog implements Observer } }); - jPanel1.setMaximumSize(new java.awt.Dimension(450, 460)); - jPanel1.setMinimumSize(new java.awt.Dimension(450, 460)); - jPanel1.setPreferredSize(new java.awt.Dimension(450, 460)); + jPanel1.setMaximumSize(null); jPanel1.setRequestFocusEnabled(false); - org.openide.awt.Mnemonics.setLocalizedText(scopeLabel, org.openide.util.NbBundle.getMessage(CommonAttributePanel.class, "CommonAttributePanel.scopeLabel.text")); // NOI18N - scopeLabel.setFocusable(false); - - org.openide.awt.Mnemonics.setLocalizedText(searchButton, org.openide.util.NbBundle.getMessage(CommonAttributePanel.class, "CommonAttributePanel.searchButton.text")); // NOI18N - searchButton.setEnabled(false); - searchButton.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING); - searchButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - searchButtonActionPerformed(evt); - } - }); - - errorText.setForeground(new java.awt.Color(255, 0, 0)); - org.openide.awt.Mnemonics.setLocalizedText(errorText, org.openide.util.NbBundle.getMessage(CommonAttributePanel.class, "CommonAttributePanel.errorText.text")); // NOI18N - errorText.setVerticalAlignment(javax.swing.SwingConstants.TOP); - org.openide.awt.Mnemonics.setLocalizedText(commonItemSearchDescription, org.openide.util.NbBundle.getMessage(CommonAttributePanel.class, "CommonAttributePanel.commonItemSearchDescription.text")); // NOI18N commonItemSearchDescription.setFocusable(false); + org.openide.awt.Mnemonics.setLocalizedText(scopeLabel, org.openide.util.NbBundle.getMessage(CommonAttributePanel.class, "CommonAttributePanel.scopeLabel.text")); // NOI18N + scopeLabel.setFocusable(false); + interIntraButtonGroup.add(intraCaseRadio); intraCaseRadio.setSelected(true); org.openide.awt.Mnemonics.setLocalizedText(intraCaseRadio, org.openide.util.NbBundle.getMessage(CommonAttributePanel.class, "CommonAttributePanel.intraCaseRadio.text")); // NOI18N @@ -554,6 +566,20 @@ final class CommonAttributePanel extends javax.swing.JDialog implements Observer } }); + containerPanel.setBackground(new java.awt.Color(0, 0, 0)); + containerPanel.setOpaque(false); + + javax.swing.GroupLayout containerPanelLayout = new javax.swing.GroupLayout(containerPanel); + containerPanel.setLayout(containerPanelLayout); + containerPanelLayout.setHorizontalGroup( + containerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 430, Short.MAX_VALUE) + ); + containerPanelLayout.setVerticalGroup( + containerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 330, Short.MAX_VALUE) + ); + org.openide.awt.Mnemonics.setLocalizedText(percentageThresholdCheck, org.openide.util.NbBundle.getMessage(CommonAttributePanel.class, "CommonAttributePanel.percentageThresholdCheck.text_1_1")); // NOI18N percentageThresholdCheck.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -569,15 +595,20 @@ final class CommonAttributePanel extends javax.swing.JDialog implements Observer org.openide.awt.Mnemonics.setLocalizedText(percentageThresholdTextTwo, org.openide.util.NbBundle.getMessage(CommonAttributePanel.class, "CommonAttributePanel.percentageThresholdTextTwo.text_1")); // NOI18N - intraCasePanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(CommonAttributePanel.class, "CommonAttributePanel.intraCasePanel.border.title"))); // NOI18N - intraCasePanel.setMaximumSize(new java.awt.Dimension(32779, 192)); - intraCasePanel.setMinimumSize(new java.awt.Dimension(204, 192)); - intraCasePanel.setPreferredSize(new java.awt.Dimension(430, 192)); - intraCasePanel.setVerifyInputWhenFocusTarget(false); + org.openide.awt.Mnemonics.setLocalizedText(dataSourcesLabel, org.openide.util.NbBundle.getMessage(CommonAttributePanel.class, "CommonAttributePanel.dataSourcesLabel.text")); // NOI18N - interCasePanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(CommonAttributePanel.class, "CommonAttributePanel.interCasePanel.border.title"))); // NOI18N - interCasePanel.setMinimumSize(new java.awt.Dimension(430, 230)); - interCasePanel.setPreferredSize(new java.awt.Dimension(430, 230)); + errorText.setForeground(new java.awt.Color(255, 0, 0)); + org.openide.awt.Mnemonics.setLocalizedText(errorText, org.openide.util.NbBundle.getMessage(CommonAttributePanel.class, "CommonAttributePanel.errorText.text")); // NOI18N + errorText.setVerticalAlignment(javax.swing.SwingConstants.TOP); + + org.openide.awt.Mnemonics.setLocalizedText(searchButton, org.openide.util.NbBundle.getMessage(CommonAttributePanel.class, "CommonAttributePanel.searchButton.text")); // NOI18N + searchButton.setEnabled(false); + searchButton.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING); + searchButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + searchButtonActionPerformed(evt); + } + }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); @@ -586,37 +617,37 @@ final class CommonAttributePanel extends javax.swing.JDialog implements Observer .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addComponent(errorText, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE) - .addGap(65, 65, 65) - .addComponent(searchButton) - .addContainerGap()) .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(scopeLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(dataSourcesLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(intraCaseRadio, javax.swing.GroupLayout.PREFERRED_SIZE, 383, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(scopeLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(37, 37, 37)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(percentageThresholdCheck) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(percentageThresholdInputBox, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(percentageThresholdTextTwo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(percentageThresholdTextTwo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addComponent(errorText, javax.swing.GroupLayout.PREFERRED_SIZE, 330, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(searchButton) + .addContainerGap()) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(containerPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(commonItemSearchDescription, javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup() .addGap(20, 20, 20) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(intraCaseRadio, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(interCaseRadio, javax.swing.GroupLayout.DEFAULT_SIZE, 383, Short.MAX_VALUE)))) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) - .addComponent(interCasePanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(intraCasePanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) - .addGap(0, 0, Short.MAX_VALUE)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addGap(21, 21, 21) - .addComponent(dataSourcesLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addContainerGap()))) + .addComponent(interCaseRadio, javax.swing.GroupLayout.PREFERRED_SIZE, 383, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -625,26 +656,24 @@ final class CommonAttributePanel extends javax.swing.JDialog implements Observer .addComponent(commonItemSearchDescription, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(scopeLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(intraCaseRadio) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(interCaseRadio) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(interCasePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 0, 0) - .addComponent(intraCasePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(containerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(percentageThresholdCheck) .addComponent(percentageThresholdInputBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(percentageThresholdTextTwo)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(dataSourcesLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, Short.MAX_VALUE) + .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(searchButton) .addComponent(errorText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap()) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER); @@ -665,13 +694,11 @@ final class CommonAttributePanel extends javax.swing.JDialog implements Observer }//GEN-LAST:event_percentageThresholdCheckActionPerformed private void interCaseRadioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_interCaseRadioActionPerformed - intraCasePanel.setVisible(false); - interCasePanel.setVisible(true); + switchInnerPanel(interCasePanel); }//GEN-LAST:event_interCaseRadioActionPerformed private void intraCaseRadioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_intraCaseRadioActionPerformed - intraCasePanel.setVisible(true); - interCasePanel.setVisible(false); + switchInnerPanel(intraCasePanel); }//GEN-LAST:event_intraCaseRadioActionPerformed private void searchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchButtonActionPerformed @@ -842,12 +869,11 @@ final class CommonAttributePanel extends javax.swing.JDialog implements Observer // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel commonItemSearchDescription; + private javax.swing.JPanel containerPanel; private javax.swing.JLabel dataSourcesLabel; private javax.swing.JLabel errorText; - private org.sleuthkit.autopsy.commonfilesearch.InterCasePanel interCasePanel; private javax.swing.JRadioButton interCaseRadio; private javax.swing.ButtonGroup interIntraButtonGroup; - private org.sleuthkit.autopsy.commonfilesearch.IntraCasePanel intraCasePanel; private javax.swing.JRadioButton intraCaseRadio; private javax.swing.JPanel jPanel1; private javax.swing.JCheckBox percentageThresholdCheck;