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

Copyright © 2012-2016 Basis Technology. Generated on: Mon May 7 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.