Autopsy  4.4.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
DataContentViewerOtherCases.java
Go to the documentation of this file.
1 /*
2  * Central Repository
3  *
4  * Copyright 2015-2017 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 obtain 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.centralrepository.contentviewer;
20 
21 import java.awt.Component;
22 import java.awt.event.ActionEvent;
23 import java.awt.event.ActionListener;
24 import java.io.BufferedWriter;
25 import java.io.File;
26 import java.io.IOException;
27 import java.nio.file.Files;
28 import java.util.ArrayList;
29 import java.util.Calendar;
30 import java.util.Collection;
31 import java.util.Collections;
32 import java.util.List;
33 import java.util.logging.Level;
35 import java.util.stream.Collectors;
36 import javax.swing.JFileChooser;
37 import javax.swing.JMenuItem;
38 import javax.swing.JOptionPane;
39 import static javax.swing.JOptionPane.DEFAULT_OPTION;
40 import static javax.swing.JOptionPane.PLAIN_MESSAGE;
41 import static javax.swing.JOptionPane.ERROR_MESSAGE;
42 import javax.swing.filechooser.FileNameExtensionFilter;
43 import javax.swing.table.TableCellRenderer;
44 import javax.swing.table.TableColumn;
45 import org.openide.nodes.Node;
46 import org.openide.util.NbBundle.Messages;
47 import org.openide.util.lookup.ServiceProvider;
56 import org.sleuthkit.datamodel.AbstractFile;
57 import org.sleuthkit.datamodel.BlackboardArtifact;
58 import org.sleuthkit.datamodel.BlackboardArtifactTag;
59 import org.sleuthkit.datamodel.Content;
60 import org.sleuthkit.datamodel.ContentTag;
61 import org.sleuthkit.datamodel.TskCoreException;
62 import org.sleuthkit.datamodel.TskException;
64 
68 @ServiceProvider(service = DataContentViewer.class, position = 8)
69 @Messages({"DataContentViewerOtherCases.title=Other Occurrences",
70  "DataContentViewerOtherCases.toolTip=Displays instances of the selected file/artifact from other occurrences.",})
71 public class DataContentViewerOtherCases extends javax.swing.JPanel implements DataContentViewer {
72 
73  private final static Logger LOGGER = Logger.getLogger(DataContentViewerOtherCases.class.getName());
74 
76  private final Collection<CorrelationAttribute> correlationAttributes;
77 
82  this.tableModel = new DataContentViewerOtherCasesTableModel();
83  this.correlationAttributes = new ArrayList<>();
84 
85  initComponents();
86  customizeComponents();
87  reset();
88  }
89 
90  private void customizeComponents() {
91  ActionListener actList = new ActionListener() {
92  @Override
93  public void actionPerformed(ActionEvent e) {
94  JMenuItem jmi = (JMenuItem) e.getSource();
95  if (jmi.equals(selectAllMenuItem)) {
96  otherCasesTable.selectAll();
97  } else if (jmi.equals(showCaseDetailsMenuItem)) {
98  showCaseDetails(otherCasesTable.getSelectedRow());
99  } else if (jmi.equals(exportToCSVMenuItem)) {
100  saveToCSV();
101  } else if (jmi.equals(showCommonalityMenuItem)) {
102  showCommonalityDetails();
103  }
104  }
105  };
106 
107  exportToCSVMenuItem.addActionListener(actList);
108  selectAllMenuItem.addActionListener(actList);
109  showCaseDetailsMenuItem.addActionListener(actList);
110  showCommonalityMenuItem.addActionListener(actList);
111 
112  // Set background of every nth row as light grey.
113  TableCellRenderer renderer = new DataContentViewerOtherCasesTableCellRenderer();
114  otherCasesTable.setDefaultRenderer(Object.class, renderer);
115  tableStatusPanelLabel.setVisible(false);
116  }
117 
118  @Messages({"DataContentViewerOtherCases.correlatedArtifacts.isEmpty=There are no files or artifacts to correlate.",
119  "# {0} - commonality percentage",
120  "# {1} - correlation type",
121  "# {2} - correlation value",
122  "DataContentViewerOtherCases.correlatedArtifacts.byType={0}% of data sources have {2} (type: {1})\n",
123  "DataContentViewerOtherCases.correlatedArtifacts.title=Attribute Frequency",
124  "DataContentViewerOtherCases.correlatedArtifacts.failed=Failed to get frequency details."})
128  private void showCommonalityDetails() {
129  if (correlationAttributes.isEmpty()) {
130  JOptionPane.showConfirmDialog(showCommonalityMenuItem,
131  Bundle.DataContentViewerOtherCases_correlatedArtifacts_isEmpty(),
132  Bundle.DataContentViewerOtherCases_correlatedArtifacts_title(),
133  DEFAULT_OPTION, PLAIN_MESSAGE);
134  } else {
135  StringBuilder msg = new StringBuilder();
136  int percentage;
137  try {
138  EamDb dbManager = EamDb.getInstance();
139  for (CorrelationAttribute eamArtifact : correlationAttributes) {
140  percentage = dbManager.getFrequencyPercentage(eamArtifact);
141  msg.append(Bundle.DataContentViewerOtherCases_correlatedArtifacts_byType(percentage,
142  eamArtifact.getCorrelationType().getDisplayName(),
143  eamArtifact.getCorrelationValue()));
144  }
145  JOptionPane.showConfirmDialog(showCommonalityMenuItem,
146  msg.toString(),
147  Bundle.DataContentViewerOtherCases_correlatedArtifacts_title(),
148  DEFAULT_OPTION, PLAIN_MESSAGE);
149  } catch (EamDbException ex) {
150  LOGGER.log(Level.SEVERE, "Error getting commonality details.", ex);
151  JOptionPane.showConfirmDialog(showCommonalityMenuItem,
152  Bundle.DataContentViewerOtherCases_correlatedArtifacts_failed(),
153  Bundle.DataContentViewerOtherCases_correlatedArtifacts_title(),
154  DEFAULT_OPTION, ERROR_MESSAGE);
155  }
156  }
157  }
158 
159  @Messages({"DataContentViewerOtherCases.caseDetailsDialog.notSelected=No Row Selected",
160  "DataContentViewerOtherCases.caseDetailsDialog.noDetails=No details for this case.",
161  "DataContentViewerOtherCases.caseDetailsDialog.noDetailsReference=No case details for Global reference properties.",
162  "DataContentViewerOtherCases.caseDetailsDialog.noCaseNameError=Error"})
163  private void showCaseDetails(int selectedRowViewIdx) {
164  String caseDisplayName = Bundle.DataContentViewerOtherCases_caseDetailsDialog_noCaseNameError();
165  try {
166  if (-1 != selectedRowViewIdx) {
167  EamDb dbManager = EamDb.getInstance();
168  int selectedRowModelIdx = otherCasesTable.convertRowIndexToModel(selectedRowViewIdx);
169  CorrelationAttribute eamArtifact = (CorrelationAttribute) tableModel.getRow(selectedRowModelIdx);
170  CorrelationCase eamCasePartial = eamArtifact.getInstances().get(0).getCorrelationCase();
171  if (eamCasePartial == null) {
172  JOptionPane.showConfirmDialog(showCaseDetailsMenuItem,
173  Bundle.DataContentViewerOtherCases_caseDetailsDialog_noDetailsReference(),
174  caseDisplayName,
175  DEFAULT_OPTION, PLAIN_MESSAGE);
176  return;
177  }
178  caseDisplayName = eamCasePartial.getDisplayName();
179  // query case details
180  CorrelationCase eamCase = dbManager.getCaseByUUID(eamCasePartial.getCaseUUID());
181  if (eamCase == null) {
182  JOptionPane.showConfirmDialog(showCaseDetailsMenuItem,
183  Bundle.DataContentViewerOtherCases_caseDetailsDialog_noDetails(),
184  caseDisplayName,
185  DEFAULT_OPTION, PLAIN_MESSAGE);
186  return;
187  }
188 
189  // display case details
190  JOptionPane.showConfirmDialog(showCaseDetailsMenuItem,
192  caseDisplayName,
193  DEFAULT_OPTION, PLAIN_MESSAGE);
194  } else {
195  JOptionPane.showConfirmDialog(showCaseDetailsMenuItem,
196  Bundle.DataContentViewerOtherCases_caseDetailsDialog_notSelected(),
197  caseDisplayName,
198  DEFAULT_OPTION, PLAIN_MESSAGE);
199  }
200  } catch (EamDbException ex) {
201  JOptionPane.showConfirmDialog(showCaseDetailsMenuItem,
202  Bundle.DataContentViewerOtherCases_caseDetailsDialog_noDetails(),
203  caseDisplayName,
204  DEFAULT_OPTION, PLAIN_MESSAGE);
205  }
206  }
207 
208  private void saveToCSV() {
209  if (0 != otherCasesTable.getSelectedRowCount()) {
210  Calendar now = Calendar.getInstance();
211  String fileName = String.format("%1$tY%1$tm%1$te%1$tI%1$tM%1$tS_other_data_sources.csv", now);
212  CSVFileChooser.setCurrentDirectory(new File(Case.getCurrentCase().getExportDirectory()));
213  CSVFileChooser.setSelectedFile(new File(fileName));
214  CSVFileChooser.setFileFilter(new FileNameExtensionFilter("csv file", "csv"));
215 
216  int returnVal = CSVFileChooser.showSaveDialog(otherCasesTable);
217  if (returnVal == JFileChooser.APPROVE_OPTION) {
218 
219  File selectedFile = CSVFileChooser.getSelectedFile();
220  if (!selectedFile.getName().endsWith(".csv")) { // NON-NLS
221  selectedFile = new File(selectedFile.toString() + ".csv"); // NON-NLS
222  }
223 
224  writeSelectedRowsToFileAsCSV(selectedFile);
225  }
226  }
227  }
228 
229  private void writeSelectedRowsToFileAsCSV(File destFile) {
230  StringBuilder content;
231  int[] selectedRowViewIndices = otherCasesTable.getSelectedRows();
232  int colCount = tableModel.getColumnCount();
233 
234  try (BufferedWriter writer = Files.newBufferedWriter(destFile.toPath())) {
235 
236  // write column names
237  content = new StringBuilder("");
238  for (int colIdx = 0; colIdx < colCount; colIdx++) {
239  content.append('"').append(tableModel.getColumnName(colIdx)).append('"');
240  if (colIdx < (colCount - 1)) {
241  content.append(",");
242  }
243  }
244 
245  content.append(System.getProperty("line.separator"));
246  writer.write(content.toString());
247 
248  // write rows
249  for (int rowViewIdx : selectedRowViewIndices) {
250  content = new StringBuilder("");
251  for (int colIdx = 0; colIdx < colCount; colIdx++) {
252  int rowModelIdx = otherCasesTable.convertRowIndexToModel(rowViewIdx);
253  content.append('"').append(tableModel.getValueAt(rowModelIdx, colIdx)).append('"');
254  if (colIdx < (colCount - 1)) {
255  content.append(",");
256  }
257  }
258  content.append(System.getProperty("line.separator"));
259  writer.write(content.toString());
260  }
261 
262  } catch (IOException ex) {
263  LOGGER.log(Level.SEVERE, "Error writing selected rows to CSV.", ex);
264  }
265  }
266 
270  private void reset() {
271  // start with empty table
272  tableModel.clearTable();
273  correlationAttributes.clear();
274  }
275 
276  @Override
277  public String getTitle() {
278  return Bundle.DataContentViewerOtherCases_title();
279  }
280 
281  @Override
282  public String getToolTip() {
283  return Bundle.DataContentViewerOtherCases_toolTip();
284  }
285 
286  @Override
288  return new DataContentViewerOtherCases();
289  }
290 
291  @Override
292  public Component getComponent() {
293  return this;
294  }
295 
296  @Override
297  public void resetComponent() {
298  reset();
299  }
300 
301  @Override
302  public int isPreferred(Node node) {
303  return 1;
304  }
305 
313  private BlackboardArtifact getBlackboardArtifactFromNode(Node node) {
314  BlackboardArtifactTag nodeBbArtifactTag = node.getLookup().lookup(BlackboardArtifactTag.class);
315  BlackboardArtifact nodeBbArtifact = node.getLookup().lookup(BlackboardArtifact.class);
316 
317  if (nodeBbArtifactTag != null) {
318  return nodeBbArtifactTag.getArtifact();
319  } else if (nodeBbArtifact != null) {
320  return nodeBbArtifact;
321  }
322 
323  return null;
324  }
325 
333  private AbstractFile getAbstractFileFromNode(Node node) {
334  BlackboardArtifactTag nodeBbArtifactTag = node.getLookup().lookup(BlackboardArtifactTag.class);
335  ContentTag nodeContentTag = node.getLookup().lookup(ContentTag.class);
336  BlackboardArtifact nodeBbArtifact = node.getLookup().lookup(BlackboardArtifact.class);
337  AbstractFile nodeAbstractFile = node.getLookup().lookup(AbstractFile.class);
338 
339  if (nodeBbArtifactTag != null) {
340  Content content = nodeBbArtifactTag.getContent();
341  if (content instanceof AbstractFile) {
342  return (AbstractFile) content;
343  }
344  } else if (nodeContentTag != null) {
345  Content content = nodeContentTag.getContent();
346  if (content instanceof AbstractFile) {
347  return (AbstractFile) content;
348  }
349  } else if (nodeBbArtifact != null) {
350  Content content;
351  try {
352  content = nodeBbArtifact.getSleuthkitCase().getContentById(nodeBbArtifact.getObjectID());
353  } catch (TskCoreException ex) {
354  LOGGER.log(Level.SEVERE, "Error retrieving blackboard artifact", ex); // NON-NLS
355  return null;
356  }
357 
358  if (content instanceof AbstractFile) {
359  return (AbstractFile) content;
360  }
361  } else if (nodeAbstractFile != null) {
362  return nodeAbstractFile;
363  }
364 
365  return null;
366  }
367 
375  private Collection<CorrelationAttribute> getCorrelationAttributesFromNode(Node node) {
376  Collection<CorrelationAttribute> ret = new ArrayList<>();
377 
378  // correlate on blackboard artifact attributes if they exist and supported
379  BlackboardArtifact bbArtifact = getBlackboardArtifactFromNode(node);
380  if (bbArtifact != null) {
381  ret.addAll(EamArtifactUtil.getCorrelationAttributeFromBlackboardArtifact(bbArtifact, false, false));
382  }
383 
384  // we can correlate based on the MD5 if it is enabled
385  AbstractFile abstractFile = getAbstractFileFromNode(node);
386  if (abstractFile != null) {
387  try {
389  String md5 = abstractFile.getMd5Hash();
390  if (md5 != null && !md5.isEmpty() && null != artifactTypes && !artifactTypes.isEmpty()) {
391  for (CorrelationAttribute.Type aType : artifactTypes) {
392  if (aType.getId() == CorrelationAttribute.FILES_TYPE_ID) {
393  ret.add(new CorrelationAttribute(aType, md5));
394  break;
395  }
396  }
397  }
398  } catch (EamDbException ex) {
399  LOGGER.log(Level.SEVERE, "Error connecting to DB", ex); // NON-NLS
400  }
401  }
402 
403  return ret;
404  }
405 
406 
407 
418  private Collection<CorrelationAttributeInstance> getCorrelatedInstances(CorrelationAttribute corAttr, String dataSourceName, String deviceId) {
419  // @@@ Check exception
420  String caseUUID = Case.getCurrentCase().getName();
421  try {
422  EamDb dbManager = EamDb.getInstance();
423  Collection<CorrelationAttributeInstance> artifactInstances = dbManager.getArtifactInstancesByTypeValue(corAttr.getCorrelationType(), corAttr.getCorrelationValue()).stream()
424  .filter(artifactInstance -> !artifactInstance.getCorrelationCase().getCaseUUID().equals(caseUUID)
425  || !artifactInstance.getCorrelationDataSource().getName().equals(dataSourceName)
426  || !artifactInstance.getCorrelationDataSource().getDeviceID().equals(deviceId))
427  .collect(Collectors.toList());
428  return artifactInstances;
429  } catch (EamDbException ex) {
430  LOGGER.log(Level.SEVERE, "Error getting artifact instances from database.", ex); // NON-NLS
431  }
432 
433  return Collections.emptyList();
434  }
435 
445  public Collection<CorrelationAttributeInstance> getReferenceInstancesAsArtifactInstances(CorrelationAttribute eamArtifact) {
446  Collection<CorrelationAttributeInstance> eamArtifactInstances = new ArrayList<>();
447  // FUTURE: support other reference types
449  return Collections.emptyList();
450  }
451  try {
452  EamDb dbManager = EamDb.getInstance();
453  Collection<EamGlobalFileInstance> eamGlobalFileInstances = dbManager.getReferenceInstancesByTypeValue(eamArtifact.getCorrelationType(), eamArtifact.getCorrelationValue());
454  eamGlobalFileInstances.forEach((eamGlobalFileInstance) -> {
455  eamArtifactInstances.add(new CorrelationAttributeInstance(
456  null, null, "", eamGlobalFileInstance.getComment(), eamGlobalFileInstance.getKnownStatus(), CorrelationAttributeInstance.GlobalStatus.GLOBAL
457  ));
458  });
459  return eamArtifactInstances;
460  } catch (EamDbException ex) {
461  LOGGER.log(Level.SEVERE, "Error getting reference instances from database.", ex); // NON-NLS
462  }
463  return Collections.emptyList();
464  }
465 
466  @Override
467  public boolean isSupported(Node node) {
468  if (!EamDb.isEnabled()) {
469  return false;
470  }
471 
472  // Is supported if this node has correlatable content (File, BlackboardArtifact)
473  return !getCorrelationAttributesFromNode(node).isEmpty();
474  }
475 
476  @Override
477  @Messages({"DataContentViewerOtherCases.table.nodbconnection=Cannot connect to central repository database."})
478  public void setNode(Node node) {
479  if (!EamDb.isEnabled()) {
480  return;
481  }
482 
483  reset(); // reset the table to empty.
484  if (node == null) {
485  return;
486  }
487  populateTable(node);
488  }
489 
496  @Messages({"DataContentViewerOtherCases.table.isempty=There are no associated artifacts or files from other occurrences to display.",
497  "DataContentViewerOtherCases.table.noArtifacts=Correlation cannot be performed on the selected file."})
498  private void populateTable(Node node) {
499  AbstractFile af = getAbstractFileFromNode(node);
500  String dataSourceName = "";
501  String deviceId = "";
502  try {
503  if (af != null) {
504  Content dataSource = af.getDataSource();
505  dataSourceName = dataSource.getName();
506  deviceId = Case.getCurrentCase().getSleuthkitCase().getDataSource(dataSource.getId()).getDeviceId();
507  }
508  } catch (TskException ex) {
509  // do nothing.
510  // @@@ Review this behavior
511  }
512 
513  // get the attributes we can correlate on
514  correlationAttributes.addAll(getCorrelationAttributesFromNode(node));
515  for (CorrelationAttribute corAttr : correlationAttributes) {
516  Collection<CorrelationAttributeInstance> corAttrInstances = new ArrayList<>();
517 
518  // get correlation and reference set instances from DB
519  corAttrInstances.addAll(getCorrelatedInstances(corAttr, dataSourceName, deviceId));
520  corAttrInstances.addAll(getReferenceInstancesAsArtifactInstances(corAttr));
521 
522  corAttrInstances.forEach((corAttrInstance) -> {
523  CorrelationAttribute newCeArtifact = new CorrelationAttribute(
524  corAttr.getCorrelationType(),
525  corAttr.getCorrelationValue()
526  );
527  newCeArtifact.addInstance(corAttrInstance);
528  tableModel.addEamArtifact(newCeArtifact);
529  });
530  }
531 
532  if (correlationAttributes.isEmpty()) {
533  displayMessageOnTableStatusPanel(Bundle.DataContentViewerOtherCases_table_noArtifacts());
534  } else if (0 == tableModel.getRowCount()) {
535  displayMessageOnTableStatusPanel(Bundle.DataContentViewerOtherCases_table_isempty());
536  } else {
537  clearMessageOnTableStatusPanel();
538  setColumnWidths();
539  }
540  }
541 
542  private void setColumnWidths() {
543  for (int idx = 0; idx < tableModel.getColumnCount(); idx++) {
544  TableColumn column = otherCasesTable.getColumnModel().getColumn(idx);
545  int colWidth = tableModel.getColumnPreferredWidth(idx);
546  if (0 < colWidth) {
547  column.setPreferredWidth(colWidth);
548  }
549  }
550  }
551 
552  private void displayMessageOnTableStatusPanel(String message) {
553  tableStatusPanelLabel.setText(message);
554  tableStatusPanelLabel.setVisible(true);
555  }
556 
558  tableStatusPanelLabel.setVisible(false);
559  }
560 
566  @SuppressWarnings("unchecked")
567  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
568  private void initComponents() {
569 
570  rightClickPopupMenu = new javax.swing.JPopupMenu();
571  selectAllMenuItem = new javax.swing.JMenuItem();
572  exportToCSVMenuItem = new javax.swing.JMenuItem();
573  showCaseDetailsMenuItem = new javax.swing.JMenuItem();
574  showCommonalityMenuItem = new javax.swing.JMenuItem();
575  CSVFileChooser = new javax.swing.JFileChooser();
576  otherCasesPanel = new javax.swing.JPanel();
577  tableContainerPanel = new javax.swing.JPanel();
578  tableScrollPane = new javax.swing.JScrollPane();
579  otherCasesTable = new javax.swing.JTable();
580  tableStatusPanel = new javax.swing.JPanel();
581  tableStatusPanelLabel = new javax.swing.JLabel();
582 
583  org.openide.awt.Mnemonics.setLocalizedText(selectAllMenuItem, org.openide.util.NbBundle.getMessage(DataContentViewerOtherCases.class, "DataContentViewerOtherCases.selectAllMenuItem.text")); // NOI18N
584  rightClickPopupMenu.add(selectAllMenuItem);
585 
586  org.openide.awt.Mnemonics.setLocalizedText(exportToCSVMenuItem, org.openide.util.NbBundle.getMessage(DataContentViewerOtherCases.class, "DataContentViewerOtherCases.exportToCSVMenuItem.text")); // NOI18N
587  rightClickPopupMenu.add(exportToCSVMenuItem);
588 
589  org.openide.awt.Mnemonics.setLocalizedText(showCaseDetailsMenuItem, org.openide.util.NbBundle.getMessage(DataContentViewerOtherCases.class, "DataContentViewerOtherCases.showCaseDetailsMenuItem.text")); // NOI18N
590  rightClickPopupMenu.add(showCaseDetailsMenuItem);
591 
592  org.openide.awt.Mnemonics.setLocalizedText(showCommonalityMenuItem, org.openide.util.NbBundle.getMessage(DataContentViewerOtherCases.class, "DataContentViewerOtherCases.showCommonalityMenuItem.text")); // NOI18N
593  rightClickPopupMenu.add(showCommonalityMenuItem);
594 
595  tableScrollPane.setPreferredSize(new java.awt.Dimension(452, 30));
596 
597  otherCasesTable.setAutoCreateRowSorter(true);
598  otherCasesTable.setModel(tableModel);
599  otherCasesTable.setToolTipText(org.openide.util.NbBundle.getMessage(DataContentViewerOtherCases.class, "DataContentViewerOtherCases.table.toolTip.text")); // NOI18N
600  otherCasesTable.setComponentPopupMenu(rightClickPopupMenu);
601  otherCasesTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION);
602  tableScrollPane.setViewportView(otherCasesTable);
603 
604  tableStatusPanelLabel.setForeground(new java.awt.Color(255, 0, 51));
605 
606  javax.swing.GroupLayout tableStatusPanelLayout = new javax.swing.GroupLayout(tableStatusPanel);
607  tableStatusPanel.setLayout(tableStatusPanelLayout);
608  tableStatusPanelLayout.setHorizontalGroup(
609  tableStatusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
610  .addGap(0, 0, Short.MAX_VALUE)
611  .addGroup(tableStatusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
612  .addGroup(tableStatusPanelLayout.createSequentialGroup()
613  .addContainerGap()
614  .addComponent(tableStatusPanelLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 780, Short.MAX_VALUE)
615  .addContainerGap()))
616  );
617  tableStatusPanelLayout.setVerticalGroup(
618  tableStatusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
619  .addGap(0, 16, Short.MAX_VALUE)
620  .addGroup(tableStatusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
621  .addGroup(tableStatusPanelLayout.createSequentialGroup()
622  .addComponent(tableStatusPanelLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
623  .addGap(0, 0, Short.MAX_VALUE)))
624  );
625 
626  javax.swing.GroupLayout tableContainerPanelLayout = new javax.swing.GroupLayout(tableContainerPanel);
627  tableContainerPanel.setLayout(tableContainerPanelLayout);
628  tableContainerPanelLayout.setHorizontalGroup(
629  tableContainerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
630  .addComponent(tableScrollPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
631  .addComponent(tableStatusPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
632  );
633  tableContainerPanelLayout.setVerticalGroup(
634  tableContainerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
635  .addGroup(tableContainerPanelLayout.createSequentialGroup()
636  .addComponent(tableScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
637  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
638  .addComponent(tableStatusPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
639  .addContainerGap())
640  );
641 
642  javax.swing.GroupLayout otherCasesPanelLayout = new javax.swing.GroupLayout(otherCasesPanel);
643  otherCasesPanel.setLayout(otherCasesPanelLayout);
644  otherCasesPanelLayout.setHorizontalGroup(
645  otherCasesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
646  .addGap(0, 800, Short.MAX_VALUE)
647  .addGroup(otherCasesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
648  .addComponent(tableContainerPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
649  );
650  otherCasesPanelLayout.setVerticalGroup(
651  otherCasesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
652  .addGap(0, 144, Short.MAX_VALUE)
653  .addGroup(otherCasesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
654  .addGroup(otherCasesPanelLayout.createSequentialGroup()
655  .addComponent(tableContainerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
656  .addGap(0, 0, 0)))
657  );
658 
659  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
660  this.setLayout(layout);
661  layout.setHorizontalGroup(
662  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
663  .addComponent(otherCasesPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
664  );
665  layout.setVerticalGroup(
666  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
667  .addComponent(otherCasesPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
668  );
669  }// </editor-fold>//GEN-END:initComponents
670 
671 
672  // Variables declaration - do not modify//GEN-BEGIN:variables
673  private javax.swing.JFileChooser CSVFileChooser;
674  private javax.swing.JMenuItem exportToCSVMenuItem;
675  private javax.swing.JPanel otherCasesPanel;
676  private javax.swing.JTable otherCasesTable;
677  private javax.swing.JPopupMenu rightClickPopupMenu;
678  private javax.swing.JMenuItem selectAllMenuItem;
679  private javax.swing.JMenuItem showCaseDetailsMenuItem;
680  private javax.swing.JMenuItem showCommonalityMenuItem;
681  private javax.swing.JPanel tableContainerPanel;
682  private javax.swing.JScrollPane tableScrollPane;
683  private javax.swing.JPanel tableStatusPanel;
684  private javax.swing.JLabel tableStatusPanelLabel;
685  // End of variables declaration//GEN-END:variables
686 }
int getFrequencyPercentage(CorrelationAttribute corAttr)
CorrelationCase getCaseByUUID(String caseUUID)
void addInstance(CorrelationAttributeInstance artifactInstance)
List< CorrelationAttributeInstance > getArtifactInstancesByTypeValue(CorrelationAttribute.Type aType, String value)
List< EamGlobalFileInstance > getReferenceInstancesByTypeValue(CorrelationAttribute.Type aType, String aValue)
synchronized static Logger getLogger(String name)
Definition: Logger.java:161
Collection< CorrelationAttributeInstance > getCorrelatedInstances(CorrelationAttribute corAttr, String dataSourceName, String deviceId)
Collection< CorrelationAttributeInstance > getReferenceInstancesAsArtifactInstances(CorrelationAttribute eamArtifact)
List< CorrelationAttribute.Type > getDefinedCorrelationTypes()
static List< CorrelationAttribute > getCorrelationAttributeFromBlackboardArtifact(BlackboardArtifact bbArtifact, boolean addInstanceDetails, boolean checkEnabled)

Copyright © 2012-2016 Basis Technology. Generated on: Fri Sep 29 2017
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.