19 package org.sleuthkit.autopsy.communications.relationships;
 
   21 import java.awt.CardLayout;
 
   22 import java.util.ArrayList;
 
   23 import java.util.List;
 
   24 import java.util.concurrent.ExecutionException;
 
   25 import java.util.logging.Level;
 
   26 import javax.swing.DefaultListModel;
 
   27 import javax.swing.JPanel;
 
   28 import javax.swing.SwingWorker;
 
   29 import org.netbeans.swing.outline.DefaultOutlineModel;
 
   30 import org.netbeans.swing.outline.Outline;
 
   31 import org.openide.explorer.view.OutlineView;
 
   32 import org.openide.nodes.AbstractNode;
 
   33 import org.openide.nodes.Children;
 
   34 import org.openide.util.Lookup;
 
   35 import org.openide.util.NbBundle.Messages;
 
   56         "SummaryViewer_TabTitle=Summary",
 
   57         "SummaryViewer_FileRefNameColumn_Title=Path",
 
   58         "SummaryViewer_CaseRefNameColumn_Title=Case Name",
 
   59         "SummaryViewer_CentralRepository_Message=<Enable Central Respository to see Other Occurrences>",
 
   60         "SummaryViewer_Creation_Date_Title=Creation Date",
 
   61         "SummaryViewer_FileRef_Message=<Select a single account to see File References>",
 
   62         "SummaryViewer_Device_Account_Description=This account was referenced by a device in the case.",
 
   63         "SummaryViewer_Account_Description=This account represents a device in the case.",
 
   64         "SummaryViewer_Account_Description_MuliSelect=Summary information is not available when multiple accounts are selected.",
 
   65         "SummaryViewer_Country_Code=Country: " 
   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());
 
   92         return Bundle.SummaryViewer_TabTitle();
 
  109         CardLayout cardLayout = (CardLayout) 
