mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
4792 display details when just case or data source selected
This commit is contained in:
parent
793366a142
commit
84b69f86c9
@ -57,6 +57,7 @@ import javax.swing.table.TableRowSorter;
|
|||||||
import org.joda.time.DateTimeZone;
|
import org.joda.time.DateTimeZone;
|
||||||
import org.joda.time.LocalDateTime;
|
import org.joda.time.LocalDateTime;
|
||||||
import org.openide.nodes.Node;
|
import org.openide.nodes.Node;
|
||||||
|
import org.openide.util.Exceptions;
|
||||||
import org.openide.util.NbBundle.Messages;
|
import org.openide.util.NbBundle.Messages;
|
||||||
import org.openide.util.lookup.ServiceProvider;
|
import org.openide.util.lookup.ServiceProvider;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
@ -117,7 +118,7 @@ public class DataContentViewerOtherCases extends JPanel implements DataContentVi
|
|||||||
this.casesTableModel = new OtherOccurrencesCasesTableModel();
|
this.casesTableModel = new OtherOccurrencesCasesTableModel();
|
||||||
this.dataSourcesTableModel = new OtherOccurrencesDataSourcesTableModel();
|
this.dataSourcesTableModel = new OtherOccurrencesDataSourcesTableModel();
|
||||||
this.correlationAttributes = new ArrayList<>();
|
this.correlationAttributes = new ArrayList<>();
|
||||||
occurrencePanel = new OccurrencePanel(new ArrayList<>());
|
occurrencePanel = new OccurrencePanel();
|
||||||
initComponents();
|
initComponents();
|
||||||
customizeComponents();
|
customizeComponents();
|
||||||
|
|
||||||
@ -337,7 +338,7 @@ public class DataContentViewerOtherCases extends JPanel implements DataContentVi
|
|||||||
earliestCaseDate.setText(Bundle.DataContentViewerOtherCases_earliestCaseNotAvailable());
|
earliestCaseDate.setText(Bundle.DataContentViewerOtherCases_earliestCaseNotAvailable());
|
||||||
foundInLabel.setText("");
|
foundInLabel.setText("");
|
||||||
//calling getPreferredSize has a side effect of ensuring it has a preferred size which reflects the contents which are visible
|
//calling getPreferredSize has a side effect of ensuring it has a preferred size which reflects the contents which are visible
|
||||||
occurrencePanel = new OccurrencePanel(new ArrayList<>());
|
occurrencePanel = new OccurrencePanel();
|
||||||
occurrencePanel.getPreferredSize();
|
occurrencePanel.getPreferredSize();
|
||||||
detailsPanelScrollPane.setViewportView(occurrencePanel);
|
detailsPanelScrollPane.setViewportView(occurrencePanel);
|
||||||
}
|
}
|
||||||
@ -809,7 +810,7 @@ public class DataContentViewerOtherCases extends JPanel implements DataContentVi
|
|||||||
try {
|
try {
|
||||||
if (nodeData.isCentralRepoNode()) {
|
if (nodeData.isCentralRepoNode()) {
|
||||||
if (casesTableModel.getCorrelationCase(casesTable.convertRowIndexToModel(selectedRow)) != null
|
if (casesTableModel.getCorrelationCase(casesTable.convertRowIndexToModel(selectedRow)) != null
|
||||||
&& ((CorrelationCase) casesTableModel.getCorrelationCase(casesTable.convertRowIndexToModel(selectedRow))).getCaseUUID().equals(nodeData.getCorrelationAttributeInstance().getCorrelationCase().getCaseUUID())) {
|
&& casesTableModel.getCorrelationCase(casesTable.convertRowIndexToModel(selectedRow)).getCaseUUID().equals(nodeData.getCorrelationAttributeInstance().getCorrelationCase().getCaseUUID())) {
|
||||||
dataSourcesTableModel.addNodeData(nodeData);
|
dataSourcesTableModel.addNodeData(nodeData);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -845,7 +846,7 @@ public class DataContentViewerOtherCases extends JPanel implements DataContentVi
|
|||||||
try {
|
try {
|
||||||
if (nodeData.isCentralRepoNode()) {
|
if (nodeData.isCentralRepoNode()) {
|
||||||
if (casesTableModel.getCorrelationCase(casesTable.convertRowIndexToModel(selectedCaseRow)) != null
|
if (casesTableModel.getCorrelationCase(casesTable.convertRowIndexToModel(selectedCaseRow)) != null
|
||||||
&& ((CorrelationCase) casesTableModel.getCorrelationCase(casesTable.convertRowIndexToModel(selectedCaseRow))).getCaseUUID().equals(nodeData.getCorrelationAttributeInstance().getCorrelationCase().getCaseUUID())
|
&& casesTableModel.getCorrelationCase(casesTable.convertRowIndexToModel(selectedCaseRow)).getCaseUUID().equals(nodeData.getCorrelationAttributeInstance().getCorrelationCase().getCaseUUID())
|
||||||
&& dataSourcesTableModel.getDeviceIdForRow(dataSourcesTable.convertRowIndexToModel(selectedDataSourceRow)).equals(nodeData.getDeviceID())) {
|
&& dataSourcesTableModel.getDeviceIdForRow(dataSourcesTable.convertRowIndexToModel(selectedDataSourceRow)).equals(nodeData.getDeviceID())) {
|
||||||
filesTableModel.addNodeData(nodeData);
|
filesTableModel.addNodeData(nodeData);
|
||||||
}
|
}
|
||||||
@ -872,18 +873,52 @@ public class DataContentViewerOtherCases extends JPanel implements DataContentVi
|
|||||||
occurrencePanel = new OccurrencePanel(filesTableModel.getRow(filesTable.convertRowIndexToModel(filesTable.getSelectedRow())));
|
occurrencePanel = new OccurrencePanel(filesTableModel.getRow(filesTable.convertRowIndexToModel(filesTable.getSelectedRow())));
|
||||||
} else if (dataSourcesTable.getSelectedRowCount() == 1) {
|
} else if (dataSourcesTable.getSelectedRowCount() == 1) {
|
||||||
//calling getPreferredSize has a side effect of ensuring it has a preferred size which reflects the contents which are visible
|
//calling getPreferredSize has a side effect of ensuring it has a preferred size which reflects the contents which are visible
|
||||||
occurrencePanel = new OccurrencePanel(new ArrayList<>());
|
String caseName = dataSourcesTableModel.getCaseNameForRow(dataSourcesTable.convertRowIndexToModel(dataSourcesTable.getSelectedRow()));
|
||||||
|
String dataSourceName = dataSourcesTableModel.getValueAt(dataSourcesTable.convertRowIndexToModel(dataSourcesTable.getSelectedRow()), 0).toString();
|
||||||
|
String caseCreatedDate = "";
|
||||||
|
for (int row : casesTable.getSelectedRows()) {
|
||||||
|
if (casesTableModel.getValueAt(casesTable.convertRowIndexToModel(row), 0).toString().equals(caseName)) {
|
||||||
|
caseCreatedDate = getCaseCreatedDate(row);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
occurrencePanel = new OccurrencePanel(caseName, caseCreatedDate, dataSourceName);
|
||||||
} else if (casesTable.getSelectedRowCount() == 1) {
|
} else if (casesTable.getSelectedRowCount() == 1) {
|
||||||
//calling getPreferredSize has a side effect of ensuring it has a preferred size which reflects the contents which are visible
|
//calling getPreferredSize has a side effect of ensuring it has a preferred size which reflects the contents which are visible
|
||||||
occurrencePanel = new OccurrencePanel(new ArrayList<>());
|
String createdDate = "";
|
||||||
|
String caseName = "";
|
||||||
|
if (casesTable.getRowCount() > 0) {
|
||||||
|
caseName = casesTableModel.getValueAt(casesTable.convertRowIndexToModel(casesTable.getSelectedRow()), 0).toString();
|
||||||
|
}
|
||||||
|
if (caseName.isEmpty()) {
|
||||||
|
occurrencePanel = new OccurrencePanel();
|
||||||
|
} else {
|
||||||
|
createdDate = getCaseCreatedDate(casesTable.getSelectedRow());
|
||||||
|
occurrencePanel = new OccurrencePanel(caseName, createdDate);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//calling getPreferredSize has a side effect of ensuring it has a preferred size which reflects the contents which are visible
|
//calling getPreferredSize has a side effect of ensuring it has a preferred size which reflects the contents which are visible
|
||||||
occurrencePanel = new OccurrencePanel(new ArrayList<>());
|
occurrencePanel = new OccurrencePanel();
|
||||||
}
|
}
|
||||||
occurrencePanel.getPreferredSize();
|
occurrencePanel.getPreferredSize();
|
||||||
detailsPanelScrollPane.setViewportView(occurrencePanel);
|
detailsPanelScrollPane.setViewportView(occurrencePanel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getCaseCreatedDate(int caseTableRowIdx) {
|
||||||
|
try {
|
||||||
|
if (EamDb.isEnabled()) {
|
||||||
|
CorrelationCase partialCase;
|
||||||
|
partialCase = casesTableModel.getCorrelationCase(casesTable.convertRowIndexToModel(caseTableRowIdx));
|
||||||
|
return EamDb.getInstance().getCaseByUUID(partialCase.getCaseUUID()).getCreationDate();
|
||||||
|
} else {
|
||||||
|
return Case.getCurrentCase().getCreatedDate();
|
||||||
|
}
|
||||||
|
} catch (EamDbException ex) {
|
||||||
|
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called from within the constructor to initialize the form.
|
* This method is called from within the constructor to initialize the form.
|
||||||
* WARNING: Do NOT modify this code. The content of this method is always
|
* WARNING: Do NOT modify this code. The content of this method is always
|
||||||
|
@ -5,9 +5,6 @@
|
|||||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
<Dimension value="[50, 30]"/>
|
<Dimension value="[50, 30]"/>
|
||||||
</Property>
|
</Property>
|
||||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
|
||||||
<Dimension value="null"/>
|
|
||||||
</Property>
|
|
||||||
</Properties>
|
</Properties>
|
||||||
<AuxValues>
|
<AuxValues>
|
||||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
|
||||||
|
@ -20,6 +20,7 @@ package org.sleuthkit.autopsy.centralrepository.contentviewer;
|
|||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@ -48,24 +49,44 @@ final class OccurrencePanel extends javax.swing.JPanel {
|
|||||||
private final Set<String> dataSourceNames = new HashSet<>();
|
private final Set<String> dataSourceNames = new HashSet<>();
|
||||||
private final Set<String> filePaths = new HashSet<>();
|
private final Set<String> filePaths = new HashSet<>();
|
||||||
|
|
||||||
|
OccurrencePanel() {
|
||||||
|
nodeDataList = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
OccurrencePanel(String caseName, String caseCreatedDate) {
|
||||||
|
this();
|
||||||
|
caseNamesAndDates.put(caseName, caseCreatedDate);
|
||||||
|
customizeComponents();
|
||||||
|
}
|
||||||
|
|
||||||
|
OccurrencePanel(String caseName, String caseCreatedDate, String dataSourceName) {
|
||||||
|
this(caseName, caseCreatedDate);
|
||||||
|
dataSourceNames.add(dataSourceName);
|
||||||
|
customizeComponents();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new form OccurrencePanel2
|
* Creates new form OccurrencePanel2
|
||||||
*/
|
*/
|
||||||
OccurrencePanel(List<OtherOccurrenceNodeData> nodeDataList) {
|
OccurrencePanel(List<OtherOccurrenceNodeData> nodeDataList) {
|
||||||
this.nodeDataList = nodeDataList;
|
this.nodeDataList = nodeDataList;
|
||||||
initComponents();
|
initComponents();
|
||||||
|
customizeComponents();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void customizeComponents() {
|
||||||
if (!this.nodeDataList.isEmpty()) {
|
if (!this.nodeDataList.isEmpty()) {
|
||||||
addInstanceDetails();
|
addInstanceDetails();
|
||||||
if (!filePaths.isEmpty()) {
|
if (!filePaths.isEmpty()) {
|
||||||
addFileDetails();
|
addFileDetails();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!dataSourceNames.isEmpty()) {
|
if (!dataSourceNames.isEmpty()) {
|
||||||
addDataSourceDetails();
|
addDataSourceDetails();
|
||||||
}
|
}
|
||||||
if (!caseNamesAndDates.keySet().isEmpty()) {
|
if (!caseNamesAndDates.keySet().isEmpty()) {
|
||||||
addCaseDetails();
|
addCaseDetails();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
//add filler to keep everything else at the top
|
//add filler to keep everything else at the top
|
||||||
addItemToBag(gridY, 0, 0, 0, new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767)));
|
addItemToBag(gridY, 0, 0, 0, new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767)));
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.swing.table.AbstractTableModel;
|
import javax.swing.table.AbstractTableModel;
|
||||||
import org.openide.util.NbBundle.Messages;
|
import org.openide.util.NbBundle.Messages;
|
||||||
|
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Model for cells in the cases section of the other occurrences data content
|
* Model for cells in the cases section of the other occurrences data content
|
||||||
@ -40,7 +41,6 @@ public class OtherOccurrencesCasesTableModel extends AbstractTableModel {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRowCount() {
|
public int getRowCount() {
|
||||||
return correlationCaseList.size();
|
return correlationCaseList.size();
|
||||||
@ -66,8 +66,12 @@ public class OtherOccurrencesCasesTableModel extends AbstractTableModel {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object getCorrelationCase(int rowIdx) {
|
CorrelationCase getCorrelationCase(int rowIdx) {
|
||||||
|
if (rowIdx < correlationCaseList.size()) {
|
||||||
return correlationCaseList.get(rowIdx).getCorrelationCase();
|
return correlationCaseList.get(rowIdx).getCorrelationCase();
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -63,6 +63,10 @@ final class OtherOccurrencesDataSourcesTableModel extends AbstractTableModel {
|
|||||||
return ((DataSourceColumnItem) dataSourceSet.toArray()[rowIdx]).getDeviceId();
|
return ((DataSourceColumnItem) dataSourceSet.toArray()[rowIdx]).getDeviceId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCaseNameForRow(int rowIdx){
|
||||||
|
return ((DataSourceColumnItem) dataSourceSet.toArray()[rowIdx]).getCaseName();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<String> getColumnClass(int colIdx) {
|
public Class<String> getColumnClass(int colIdx) {
|
||||||
return String.class;
|
return String.class;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user