From 786c8ffc319cbbaf6e90152e8e510c46ded6566d Mon Sep 17 00:00:00 2001 From: millmanorama Date: Mon, 23 Oct 2017 16:34:05 +0200 Subject: [PATCH] Add CVTTopComponent and accountsBrowser --- .../autopsy/communications/AccountNode.java | 23 +++ .../communications/AccountsBrowser.form | 40 ++++ .../communications/AccountsBrowser.java | 49 +++++ .../autopsy/communications/Bundle.properties | 9 + .../communications/CVTTopComponent.form | 167 ++++++++++++++++ .../communications/CVTTopComponent.java | 178 ++++++++++++++++++ .../autopsy/communications/OpenCVTAction.java | 78 ++++++++ .../communications/images/email_link.png | Bin 0 -> 821 bytes .../org/sleuthkit/autopsy/core/cvtWsmode.xml | 11 ++ Core/src/org/sleuthkit/autopsy/core/layer.xml | 1 + 10 files changed, 556 insertions(+) create mode 100644 Core/src/org/sleuthkit/autopsy/communications/AccountNode.java create mode 100644 Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.form create mode 100644 Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.java create mode 100644 Core/src/org/sleuthkit/autopsy/communications/Bundle.properties create mode 100644 Core/src/org/sleuthkit/autopsy/communications/CVTTopComponent.form create mode 100644 Core/src/org/sleuthkit/autopsy/communications/CVTTopComponent.java create mode 100644 Core/src/org/sleuthkit/autopsy/communications/OpenCVTAction.java create mode 100644 Core/src/org/sleuthkit/autopsy/communications/images/email_link.png create mode 100644 Core/src/org/sleuthkit/autopsy/core/cvtWsmode.xml diff --git a/Core/src/org/sleuthkit/autopsy/communications/AccountNode.java b/Core/src/org/sleuthkit/autopsy/communications/AccountNode.java new file mode 100644 index 0000000000..0d6920e3c9 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/communications/AccountNode.java @@ -0,0 +1,23 @@ +/* + * 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.communications; + +public class AccountNode { + +} diff --git a/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.form b/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.form new file mode 100644 index 0000000000..83a3e75e9a --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.form @@ -0,0 +1,40 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.java b/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.java new file mode 100644 index 0000000000..cc9faa3ec5 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.java @@ -0,0 +1,49 @@ +package org.sleuthkit.autopsy.communications; + +import javax.swing.JPanel; + +public class AccountsBrowser extends JPanel { + + private static final long serialVersionUID = 1L; + + /** + * Creates new form AccountsBrowser + */ + public AccountsBrowser() { + 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() { + + outlineView = new org.openide.explorer.view.OutlineView(); + + 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() + .addGap(0, 0, 0) + .addComponent(outlineView, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) + .addGap(0, 0, 0)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGap(0, 0, 0) + .addComponent(outlineView, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE) + .addGap(0, 0, 0)) + ); + }// //GEN-END:initComponents + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private org.openide.explorer.view.OutlineView outlineView; + // End of variables declaration//GEN-END:variables +} diff --git a/Core/src/org/sleuthkit/autopsy/communications/Bundle.properties b/Core/src/org/sleuthkit/autopsy/communications/Bundle.properties new file mode 100644 index 0000000000..bd82de278e --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/communications/Bundle.properties @@ -0,0 +1,9 @@ +# 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. + +CVTTopComponent.jPanel2.border.title=Filters +CVTTopComponent.jTextField1.text=place holder for messages ,thumbnail list, etc +CVTTopComponent.jTextField2.text=place holder for message viewer +CVTTopComponent.TabConstraints.tabTitle=Visualize +CVTTopComponent.accountsBrowser.TabConstraints.tabTitle=Browse diff --git a/Core/src/org/sleuthkit/autopsy/communications/CVTTopComponent.form b/Core/src/org/sleuthkit/autopsy/communications/CVTTopComponent.form new file mode 100644 index 0000000000..3dd339c0be --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/communications/CVTTopComponent.form @@ -0,0 +1,167 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/Core/src/org/sleuthkit/autopsy/communications/CVTTopComponent.java b/Core/src/org/sleuthkit/autopsy/communications/CVTTopComponent.java new file mode 100644 index 0000000000..23a752b78b --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/communications/CVTTopComponent.java @@ -0,0 +1,178 @@ +/* + * 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.communications; + +import java.util.List; +import java.util.stream.Collectors; +import org.openide.explorer.ExplorerManager; +import org.openide.util.NbBundle; +import org.openide.windows.Mode; +import org.openide.windows.RetainLocation; +import org.openide.windows.TopComponent; +import org.openide.windows.WindowManager; +import org.sleuthkit.autopsy.coreutils.ThreadConfined; + +/** + * Top component which displays something. + */ +@TopComponent.Description( + preferredID = "CVTTopComponent", + //iconBase="SET/PATH/TO/ICON/HERE", //use this to put icon in window title area, + persistenceType = TopComponent.PERSISTENCE_NEVER) +@TopComponent.Registration(mode = "cvt", openAtStartup = false) +@RetainLocation("cvt") +@NbBundle.Messages("CVTTopComponent.name= Communications Visualization") +public final class CVTTopComponent extends TopComponent implements ExplorerManager.Provider { + + private static final long serialVersionUID = 1L; + + @ThreadConfined(type = ThreadConfined.ThreadType.AWT) + private final ExplorerManager em = new ExplorerManager(); + + public CVTTopComponent() { + initComponents(); + setName(Bundle.CVTTopComponent_name()); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + jPanel2 = new javax.swing.JPanel(); + jSplitPane1 = new javax.swing.JSplitPane(); + jTabbedPane1 = new javax.swing.JTabbedPane(); + accountsBrowser = new org.sleuthkit.autopsy.communications.AccountsBrowser(); + jPanel1 = new javax.swing.JPanel(); + jSplitPane2 = new javax.swing.JSplitPane(); + jTextField1 = new javax.swing.JTextField(); + jTextField2 = new javax.swing.JTextField(); + + jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(CVTTopComponent.class, "CVTTopComponent.jPanel2.border.title"))); // NOI18N + + javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); + jPanel2.setLayout(jPanel2Layout); + jPanel2Layout.setHorizontalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 232, Short.MAX_VALUE) + ); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 0, Short.MAX_VALUE) + ); + + jSplitPane1.setDividerLocation(600); + + jTabbedPane1.addTab(org.openide.util.NbBundle.getMessage(CVTTopComponent.class, "CVTTopComponent.accountsBrowser.TabConstraints.tabTitle"), accountsBrowser); // NOI18N + + jPanel1.setName(""); // NOI18N + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 594, Short.MAX_VALUE) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 716, Short.MAX_VALUE) + ); + + jTabbedPane1.addTab(org.openide.util.NbBundle.getMessage(CVTTopComponent.class, "CVTTopComponent.TabConstraints.tabTitle"), jPanel1); // NOI18N + + jSplitPane1.setLeftComponent(jTabbedPane1); + + jSplitPane2.setDividerLocation(200); + jSplitPane2.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); + + jTextField1.setText(org.openide.util.NbBundle.getMessage(CVTTopComponent.class, "CVTTopComponent.jTextField1.text")); // NOI18N + jTextField1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jTextField1ActionPerformed(evt); + } + }); + jSplitPane2.setTopComponent(jTextField1); + + jTextField2.setText(org.openide.util.NbBundle.getMessage(CVTTopComponent.class, "CVTTopComponent.jTextField2.text")); // NOI18N + jSplitPane2.setRightComponent(jTextField2); + + jSplitPane1.setRightComponent(jSplitPane2); + + 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(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, 0) + .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1334, Short.MAX_VALUE) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jSplitPane1) + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap()) + ); + }// //GEN-END:initComponents + + private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jTextField1ActionPerformed + + // Variables declaration - do not modify//GEN-BEGIN:variables + private org.sleuthkit.autopsy.communications.AccountsBrowser accountsBrowser; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + private javax.swing.JSplitPane jSplitPane1; + private javax.swing.JSplitPane jSplitPane2; + private javax.swing.JTabbedPane jTabbedPane1; + private javax.swing.JTextField jTextField1; + private javax.swing.JTextField jTextField2; + // End of variables declaration//GEN-END:variables + + @Override + public void componentOpened() { + super.componentOpened(); + WindowManager.getDefault().setTopComponentFloating(this, true); + } + + @Override + public ExplorerManager getExplorerManager() { + return em; + } + + @Override + public List availableModes(List modes) { + /* + * This looks like the right thing to do, but online discussions seems + * to indicate this method is effectively deprecated. A break point + * placed here was never hit. + */ + return modes.stream().filter(mode -> mode.getName().equals("cvt")) + .collect(Collectors.toList()); + } +} diff --git a/Core/src/org/sleuthkit/autopsy/communications/OpenCVTAction.java b/Core/src/org/sleuthkit/autopsy/communications/OpenCVTAction.java new file mode 100644 index 0000000000..6606b563ec --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/communications/OpenCVTAction.java @@ -0,0 +1,78 @@ +/* + * 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.communications; + +import java.awt.Component; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import org.openide.awt.ActionID; +import org.openide.awt.ActionReference; +import org.openide.awt.ActionReferences; +import org.openide.awt.ActionRegistration; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; +import org.openide.util.NbBundle.Messages; +import org.openide.util.actions.CallableSystemAction; +import org.openide.util.actions.Presenter; +import org.openide.windows.TopComponent; +import org.openide.windows.WindowManager; + +@ActionID(category = "Tools", + id = "org.sleuthkit.autopsy.communicationsVisualization.OpenCVTAction") +@ActionRegistration(displayName = "#CTL_OpenCVTAction", lazy = false) +@ActionReferences(value = { + @ActionReference(path = "Menu/Tools", position = 102) + , @ActionReference(path = "Toolbars/Case", position = 102)}) +@Messages("CTL_OpenCVTAction=Visualize Communications") +public final class OpenCVTAction extends CallableSystemAction implements Presenter.Toolbar { + + private static final long serialVersionUID = 1L; + + private final JButton toolbarButton = new JButton(getName(), + new ImageIcon(getClass().getResource("images/email_link.png"))); //NON-NLS + + public OpenCVTAction() { + toolbarButton.addActionListener(actionEvent -> performAction()); + } + + @Override + public void performAction() { + final TopComponent tc = WindowManager.getDefault().findTopComponent("CVTTopComponent"); + if (tc != null) { + if (tc.isOpened() == false) { + tc.open(); + } + tc.toFront(); + tc.requestActive(); + } + } + + @Override + @NbBundle.Messages("OpenCVTAction.displayName=Communications Visualizaton") + public String getName() { + return Bundle.OpenCVTAction_displayName(); + } + + /** + * Returns the toolbar component of this action + * + * @return component the toolbar button + */ + @Override + public Component getToolbarPresenter() { + return toolbarButton; + } + + @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/communications/images/email_link.png b/Core/src/org/sleuthkit/autopsy/communications/images/email_link.png new file mode 100644 index 0000000000000000000000000000000000000000..2c49f78a657c1ba1ec0ca6a28455721b20d4ec50 GIT binary patch literal 821 zcmV-51Iqk~P)@&xZvixulsk-;T#44a~v_p20ZGUos{+e ziqz?x2bDc`a!X|=H&x$AMYoNVcg>OOowMZH)34;Je1??Brir-Kni02|lNTF@eWxU< zNk%>3@}$y)izYH)GssfVp3xDiE3_bkWMX`Nts^t6W3>pK-9Ht?o9O^7?i6NLjsQv?P*iV0iU-X5Sd9M&!sd>k z-}n)V&Ti=SdNj)vcx!UOwiJe3ap)x zhTreU^71mwW;2vMYG|~5SX^`qp4Dm_$qtT$Tu~De0*V@+3QHb<@Jz?l?%DX)jK3n%GeMWMRG`GqGK;aY9f#^aZ zOePZ?4hJk23kC-Vah~@swT#Cppt+@$Wc};h+}xV#>gq5Bl$Mr`=jZ3Ai;9XMkw^s5 zntHTH0W_NhILR;mh%Tj488#RUA*0aU)W&v_?a!!auqSM92 z#VeJSmGRoz+9WTwtgP$?uL8c_qaN+i49)%pyygIR5QP`^00000NkvXXu0mjf)cSaJ literal 0 HcmV?d00001 diff --git a/Core/src/org/sleuthkit/autopsy/core/cvtWsmode.xml b/Core/src/org/sleuthkit/autopsy/core/cvtWsmode.xml new file mode 100644 index 0000000000..fc0f8a0200 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/core/cvtWsmode.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/core/layer.xml b/Core/src/org/sleuthkit/autopsy/core/layer.xml index 95cfcd481e..09514caddf 100755 --- a/Core/src/org/sleuthkit/autopsy/core/layer.xml +++ b/Core/src/org/sleuthkit/autopsy/core/layer.xml @@ -443,6 +443,7 @@ +