Autopsy  4.11.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 
33 
37  private final MediaViewer mediaViewer;
38 
40 
46  messagesViewer = new MessageViewer();
47  contactsViewer = new ContactsViewer();
48  summaryViewer = new SummaryViewer();
49  mediaViewer = new MediaViewer();
50 
51  proxyLookup = new ModifiableProxyLookup(messagesViewer.getLookup());
52 
53  tabPane.add(summaryViewer.getDisplayName(), summaryViewer);
54  tabPane.add(messagesViewer.getDisplayName(), messagesViewer);
55  tabPane.add(contactsViewer.getDisplayName(), contactsViewer);
56  tabPane.add(mediaViewer.getDisplayName(), mediaViewer);
57  }
58 
65  public void setSelectionInfo(SelectionInfo info) {
66  currentSelection = info;
67  ((RelationshipsViewer) tabPane.getSelectedComponent()).setSelectionInfo(info);
68  }
69 
75  @SuppressWarnings("unchecked")
76  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
77  private void initComponents() {
78  java.awt.GridBagConstraints gridBagConstraints;
79 
80  tabPane = new javax.swing.JTabbedPane();
81 
82  setLayout(new java.awt.GridBagLayout());
83 
84  tabPane.addChangeListener(new javax.swing.event.ChangeListener() {
85  public void stateChanged(javax.swing.event.ChangeEvent evt) {
87  }
88  });
89  gridBagConstraints = new java.awt.GridBagConstraints();
90  gridBagConstraints.gridx = 0;
91  gridBagConstraints.gridy = 0;
92  gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
93  gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
94  gridBagConstraints.weightx = 1.0;
95  gridBagConstraints.weighty = 1.0;
96  add(tabPane, gridBagConstraints);
97  }// </editor-fold>//GEN-END:initComponents
98 
99  private void tabPaneStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_tabPaneStateChanged
100  if(currentSelection != null) {
101  ((RelationshipsViewer) tabPane.getSelectedComponent()).setSelectionInfo(currentSelection);
102  }
103 
104  Component selectedComponent = tabPane.getSelectedComponent();
105  if(selectedComponent instanceof Lookup.Provider) {
106  Lookup lookup = ((Lookup.Provider)selectedComponent).getLookup();
107  proxyLookup.setNewLookups(lookup);
108  }
109  }//GEN-LAST:event_tabPaneStateChanged
110 
111 
112  // Variables declaration - do not modify//GEN-BEGIN:variables
113  private javax.swing.JTabbedPane tabPane;
114  // End of variables declaration//GEN-END:variables
115 
116  @Override
117  public Lookup getLookup() {
118  return proxyLookup;
119  }
120 }

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