Autopsy  4.12.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
RelationshipBrowser.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2019 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obt ain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.communications.relationships;
20 
21 import java.awt.Component;
22 import javax.swing.JPanel;
23 import org.openide.util.Lookup;
25 
30 public final class RelationshipBrowser extends JPanel implements Lookup.Provider {
31 
34 
40 
41  MessageViewer messagesViewer = new MessageViewer();
42  ContactsViewer contactsViewer = new ContactsViewer();
43  SummaryViewer summaryViewer = new SummaryViewer();
44  MediaViewer mediaViewer = new MediaViewer();
45  CallLogViewer callLogViewer = new CallLogViewer();
46 
47  proxyLookup = new ModifiableProxyLookup(messagesViewer.getLookup());
48 
49  tabPane.add(summaryViewer.getDisplayName(), summaryViewer);
50  tabPane.add(messagesViewer.getDisplayName(), messagesViewer);
51  tabPane.add(callLogViewer.getDisplayName(), callLogViewer);
52  tabPane.add(contactsViewer.getDisplayName(), contactsViewer);
53  tabPane.add(mediaViewer.getDisplayName(), mediaViewer);
54  }
55 
62  public void setSelectionInfo(SelectionInfo info) {
63  currentSelection = info;
64  ((RelationshipsViewer) tabPane.getSelectedComponent()).setSelectionInfo(info);
65  }
66 
72  @SuppressWarnings("unchecked")
73  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
74  private void initComponents() {
75  java.awt.GridBagConstraints gridBagConstraints;
76 
77  tabPane = new javax.swing.JTabbedPane();
78 
79  setLayout(new java.awt.GridBagLayout());
80 
81  tabPane.addChangeListener(new javax.swing.event.ChangeListener() {
82  public void stateChanged(javax.swing.event.ChangeEvent evt) {
84  }
85  });
86  gridBagConstraints = new java.awt.GridBagConstraints();
87  gridBagConstraints.gridx = 0;
88  gridBagConstraints.gridy = 0;
89  gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
90  gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
91  gridBagConstraints.weightx = 1.0;
92  gridBagConstraints.weighty = 1.0;
93  add(tabPane, gridBagConstraints);
94  }// </editor-fold>//GEN-END:initComponents
95 
96  private void tabPaneStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_tabPaneStateChanged
97  if(currentSelection != null) {
98  ((RelationshipsViewer) tabPane.getSelectedComponent()).setSelectionInfo(currentSelection);
99  }
100 
101  Component selectedComponent = tabPane.getSelectedComponent();
102  if(selectedComponent instanceof Lookup.Provider) {
103  Lookup lookup = ((Lookup.Provider)selectedComponent).getLookup();
104  proxyLookup.setNewLookups(lookup);
105  }
106  }//GEN-LAST:event_tabPaneStateChanged
107 
108 
109  // Variables declaration - do not modify//GEN-BEGIN:variables
110  private javax.swing.JTabbedPane tabPane;
111  // End of variables declaration//GEN-END:variables
112 
113  @Override
114  public Lookup getLookup() {
115  return proxyLookup;
116  }
117 }

Copyright © 2012-2018 Basis Technology. Generated on: Wed Sep 18 2019
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.