Autopsy  4.5.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-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.getCase(Case.getCurrentCase());
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 
436  @Override
437  public boolean isSupported(Node node) {
438  if (!EamDb.isEnabled()) {
439  return false;
440  }
441 
442  // Is supported if this node has correlatable content (File, BlackboardArtifact)
443  return !getCorrelationAttributesFromNode(node).isEmpty();
444  }
445 
446  @Override
447  @Messages({"DataContentViewerOtherCases.table.nodbconnection=Cannot connect to central repository database."})
448  public void setNode(Node node) {
449  if (!EamDb.isEnabled()) {
450  return;
451  }
452 
453  reset(); // reset the table to empty.
454  if (node == null) {
455  return;
456  }
457  populateTable(node);
458  }
459 
466  @Messages({"DataContentViewerOtherCases.table.isempty=There are no associated artifacts or files from other occurrences to display.",
467  "DataContentViewerOtherCases.table.noArtifacts=Correlation cannot be performed on the selected file."})
468  private void populateTable(Node node) {
469  AbstractFile af = getAbstractFileFromNode(node);
470  String dataSourceName = "";
471  String deviceId = "";
472  try {
473  if (af != null) {
474  Content dataSource = af.getDataSource();
475  dataSourceName = dataSource.getName();
476  deviceId = Case.getCurrentCase().getSleuthkitCase().getDataSource(dataSource.getId()).getDeviceId();
477  }
478  } catch (TskException ex) {
479  // do nothing.
480  // @@@ Review this behavior
481  }
482 
483  // get the attributes we can correlate on
484  correlationAttributes.addAll(getCorrelationAttributesFromNode(node));
485  for (CorrelationAttribute corAttr : correlationAttributes) {
486  Collection<CorrelationAttributeInstance> corAttrInstances = new ArrayList<>();
487 
488  // get correlation and reference set instances from DB
489  corAttrInstances.addAll(getCorrelatedInstances(corAttr, dataSourceName, deviceId));
490 
491  corAttrInstances.forEach((corAttrInstance) -> {
492  try {
493  CorrelationAttribute newCeArtifact = new CorrelationAttribute(
494  corAttr.getCorrelationType(),
495  corAttr.getCorrelationValue()
496  );
497  newCeArtifact.addInstance(corAttrInstance);
498  tableModel.addEamArtifact(newCeArtifact);
499  } catch (EamDbException ex){
500  LOGGER.log(Level.SEVERE, "Error creating correlation attribute", ex);
501  }
502  });
503  }
504 
505  if (correlationAttributes.isEmpty()) {
506  displayMessageOnTableStatusPanel(Bundle.DataContentViewerOtherCases_table_noArtifacts());
507  } else if (0 == tableModel.getRowCount()) {
508  displayMessageOnTableStatusPanel(Bundle.DataContentViewerOtherCases_table_isempty());
509  } else {
510  clearMessageOnTableStatusPanel();
511  setColumnWidths();
512  }
513  }
514 
515  private void setColumnWidths() {
516  for (int idx = 0; idx < tableModel.getColumnCount(); idx++) {
517  TableColumn column = otherCasesTable.getColumnModel().getColumn(idx);
518  int colWidth = tableModel.getColumnPreferredWidth(idx);
519  if (0 < colWidth) {
520  column.setPreferredWidth(colWidth);
521  }
522  }
523  }
524 
525  private void displayMessageOnTableStatusPanel(String message) {
526  tableStatusPanelLabel.setText(message);
527  tableStatusPanelLabel.setVisible(true);
528  }
529 
531  tableStatusPanelLabel.setVisible(false);
532  }
533 
539  @SuppressWarnings("unchecked")
540  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
541  private void initComponents() {
542 
543  rightClickPopupMenu = new javax.swing.JPopupMenu();
544  selectAllMenuItem = new javax.swing.JMenuItem();
545  exportToCSVMenuItem = new javax.swing.JMenuItem();
546  showCaseDetailsMenuItem = new javax.swing.JMenuItem();
547  showCommonalityMenuItem = new javax.swing.JMenuItem();
548  CSVFileChooser = new javax.swing.JFileChooser();
549  otherCasesPanel = new javax.swing.JPanel();
550  tableContainerPanel = new javax.swing.JPanel();
551  tableScrollPane = new javax.swing.JScrollPane();
552  otherCasesTable = new javax.swing.JTable();
553  tableStatusPanel = new javax.swing.JPanel();
554  tableStatusPanelLabel = new javax.swing.JLabel();
555 
556  org.openide.awt.Mnemonics.setLocalizedText(selectAllMenuItem, org.openide.util.NbBundle.getMessage(DataContentViewerOtherCases.class, "DataContentViewerOtherCases.selectAllMenuItem.text")); // NOI18N
557  rightClickPopupMenu.add(selectAllMenuItem);
558 
559  org.openide.awt.Mnemonics.setLocalizedText(exportToCSVMenuItem, org.openide.util.NbBundle.getMessage(DataContentViewerOtherCases.class, "DataContentViewerOtherCases.exportToCSVMenuItem.text")); // NOI18N
560  rightClickPopupMenu.add(exportToCSVMenuItem);
561 
562  org.openide.awt.Mnemonics.setLocalizedText(showCaseDetailsMenuItem, org.openide.util.NbBundle.getMessage(DataContentViewerOtherCases.class, "DataContentViewerOtherCases.showCaseDetailsMenuItem.text")); // NOI18N
563  rightClickPopupMenu.add(showCaseDetailsMenuItem);
564 
565  org.openide.awt.Mnemonics.setLocalizedText(showCommonalityMenuItem, org.openide.util.NbBundle.getMessage(DataContentViewerOtherCases.class, "DataContentViewerOtherCases.showCommonalityMenuItem.text")); // NOI18N
566  rightClickPopupMenu.add(showCommonalityMenuItem);
567 
568  setMinimumSize(new java.awt.Dimension(1500, 10));
569  setOpaque(false);
570  setPreferredSize(new java.awt.Dimension(1500, 44));
571 
572  otherCasesPanel.setPreferredSize(new java.awt.Dimension(1500, 144));
573 
574  tableContainerPanel.setPreferredSize(new java.awt.Dimension(1500, 63));
575 
576  tableScrollPane.setPreferredSize(new java.awt.Dimension(1500, 30));
577 
578  otherCasesTable.setAutoCreateRowSorter(true);
579  otherCasesTable.setModel(tableModel);
580  otherCasesTable.setToolTipText(org.openide.util.NbBundle.getMessage(DataContentViewerOtherCases.class, "DataContentViewerOtherCases.table.toolTip.text")); // NOI18N
581  otherCasesTable.setComponentPopupMenu(rightClickPopupMenu);
582  otherCasesTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION);
583  tableScrollPane.setViewportView(otherCasesTable);
584 
585  tableStatusPanel.setPreferredSize(new java.awt.Dimension(1500, 16));
586 
587  tableStatusPanelLabel.setForeground(new java.awt.Color(255, 0, 51));
588 
589  javax.swing.GroupLayout tableStatusPanelLayout = new javax.swing.GroupLayout(tableStatusPanel);
590  tableStatusPanel.setLayout(tableStatusPanelLayout);
591  tableStatusPanelLayout.setHorizontalGroup(
592  tableStatusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
593  .addGap(0, 0, Short.MAX_VALUE)
594  .addGroup(tableStatusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
595  .addGroup(tableStatusPanelLayout.createSequentialGroup()
596  .addContainerGap()
597  .addComponent(tableStatusPanelLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 780, Short.MAX_VALUE)
598  .addContainerGap()))
599  );
600  tableStatusPanelLayout.setVerticalGroup(
601  tableStatusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
602  .addGap(0, 16, Short.MAX_VALUE)
603  .addGroup(tableStatusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
604  .addGroup(tableStatusPanelLayout.createSequentialGroup()
605  .addComponent(tableStatusPanelLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
606  .addGap(0, 0, Short.MAX_VALUE)))
607  );
608 
609  javax.swing.GroupLayout tableContainerPanelLayout = new javax.swing.GroupLayout(tableContainerPanel);
610  tableContainerPanel.setLayout(tableContainerPanelLayout);
611  tableContainerPanelLayout.setHorizontalGroup(
612  tableContainerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
613  .addComponent(tableScrollPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
614  .addComponent(tableStatusPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
615  );
616  tableContainerPanelLayout.setVerticalGroup(
617  tableContainerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
618  .addGroup(tableContainerPanelLayout.createSequentialGroup()
619  .addComponent(tableScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
620  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
621  .addComponent(tableStatusPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
622  .addContainerGap())
623  );
624 
625  javax.swing.GroupLayout otherCasesPanelLayout = new javax.swing.GroupLayout(otherCasesPanel);
626  otherCasesPanel.setLayout(otherCasesPanelLayout);
627  otherCasesPanelLayout.setHorizontalGroup(
628  otherCasesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
629  .addGap(0, 1500, Short.MAX_VALUE)
630  .addGroup(otherCasesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
631  .addComponent(tableContainerPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
632  );
633  otherCasesPanelLayout.setVerticalGroup(
634  otherCasesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
635  .addGap(0, 60, Short.MAX_VALUE)
636  .addGroup(otherCasesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
637  .addGroup(otherCasesPanelLayout.createSequentialGroup()
638  .addComponent(tableContainerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 60, Short.MAX_VALUE)
639  .addGap(0, 0, 0)))
640  );
641 
642  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
643  this.setLayout(layout);
644  layout.setHorizontalGroup(
645  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
646  .addComponent(otherCasesPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
647  );
648  layout.setVerticalGroup(
649  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
650  .addComponent(otherCasesPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 60, Short.MAX_VALUE)
651  );
652  }// </editor-fold>//GEN-END:initComponents
653 
654 
655  // Variables declaration - do not modify//GEN-BEGIN:variables
656  private javax.swing.JFileChooser CSVFileChooser;
657  private javax.swing.JMenuItem exportToCSVMenuItem;
658  private javax.swing.JPanel otherCasesPanel;
659  private javax.swing.JTable otherCasesTable;
660  private javax.swing.JPopupMenu rightClickPopupMenu;
661  private javax.swing.JMenuItem selectAllMenuItem;
662  private javax.swing.JMenuItem showCaseDetailsMenuItem;
663  private javax.swing.JMenuItem showCommonalityMenuItem;
664  private javax.swing.JPanel tableContainerPanel;
665  private javax.swing.JScrollPane tableScrollPane;
666  private javax.swing.JPanel tableStatusPanel;
667  private javax.swing.JLabel tableStatusPanelLabel;
668  // End of variables declaration//GEN-END:variables
669 }
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: Tue Feb 20 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.