19 package org.sleuthkit.autopsy.centralrepository.contentviewer;
21 import com.google.common.util.concurrent.ThreadFactoryBuilder;
25 import java.awt.Cursor;
26 import java.awt.event.ActionEvent;
27 import java.awt.event.ActionListener;
28 import java.awt.event.ComponentAdapter;
29 import java.awt.event.ComponentEvent;
31 import java.util.ArrayList;
32 import java.util.Calendar;
33 import java.util.Collection;
34 import java.util.Collections;
35 import java.util.HashMap;
36 import java.util.List;
38 import java.util.concurrent.ExecutionException;
39 import java.util.concurrent.ExecutorService;
40 import java.util.concurrent.Executors;
41 import java.util.concurrent.FutureTask;
42 import java.util.logging.Level;
43 import javax.swing.JFileChooser;
44 import javax.swing.JMenuItem;
45 import javax.swing.JOptionPane;
46 import static javax.swing.JOptionPane.DEFAULT_OPTION;
47 import static javax.swing.JOptionPane.ERROR_MESSAGE;
48 import static javax.swing.JOptionPane.PLAIN_MESSAGE;
49 import javax.swing.SwingWorker;
50 import javax.swing.filechooser.FileNameExtensionFilter;
51 import javax.swing.table.TableModel;
52 import javax.swing.table.TableRowSorter;
53 import org.openide.util.NbBundle;
69 "OtherOccurrencesPanel.table.noArtifacts=Item has no attributes with which to search.",
70 "OtherOccurrencesPanel.table.noResultsFound=No results found.",
71 "OtherOccurrencesPanel_table_loadingResults=Loading results"
75 private static final CorrelationCaseWrapper NO_ARTIFACTS_CASE =
new CorrelationCaseWrapper(Bundle.OtherOccurrencesPanel_table_noArtifacts());
76 private static final CorrelationCaseWrapper NO_RESULTS_CASE =
new CorrelationCaseWrapper(Bundle.OtherOccurrencesPanel_table_noResultsFound());
78 private static final long serialVersionUID = 1L;
84 private String dataSourceName =
"";
85 private String deviceId =
"";
86 private AbstractFile file = null;
92 private final FutureTask<JFileChooser> futureFileChooser =
new FutureTask<>(JFileChooser::new);
101 this.dataSourcesTableModel =
new OtherOccurrencesDataSourcesTableModel();
102 this.correlationAttributes =
new ArrayList<>();
104 customizeComponents();
106 ExecutorService executor = Executors.newSingleThreadExecutor(
new ThreadFactoryBuilder().setNameFormat(
"JFileChooser-background-thread-OtherOccurrencesPanel").build());
107 executor.execute(futureFileChooser);
111 ActionListener actList = (ActionEvent e) -> {
112 JMenuItem jmi = (JMenuItem) e.getSource();
113 if (jmi.equals(showCaseDetailsMenuItem)) {
114 showCaseDetails(filesTable.getSelectedRow());
115 }
else if (jmi.equals(exportToCSVMenuItem)) {
119 logger.log(Level.SEVERE,
"Exception while getting open case.", ex);
121 }
else if (jmi.equals(showCommonalityMenuItem)) {
122 showCommonalityDetails();
126 exportToCSVMenuItem.addActionListener(actList);
127 showCaseDetailsMenuItem.addActionListener(actList);
128 showCommonalityMenuItem.addActionListener(actList);
129 filesTable.setComponentPopupMenu(rightClickPopupMenu);
131 TableRowSorter<TableModel> sorter =
new TableRowSorter<>(filesTable.getModel());
132 filesTable.setRowSorter(sorter);
135 casesTable.getRowSorter().toggleSortOrder(0);
136 dataSourcesTable.getRowSorter().toggleSortOrder(0);
137 filesTable.getRowSorter().toggleSortOrder(0);
139 casesTable.getSelectionModel().addListSelectionListener((e) -> {
141 updateOnCaseSelection();
144 dataSourcesTable.getSelectionModel().addListSelectionListener((e) -> {
146 updateOnDataSourceSelection();
151 filesTable.getSelectionModel().addListSelectionListener((e) -> {
153 occurrencePanel =
new OccurrencePanel();
154 updateOnFileSelection();
157 detailsPanelScrollPane.addComponentListener(
new ComponentAdapter() {
159 public void componentResized(ComponentEvent componentEvent) {
161 occurrencePanel.setPreferredSize(
new java.awt.Dimension(detailsPanelScrollPane.getPreferredSize().width, occurrencePanel.getPreferredSize().height));
162 detailsPanelScrollPane.setViewportView(occurrencePanel);
168 @NbBundle.Messages({
"OtherOccurrencesPanel.correlatedArtifacts.isEmpty=There are no files or artifacts to correlate.",
169 "# {0} - commonality percentage",
170 "# {1} - correlation type",
171 "# {2} - correlation value",
172 "OtherOccurrencesPanel.correlatedArtifacts.byType={0}% of data sources have {2} (type: {1})\n",
173 "OtherOccurrencesPanel.correlatedArtifacts.title=Attribute Frequency",
174 "OtherOccurrencesPanel.correlatedArtifacts.failed=Failed to get frequency details."})
180 if (correlationAttributes.isEmpty()) {
182 Bundle.OtherOccurrencesPanel_correlatedArtifacts_isEmpty(),
183 Bundle.OtherOccurrencesPanel_correlatedArtifacts_title(),
184 DEFAULT_OPTION, PLAIN_MESSAGE);
186 StringBuilder msg =
new StringBuilder(correlationAttributes.size());
188 this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
195 msg.append(Bundle.OtherOccurrencesPanel_correlatedArtifacts_byType(percentage,
196 eamArtifact.getCorrelationType().getDisplayName(),
197 eamArtifact.getCorrelationValue()));
199 logger.log(Level.WARNING, String.format(
"Error getting commonality details for artifact with ID: %s.", eamArtifact.getID()), ex);
202 this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
205 Bundle.OtherOccurrencesPanel_correlatedArtifacts_title(),
206 DEFAULT_OPTION, PLAIN_MESSAGE);
208 this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
209 logger.log(Level.SEVERE,
"Error getting commonality details.", ex);
211 Bundle.OtherOccurrencesPanel_correlatedArtifacts_failed(),
212 Bundle.OtherOccurrencesPanel_correlatedArtifacts_title(),
213 DEFAULT_OPTION, ERROR_MESSAGE);
218 @NbBundle.Messages({
"OtherOccurrencesPanel.caseDetailsDialog.notSelected=No Row Selected",
219 "OtherOccurrencesPanel.caseDetailsDialog.noDetails=No details for this case.",
220 "OtherOccurrencesPanel.caseDetailsDialog.noDetailsReference=No case details for Global reference properties.",
221 "OtherOccurrencesPanel.caseDetailsDialog.noCaseNameError=Error",
222 "OtherOccurrencesPanel.noOpenCase.errMsg=No open case available."})
224 String caseDisplayName = Bundle.OtherOccurrencesPanel_caseDetailsDialog_noCaseNameError();
225 String details = Bundle.OtherOccurrencesPanel_caseDetailsDialog_noDetails();
227 if (-1 != selectedRowViewIdx && filesTableModel.
getRowCount() > 0) {
229 int selectedRowModelIdx = filesTable.convertRowIndexToModel(selectedRowViewIdx);
230 List<NodeData> rowList = filesTableModel.getListOfNodesForFile(selectedRowModelIdx);
231 if (!rowList.isEmpty()) {
232 CorrelationCase eamCasePartial = rowList.get(0).getCorrelationAttributeInstance().getCorrelationCase();
236 if (eamCase != null) {
239 details = Bundle.OtherOccurrencesPanel_caseDetailsDialog_noDetails();
242 details = Bundle.OtherOccurrencesPanel_caseDetailsDialog_noDetailsReference();
246 logger.log(Level.SEVERE,
"Error loading case details", ex);
251 DEFAULT_OPTION, PLAIN_MESSAGE);
258 if (CSVFileChooser == null) {
260 CSVFileChooser = futureFileChooser.get();
261 }
catch (InterruptedException | ExecutionException ex) {
264 logger.log(Level.WARNING,
"A failure occurred in the JFileChooser background thread");
265 CSVFileChooser =
new JFileChooser();
269 Calendar now = Calendar.getInstance();
270 String fileName = String.format(
"%1$tY%1$tm%1$te%1$tI%1$tM%1$tS_other_data_sources.csv", now);
272 CSVFileChooser.setSelectedFile(
new File(fileName));
273 CSVFileChooser.setFileFilter(
new FileNameExtensionFilter(
"csv file",
"csv"));
275 int returnVal = CSVFileChooser.showSaveDialog(filesTable);
276 if (returnVal == JFileChooser.APPROVE_OPTION) {
278 File selectedFile = CSVFileChooser.getSelectedFile();
279 if (!selectedFile.getName().endsWith(
".csv")) {
280 selectedFile =
new File(selectedFile.toString() +
".csv");
282 CSVWorker csvWorker =
new CSVWorker(selectedFile, dataSourceName, deviceId, Collections.unmodifiableCollection(correlationAttributes));
288 @NbBundle.Messages({
"OtherOccurrencesPanel_earliestCaseNotAvailable=Not Available."})
294 casesTableModel.clearTable();
295 dataSourcesTableModel.clearTable();
296 filesTableModel.clearTable();
297 correlationAttributes.clear();
298 earliestCaseDate.setText(Bundle.OtherOccurrencesPanel_earliestCaseNotAvailable());
299 foundInLabel.setText(
"");
301 occurrencePanel =
new OccurrencePanel();
302 occurrencePanel.getPreferredSize();
303 detailsPanelScrollPane.setViewportView(occurrencePanel);
317 if (worker != null) {
322 casesTableModel.addCorrelationCase(NO_ARTIFACTS_CASE);
324 worker =
new OtherOccurrenceOneTypeWorker(aType, value, file, deviceId, dataSourceName) {
332 casesTableModel.clearTable();
334 OtherOccurrenceOneTypeWorker.OneTypeData data =
get();
335 correlationAttributes.addAll(data.getCorrelationAttributesToAdd());
337 casesTableModel.addCorrelationCase(
new CorrelationCaseWrapper(corCase));
340 if (correlationAttributes.isEmpty()) {
341 casesTableModel.addCorrelationCase(NO_ARTIFACTS_CASE);
342 }
else if (caseCount == 0) {
343 casesTableModel.addCorrelationCase(NO_RESULTS_CASE);
345 String earliestDate = data.getEarliestCaseDate();
346 earliestCaseDate.setText(earliestDate.isEmpty() ? Bundle.OtherOccurrencesPanel_earliestCaseNotAvailable() : earliestDate);
347 foundInLabel.setText(String.format(Bundle.OtherOccurrencesPanel_foundIn_text(), data.getTotalCount(), caseCount, data.getDataSourceCount()));
349 casesTable.setRowSelectionInterval(0, 0);
353 }
catch (InterruptedException | ExecutionException ex) {
354 logger.log(Level.SEVERE,
"Failed to update OtherOccurrence panel", ex);
365 void showPanelLoadingMessage() {
366 casesTableModel.addCorrelationCase(NO_ARTIFACTS_CASE);
376 "OtherOccurrencesPanel.foundIn.text=Found %d instances in %d cases and %d data sources."
378 void populateTable(OtherOccurrencesData data) {
379 this.file = data.getFile();
380 this.dataSourceName = data.getDataSourceName();
381 this.deviceId = data.getDeviceId();
383 casesTableModel.clearTable();
385 correlationAttributes.addAll(data.getCorrelationAttributes());
387 for (CorrelationCase corCase : data.getCaseMap().values()) {
388 casesTableModel.addCorrelationCase(
new CorrelationCaseWrapper(corCase));
391 if (correlationAttributes.isEmpty()) {
392 casesTableModel.addCorrelationCase(NO_ARTIFACTS_CASE);
393 }
else if (caseCount == 0) {
394 casesTableModel.addCorrelationCase(NO_RESULTS_CASE);
396 String earliestDate = data.getEarliestCaseDate();
397 earliestCaseDate.setText(earliestDate.isEmpty() ? Bundle.OtherOccurrencesPanel_earliestCaseNotAvailable() : earliestDate);
398 foundInLabel.setText(String.format(Bundle.OtherOccurrencesPanel_foundIn_text(), data.getInstanceDataCount(), caseCount, data.getDataSourceCount()));
400 casesTable.setRowSelectionInterval(0, 0);
410 if (worker != null) {
415 final int[] selectedCaseIndexes = casesTable.getSelectedRows();
416 dataSourcesTableModel.clearTable();
417 filesTableModel.clearTable();
419 if (selectedCaseIndexes.length == 0) {
421 occurrencePanel =
new OccurrencePanel();
422 occurrencePanel.getPreferredSize();
423 detailsPanelScrollPane.setViewportView(occurrencePanel);
428 setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
430 worker =
new SelectionWorker(correlationAttributes, deviceId, dataSourceName) {
438 Map<UniquePathKey, NodeData> correlatedNodeDataMap =
get();
440 String currentCaseName;
444 currentCaseName = null;
445 logger.log(Level.WARNING,
"Unable to get current case for other occurrences content viewer", ex);
448 for (
NodeData nodeData : correlatedNodeDataMap.values()) {
449 for (
int selectedRow : selectedCaseIndexes) {
451 if (casesTableModel.getCorrelationCase(casesTable.convertRowIndexToModel(selectedRow)) != null
452 && casesTableModel.getCorrelationCase(casesTable.convertRowIndexToModel(selectedRow)).getCaseUUID().equals(nodeData.getCorrelationAttributeInstance().getCorrelationCase().getCaseUUID())) {
453 dataSourcesTableModel.addNodeData(nodeData);
456 logger.log(Level.WARNING,
"Unable to get correlation attribute instance from OtherOccurrenceNodeInstanceData for case " + nodeData.getCaseName(), ex);
461 if (dataSourcesTableModel.getRowCount() > 0) {
462 dataSourcesTable.setRowSelectionInterval(0, 0);
465 setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
467 }
catch (InterruptedException | ExecutionException ex) {
468 logger.log(Level.SEVERE,
"Failed to update OtherOccurrencesPanel on data source selection", ex);
481 if (worker != null) {
486 setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
488 final int[] selectedDataSources = dataSourcesTable.getSelectedRows();
489 filesTableModel.clearTable();
491 worker =
new SelectionWorker(correlationAttributes, deviceId, dataSourceName) {
499 Map<UniquePathKey, NodeData> correlatedNodeDataMap =
get();
500 if (dataSourcesTableModel.getRowCount() > 0) {
501 for (
NodeData nodeData : correlatedNodeDataMap.values()) {
502 for (
int selectedDataSourceRow : selectedDataSources) {
503 int rowModelIndex = dataSourcesTable.convertRowIndexToModel(selectedDataSourceRow);
505 if (dataSourcesTableModel.getCaseUUIDForRow(rowModelIndex).equals(nodeData.getCorrelationAttributeInstance().getCorrelationCase().getCaseUUID())
506 && dataSourcesTableModel.getDeviceIdForRow(rowModelIndex).equals(nodeData.getDeviceID())) {
507 filesTableModel.addNodeData(nodeData);
510 logger.log(Level.WARNING,
"Unable to get correlation attribute instance from OtherOccurrenceNodeInstanceData for case " + nodeData.getCaseName(), ex);
517 filesTable.setRowSelectionInterval(0, 0);
519 }
catch (InterruptedException | ExecutionException ex) {
520 logger.log(Level.SEVERE,
"Failed to update OtherOccurrencesPanel on case selection", ex);
522 setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
535 setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
537 if (filesTableModel.
getRowCount() > 0 && filesTable.getSelectedRowCount() == 1) {
539 occurrencePanel =
new OccurrencePanel(filesTableModel.getListOfNodesForFile(filesTable.convertRowIndexToModel(filesTable.getSelectedRow())));
540 }
else if (dataSourcesTableModel.getRowCount() > 0 && dataSourcesTable.getSelectedRowCount() == 1) {
542 String caseName = dataSourcesTableModel.getCaseNameForRow(dataSourcesTable.convertRowIndexToModel(dataSourcesTable.getSelectedRow()));
543 String dsName = dataSourcesTableModel.getValueAt(dataSourcesTable.convertRowIndexToModel(dataSourcesTable.getSelectedRow()), 0).toString();
544 String caseCreatedDate =
"";
546 for (
int row : casesTable.getSelectedRows()) {
547 if (casesTableModel.
getValueAt(casesTable.convertRowIndexToModel(row), 0).toString().equals(caseName)) {
548 caseCreatedDate = getCaseCreatedDate(row);
553 occurrencePanel =
new OccurrencePanel(caseName, caseCreatedDate, dsName);
554 }
else if (casesTable.getSelectedRowCount() == 1) {
558 String caseName =
"";
560 caseName = casesTableModel.
getValueAt(casesTable.convertRowIndexToModel(casesTable.getSelectedRow()), 0).toString();
562 if (caseName.isEmpty()) {
563 occurrencePanel =
new OccurrencePanel();
565 createdDate = getCaseCreatedDate(casesTable.getSelectedRow());
566 occurrencePanel =
new OccurrencePanel(caseName, createdDate);
570 occurrencePanel =
new OccurrencePanel();
573 occurrencePanel.getPreferredSize();
574 detailsPanelScrollPane.setViewportView(occurrencePanel);
576 setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
592 partialCase = casesTableModel.getCorrelationCase(casesTable.convertRowIndexToModel(caseTableRowIdx));
593 if (partialCase == null) {
601 logger.log(Level.WARNING,
"Error getting case created date for row: " + caseTableRowIdx, ex);
609 private class SelectionWorker extends SwingWorker<Map<UniquePathKey, NodeData>, Void> {
623 SelectionWorker(Collection<CorrelationAttributeInstance> coAtInstances, String deviceIdStr, String dataSourceNameStr) {
624 this.coAtInstances = coAtInstances;
625 this.dataSourceNameStr = dataSourceNameStr;
626 this.deviceIdStr = deviceIdStr;
631 Map<UniquePathKey, NodeData> correlatedNodeDataMap =
new HashMap<>();
636 return new HashMap<>();
640 return correlatedNodeDataMap;
647 private class CSVWorker extends SwingWorker<Void, Void> {
663 CSVWorker(File destFile, String dataSourceName, String deviceId, Collection<CorrelationAttributeInstance> correlationAttList) {
664 this.destFile = destFile;
665 this.dataSourceName = dataSourceName;
666 this.deviceId = deviceId;
667 this.correlationAttList = correlationAttList;
680 }
catch (InterruptedException | ExecutionException ex) {
682 "Failed to create csv file for Other Occurrences at\n" + destFile.getAbsolutePath(),
683 "Error Creating CSV",
684 JOptionPane.ERROR_MESSAGE);
686 logger.log(Level.SEVERE,
"Error writing selected rows to from OtherOccurrencePanel to " + destFile.getAbsolutePath(), ex);
696 @SuppressWarnings(
"unchecked")
698 private
void initComponents() {
699 java.awt.GridBagConstraints gridBagConstraints;
701 rightClickPopupMenu =
new javax.swing.JPopupMenu();
702 exportToCSVMenuItem =
new javax.swing.JMenuItem();
703 showCaseDetailsMenuItem =
new javax.swing.JMenuItem();
704 showCommonalityMenuItem =
new javax.swing.JMenuItem();
705 tableContainerPanel =
new javax.swing.JPanel();
706 tablesViewerSplitPane =
new javax.swing.JSplitPane();
707 caseDatasourceFileSplitPane =
new javax.swing.JSplitPane();
708 caseDatasourceSplitPane =
new javax.swing.JSplitPane();
709 caseScrollPane =
new javax.swing.JScrollPane();
710 casesTable =
new javax.swing.JTable();
711 dataSourceScrollPane =
new javax.swing.JScrollPane();
712 dataSourcesTable =
new javax.swing.JTable();
713 filesTableScrollPane =
new javax.swing.JScrollPane();
714 filesTable =
new javax.swing.JTable();
715 detailsPanelScrollPane =
new javax.swing.JScrollPane();
716 jPanel1 =
new javax.swing.JPanel();
717 foundInLabel =
new javax.swing.JLabel();
718 earliestCaseDate =
new javax.swing.JLabel();
719 earliestCaseLabel =
new javax.swing.JLabel();
720 filler1 =
new javax.swing.Box.Filler(
new java.awt.Dimension(0, 0),
new java.awt.Dimension(0, 0),
new java.awt.Dimension(32767, 0));
722 rightClickPopupMenu.addPopupMenuListener(
new javax.swing.event.PopupMenuListener() {
723 public void popupMenuCanceled(javax.swing.event.PopupMenuEvent evt) {
725 public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {
727 public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {
728 rightClickPopupMenuPopupMenuWillBecomeVisible(evt);
732 org.openide.awt.Mnemonics.setLocalizedText(exportToCSVMenuItem,
org.openide.util.NbBundle.getMessage(
OtherOccurrencesPanel.class,
"OtherOccurrencesPanel.exportToCSVMenuItem.text"));
733 rightClickPopupMenu.add(exportToCSVMenuItem);
735 org.openide.awt.Mnemonics.setLocalizedText(showCaseDetailsMenuItem,
org.openide.util.NbBundle.getMessage(
OtherOccurrencesPanel.class,
"OtherOccurrencesPanel.showCaseDetailsMenuItem.text"));
736 rightClickPopupMenu.add(showCaseDetailsMenuItem);
738 org.openide.awt.Mnemonics.setLocalizedText(showCommonalityMenuItem,
org.openide.util.NbBundle.getMessage(
OtherOccurrencesPanel.class,
"OtherOccurrencesPanel.showCommonalityMenuItem.text"));
739 rightClickPopupMenu.add(showCommonalityMenuItem);
741 tableContainerPanel.setPreferredSize(
new java.awt.Dimension(600, 63));
742 tableContainerPanel.setRequestFocusEnabled(
false);
744 tablesViewerSplitPane.setDividerLocation(450);
745 tablesViewerSplitPane.setResizeWeight(0.75);
747 caseDatasourceFileSplitPane.setDividerLocation(300);
748 caseDatasourceFileSplitPane.setResizeWeight(0.66);
749 caseDatasourceFileSplitPane.setToolTipText(
org.openide.util.NbBundle.getMessage(
OtherOccurrencesPanel.class,
"OtherOccurrencesPanel.caseDatasourceFileSplitPane.toolTipText"));
751 caseDatasourceSplitPane.setDividerLocation(150);
752 caseDatasourceSplitPane.setResizeWeight(0.5);
754 caseScrollPane.setPreferredSize(
new java.awt.Dimension(150, 30));
756 casesTable.setAutoCreateRowSorter(
true);
757 casesTable.setModel(casesTableModel);
758 caseScrollPane.setViewportView(casesTable);
760 caseDatasourceSplitPane.setLeftComponent(caseScrollPane);
762 dataSourceScrollPane.setPreferredSize(
new java.awt.Dimension(150, 30));
764 dataSourcesTable.setAutoCreateRowSorter(
true);
765 dataSourcesTable.setModel(dataSourcesTableModel);
766 dataSourceScrollPane.setViewportView(dataSourcesTable);
768 caseDatasourceSplitPane.setRightComponent(dataSourceScrollPane);
770 caseDatasourceFileSplitPane.setLeftComponent(caseDatasourceSplitPane);
772 filesTableScrollPane.setPreferredSize(
new java.awt.Dimension(150, 30));
774 filesTable.setAutoCreateRowSorter(
true);
775 filesTable.setModel(filesTableModel);
776 filesTable.setToolTipText(
org.openide.util.NbBundle.getMessage(
OtherOccurrencesPanel.class,
"OtherOccurrencesPanel.filesTable.toolTipText"));
777 filesTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
778 filesTableScrollPane.setViewportView(filesTable);
780 caseDatasourceFileSplitPane.setRightComponent(filesTableScrollPane);
782 tablesViewerSplitPane.setLeftComponent(caseDatasourceFileSplitPane);
784 detailsPanelScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
785 detailsPanelScrollPane.setPreferredSize(
new java.awt.Dimension(300, 100));
786 tablesViewerSplitPane.setRightComponent(detailsPanelScrollPane);
788 jPanel1.setPreferredSize(
new java.awt.Dimension(576, 22));
789 jPanel1.setLayout(
new java.awt.GridBagLayout());
791 foundInLabel.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
792 org.openide.awt.Mnemonics.setLocalizedText(foundInLabel,
org.openide.util.NbBundle.getMessage(
OtherOccurrencesPanel.class,
"OtherOccurrencesPanel.foundInLabel.text"));
793 foundInLabel.setPreferredSize(
new java.awt.Dimension(400, 16));
794 gridBagConstraints =
new java.awt.GridBagConstraints();
795 gridBagConstraints.gridx = 3;
796 gridBagConstraints.gridy = 0;
797 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
798 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
799 gridBagConstraints.insets =
new java.awt.Insets(2, 2, 0, 0);
800 jPanel1.add(foundInLabel, gridBagConstraints);
802 org.openide.awt.Mnemonics.setLocalizedText(earliestCaseDate,
org.openide.util.NbBundle.getMessage(
OtherOccurrencesPanel.class,
"OtherOccurrencesPanel.earliestCaseDate.text"));
803 earliestCaseDate.setMaximumSize(
new java.awt.Dimension(200, 16));
804 gridBagConstraints =
new java.awt.GridBagConstraints();
805 gridBagConstraints.gridx = 1;
806 gridBagConstraints.gridy = 0;
807 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
808 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
809 gridBagConstraints.insets =
new java.awt.Insets(0, 7, 0, 0);
810 jPanel1.add(earliestCaseDate, gridBagConstraints);
812 org.openide.awt.Mnemonics.setLocalizedText(earliestCaseLabel,
org.openide.util.NbBundle.getMessage(
OtherOccurrencesPanel.class,
"OtherOccurrencesPanel.earliestCaseLabel.text"));
813 earliestCaseLabel.setToolTipText(
org.openide.util.NbBundle.getMessage(
OtherOccurrencesPanel.class,
"OtherOccurrencesPanel.earliestCaseLabel.toolTipText"));
814 earliestCaseLabel.setMaximumSize(
new java.awt.Dimension(260, 16));
815 gridBagConstraints =
new java.awt.GridBagConstraints();
816 gridBagConstraints.gridx = 0;
817 gridBagConstraints.gridy = 0;
818 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
819 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
820 jPanel1.add(earliestCaseLabel, gridBagConstraints);
821 gridBagConstraints =
new java.awt.GridBagConstraints();
822 gridBagConstraints.gridx = 2;
823 gridBagConstraints.gridy = 0;
824 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
825 gridBagConstraints.weightx = 0.1;
826 jPanel1.add(filler1, gridBagConstraints);
828 javax.swing.GroupLayout tableContainerPanelLayout =
new javax.swing.GroupLayout(tableContainerPanel);
829 tableContainerPanel.setLayout(tableContainerPanelLayout);
830 tableContainerPanelLayout.setHorizontalGroup(
831 tableContainerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
832 .addGroup(tableContainerPanelLayout.createSequentialGroup()
833 .addGroup(tableContainerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
834 .addComponent(tablesViewerSplitPane, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
835 .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 516, Short.MAX_VALUE))
838 tableContainerPanelLayout.setVerticalGroup(
839 tableContainerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
840 .addGroup(tableContainerPanelLayout.createSequentialGroup()
842 .addComponent(tablesViewerSplitPane)
843 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
844 .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
848 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
849 this.setLayout(layout);
850 layout.setHorizontalGroup(
851 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
852 .addComponent(tableContainerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 528, Short.MAX_VALUE)
854 layout.setVerticalGroup(
855 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
856 .addComponent(tableContainerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 143, Short.MAX_VALUE)
861 boolean enableCentralRepoActions =
false;
863 int rowIndex = filesTable.getSelectedRow();
864 List<NodeData> selectedFile = filesTableModel.getListOfNodesForFile(rowIndex);
865 if (!selectedFile.isEmpty() && selectedFile.get(0) instanceof
NodeData) {
866 enableCentralRepoActions =
true;
869 showCaseDetailsMenuItem.setVisible(enableCentralRepoActions);
870 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