From e16b0636d2eef5699b66111d45193c01fbc4da4c Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Thu, 7 Dec 2017 14:35:29 -0500 Subject: [PATCH] Implemented dynamic 'Open Case' button and menu item. --- .../autopsy/casemodule/Bundle.properties | 7 +- .../autopsy/casemodule/Bundle_ja.properties | 2 +- .../autopsy/casemodule/CaseOpenAction.java | 53 ++++--- .../casemodule/CaseOpenMultiUserAction.java | 91 ------------ .../autopsy/casemodule/CueBannerPanel.form | 120 +++++---------- .../autopsy/casemodule/CueBannerPanel.java | 139 ++++++------------ .../casemodule/MultiUserCasesPanel.form | 23 ++- .../casemodule/MultiUserCasesPanel.java | 29 +++- Core/src/org/sleuthkit/autopsy/core/layer.xml | 4 +- 9 files changed, 167 insertions(+), 301 deletions(-) delete mode 100755 Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenMultiUserAction.java diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index 186864c2e4..cc75f4d6a9 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -233,8 +233,7 @@ MultiUserCasesPanel.bnRefresh.text=&Refresh MultiUserCasesPanel.bnOpen.text=&Open MultiUserCasesPanel.rbGroupLabel.text=Show cases accessed in the last 10: MultiUserCasesPanel.rbMonths.text=Months -CueBannerPanel.primaryOpenCaseButton.text= -CueBannerPanel.secondaryOpenCaseButton.text= -CueBannerPanel.primaryOpenCaseLabel.text=Open Multi-User Case -CueBannerPanel.secondaryOpenCaseLabel.text=Open Single-User Case CueBannerPanel.newCaseLabel.text=New Case +CueBannerPanel.openCaseButton.text= +CueBannerPanel.openCaseLabel.text=Open Case +MultiUserCasesPanel.bnOpenSingleUserCase.text=Open Single-User Case... diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle_ja.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle_ja.properties index 7e70df3316..8b7bfae3eb 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle_ja.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle_ja.properties @@ -195,5 +195,5 @@ CueBannerPanel.openAutoIngestCaseLabel.text=\u65e2\u5b58\u30b1\u30fc\u30b9\u3092 OpenMultiUserCasePanel.openButton.text=\u958b\u304f OpenMultiUserCasePanel.cancelButton.text=\u30ad\u30e3\u30f3\u30bb\u30eb OpenMultiUserCasePanel.jLabel1.text=\u6700\u8fd1\u958b\u3044\u305f\u30d5\u30a1\u30a4\u30eb -CueBannerPanel.primaryOpenCaseLabel.text=\u65e2\u5b58\u30b1\u30fc\u30b9\u3092\u958b\u304f CueBannerPanel.newCaseLabel.text=\u65b0\u898f\u30b1\u30fc\u30b9\u3092\u4f5c\u6210 +CueBannerPanel.openCaseLabel.text=\u65e2\u5b58\u30b1\u30fc\u30b9\u3092\u958b\u304f diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java index 1237b5600e..202b2ee3c3 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java @@ -24,6 +24,7 @@ import java.awt.event.ActionListener; import java.io.File; import java.util.concurrent.ExecutionException; import java.util.logging.Level; +import javax.swing.JDialog; import javax.swing.JFileChooser; import javax.swing.JOptionPane; import javax.swing.SwingWorker; @@ -51,18 +52,17 @@ import org.sleuthkit.autopsy.coreutils.Version; * This action should only be invoked in the event dispatch thread (EDT). */ @ActionID(category = "Case", id = "org.sleuthkit.autopsy.casemodule.CaseOpenAction") -@ActionReference(path = "Menu/Case", position = 103) +@ActionReference(path = "Menu/Case", position = 102) @ActionRegistration(displayName = "#CTL_CaseOpenAction", lazy = false) -@NbBundle.Messages({ - "CTL_CaseOpenAction=Open Case", - "CTL_CaseOpenSingleUserAction=Open Single-User Case" -}) +@NbBundle.Messages({"CTL_CaseOpenAction=Open Case",}) @ServiceProvider(service = CaseOpenAction.class) public final class CaseOpenAction extends CallableSystemAction implements ActionListener { private static final long serialVersionUID = 1L; + private static final String DISPLAY_NAME = Bundle.CTL_CaseOpenAction(); private static final String PROP_BASECASE = "LBL_BaseCase_PATH"; //NON-NLS private static final Logger logger = Logger.getLogger(CaseOpenAction.class.getName()); + private static JDialog multiUserCaseWindow; private final JFileChooser fileChooser = new JFileChooser(); private final FileFilter caseMetadataFileFilter; @@ -71,7 +71,6 @@ public final class CaseOpenAction extends CallableSystemAction implements Action * the layer.xml file, a toolbar button, and the Create New Case button of * the start up window that allows a user to open a case. It opens an * existing case. - * */ public CaseOpenAction() { caseMetadataFileFilter = new FileNameExtensionFilter(NbBundle.getMessage(CaseOpenAction.class, "CaseOpenAction.autFilter.title", Version.getName(), CaseMetadata.getFileExtension()), CaseMetadata.getFileExtension().substring(1)); @@ -85,13 +84,11 @@ public final class CaseOpenAction extends CallableSystemAction implements Action } /** - * Pops up a file chooser to allow the user to select a case metadata file - * (.aut file) and attempts to open the case described by the file. - * - * @param e The action event. + * Open the case selection window to allow the user to select a case + * metadata file (.aut file). Upon confirming the selection, it will attempt + * to open the case described by the file. */ - @Override - public void actionPerformed(ActionEvent e) { + void openCaseSelectionWindow() { String optionsDlgTitle = NbBundle.getMessage(Case.class, "CloseCaseWhileIngesting.Warning.title"); String optionsDlgMessage = NbBundle.getMessage(Case.class, "CloseCaseWhileIngesting.Warning"); if (IngestRunningCheck.checkAndConfirmProceed(optionsDlgTitle, optionsDlgMessage)) { @@ -105,6 +102,9 @@ public final class CaseOpenAction extends CallableSystemAction implements Action * Close the startup window, if it is open. */ StartupWindowProvider.getInstance().close(); + if (multiUserCaseWindow != null) { + multiUserCaseWindow.setVisible(false); + } /* * Try to open the case associated with the case metadata file @@ -145,6 +145,25 @@ public final class CaseOpenAction extends CallableSystemAction implements Action } } + /** + * Pops up either the case selection window or the Open Multi-User Case + * window, depending on the multi-user case settings. + * + * @param e The action event. + */ + @Override + public void actionPerformed(ActionEvent e) { + if (UserPreferences.getIsMultiUserModeEnabled()) { + if (multiUserCaseWindow == null) { + multiUserCaseWindow = MultiUserCasesDialog.getInstance(); + } + multiUserCaseWindow.setLocationRelativeTo(WindowManager.getDefault().getMainWindow()); + multiUserCaseWindow.setVisible(true); + } else { + openCaseSelectionWindow(); + } + } + @Override public void performAction() { actionPerformed(null); @@ -152,15 +171,7 @@ public final class CaseOpenAction extends CallableSystemAction implements Action @Override public String getName() { - String name; - - if(UserPreferences.getIsMultiUserModeEnabled()) { - name = Bundle.CTL_CaseOpenSingleUserAction(); - } else { - name = Bundle.CTL_CaseOpenAction(); - } - - return name; + return DISPLAY_NAME; } @Override diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenMultiUserAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenMultiUserAction.java deleted file mode 100755 index 7a12b69cf7..0000000000 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenMultiUserAction.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Autopsy Forensic Browser - * - * Copyright 2011-2017 Basis Technology Corp. - * Contact: carrier sleuthkit org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.sleuthkit.autopsy.casemodule; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import javax.swing.JDialog; -import org.openide.awt.ActionID; -import org.openide.awt.ActionReference; -import org.openide.awt.ActionRegistration; -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.core.UserPreferences; - -/** - * The action associated with the Open Multi-User Case menu item via the - * layer.xml file. - * - * This action should only be invoked in the event dispatch thread (EDT). - */ -@ActionID(category = "Case", id = "org.sleuthkit.autopsy.casemodule.CaseOpenMultiUserAction") -@ActionReference(path = "Menu/Case", position = 102) -@ActionRegistration(displayName = "#CTL_CaseOpenMultiUserAction", lazy = false) -@NbBundle.Messages({"CTL_CaseOpenMultiUserAction=Open Multi-User Case"}) -public final class CaseOpenMultiUserAction extends CallableSystemAction implements ActionListener { - - private static final long serialVersionUID = 1L; - private static JDialog multiUserCaseWindow; - - private static final String DISPLAY_NAME = Bundle.CTL_CaseOpenMultiUserAction(); - - public CaseOpenMultiUserAction() {} - - @Override - public boolean isEnabled() { - return UserPreferences.getIsMultiUserModeEnabled(); - } - - /** - * Pops up a case selection panel to allow the user to select a multi-user - * case to open. - * - * @param event The action event. - */ - @Override - public void actionPerformed(ActionEvent event) { - if(multiUserCaseWindow == null) { - multiUserCaseWindow = MultiUserCasesDialog.getInstance(); - } - multiUserCaseWindow.setLocationRelativeTo(WindowManager.getDefault().getMainWindow()); - multiUserCaseWindow.setVisible(true); - } - - @Override - public void performAction() { - actionPerformed(null); - } - - @Override - public String getName() { - return DISPLAY_NAME; - } - - @Override - public HelpCtx getHelpCtx() { - return HelpCtx.DEFAULT_HELP; - } - - @Override - public boolean asynchronous() { - return false; // run on edt - } -} diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.form b/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.form index 4e347413ad..83f2662859 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.form @@ -18,29 +18,31 @@ + @@ -48,37 +50,31 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + - - @@ -163,13 +159,13 @@ - + - + @@ -184,18 +180,18 @@ - + - + - + - + @@ -216,41 +212,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.java index 4d0fbd5abc..241f89cf62 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.java @@ -20,7 +20,6 @@ package org.sleuthkit.autopsy.casemodule; import java.awt.Dialog; import java.awt.Dimension; -import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; @@ -107,16 +106,6 @@ public class CueBannerPanel extends javax.swing.JPanel { boolean enableOpenRecentCaseButton = (RecentCases.getInstance().getTotalRecentCases() > 0); openRecentCaseButton.setEnabled(enableOpenRecentCaseButton); openRecentCaseLabel.setEnabled(enableOpenRecentCaseButton); - - if(UserPreferences.getIsMultiUserModeEnabled()) { - primaryOpenCaseLabel.setText("Open Multi-User Case"); - secondaryOpenCaseButton.setVisible(true); - secondaryOpenCaseLabel.setVisible(true); - } else { - primaryOpenCaseLabel.setText("Open Case"); - secondaryOpenCaseButton.setVisible(false); - secondaryOpenCaseLabel.setVisible(false); - } } /** @@ -134,12 +123,10 @@ public class CueBannerPanel extends javax.swing.JPanel { openRecentCaseButton = new javax.swing.JButton(); newCaseLabel = new javax.swing.JLabel(); openRecentCaseLabel = new javax.swing.JLabel(); - primaryOpenCaseButton = new javax.swing.JButton(); - primaryOpenCaseLabel = new javax.swing.JLabel(); + openCaseButton = new javax.swing.JButton(); + openCaseLabel = new javax.swing.JLabel(); closeButton = new javax.swing.JButton(); jSeparator1 = new javax.swing.JSeparator(); - secondaryOpenCaseButton = new javax.swing.JButton(); - secondaryOpenCaseLabel = new javax.swing.JLabel(); autopsyLogo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/casemodule/welcome_logo.png"))); // NOI18N autopsyLogo.setText(org.openide.util.NbBundle.getMessage(CueBannerPanel.class, "CueBannerPanel.autopsyLogo.text")); // NOI18N @@ -174,97 +161,77 @@ public class CueBannerPanel extends javax.swing.JPanel { openRecentCaseLabel.setFont(openRecentCaseLabel.getFont().deriveFont(openRecentCaseLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 13)); openRecentCaseLabel.setText(org.openide.util.NbBundle.getMessage(CueBannerPanel.class, "CueBannerPanel.openRecentCaseLabel.text")); // NOI18N - primaryOpenCaseButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/casemodule/btn_icon_open_existing.png"))); // NOI18N - primaryOpenCaseButton.setText(org.openide.util.NbBundle.getMessage(CueBannerPanel.class, "CueBannerPanel.primaryOpenCaseButton.text")); // NOI18N - primaryOpenCaseButton.setBorder(null); - primaryOpenCaseButton.setBorderPainted(false); - primaryOpenCaseButton.setContentAreaFilled(false); - primaryOpenCaseButton.setMargin(new java.awt.Insets(1, 1, 1, 1)); - primaryOpenCaseButton.setPreferredSize(new java.awt.Dimension(64, 64)); - primaryOpenCaseButton.addActionListener(new java.awt.event.ActionListener() { + openCaseButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/casemodule/btn_icon_open_existing.png"))); // NOI18N + openCaseButton.setText(org.openide.util.NbBundle.getMessage(CueBannerPanel.class, "CueBannerPanel.openCaseButton.text")); // NOI18N + openCaseButton.setBorder(null); + openCaseButton.setBorderPainted(false); + openCaseButton.setContentAreaFilled(false); + openCaseButton.setMargin(new java.awt.Insets(1, 1, 1, 1)); + openCaseButton.setPreferredSize(new java.awt.Dimension(64, 64)); + openCaseButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { - primaryOpenCaseButtonActionPerformed(evt); + openCaseButtonActionPerformed(evt); } }); - primaryOpenCaseLabel.setFont(primaryOpenCaseLabel.getFont().deriveFont(primaryOpenCaseLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 13)); - primaryOpenCaseLabel.setText(org.openide.util.NbBundle.getMessage(CueBannerPanel.class, "CueBannerPanel.primaryOpenCaseLabel.text")); // NOI18N + openCaseLabel.setFont(openCaseLabel.getFont().deriveFont(openCaseLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 13)); + openCaseLabel.setText(org.openide.util.NbBundle.getMessage(CueBannerPanel.class, "CueBannerPanel.openCaseLabel.text")); // NOI18N closeButton.setFont(closeButton.getFont().deriveFont(closeButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11)); closeButton.setText(org.openide.util.NbBundle.getMessage(CueBannerPanel.class, "CueBannerPanel.closeButton.text")); // NOI18N jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL); - secondaryOpenCaseButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/casemodule/btn_icon_open_existing.png"))); // NOI18N - secondaryOpenCaseButton.setText(org.openide.util.NbBundle.getMessage(CueBannerPanel.class, "CueBannerPanel.secondaryOpenCaseButton.text")); // NOI18N - secondaryOpenCaseButton.setBorder(null); - secondaryOpenCaseButton.setBorderPainted(false); - secondaryOpenCaseButton.setContentAreaFilled(false); - secondaryOpenCaseButton.setMargin(new java.awt.Insets(1, 1, 1, 1)); - secondaryOpenCaseButton.setPreferredSize(new java.awt.Dimension(64, 64)); - secondaryOpenCaseButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - secondaryOpenCaseButtonActionPerformed(evt); - } - }); - - secondaryOpenCaseLabel.setFont(secondaryOpenCaseLabel.getFont().deriveFont(secondaryOpenCaseLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 13)); - secondaryOpenCaseLabel.setText(org.openide.util.NbBundle.getMessage(CueBannerPanel.class, "CueBannerPanel.secondaryOpenCaseLabel.text")); // NOI18N - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() + .addComponent(autopsyLogo) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 5, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addComponent(autopsyLogo) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 5, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(createNewCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(openRecentCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(primaryOpenCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(secondaryOpenCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(openCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(newCaseLabel) .addComponent(openRecentCaseLabel) - .addComponent(primaryOpenCaseLabel) - .addComponent(secondaryOpenCaseLabel))) - .addComponent(closeButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap()) + .addComponent(openCaseLabel)) + .addGap(18, 18, 18)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 139, Short.MAX_VALUE) + .addComponent(closeButton, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap()))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(createNewCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(newCaseLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(openRecentCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(openRecentCaseLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(primaryOpenCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(primaryOpenCaseLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(secondaryOpenCaseButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addComponent(secondaryOpenCaseLabel) - .addGap(20, 20, 20)))) - .addComponent(jSeparator1) - .addComponent(autopsyLogo, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(closeButton) - .addContainerGap()) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(autopsyLogo, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) + .addComponent(createNewCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(newCaseLabel)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) + .addComponent(openRecentCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(openRecentCaseLabel)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) + .addComponent(openCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(openCaseLabel)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(closeButton)) + .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 260, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); }// //GEN-END:initComponents @@ -272,15 +239,9 @@ public class CueBannerPanel extends javax.swing.JPanel { Lookup.getDefault().lookup(CaseNewActionInterface.class).actionPerformed(evt); }//GEN-LAST:event_createNewCaseButtonActionPerformed - private void primaryOpenCaseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_primaryOpenCaseButtonActionPerformed - if(UserPreferences.getIsMultiUserModeEnabled()) { - MultiUserCasesDialog multiUserCaseWindow = MultiUserCasesDialog.getInstance(); - multiUserCaseWindow.setLocationRelativeTo(WindowManager.getDefault().getMainWindow()); - multiUserCaseWindow.setVisible(true); - } else { - Lookup.getDefault().lookup(CaseOpenAction.class).actionPerformed(evt); - } - }//GEN-LAST:event_primaryOpenCaseButtonActionPerformed + private void openCaseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openCaseButtonActionPerformed + Lookup.getDefault().lookup(CaseOpenAction.class).actionPerformed(evt); + }//GEN-LAST:event_openCaseButtonActionPerformed private void openRecentCaseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openRecentCaseButtonActionPerformed recentCasesWindow.setLocationRelativeTo(WindowManager.getDefault().getMainWindow()); @@ -288,22 +249,16 @@ public class CueBannerPanel extends javax.swing.JPanel { recentCasesWindow.setVisible(true); }//GEN-LAST:event_openRecentCaseButtonActionPerformed - private void secondaryOpenCaseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_secondaryOpenCaseButtonActionPerformed - Lookup.getDefault().lookup(CaseOpenAction.class).actionPerformed(evt); - }//GEN-LAST:event_secondaryOpenCaseButtonActionPerformed - // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel autopsyLogo; private javax.swing.JButton closeButton; private javax.swing.JButton createNewCaseButton; private javax.swing.JSeparator jSeparator1; private javax.swing.JLabel newCaseLabel; + private javax.swing.JButton openCaseButton; + private javax.swing.JLabel openCaseLabel; private javax.swing.JButton openRecentCaseButton; private javax.swing.JLabel openRecentCaseLabel; - private javax.swing.JButton primaryOpenCaseButton; - private javax.swing.JLabel primaryOpenCaseLabel; - private javax.swing.JButton secondaryOpenCaseButton; - private javax.swing.JLabel secondaryOpenCaseLabel; // End of variables declaration//GEN-END:variables } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/MultiUserCasesPanel.form b/Core/src/org/sleuthkit/autopsy/casemodule/MultiUserCasesPanel.form index 18d99fa0dc..153f81561f 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/MultiUserCasesPanel.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/MultiUserCasesPanel.form @@ -7,6 +7,9 @@ + + + @@ -30,8 +33,10 @@ + + - + @@ -41,9 +46,8 @@ - + - @@ -60,9 +64,9 @@ + - @@ -72,6 +76,7 @@ + @@ -224,5 +229,15 @@ + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/MultiUserCasesPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/MultiUserCasesPanel.java index d0676e1966..e461860b1c 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/MultiUserCasesPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/MultiUserCasesPanel.java @@ -35,6 +35,7 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableColumn; import javax.swing.table.TableRowSorter; +import org.openide.util.Lookup; import org.sleuthkit.autopsy.casemodule.MultiUserCaseManager.MultiUserCase; import org.sleuthkit.autopsy.coordinationservice.CoordinationService; import org.sleuthkit.autopsy.coreutils.Logger; @@ -369,8 +370,10 @@ final class MultiUserCasesPanel extends javax.swing.JPanel { rbWeeks = new javax.swing.JRadioButton(); rbMonths = new javax.swing.JRadioButton(); rbGroupLabel = new javax.swing.JLabel(); + bnOpenSingleUserCase = new javax.swing.JButton(); setName("Completed Cases"); // NOI18N + setPreferredSize(new java.awt.Dimension(960, 485)); org.openide.awt.Mnemonics.setLocalizedText(bnOpen, org.openide.util.NbBundle.getMessage(MultiUserCasesPanel.class, "MultiUserCasesPanel.bnOpen.text")); // NOI18N bnOpen.setEnabled(false); @@ -458,6 +461,13 @@ final class MultiUserCasesPanel extends javax.swing.JPanel { rbGroupLabel.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(rbGroupLabel, org.openide.util.NbBundle.getMessage(MultiUserCasesPanel.class, "MultiUserCasesPanel.rbGroupLabel.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(bnOpenSingleUserCase, org.openide.util.NbBundle.getMessage(MultiUserCasesPanel.class, "MultiUserCasesPanel.bnOpenSingleUserCase.text")); // NOI18N + bnOpenSingleUserCase.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + bnOpenSingleUserCaseActionPerformed(evt); + } + }); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( @@ -469,8 +479,10 @@ final class MultiUserCasesPanel extends javax.swing.JPanel { .addGap(4, 4, 4) .addComponent(bnOpen, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(bnOpenSingleUserCase) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(bnShowLog) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 13, Short.MAX_VALUE) .addComponent(rbGroupLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(rbDays) @@ -480,9 +492,8 @@ final class MultiUserCasesPanel extends javax.swing.JPanel { .addComponent(rbMonths) .addGap(0, 0, 0) .addComponent(panelFilter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(bnRefresh) - .addGap(4, 4, 4)) + .addGap(14, 14, 14) + .addComponent(bnRefresh)) .addComponent(scrollPaneTable)) .addContainerGap()) ); @@ -495,15 +506,16 @@ final class MultiUserCasesPanel extends javax.swing.JPanel { .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(bnOpen) + .addComponent(bnOpenSingleUserCase) .addComponent(bnShowLog)) - .addComponent(bnRefresh) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(rbDays) .addComponent(rbWeeks) .addComponent(rbMonths) .addComponent(rbGroupLabel)) - .addComponent(panelFilter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addComponent(panelFilter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(bnRefresh, javax.swing.GroupLayout.Alignment.TRAILING)) .addGap(0, 0, 0)) ); }// //GEN-END:initComponents @@ -586,8 +598,13 @@ final class MultiUserCasesPanel extends javax.swing.JPanel { } }//GEN-LAST:event_casesTableMouseClicked + private void bnOpenSingleUserCaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnOpenSingleUserCaseActionPerformed + Lookup.getDefault().lookup(CaseOpenAction.class).openCaseSelectionWindow(); + }//GEN-LAST:event_bnOpenSingleUserCaseActionPerformed + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton bnOpen; + private javax.swing.JButton bnOpenSingleUserCase; private javax.swing.JButton bnRefresh; private javax.swing.JButton bnShowLog; private javax.swing.JTable casesTable; diff --git a/Core/src/org/sleuthkit/autopsy/core/layer.xml b/Core/src/org/sleuthkit/autopsy/core/layer.xml index 9939e747b6..04c519e181 100755 --- a/Core/src/org/sleuthkit/autopsy/core/layer.xml +++ b/Core/src/org/sleuthkit/autopsy/core/layer.xml @@ -155,11 +155,11 @@ - + - +