19 package org.sleuthkit.autopsy.communications;
21 import com.google.common.eventbus.Subscribe;
22 import java.awt.Dimension;
24 import java.util.List;
25 import java.util.stream.Collectors;
26 import javax.swing.GroupLayout;
27 import javax.swing.ImageIcon;
28 import javax.swing.JTabbedPane;
29 import javax.swing.LayoutStyle;
30 import org.openide.util.Lookup;
31 import org.openide.util.NbBundle;
32 import org.openide.windows.Mode;
33 import org.openide.windows.RetainLocation;
34 import org.openide.windows.TopComponent;
35 import org.openide.windows.WindowManager;
41 @TopComponent.Description(preferredID =
"CVTTopComponent", persistenceType = TopComponent.PERSISTENCE_NEVER)
42 @TopComponent.Registration(mode =
"cvt", openAtStartup =
false)
43 @RetainLocation(
"cvt")
44 @NbBundle.Messages(
"CVTTopComponent.name= Communications Visualization")
45 @SuppressWarnings(
"PMD.SingularField")
48 private static final long serialVersionUID = 1L;
53 setName(Bundle.CVTTopComponent_name());
60 final ModifiableProxyLookup proxyLookup =
new ModifiableProxyLookup(accountsBrowser.getLookup());
61 associateLookup(proxyLookup);
63 browseVisualizeTabPane.addChangeListener(changeEvent -> {
64 Lookup.Provider selectedComponent = (Lookup.Provider) browseVisualizeTabPane.getSelectedComponent();
65 proxyLookup.setNewLookups(selectedComponent.getLookup());
66 filtersPane.setDeviceAccountTypeEnabled(browseVisualizeTabPane.getSelectedIndex() != 0);
74 CVTEvents.getCVTEventBus().register(
this);
75 CVTEvents.getCVTEventBus().register(vizPanel);
76 CVTEvents.getCVTEventBus().register(accountsBrowser);
80 void pinAccount(CVTEvents.PinAccountsEvent pinEvent) {
81 browseVisualizeTabPane.setSelectedIndex(1);
92 browseVisualizeTabPane =
new JTabbedPane();
97 browseVisualizeTabPane.setFont(
new Font(
"Tahoma", 0, 18));
98 browseVisualizeTabPane.addTab(NbBundle.getMessage(
CVTTopComponent.class,
"CVTTopComponent.accountsBrowser.TabConstraints.tabTitle_1"),
new ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/communications/images/table.png")), accountsBrowser);
99 browseVisualizeTabPane.addTab(NbBundle.getMessage(
CVTTopComponent.class,
"CVTTopComponent.vizPanel.TabConstraints.tabTitle_1"),
new ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/communications/images/emblem-web.png")), vizPanel);
101 filtersPane.setMinimumSize(
new Dimension(256, 495));
103 GroupLayout layout =
new GroupLayout(
this);
104 this.setLayout(layout);
105 layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
106 .addGroup(layout.createSequentialGroup()
108 .addComponent(filtersPane, GroupLayout.PREFERRED_SIZE, 265, GroupLayout.PREFERRED_SIZE)
109 .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
110 .addComponent(browseVisualizeTabPane, GroupLayout.PREFERRED_SIZE, 786, Short.MAX_VALUE)
113 layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
114 .addGroup(layout.createSequentialGroup()
116 .addComponent(filtersPane, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
118 .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
119 .addComponent(browseVisualizeTabPane)
123 browseVisualizeTabPane.getAccessibleContext().setAccessibleName(NbBundle.getMessage(
CVTTopComponent.class,
"CVTTopComponent.browseVisualizeTabPane.AccessibleContext.accessibleName"));
136 super.componentOpened();
137 WindowManager.getDefault().setTopComponentFloating(
this,
true);
149 filtersPane.updateAndApplyFilters(
true);
159 return modes.stream().filter(mode -> mode.getName().equals(
"cvt"))
160 .collect(Collectors.toList());
VisualizationPanel vizPanel
JTabbedPane browseVisualizeTabPane
AccountsBrowser accountsBrowser
List< Mode > availableModes(List< Mode > modes)