Autopsy  4.17.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  tabPane.setSelectedIndex(0);
65  ((RelationshipsViewer) tabPane.getSelectedComponent()).setSelectionInfo(info);
66  }
67 
73  @SuppressWarnings("unchecked")
74  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
75  private void initComponents() {
76  java.awt.GridBagConstraints gridBagConstraints;
77 
78  tabPane = new javax.swing.JTabbedPane();
79 
80  setLayout(new java.awt.GridBagLayout());
81 
82  tabPane.addChangeListener(new javax.swing.event.ChangeListener() {
83  public void stateChanged(javax.swing.event.ChangeEvent evt) {
85  }
86  });
87  gridBagConstraints = new java.awt.GridBagConstraints();
88  gridBagConstraints.gridx = 0;
89  gridBagConstraints.gridy = 0;
90  gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
91  gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
92  gridBagConstraints.weightx = 1.0;
93  gridBagConstraints.weighty = 1.0;
94  add(tabPane, gridBagConstraints);
95  }// </editor-fold>//GEN-END:initComponents
96 
97  private void tabPaneStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_tabPaneStateChanged
98  if(currentSelection != null) {
99  ((RelationshipsViewer) tabPane.getSelectedComponent()).setSelectionInfo(currentSelection);
100  }
101 
102  Component selectedComponent = tabPane.getSelectedComponent();
103  if(selectedComponent instanceof Lookup.Provider) {
104  Lookup lookup = ((Lookup.Provider)selectedComponent).getLookup();
105  proxyLookup.setNewLookups(lookup);
106  }
107  }//GEN-LAST:event_tabPaneStateChanged
108 
109 
110  // Variables declaration - do not modify//GEN-BEGIN:variables
111  private javax.swing.JTabbedPane tabPane;
112  // End of variables declaration//GEN-END:variables
113 
114  @Override
115  public Lookup getLookup() {
116  return proxyLookup;
117  }
118 }

Copyright © 2012-2021 Basis Technology. Generated on: Tue Jan 19 2021
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.