fileRefPane.getLayout();
 
  112         fileRefListModel.removeAllElements();
 
  116         if (info == null || info.
getAccounts().size() != 1) {
 
  124             Account[] accountArray = info.
getAccounts().toArray(
new Account[1]);
 
  125             Account account = accountArray[0];
 
  127             if (account.getAccountType().getTypeName().contains(
"PHONE")) {
 
  130                 accountCountry.setText(Bundle.SummaryViewer_Country_Code() + countryCode);
 
  138             if (account.getAccountType().equals(Account.Type.DEVICE)) {
 
  144             AccountSummary summaryDetails = 
new AccountSummary(account, info.
getArtifacts());
 
  149             messagesDataLabel.setText(Integer.toString(summaryDetails.getMessagesCnt() + summaryDetails.getEmailCnt()));
 
  174         super.setEnabled(enabled);
 
  200         fileRefListModel.clear();
 
  205         "SummaryViewer_Fetching_References=<Fetching File References>" 
  208         SwingWorker<List<String>, Void> worker = 
new SwingWorker<List<String>, Void>() {
 
  210             protected List<String> doInBackground() 
throws Exception {
 
  211                 List<String> stringList = 
new ArrayList<>();
 
  213                 for (AccountFileInstance instance : accountFileInstanceList) {
 
  214                     stringList.add(instance.getFile().getUniquePath());
 
  220             protected void done() {
 
  224                     fileRefList.forEach(value -> {
 
  225                         fileRefListModel.addElement(value);
 
  228                     CardLayout cardLayout = (CardLayout) 
fileRefPane.getLayout();
 
  231                 } 
catch (InterruptedException | ExecutionException ex) {
 
  232                     logger.log(Level.WARNING, String.format((
"Failed to get file references for account: %d"), account.getAccountID()), ex);
 
  246     @SuppressWarnings(
"unchecked")
 
  249         java.awt.GridBagConstraints gridBagConstraints;
 
  271         javax.swing.JPanel fileRefScrolPanel = 
new javax.swing.JPanel();
 
  272         javax.swing.JScrollPane scrollPane = 
new javax.swing.JScrollPane();
 
  274         javax.swing.JPanel selectAccountPane = 
new javax.swing.JPanel();
 
  277         setLayout(
new java.awt.GridBagLayout());
 
  281         org.openide.awt.Mnemonics.setLocalizedText(
accountLabel, 
org.openide.util.NbBundle.getMessage(
SummaryViewer.class, 
"SummaryViewer.accountLabel.text")); 
 
  282         gridBagConstraints = 
new java.awt.GridBagConstraints();
 
  283         gridBagConstraints.gridx = 0;
 
  284         gridBagConstraints.gridy = 0;
 
  285         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
 
  286         gridBagConstraints.insets = 
new java.awt.Insets(15, 9, 0, 9);
 
  290         gridBagConstraints = 
new java.awt.GridBagConstraints();
 
  291         gridBagConstraints.gridx = 0;
 
  292         gridBagConstraints.gridy = 1;
 
  293         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
 
  294         gridBagConstraints.insets = 
new java.awt.Insets(0, 9, 0, 9);
 
  298         gridBagConstraints = 
new java.awt.GridBagConstraints();
 
  299         gridBagConstraints.gridx = 0;
 
  300         gridBagConstraints.gridy = 2;
 
  301         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
 
  302         gridBagConstraints.weightx = 1.0;
 
  303         gridBagConstraints.insets = 
new java.awt.Insets(15, 9, 15, 9);
 
  306         gridBagConstraints = 
new java.awt.GridBagConstraints();
 
  307         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
 
  310         countsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(
SummaryViewer.class, 
"SummaryViewer.countsPanel.border.title"))); 
 
  311         countsPanel.setLayout(
new java.awt.GridBagLayout());
 
  314         gridBagConstraints = 
new java.awt.GridBagConstraints();
 
  315         gridBagConstraints.gridx = 0;
 
  316         gridBagConstraints.gridy = 0;
 
  317         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
 
  318         gridBagConstraints.insets = 
new java.awt.Insets(9, 15, 9, 15);
 
  322         gridBagConstraints = 
new java.awt.GridBagConstraints();
 
  323         gridBagConstraints.gridx = 0;
 
  324         gridBagConstraints.gridy = 1;
 
  325         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
 
  326         gridBagConstraints.insets = 
new java.awt.Insets(0, 15, 9, 15);
 
  330         gridBagConstraints = 
new java.awt.GridBagConstraints();
 
  331         gridBagConstraints.gridx = 0;
 
  332         gridBagConstraints.gridy = 2;
 
  333         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
 
  334         gridBagConstraints.insets = 
new java.awt.Insets(0, 15, 9, 15);
 
  338         gridBagConstraints = 
new java.awt.GridBagConstraints();
 
  339         gridBagConstraints.gridx = 1;
 
  340         gridBagConstraints.gridy = 2;
 
  341         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
 
  342         gridBagConstraints.insets = 
new java.awt.Insets(0, 0, 9, 15);
 
  346         gridBagConstraints = 
new java.awt.GridBagConstraints();
 
  347         gridBagConstraints.gridx = 1;
 
  348         gridBagConstraints.gridy = 0;
 
  349         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
 
  350         gridBagConstraints.weightx = 1.0;
 
  351         gridBagConstraints.insets = 
new java.awt.Insets(9, 0, 9, 15);
 
  355         gridBagConstraints = 
new java.awt.GridBagConstraints();
 
  356         gridBagConstraints.gridx = 1;
 
  357         gridBagConstraints.gridy = 1;
 
  358         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
 
  359         gridBagConstraints.insets = 
new java.awt.Insets(0, 0, 9, 15);
 
  363         gridBagConstraints = 
new java.awt.GridBagConstraints();
 
  364         gridBagConstraints.gridx = 0;
 
  365         gridBagConstraints.gridy = 3;
 
  366         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
 
  367         gridBagConstraints.insets = 
new java.awt.Insets(0, 15, 9, 15);
 
  371         gridBagConstraints = 
new java.awt.GridBagConstraints();
 
  372         gridBagConstraints.gridx = 1;
 
  373         gridBagConstraints.gridy = 3;
 
  374         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
 
  375         gridBagConstraints.insets = 
new java.awt.Insets(0, 0, 9, 15);
 
  378         gridBagConstraints = 
new java.awt.GridBagConstraints();
 
  379         gridBagConstraints.gridx = 0;
 
  380         gridBagConstraints.gridy = 1;
 
  381         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
 
  382         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
 
  385         contanctsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(
SummaryViewer.class, 
"SummaryViewer.contanctsPanel.border.title"))); 
 
  390         gridBagConstraints = 
new java.awt.GridBagConstraints();
 
  391         gridBagConstraints.gridx = 0;
 
  392         gridBagConstraints.gridy = 0;
 
  393         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
 
  394         gridBagConstraints.insets = 
new java.awt.Insets(9, 15, 9, 15);
 
  398         gridBagConstraints = 
new java.awt.GridBagConstraints();
 
  399         gridBagConstraints.gridx = 1;
 
  400         gridBagConstraints.gridy = 0;
 
  401         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
 
  402         gridBagConstraints.weightx = 1.0;
 
  403         gridBagConstraints.insets = 
new java.awt.Insets(9, 9, 9, 15);
 
  408         gridBagConstraints = 
new java.awt.GridBagConstraints();
 
  409         gridBagConstraints.gridx = 0;
 
  410         gridBagConstraints.gridy = 1;
 
  411         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
 
  412         gridBagConstraints.insets = 
new java.awt.Insets(0, 15, 9, 0);
 
  416         gridBagConstraints = 
new java.awt.GridBagConstraints();
 
  417         gridBagConstraints.gridx = 1;
 
  418         gridBagConstraints.gridy = 1;
 
  419         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
 
  420         gridBagConstraints.insets = 
new java.awt.Insets(0, 9, 0, 0);
 
  423         gridBagConstraints = 
new java.awt.GridBagConstraints();
 
  424         gridBagConstraints.gridx = 0;
 
  425         gridBagConstraints.gridy = 2;
 
  426         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
 
  427         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
 
  430         caseReferencesPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(
SummaryViewer.class, 
"SummaryViewer.caseReferencesPanel.border.title"))); 
 
  431         gridBagConstraints = 
new java.awt.GridBagConstraints();
 
  432         gridBagConstraints.gridx = 0;
 
  433         gridBagConstraints.gridy = 4;
 
  434         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
 
  435         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
 
  436         gridBagConstraints.weightx = 1.0;
 
  437         gridBagConstraints.weighty = 1.0;
 
  438         gridBagConstraints.insets = 
new java.awt.Insets(9, 0, 0, 0);
 
  441         fileRefPane.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(
SummaryViewer.class, 
"SummaryViewer.fileRefPane.border.title"))); 
 
  444         fileRefScrolPanel.setLayout(
new java.awt.BorderLayout());
 
  446         fileRefList.setModel(
new javax.swing.AbstractListModel<String>() {
 
  447             String[] strings = { 
"Item 1", 
"Item 2", 
"Item 3", 
"Item 4", 
"Item 5" };
 
  448             public int getSize() { 
return strings.length; }
 
  449             public String getElementAt(
int i) { 
return strings[i]; }
 
  453         fileRefScrolPanel.add(scrollPane, java.awt.BorderLayout.CENTER);
 
  455         fileRefPane.add(fileRefScrolPanel, 
"listPanelCard");
 
  457         selectAccountPane.setLayout(
new java.awt.GridBagLayout());
 
  463         fileRefPane.add(selectAccountPane, 
"selectAccountCard");
 
  465         gridBagConstraints = 
new java.awt.GridBagConstraints();
 
  466         gridBagConstraints.gridx = 0;
 
  467         gridBagConstraints.gridy = 3;
 
  468         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
 
  469         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
 
  470         gridBagConstraints.weighty = 1.0;
 
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
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 updateFileReferences(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)
org.sleuthkit.autopsy.communications.relationships.OutlineViewPanel caseReferencesPanel
SleuthkitCase getSleuthkitCase()
static String convertToInternational(String phoneNumber)
void hideOutlineView(String message)
javax.swing.JLabel attachmentsLabel
static Case getCurrentCase()
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()