Autopsy  4.19.3
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-2021 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 javax.swing.JPanel;
22 import org.openide.util.Lookup;
24 
29 public final class RelationshipBrowser extends JPanel implements Lookup.Provider {
30 
33 
39 
40  MessageViewer messagesViewer = new MessageViewer();
41  ContactsViewer contactsViewer = new ContactsViewer();
42  SummaryViewer summaryViewer = new SummaryViewer();
43  MediaViewer mediaViewer = new MediaViewer();
44  CallLogViewer callLogViewer = new CallLogViewer();
45 
46  proxyLookup = new ModifiableProxyLookup(messagesViewer.getLookup());
47 
48  tabPane.add(summaryViewer.getDisplayName(), summaryViewer);
49  tabPane.add(messagesViewer.getDisplayName(), messagesViewer);
50  tabPane.add(callLogViewer.getDisplayName(), callLogViewer);
51  tabPane.add(contactsViewer.getDisplayName(), contactsViewer);
52  tabPane.add(mediaViewer.getDisplayName(), mediaViewer);
53  }
54 
61  public void setSelectionInfo(SelectionInfo info) {
62  currentSelection = info;
63  tabPane.setSelectedIndex(0);
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  RelationshipsViewer viewer = ((RelationshipsViewer) tabPane.getSelectedComponent());
98  //clear old values
99  viewer.setSelectionInfo(currentSelection);
100  if (viewer instanceof Lookup.Provider) {
101  Lookup lookup = viewer.getLookup();
102  proxyLookup.setNewLookups(lookup);
103  }
104  }//GEN-LAST:event_tabPaneStateChanged
105 
106 
107  // Variables declaration - do not modify//GEN-BEGIN:variables
108  private javax.swing.JTabbedPane tabPane;
109  // End of variables declaration//GEN-END:variables
110 
111  @Override
112  public Lookup getLookup() {
113  return proxyLookup;
114  }
115 }

Copyright © 2012-2022 Basis Technology. Generated on: Tue Jun 27 2023
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.