19 package org.sleuthkit.autopsy.centralrepository.contentviewer;
24 import java.awt.Cursor;
25 import java.awt.event.ActionEvent;
26 import java.awt.event.ActionListener;
27 import java.awt.event.ComponentAdapter;
28 import java.awt.event.ComponentEvent;
30 import java.util.ArrayList;
31 import java.util.Calendar;
32 import java.util.Collection;
33 import java.util.Collections;
34 import java.util.HashMap;
35 import java.util.List;
37 import java.util.concurrent.ExecutionException;
38 import java.util.concurrent.ExecutorService;
39 import java.util.concurrent.Executors;
40 import java.util.concurrent.FutureTask;
41 import java.util.logging.Level;
42 import javax.swing.JFileChooser;
43 import javax.swing.JMenuItem;
44 import javax.swing.JOptionPane;
45 import static javax.swing.JOptionPane.DEFAULT_OPTION;
46 import static javax.swing.JOptionPane.ERROR_MESSAGE;
47 import static javax.swing.JOptionPane.PLAIN_MESSAGE;
48 import javax.swing.SwingWorker;
49 import javax.swing.filechooser.FileNameExtensionFilter;
50 import javax.swing.table.TableModel;
51 import javax.swing.table.TableRowSorter;
52 import org.openide.util.NbBundle;
68 "OtherOccurrencesPanel.table.noArtifacts=Item has no attributes with which to search.",
69 "OtherOccurrencesPanel.table.noResultsFound=No results found.",
70 "OtherOccurrencesPanel_table_loadingResults=Loading results"
74 private static final CorrelationCaseWrapper NO_ARTIFACTS_CASE =
new CorrelationCaseWrapper(Bundle.OtherOccurrencesPanel_table_noArtifacts());
75 private static final CorrelationCaseWrapper NO_RESULTS_CASE =
new CorrelationCaseWrapper(Bundle.OtherOccurrencesPanel_table_noResultsFound());
77 private static final long serialVersionUID = 1L;
83 private String dataSourceName =
"";
84 private String deviceId =
"";
85 private AbstractFile file = null;
91 private final FutureTask<JFileChooser> futureFileChooser =
new FutureTask<>(JFileChooser::new);
100 this.dataSourcesTableModel =
new OtherOccurrencesDataSourcesTableModel();
101 this.correlationAttributes =
new ArrayList<>();
103 customizeComponents();
105 ExecutorService executor = Executors.newSingleThreadExecutor();
106 executor.execute(futureFileChooser);
110 ActionListener actList = (ActionEvent e) -> {
111 JMenuItem jmi = (JMenuItem) e.getSource();
112 if (jmi.equals(showCaseDetailsMenuItem)) {
113 showCaseDetails(filesTable.getSelectedRow());
114 }
else if (jmi.equals(exportToCSVMenuItem)) {
118 logger.log(Level.SEVERE,
"Exception while getting open case.", ex);
120 }
else if (jmi.equals(showCommonalityMenuItem)) {
121 showCommonalityDetails();
125 exportToCSVMenuItem.addActionListener(actList);
126 showCaseDetailsMenuItem.addActionListener(actList);
127 showCommonalityMenuItem.addActionListener(actList);
128 filesTable.setComponentPopupMenu(rightClickPopupMenu);
130 TableRowSorter<TableModel> sorter =
new TableRowSorter<>(filesTable.getModel());
131 filesTable.setRowSorter(sorter);
134 casesTable.getRowSorter().toggleSortOrder(0);
135 dataSourcesTable.getRowSorter().toggleSortOrder(0);
136 filesTable.getRowSorter().toggleSortOrder(0);
138 casesTable.getSelectionModel().addListSelectionListener((e) -> {
140 updateOnCaseSelection();
143 dataSourcesTable.getSelectionModel().addListSelectionListener((e) -> {
145 updateOnDataSourceSelection();
150 filesTable.getSelectionModel().addListSelectionListener((e) -> {
152 occurrencePanel =
new OccurrencePanel();
153 updateOnFileSelection();
156 detailsPanelScrollPane.addComponentListener(
new ComponentAdapter() {
158 public void componentResized(ComponentEvent componentEvent) {
160 occurrencePanel.setPreferredSize(
new java.awt.Dimension(detailsPanelScrollPane.getPreferredSize().width, occurrencePanel.getPreferredSize().height));
161 detailsPanelScrollPane.setViewportView(occurrencePanel);
167 @NbBundle.Messages({
"OtherOccurrencesPanel.correlatedArtifacts.isEmpty=There are no files or artifacts to correlate.",
168 "# {0} - commonality percentage",
169 "# {1} - correlation type",
170 "# {2} - correlation value",
171 "OtherOccurrencesPanel.correlatedArtifacts.byType={0}% of data sources have {2} (type: {1})\n",
172 "OtherOccurrencesPanel.correlatedArtifacts.title=Attribute Frequency",
173 "OtherOccurrencesPanel.correlatedArtifacts.failed=Failed to get frequency details."})
179 if (correlationAttributes.isEmpty()) {
181 Bundle.OtherOccurrencesPanel_correlatedArtifacts_isEmpty(),
182 Bundle.OtherOccurrencesPanel_correlatedArtifacts_title(),
183 DEFAULT_OPTION, PLAIN_MESSAGE);
185 StringBuilder msg =
new StringBuilder(correlationAttributes.size());
187 this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
194 msg.append(Bundle.OtherOccurrencesPanel_correlatedArtifacts_byType(percentage,
195 eamArtifact.getCorrelationType().getDisplayName(),
196 eamArtifact.getCorrelationValue()));
198 logger.log(Level.WARNING, String.format(
"Error getting commonality details for artifact with ID: %s.", eamArtifact.getID()), ex);
201 this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
204 Bundle.OtherOccurrencesPanel_correlatedArtifacts_title(),
205 DEFAULT_OPTION, PLAIN_MESSAGE);
207 this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
208 logger.log(Level.SEVERE,
"Error getting commonality details.", ex);
210 Bundle.OtherOccurrencesPanel_correlatedArtifacts_failed(),
211 Bundle.OtherOccurrencesPanel_correlatedArtifacts_title(),
212 DEFAULT_OPTION, ERROR_MESSAGE);
217 @NbBundle.Messages({
"OtherOccurrencesPanel.caseDetailsDialog.notSelected=No Row Selected",
218 "OtherOccurrencesPanel.caseDetailsDialog.noDetails=No details for this case.",
219 "OtherOccurrencesPanel.caseDetailsDialog.noDetailsReference=No case details for Global reference properties.",
220 "OtherOccurrencesPanel.caseDetailsDialog.noCaseNameError=Error",
221 "OtherOccurrencesPanel.noOpenCase.errMsg=No open case available."})
223 String caseDisplayName = Bundle.OtherOccurrencesPanel_caseDetailsDialog_noCaseNameError();
224 String details = Bundle.OtherOccurrencesPanel_caseDetailsDialog_noDetails();
226 if (-1 != selectedRowViewIdx && filesTableModel.
getRowCount() > 0) {
228 int selectedRowModelIdx = filesTable.convertRowIndexToModel(selectedRowViewIdx);
229 List<NodeData> rowList = filesTableModel.getListOfNodesForFile(selectedRowModelIdx);
230 if (!rowList.isEmpty()) {
231 CorrelationCase eamCasePartial = rowList.get(0).getCorrelationAttributeInstance().getCorrelationCase();
235 if (eamCase != null) {
238 details = Bundle.OtherOccurrencesPanel_caseDetailsDialog_noDetails();
241 details = Bundle.OtherOccurrencesPanel_caseDetailsDialog_noDetailsReference();
245 logger.log(Level.SEVERE,
"Error loading case details", ex);
250 DEFAULT_OPTION, PLAIN_MESSAGE);
257 if (CSVFileChooser == null) {
259 CSVFileChooser = futureFileChooser.get();
260 }
catch (InterruptedException | ExecutionException ex) {
263 logger.log(Level.WARNING,
"A failure occurred in the JFileChooser background thread");
264 CSVFileChooser =
new JFileChooser();
268 Calendar now = Calendar.getInstance();
269 String fileName = String.format(
"%1$tY%1$tm%1$te%1$tI%1$tM%1$tS_other_data_sources.csv", now);
271 CSVFileChooser.setSelectedFile(
new File(fileName));
272 CSVFileChooser.setFileFilter(
new FileNameExtensionFilter(
"csv file",
"csv"));
274 int returnVal = CSVFileChooser.showSaveDialog(filesTable);
275 if (returnVal == JFileChooser.APPROVE_OPTION) {
277 File selectedFile = CSVFileChooser.getSelectedFile();
278 if (!selectedFile.getName().endsWith(
".csv")) {
279 selectedFile =
new File(selectedFile.toString() +
".csv");
281 CSVWorker csvWorker =
new CSVWorker(selectedFile, dataSourceName, deviceId, Collections.unmodifiableCollection(correlationAttributes));
287 @NbBundle.Messages({
"OtherOccurrencesPanel_earliestCaseNotAvailable=Not Available."})
293 casesTableModel.clearTable();
294 dataSourcesTableModel.clearTable();
295 filesTableModel.clearTable();
296 correlationAttributes.clear();
297 earliestCaseDate.setText(Bundle.OtherOccurrencesPanel_earliestCaseNotAvailable());
298 foundInLabel.setText(
"");
300 occurrencePanel =
new OccurrencePanel();
301 occurrencePanel.getPreferredSize();
302 detailsPanelScrollPane.setViewportView(occurrencePanel);
316 if (worker != null) {
321 casesTableModel.addCorrelationCase(NO_ARTIFACTS_CASE);
323 worker =
new OtherOccurrenceOneTypeWorker(aType, value, file, deviceId, dataSourceName) {
331 casesTableModel.clearTable();
333 OtherOccurrenceOneTypeWorker.OneTypeData data =
get();
334 correlationAttributes.addAll(data.getCorrelationAttributesToAdd());
336 casesTableModel.addCorrelationCase(
new CorrelationCaseWrapper(corCase));
339 if (correlationAttributes.isEmpty()) {
340 casesTableModel.addCorrelationCase(NO_ARTIFACTS_CASE);
341 }
else if (caseCount == 0) {
342 casesTableModel.addCorrelationCase(NO_RESULTS_CASE);
344 String earliestDate = data.getEarliestCaseDate();
345 earliestCaseDate.setText(earliestDate.isEmpty() ? Bundle.OtherOccurrencesPanel_earliestCaseNotAvailable() : earliestDate);
346 foundInLabel.setText(String.format(Bundle.OtherOccurrencesPanel_foundIn_text(), data.getTotalCount(), caseCount, data.getDataSourceCount()));
348 casesTable.setRowSelectionInterval(0, 0);
352 }
catch (InterruptedException | ExecutionException ex) {
353 logger.log(Level.SEVERE,
"Failed to update OtherOccurrence panel", ex);
364 void showPanelLoadingMessage() {
365 casesTableModel.addCorrelationCase(NO_ARTIFACTS_CASE);
375 "OtherOccurrencesPanel.foundIn.text=Found %d instances in %d cases and %d data sources."
377 void populateTable(OtherOccurrencesData data) {
378 this.file = data.getFile();
379 this.dataSourceName = data.getDataSourceName();
380 this.deviceId = data.getDeviceId();
382 casesTableModel.clearTable();
384 correlationAttributes.addAll(data.getCorrelationAttributes());
386 for (CorrelationCase corCase : data.getCaseMap().values()) {
387 casesTableModel.addCorrelationCase(
new CorrelationCaseWrapper(corCase));
390 if (correlationAttributes.isEmpty()) {
391 casesTableModel.addCorrelationCase(NO_ARTIFACTS_CASE);
392 }
else if (caseCount == 0) {
393 casesTableModel.addCorrelationCase(NO_RESULTS_CASE);
395 String earliestDate = data.getEarliestCaseDate();
396 earliestCaseDate.setText(earliestDate.isEmpty() ? Bundle.OtherOccurrencesPanel_earliestCaseNotAvailable() : earliestDate);
397 foundInLabel.setText(String.format(Bundle.OtherOccurrencesPanel_foundIn_text(), data.getInstanceDataCount(), caseCount, data.getDataSourceCount()));
399 casesTable.setRowSelectionInterval(0, 0);
409 if (worker != null) {
414 final int[] selectedCaseIndexes = casesTable.getSelectedRows();
415 dataSourcesTableModel.clearTable();
416 filesTableModel.clearTable();
418 if (selectedCaseIndexes.length == 0) {
420 occurrencePanel =
new OccurrencePanel();
421 occurrencePanel.getPreferredSize();
422 detailsPanelScrollPane.setViewportView(occurrencePanel);
427 setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
429 worker =
new SelectionWorker(correlationAttributes, deviceId, dataSourceName) {
437 Map<UniquePathKey, NodeData> correlatedNodeDataMap =
get();
439 String currentCaseName;
443 currentCaseName = null;
444 logger.log(Level.WARNING,
"Unable to get current case for other occurrences content viewer", ex);
447 for (
NodeData nodeData : correlatedNodeDataMap.values()) {
448 for (
int selectedRow : selectedCaseIndexes) {
450 if (casesTableModel.getCorrelationCase(casesTable.convertRowIndexToModel(selectedRow)) != null
451 && casesTableModel.getCorrelationCase(casesTable.convertRowIndexToModel(selectedRow)).getCaseUUID().equals(nodeData.getCorrelationAttributeInstance().getCorrelationCase().getCaseUUID())) {
452 dataSourcesTableModel.addNodeData(nodeData);
455 logger.log(Level.WARNING,
"Unable to get correlation attribute instance from OtherOccurrenceNodeInstanceData for case " + nodeData.getCaseName(), ex);
460 if (dataSourcesTableModel.getRowCount() > 0) {
461 dataSourcesTable.setRowSelectionInterval(0, 0);
464 setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
466 }
catch (InterruptedException | ExecutionException ex) {
467 logger.log(Level.SEVERE,
"Failed to update OtherOccurrencesPanel on data source selection", ex);
480 if (worker != null) {
485 setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
487 final int[] selectedDataSources = dataSourcesTable.getSelectedRows();
488 filesTableModel.clearTable();
490 worker =
new SelectionWorker(correlationAttributes, deviceId, dataSourceName) {
498 Map<UniquePathKey, NodeData> correlatedNodeDataMap =
get();
499 if (dataSourcesTableModel.getRowCount() > 0) {
500 for (
NodeData nodeData : correlatedNodeDataMap.values()) {
501 for (
int selectedDataSourceRow : selectedDataSources) {
502 int rowModelIndex = dataSourcesTable.convertRowIndexToModel(selectedDataSourceRow);
504 if (dataSourcesTableModel.getCaseUUIDForRow(rowModelIndex).equals(nodeData.getCorrelationAttributeInstance().getCorrelationCase().getCaseUUID())
505 && dataSourcesTableModel.getDeviceIdForRow(rowModelIndex).equals(nodeData.getDeviceID())) {
506 filesTableModel.addNodeData(nodeData);
509 logger.log(Level.WARNING,
"Unable to get correlation attribute instance from OtherOccurrenceNodeInstanceData for case " + nodeData.getCaseName(), ex);
516 filesTable.setRowSelectionInterval(0, 0);
518 }
catch (InterruptedException | ExecutionException ex) {
519 logger.log(Level.SEVERE,
"Failed to update OtherOccurrencesPanel on case selection", ex);
521 setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
534 setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
536 if (filesTableModel.
getRowCount() > 0 && filesTable.getSelectedRowCount() == 1) {
538 occurrencePanel =
new OccurrencePanel(filesTableModel.getListOfNodesForFile(filesTable.convertRowIndexToModel(filesTable.getSelectedRow())));
539 }
else if (dataSourcesTableModel.getRowCount() > 0 && dataSourcesTable.getSelectedRowCount() == 1) {
541 String caseName = dataSourcesTableModel.getCaseNameForRow(dataSourcesTable.convertRowIndexToModel(dataSourcesTable.getSelectedRow()));
542 String dsName = dataSourcesTableModel.getValueAt(dataSourcesTable.convertRowIndexToModel(dataSourcesTable.getSelectedRow()), 0).toString();
543 String caseCreatedDate =
"";
545 for (
int row : casesTable.getSelectedRows()) {
546 if (casesTableModel.
getValueAt(casesTable.convertRowIndexToModel(row), 0).toString().equals(caseName)) {
547 caseCreatedDate = getCaseCreatedDate(row);
552 occurrencePanel =
new OccurrencePanel(caseName, caseCreatedDate, dsName);
553 }
else if (casesTable.getSelectedRowCount() == 1) {
557 String caseName =
"";
559 caseName = casesTableModel.
getValueAt(casesTable.convertRowIndexToModel(casesTable.getSelectedRow()), 0).toString();
561 if (caseName.isEmpty()) {
562 occurrencePanel =
new OccurrencePanel();
564 createdDate = getCaseCreatedDate(casesTable.getSelectedRow());
565 occurrencePanel =
new OccurrencePanel(caseName, createdDate);
569 occurrencePanel =
new OccurrencePanel();
572 occurrencePanel.getPreferredSize();
573 detailsPanelScrollPane.setViewportView(occurrencePanel);
575 setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
591 partialCase = casesTableModel.getCorrelationCase(casesTable.convertRowIndexToModel(caseTableRowIdx));
592 if (partialCase == null) {
600 logger.log(Level.WARNING,
"Error getting case created date for row: " + caseTableRowIdx, ex);
608 private class SelectionWorker extends SwingWorker<Map<UniquePathKey, NodeData>, Void> {
622 SelectionWorker(Collection<CorrelationAttributeInstance> coAtInstances, String deviceIdStr, String dataSourceNameStr) {
623 this.coAtInstances = coAtInstances;
624 this.dataSourceNameStr = dataSourceNameStr;
625 this.deviceIdStr = deviceIdStr;
630 Map<UniquePathKey, NodeData> correlatedNodeDataMap =
new HashMap<>();
635 return new HashMap<>();
639 return correlatedNodeDataMap;
646 private class CSVWorker extends SwingWorker<Void, Void> {
662 CSVWorker(File destFile, String dataSourceName, String deviceId, Collection<CorrelationAttributeInstance> correlationAttList) {
663 this.destFile = destFile;
664 this.dataSourceName = dataSourceName;
665 this.deviceId = deviceId;
666 this.correlationAttList = correlationAttList;
679 }
catch (InterruptedException | ExecutionException ex) {
681 "Failed to create csv file for Other Occurrences at\n" + destFile.getAbsolutePath(),
682 "Error Creating CSV",
683 JOptionPane.ERROR_MESSAGE);
685 logger.log(Level.SEVERE,
"Error writing selected rows to from OtherOccurrencePanel to " + destFile.getAbsolutePath(), ex);
695 @SuppressWarnings(
"unchecked")
697 private
void initComponents() {
698 java.awt.GridBagConstraints gridBagConstraints;
700 rightClickPopupMenu =
new javax.swing.JPopupMenu();
701 exportToCSVMenuItem =
new javax.swing.JMenuItem();
702 showCaseDetailsMenuItem =
new javax.swing.JMenuItem();
703 showCommonalityMenuItem =
new javax.swing.JMenuItem();
704 tableContainerPanel =
new javax.swing.JPanel();
705 tablesViewerSplitPane =
new javax.swing.JSplitPane();
706 caseDatasourceFileSplitPane =
new javax.swing.JSplitPane();
707 caseDatasourceSplitPane =
new javax.swing.JSplitPane();
708 caseScrollPane =
new javax.swing.JScrollPane();
709 casesTable =
new javax.swing.JTable();
710 dataSourceScrollPane =
new javax.swing.JScrollPane();
711 dataSourcesTable =
new javax.swing.JTable();
712 filesTableScrollPane =
new javax.swing.JScrollPane();
713 filesTable =
new javax.swing.JTable();
714 detailsPanelScrollPane =
new javax.swing.JScrollPane();
715 jPanel1 =
new javax.swing.JPanel();
716 foundInLabel =
new javax.swing.JLabel();
717 earliestCaseDate =
new javax.swing.JLabel();
718 earliestCaseLabel =
new javax.swing.JLabel();
719 filler1 =
new javax.swing.Box.Filler(
new java.awt.Dimension(0, 0),
new java.awt.Dimension(0, 0),
new java.awt.Dimension(32767, 0));
721 rightClickPopupMenu.addPopupMenuListener(
new javax.swing.event.PopupMenuListener() {
722 public void popupMenuCanceled(javax.swing.event.PopupMenuEvent evt) {
724 public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {
726 public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {
727 rightClickPopupMenuPopupMenuWillBecomeVisible(evt);
731 org.openide.awt.Mnemonics.setLocalizedText(exportToCSVMenuItem,
org.openide.util.NbBundle.getMessage(
OtherOccurrencesPanel.class,
"OtherOccurrencesPanel.exportToCSVMenuItem.text"));
732 rightClickPopupMenu.add(exportToCSVMenuItem);
734 org.openide.awt.Mnemonics.setLocalizedText(showCaseDetailsMenuItem,
org.openide.util.NbBundle.getMessage(
OtherOccurrencesPanel.class,
"OtherOccurrencesPanel.showCaseDetailsMenuItem.text"));
735 rightClickPopupMenu.add(showCaseDetailsMenuItem);
737 org.openide.awt.Mnemonics.setLocalizedText(showCommonalityMenuItem,
org.openide.util.NbBundle.getMessage(
OtherOccurrencesPanel.class,
"OtherOccurrencesPanel.showCommonalityMenuItem.text"));
738 rightClickPopupMenu.add(showCommonalityMenuItem);
740 tableContainerPanel.setPreferredSize(
new java.awt.Dimension(600, 63));
741 tableContainerPanel.setRequestFocusEnabled(
false);
743 tablesViewerSplitPane.setDividerLocation(450);
744 tablesViewerSplitPane.setResizeWeight(0.75);
746 caseDatasourceFileSplitPane.setDividerLocation(300);
747 caseDatasourceFileSplitPane.setResizeWeight(0.66);
748 caseDatasourceFileSplitPane.setToolTipText(
org.openide.util.NbBundle.getMessage(
OtherOccurrencesPanel.class,
"OtherOccurrencesPanel.caseDatasourceFileSplitPane.toolTipText"));
750 caseDatasourceSplitPane.setDividerLocation(150);
751 caseDatasourceSplitPane.setResizeWeight(0.5);
753 caseScrollPane.setPreferredSize(
new java.awt.Dimension(150, 30));
755 casesTable.setAutoCreateRowSorter(
true);
756 casesTable.setModel(casesTableModel);
757 caseScrollPane.setViewportView(casesTable);
759 caseDatasourceSplitPane.setLeftComponent(caseScrollPane);
761 dataSourceScrollPane.setPreferredSize(
new java.awt.Dimension(150, 30));
763 dataSourcesTable.setAutoCreateRowSorter(
true);
764 dataSourcesTable.setModel(dataSourcesTableModel);
765 dataSourceScrollPane.setViewportView(dataSourcesTable);
767 caseDatasourceSplitPane.setRightComponent(dataSourceScrollPane);
769 caseDatasourceFileSplitPane.setLeftComponent(caseDatasourceSplitPane);
771 filesTableScrollPane.setPreferredSize(
new java.awt.Dimension(150, 30));
773 filesTable.setAutoCreateRowSorter(
true);
774 filesTable.setModel(filesTableModel);
775 filesTable.setToolTipText(
org.openide.util.NbBundle.getMessage(
OtherOccurrencesPanel.class,
"OtherOccurrencesPanel.filesTable.toolTipText"));
776 filesTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
777 filesTableScrollPane.setViewportView(filesTable);
779 caseDatasourceFileSplitPane.setRightComponent(filesTableScrollPane);
781 tablesViewerSplitPane.setLeftComponent(caseDatasourceFileSplitPane);
783 detailsPanelScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
784 detailsPanelScrollPane.setPreferredSize(
new java.awt.Dimension(300, 100));
785 tablesViewerSplitPane.setRightComponent(detailsPanelScrollPane);
787 jPanel1.setPreferredSize(
new java.awt.Dimension(576, 22));
788 jPanel1.setLayout(
new java.awt.GridBagLayout());
790 foundInLabel.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
791 org.openide.awt.Mnemonics.setLocalizedText(foundInLabel,
org.openide.util.NbBundle.getMessage(
OtherOccurrencesPanel.class,
"OtherOccurrencesPanel.foundInLabel.text"));
792 foundInLabel.setPreferredSize(
new java.awt.Dimension(400, 16));
793 gridBagConstraints =
new java.awt.GridBagConstraints();
794 gridBagConstraints.gridx = 3;
795 gridBagConstraints.gridy = 0;
796 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
797 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
798 gridBagConstraints.insets =
new java.awt.Insets(2, 2, 0, 0);
799 jPanel1.add(foundInLabel, gridBagConstraints);
801 org.openide.awt.Mnemonics.setLocalizedText(earliestCaseDate,
org.openide.util.NbBundle.getMessage(
OtherOccurrencesPanel.class,
"OtherOccurrencesPanel.earliestCaseDate.text"));
802 earliestCaseDate.setMaximumSize(
new java.awt.Dimension(200, 16));
803 gridBagConstraints =
new java.awt.GridBagConstraints();
804 gridBagConstraints.gridx = 1;
805 gridBagConstraints.gridy = 0;
806 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
807 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
808 gridBagConstraints.insets =
new java.awt.Insets(0, 7, 0, 0);
809 jPanel1.add(earliestCaseDate, gridBagConstraints);
811 org.openide.awt.Mnemonics.setLocalizedText(earliestCaseLabel,
org.openide.util.NbBundle.getMessage(
OtherOccurrencesPanel.class,
"OtherOccurrencesPanel.earliestCaseLabel.text"));
812 earliestCaseLabel.setToolTipText(
org.openide.util.NbBundle.getMessage(
OtherOccurrencesPanel.class,
"OtherOccurrencesPanel.earliestCaseLabel.toolTipText"));
813 earliestCaseLabel.setMaximumSize(
new java.awt.Dimension(260, 16));
814 gridBagConstraints =
new java.awt.GridBagConstraints();
815 gridBagConstraints.gridx = 0;
816 gridBagConstraints.gridy = 0;
817 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
818 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
819 jPanel1.add(earliestCaseLabel, gridBagConstraints);
820 gridBagConstraints =
new java.awt.GridBagConstraints();
821 gridBagConstraints.gridx = 2;
822 gridBagConstraints.gridy = 0;
823 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
824 gridBagConstraints.weightx = 0.1;
825 jPanel1.add(filler1, gridBagConstraints);
827 javax.swing.GroupLayout tableContainerPanelLayout =
new javax.swing.GroupLayout(tableContainerPanel);
828 tableContainerPanel.setLayout(tableContainerPanelLayout);
829 tableContainerPanelLayout.setHorizontalGroup(
830 tableContainerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
831 .addGroup(tableContainerPanelLayout.createSequentialGroup()
832 .addGroup(tableContainerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
833 .addComponent(tablesViewerSplitPane, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
834 .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 516, Short.MAX_VALUE))
837 tableContainerPanelLayout.setVerticalGroup(
838 tableContainerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
839 .addGroup(tableContainerPanelLayout.createSequentialGroup()
841 .addComponent(tablesViewerSplitPane)
842 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
843 .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
847 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
848 this.setLayout(layout);
849 layout.setHorizontalGroup(
850 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
851 .addComponent(tableContainerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 528, Short.MAX_VALUE)
853 layout.setVerticalGroup(
854 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
855 .addComponent(tableContainerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 143, Short.MAX_VALUE)
860 boolean enableCentralRepoActions =
false;
862 int rowIndex = filesTable.getSelectedRow();
863 List<NodeData> selectedFile = filesTableModel.getListOfNodesForFile(rowIndex);
864 if (!selectedFile.isEmpty() && selectedFile.get(0) instanceof
NodeData) {
865 enableCentralRepoActions =
true;
868 showCaseDetailsMenuItem.setVisible(enableCentralRepoActions);
869 showCommonalityMenuItem.setVisible(enableCentralRepoActions);
Object getValueAt(int rowIdx, int colIdx)
javax.swing.JScrollPane caseScrollPane
javax.swing.JScrollPane filesTableScrollPane
static void writeOtherOccurrencesToFileAsCSV(File destFile, Collection< CorrelationAttributeInstance > correlationAttList, String dataSourceName, String deviceId)
javax.swing.JPopupMenu rightClickPopupMenu
final OtherOccurrencesDataSourcesTableModel dataSourcesTableModel
static Map< UniquePathKey, NodeData > getCorrelatedInstances(String deviceId, String dataSourceName, CorrelationAttributeInstance corAttr)
javax.swing.JMenuItem showCaseDetailsMenuItem
javax.swing.JSplitPane caseDatasourceSplitPane
final Collection< CorrelationAttributeInstance > correlationAttList
CorrelationCase getCaseByUUID(String caseUUID)
void customizeComponents()
javax.swing.JPanel tableContainerPanel
final Collection< CorrelationAttributeInstance > correlationAttributes
final String dataSourceName
String getCaseCreatedDate(int caseTableRowIdx)
javax.swing.JLabel foundInLabel
javax.swing.JTable casesTable
void showCommonalityDetails()
void showCaseDetails(int selectedRowViewIdx)
final Collection< CorrelationAttributeInstance > coAtInstances
String getCaseDetailsOptionsPaneDialog()
OccurrencePanel occurrencePanel
javax.swing.JScrollPane detailsPanelScrollPane
void updateOnDataSourceSelection()
void updateOnFileSelection()
javax.swing.Box.Filler filler1
javax.swing.JLabel earliestCaseDate
javax.swing.JPanel jPanel1
final OtherOccurrencesFilesTableModel filesTableModel
javax.swing.JScrollPane dataSourceScrollPane
void populateTableForOneType(CorrelationAttributeInstance.Type aType, String value)
javax.swing.JMenuItem exportToCSVMenuItem
int getFrequencyPercentage(CorrelationAttributeInstance corAttr)
javax.swing.JMenuItem showCommonalityMenuItem
javax.swing.JLabel earliestCaseLabel
final String dataSourceNameStr
static Case getCurrentCase()
synchronized static Logger getLogger(String name)
javax.swing.JTable filesTable
JFileChooser CSVFileChooser
static Case getCurrentCaseThrows()
javax.swing.JSplitPane tablesViewerSplitPane
void updateOnCaseSelection()
void rightClickPopupMenuPopupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt)
String getExportDirectory()
final OtherOccurrencesCasesTableModel casesTableModel
javax.swing.JSplitPane caseDatasourceFileSplitPane
static CentralRepository getInstance()
static boolean isCaseOpen()
Map< UniquePathKey, NodeData > doInBackground()
static boolean isEnabled()
javax.swing.JTable dataSourcesTable