19 package org.sleuthkit.autopsy.communications.relationships;
21 import java.awt.CardLayout;
22 import java.util.List;
23 import java.util.concurrent.ExecutionException;
24 import java.util.logging.Level;
25 import javax.swing.DefaultListModel;
26 import javax.swing.JPanel;
27 import org.netbeans.swing.outline.DefaultOutlineModel;
28 import org.netbeans.swing.outline.Outline;
29 import org.openide.explorer.view.OutlineView;
30 import org.openide.nodes.AbstractNode;
31 import org.openide.nodes.Children;
32 import org.openide.util.Lookup;
33 import org.openide.util.NbBundle.Messages;
55 "SummaryViewer_TabTitle=Summary",
56 "SummaryViewer_FileRefNameColumn_Title=Path",
57 "SummaryViewer_CaseRefNameColumn_Title=Case Name",
58 "SummaryViewer_CentralRepository_Message=<Enable Central Respository to see Other Occurrences>",
59 "SummaryViewer_Creation_Date_Title=Creation Date",
60 "SummaryViewer_FileRef_Message=<Select a single account to see File References>",
61 "SummaryViewer_Device_Account_Description=This account was referenced by a device in the case.",
62 "SummaryViewer_Account_Description=This account represents a device in the case.",
63 "SummaryViewer_Account_Description_MuliSelect=Summary information is not available when multiple accounts are selected.",
64 "SummaryViewer_Country_Code=Country: ",
65 "SummaryViewer_Select_account_for_persona=<Select a single account to see Persona(s)>"
72 lookup = Lookup.getDefault();
75 fileRefListModel =
new DefaultListModel<>();
79 Outline outline = outlineView.getOutline();
80 outlineView.setPropertyColumns(
"creationDate", Bundle.SummaryViewer_Creation_Date_Title());
82 outline.setRootVisible(
false);
83 ((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel(Bundle.SummaryViewer_CaseRefNameColumn_Title());
94 return Bundle.SummaryViewer_TabTitle();
111 CardLayout cardLayout = (CardLayout)
fileRefPane.getLayout();
114 fileRefListModel.removeAllElements();
118 if (info == null || info.
getAccounts().size() != 1) {
126 Account[] accountArray = info.
getAccounts().toArray(
new Account[1]);
127 Account account = accountArray[0];
129 if (account.getAccountType().getTypeName().contains(
"PHONE")) {
132 accountCountry.setText(Bundle.SummaryViewer_Country_Code() + countryCode);
140 if (account.getAccountType().equals(Account.Type.DEVICE)) {
146 AccountSummary summaryDetails =
new AccountSummary(account, info.
getArtifacts());
151 messagesDataLabel.setText(Integer.toString(summaryDetails.getMessagesCnt() + summaryDetails.getEmailCnt()));
176 super.setEnabled(enabled);
202 fileRefListModel.clear();
207 "SummaryViewer_Fetching_References=<Fetching File References>",
208 "SummaryViewer_Persona_Message=<Enable Central Repository to view Personas>"
211 SummaryPanelWorker worker =
new SummaryPanelWorker(account) {
213 protected void done() {
215 SummaryPanelWorker.SummaryWorkerResults results =
get();
219 fileRefList.forEach(value -> {
220 fileRefListModel.addElement(value);
223 CardLayout cardLayout = (CardLayout)
fileRefPane.getLayout();
226 List<Persona> personaList = results.getPersonaList();
236 }
catch (InterruptedException | ExecutionException ex) {
237 logger.log(Level.WARNING, String.format((
"Failed to get data for account: %d"), account.getAccountID()), ex);
251 @SuppressWarnings(
"unchecked")
254 java.awt.GridBagConstraints gridBagConstraints;
276 javax.swing.JPanel fileRefScrolPanel =
new javax.swing.JPanel();
277 javax.swing.JScrollPane scrollPane =
new javax.swing.JScrollPane();
279 javax.swing.JPanel selectAccountPane =
new javax.swing.JPanel();
283 setLayout(
new java.awt.GridBagLayout());
287 org.openide.awt.Mnemonics.setLocalizedText(
accountLabel,
org.openide.util.NbBundle.getMessage(
SummaryViewer.class,
"SummaryViewer.accountLabel.text"));
288 gridBagConstraints =
new java.awt.GridBagConstraints();
289 gridBagConstraints.gridx = 0;
290 gridBagConstraints.gridy = 0;
291 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
292 gridBagConstraints.insets =
new java.awt.Insets(15, 9, 0, 9);
296 gridBagConstraints =
new java.awt.GridBagConstraints();
297 gridBagConstraints.gridx = 0;
298 gridBagConstraints.gridy = 1;
299 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
300 gridBagConstraints.insets =
new java.awt.Insets(0, 9, 0, 9);
304 gridBagConstraints =
new java.awt.GridBagConstraints();
305 gridBagConstraints.gridx = 0;
306 gridBagConstraints.gridy = 2;
307 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
308 gridBagConstraints.weightx = 1.0;
309 gridBagConstraints.insets =
new java.awt.Insets(15, 9, 15, 9);
312 gridBagConstraints =
new java.awt.GridBagConstraints();
313 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
316 countsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(
SummaryViewer.class,
"SummaryViewer.countsPanel.border.title")));
317 countsPanel.setLayout(
new java.awt.GridBagLayout());
320 gridBagConstraints =
new java.awt.GridBagConstraints();
321 gridBagConstraints.gridx = 0;
322 gridBagConstraints.gridy = 0;
323 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
324 gridBagConstraints.insets =
new java.awt.Insets(9, 15, 9, 15);
328 gridBagConstraints =
new java.awt.GridBagConstraints();
329 gridBagConstraints.gridx = 0;
330 gridBagConstraints.gridy = 1;
331 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
332 gridBagConstraints.insets =
new java.awt.Insets(0, 15, 9, 15);
336 gridBagConstraints =
new java.awt.GridBagConstraints();
337 gridBagConstraints.gridx = 0;
338 gridBagConstraints.gridy = 2;
339 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
340 gridBagConstraints.insets =
new java.awt.Insets(0, 15, 9, 15);
344 gridBagConstraints =
new java.awt.GridBagConstraints();
345 gridBagConstraints.gridx = 1;
346 gridBagConstraints.gridy = 2;
347 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
348 gridBagConstraints.insets =
new java.awt.Insets(0, 0, 9, 15);
352 gridBagConstraints =
new java.awt.GridBagConstraints();
353 gridBagConstraints.gridx = 1;
354 gridBagConstraints.gridy = 0;
355 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
356 gridBagConstraints.weightx = 1.0;
357 gridBagConstraints.insets =
new java.awt.Insets(9, 0, 9, 15);
361 gridBagConstraints =
new java.awt.GridBagConstraints();
362 gridBagConstraints.gridx = 1;
363 gridBagConstraints.gridy = 1;
364 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
365 gridBagConstraints.insets =
new java.awt.Insets(0, 0, 9, 15);
369 gridBagConstraints =
new java.awt.GridBagConstraints();
370 gridBagConstraints.gridx = 0;
371 gridBagConstraints.gridy = 3;
372 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
373 gridBagConstraints.insets =
new java.awt.Insets(0, 15, 9, 15);
377 gridBagConstraints =
new java.awt.GridBagConstraints();
378 gridBagConstraints.gridx = 1;
379 gridBagConstraints.gridy = 3;
380 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
381 gridBagConstraints.insets =
new java.awt.Insets(0, 0, 9, 15);
384 gridBagConstraints =
new java.awt.GridBagConstraints();
385 gridBagConstraints.gridx = 0;
386 gridBagConstraints.gridy = 1;
387 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
388 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
391 contanctsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(
SummaryViewer.class,
"SummaryViewer.contanctsPanel.border.title")));
396 gridBagConstraints =
new java.awt.GridBagConstraints();
397 gridBagConstraints.gridx = 0;
398 gridBagConstraints.gridy = 0;
399 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
400 gridBagConstraints.insets =
new java.awt.Insets(9, 15, 9, 15);
404 gridBagConstraints =
new java.awt.GridBagConstraints();
405 gridBagConstraints.gridx = 1;
406 gridBagConstraints.gridy = 0;
407 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
408 gridBagConstraints.weightx = 1.0;
409 gridBagConstraints.insets =
new java.awt.Insets(9, 9, 9, 15);
414 gridBagConstraints =
new java.awt.GridBagConstraints();
415 gridBagConstraints.gridx = 0;
416 gridBagConstraints.gridy = 1;
417 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
418 gridBagConstraints.insets =
new java.awt.Insets(0, 15, 9, 0);
422 gridBagConstraints =
new java.awt.GridBagConstraints();
423 gridBagConstraints.gridx = 1;
424 gridBagConstraints.gridy = 1;
425 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
426 gridBagConstraints.insets =
new java.awt.Insets(0, 9, 0, 0);
429 gridBagConstraints =
new java.awt.GridBagConstraints();
430 gridBagConstraints.gridx = 0;
431 gridBagConstraints.gridy = 2;
432 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
433 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
436 caseReferencesPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(
SummaryViewer.class,
"SummaryViewer.caseReferencesPanel.border.title")));
437 gridBagConstraints =
new java.awt.GridBagConstraints();
438 gridBagConstraints.gridx = 0;
439 gridBagConstraints.gridy = 5;
440 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
441 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
442 gridBagConstraints.weightx = 1.0;
443 gridBagConstraints.weighty = 1.0;
444 gridBagConstraints.insets =
new java.awt.Insets(9, 0, 0, 0);
447 fileRefPane.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(
SummaryViewer.class,
"SummaryViewer.fileRefPane.border.title")));
450 fileRefScrolPanel.setLayout(
new java.awt.BorderLayout());
452 fileRefList.setModel(
new javax.swing.AbstractListModel<String>() {
453 String[] strings = {
"Item 1",
"Item 2",
"Item 3",
"Item 4",
"Item 5" };
454 public int getSize() {
return strings.length; }
455 public String getElementAt(
int i) {
return strings[i]; }
459 fileRefScrolPanel.add(scrollPane, java.awt.BorderLayout.CENTER);
461 fileRefPane.add(fileRefScrolPanel,
"listPanelCard");
463 selectAccountPane.setLayout(
new java.awt.GridBagLayout());
469 fileRefPane.add(selectAccountPane,
"selectAccountCard");
471 gridBagConstraints =
new java.awt.GridBagConstraints();
472 gridBagConstraints.gridx = 0;
473 gridBagConstraints.gridy = 4;
474 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
475 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
476 gridBagConstraints.weighty = 1.0;
479 personaPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(
SummaryViewer.class,
"SummaryViewer.personaPanel.border.title")));
480 personaPanel.setMinimumSize(
new java.awt.Dimension(35, 75));
481 personaPanel.setPreferredSize(
new java.awt.Dimension(112, 75));
482 gridBagConstraints =
new java.awt.GridBagConstraints();
483 gridBagConstraints.gridy = 3;
484 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
javax.swing.JLabel accountCountry
javax.swing.JLabel contactsDataLabel
javax.swing.JLabel attachmentDataLabel
javax.swing.JLabel callLogsDataLabel
javax.swing.JLabel selectAccountFileRefLabel
javax.swing.JLabel messagesDataLabel
static final Logger logger
static final long serialVersionUID
javax.swing.JLabel referencesDataLabel
javax.swing.JLabel accoutDescriptionLabel
javax.swing.JLabel referencesLabel
void setEnabled(boolean enabled)
javax.swing.JLabel contactsLabel
javax.swing.JPanel contanctsPanel
javax.swing.JPanel countsPanel
void updateOtherAccountInfo(final Account account)
javax.swing.JPanel summaryPanel
javax.swing.JLabel callLogsLabel
void setEnabled(boolean enabled)
javax.swing.JList< String > fileRefList
javax.swing.JLabel messagesLabel
javax.swing.JLabel thumbnailsDataLabel
final DefaultListModel< String > fileRefListModel
javax.swing.JPanel fileRefPane
static String getCountryCode(String phoneNumber)
javax.swing.JPanel personaPanel
org.sleuthkit.autopsy.communications.relationships.OutlineViewPanel caseReferencesPanel
static String convertToInternational(String phoneNumber)
void hideOutlineView(String message)
javax.swing.JLabel attachmentsLabel
synchronized static Logger getLogger(String name)
javax.swing.JLabel thumbnailCntLabel
Set< BlackboardArtifact > getArtifacts()
OutlineView getOutlineView()
Set< Account > getAccounts()
void setSelectionInfo(SelectionInfo info)
javax.swing.JLabel accountLabel
static boolean isEnabled()