mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-13 08:26:15 +00:00
6985 final clean up of mini timeline before initial pr
This commit is contained in:
parent
8653e908fe
commit
f52351bf47
@ -186,6 +186,18 @@ public class DomainSearch {
|
|||||||
return artifactsCache.get(artifactsRequest);
|
return artifactsCache.get(artifactsRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a list of MiniTimelineResults one for each date any TSK_WEB artifacts
|
||||||
|
* existed for, which contains a list of artifacts observed on that date.
|
||||||
|
*
|
||||||
|
* @param sleuthkitCase The case database for the search.
|
||||||
|
* @param domain The domain that artifacts are being requested for.
|
||||||
|
*
|
||||||
|
* @return The list of MiniTimelineResults
|
||||||
|
*
|
||||||
|
* @throws DiscoveryException if unable to get the artifacts or the date
|
||||||
|
* attributes from an artifact.
|
||||||
|
*/
|
||||||
public List<MiniTimelineResult> getAllArtifactsForDomain(SleuthkitCase sleuthkitCase, String domain) throws DiscoveryException {
|
public List<MiniTimelineResult> getAllArtifactsForDomain(SleuthkitCase sleuthkitCase, String domain) throws DiscoveryException {
|
||||||
List<BlackboardArtifact> artifacts = new ArrayList<>();
|
List<BlackboardArtifact> artifacts = new ArrayList<>();
|
||||||
Map<String, List<BlackboardArtifact>> dateMap = new HashMap<>();
|
Map<String, List<BlackboardArtifact>> dateMap = new HashMap<>();
|
||||||
@ -220,6 +232,16 @@ public class DomainSearch {
|
|||||||
return dateArtifactList;
|
return dateArtifactList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Private helper method to get a date from the artifact.
|
||||||
|
*
|
||||||
|
* @param artifact The artifact to get a date from.
|
||||||
|
*
|
||||||
|
* @return The date as a string in the form YYYY-MM-DD.
|
||||||
|
*
|
||||||
|
* @throws TskCoreException when unable to get the attributes for the
|
||||||
|
* artifact.
|
||||||
|
*/
|
||||||
private String getDate(BlackboardArtifact artifact) throws TskCoreException {
|
private String getDate(BlackboardArtifact artifact) throws TskCoreException {
|
||||||
for (BlackboardAttribute attribute : artifact.getAttributes()) {
|
for (BlackboardAttribute attribute : artifact.getAttributes()) {
|
||||||
if (attribute.getAttributeType().getTypeName().startsWith("TSK_DATETIME")) {
|
if (attribute.getAttributeType().getTypeName().startsWith("TSK_DATETIME")) {
|
||||||
|
@ -56,7 +56,7 @@ public class MiniTimelineResult {
|
|||||||
/**
|
/**
|
||||||
* Get the number of artifacts observed on the specified date.
|
* Get the number of artifacts observed on the specified date.
|
||||||
*
|
*
|
||||||
* @return the count
|
* @return The number of artifacts observed on the specified date.
|
||||||
*/
|
*/
|
||||||
public int getCount() {
|
public int getCount() {
|
||||||
return artifactList.size();
|
return artifactList.size();
|
||||||
|
@ -60,4 +60,3 @@ DomainSummaryPanel.totalVisitsLabel.text=
|
|||||||
FileDetailsPanel.instancesList.border.title=Instances
|
FileDetailsPanel.instancesList.border.title=Instances
|
||||||
CookieDetailsPanel.jLabel1.text=Artifact:
|
CookieDetailsPanel.jLabel1.text=Artifact:
|
||||||
CookieDetailsPanel.jLabel2.text=
|
CookieDetailsPanel.jLabel2.text=
|
||||||
MiniTimelinePanel.mainSplitPane.toolTipText=
|
|
||||||
|
@ -123,6 +123,10 @@ final class DomainDetailsPanel extends JPanel {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run the worker which retrieves the list of MiniTimelineResults for the
|
||||||
|
* mini timeline view to populate.
|
||||||
|
*/
|
||||||
private void runMiniTimelineWorker(MiniTimelinePanel miniTimelinePanel) {
|
private void runMiniTimelineWorker(MiniTimelinePanel miniTimelinePanel) {
|
||||||
if (miniTimelineWorker != null && !miniTimelineWorker.isDone()) {
|
if (miniTimelineWorker != null && !miniTimelineWorker.isDone()) {
|
||||||
miniTimelineWorker.cancel(true);
|
miniTimelineWorker.cancel(true);
|
||||||
|
@ -137,8 +137,11 @@ class MiniTimelineArtifactListPanel extends JPanel {
|
|||||||
tableModel.fireTableDataChanged();
|
tableModel.fireTableDataChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the UI components.
|
||||||
|
*/
|
||||||
private void initComponents() {
|
private void initComponents() {
|
||||||
|
//This class is a refactored copy of ArtifactsListPanel so lacks the form however the init method still constructs the proper UI elements.
|
||||||
javax.swing.JScrollPane jScrollPane1 = new javax.swing.JScrollPane();
|
javax.swing.JScrollPane jScrollPane1 = new javax.swing.JScrollPane();
|
||||||
jTable1 = new javax.swing.JTable();
|
jTable1 = new javax.swing.JTable();
|
||||||
|
|
||||||
@ -234,7 +237,7 @@ class MiniTimelineArtifactListPanel extends JPanel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
logger.log(Level.WARNING, "Unable to get description attribute for artifact id " + artifact.getArtifactID());
|
logger.log(Level.WARNING, "Unable to get description attribute for artifact id {0}", artifact.getArtifactID());
|
||||||
}
|
}
|
||||||
return Bundle.MiniTimelineArtifactListPanel_value_noValue();
|
return Bundle.MiniTimelineArtifactListPanel_value_noValue();
|
||||||
}
|
}
|
||||||
|
@ -36,8 +36,6 @@ class MiniTimelineDateListPanel extends JPanel {
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
private final DateCountTableModel tableModel = new DateCountTableModel();
|
private final DateCountTableModel tableModel = new DateCountTableModel();
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new form DiscoveryTimelineListPanel.
|
* Creates new form DiscoveryTimelineListPanel.
|
||||||
*/
|
*/
|
||||||
@ -92,6 +90,13 @@ class MiniTimelineDateListPanel extends JPanel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the list of BlackboardArtifacts for the selected date in the
|
||||||
|
* list.
|
||||||
|
*
|
||||||
|
* @return The list of BlackboardArtifacts for the selected date in the
|
||||||
|
* list, or an empty list if a valid selection does not exist.
|
||||||
|
*/
|
||||||
List<BlackboardArtifact> getArtifactsForSelectedDate() {
|
List<BlackboardArtifact> getArtifactsForSelectedDate() {
|
||||||
int selectedIndex = jTable1.getSelectionModel().getLeadSelectionIndex();
|
int selectedIndex = jTable1.getSelectionModel().getLeadSelectionIndex();
|
||||||
if (selectedIndex < jTable1.getSelectionModel().getMinSelectionIndex() || jTable1.getSelectionModel().getMaxSelectionIndex() < 0 || selectedIndex > jTable1.getSelectionModel().getMaxSelectionIndex()) {
|
if (selectedIndex < jTable1.getSelectionModel().getMinSelectionIndex() || jTable1.getSelectionModel().getMaxSelectionIndex() < 0 || selectedIndex > jTable1.getSelectionModel().getMaxSelectionIndex()) {
|
||||||
@ -123,8 +128,11 @@ class MiniTimelineDateListPanel extends JPanel {
|
|||||||
tableModel.fireTableDataChanged();
|
tableModel.fireTableDataChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the UI components.
|
||||||
|
*/
|
||||||
private void initComponents() {
|
private void initComponents() {
|
||||||
|
//This class is a refactored copy of ArtifactsListPanel so lacks the form however the init method still constructs the proper UI elements.
|
||||||
javax.swing.JScrollPane jScrollPane1 = new javax.swing.JScrollPane();
|
javax.swing.JScrollPane jScrollPane1 = new javax.swing.JScrollPane();
|
||||||
jTable1 = new javax.swing.JTable();
|
jTable1 = new javax.swing.JTable();
|
||||||
|
|
||||||
|
@ -27,9 +27,7 @@
|
|||||||
<Container class="javax.swing.JSplitPane" name="mainSplitPane">
|
<Container class="javax.swing.JSplitPane" name="mainSplitPane">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="resizeWeight" type="double" value="0.4"/>
|
<Property name="resizeWeight" type="double" value="0.4"/>
|
||||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="toolTipText" type="java.lang.String" value=""/>
|
||||||
<ResourceString bundle="org/sleuthkit/autopsy/discovery/ui/Bundle.properties" key="MiniTimelinePanel.mainSplitPane.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
|
||||||
</Property>
|
|
||||||
<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="[0, 0]"/>
|
<Dimension value="[0, 0]"/>
|
||||||
</Property>
|
</Property>
|
||||||
|
@ -30,6 +30,9 @@ import org.sleuthkit.autopsy.coreutils.ThreadConfined;
|
|||||||
import org.sleuthkit.autopsy.discovery.search.DiscoveryEventUtils;
|
import org.sleuthkit.autopsy.discovery.search.DiscoveryEventUtils;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Panel to display the entire mini timeline feature.
|
||||||
|
*/
|
||||||
class MiniTimelinePanel extends javax.swing.JPanel {
|
class MiniTimelinePanel extends javax.swing.JPanel {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@ -39,8 +42,16 @@ class MiniTimelinePanel extends javax.swing.JPanel {
|
|||||||
private DomainArtifactsTabPanel.ArtifactRetrievalStatus status = DomainArtifactsTabPanel.ArtifactRetrievalStatus.UNPOPULATED;
|
private DomainArtifactsTabPanel.ArtifactRetrievalStatus status = DomainArtifactsTabPanel.ArtifactRetrievalStatus.UNPOPULATED;
|
||||||
private AbstractArtifactDetailsPanel rightPanel = new GeneralPurposeArtifactViewer();
|
private AbstractArtifactDetailsPanel rightPanel = new GeneralPurposeArtifactViewer();
|
||||||
private static final Logger logger = Logger.getLogger(MiniTimelinePanel.class.getName());
|
private static final Logger logger = Logger.getLogger(MiniTimelinePanel.class.getName());
|
||||||
|
private final ListSelectionListener artifactListener;
|
||||||
|
private final ListSelectionListener dateListener;
|
||||||
|
|
||||||
private final ListSelectionListener artifactListener = new ListSelectionListener() {
|
/**
|
||||||
|
* Creates new form MiniTimelinePanel.
|
||||||
|
*/
|
||||||
|
@ThreadConfined(type = ThreadConfined.ThreadType.AWT)
|
||||||
|
MiniTimelinePanel() {
|
||||||
|
initComponents();
|
||||||
|
artifactListener = new ListSelectionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void valueChanged(ListSelectionEvent event) {
|
public void valueChanged(ListSelectionEvent event) {
|
||||||
if (!event.getValueIsAdjusting()) {
|
if (!event.getValueIsAdjusting()) {
|
||||||
@ -57,7 +68,7 @@ class MiniTimelinePanel extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
private final ListSelectionListener dateListener = new ListSelectionListener() {
|
dateListener = new ListSelectionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void valueChanged(ListSelectionEvent event) {
|
public void valueChanged(ListSelectionEvent event) {
|
||||||
if (!event.getValueIsAdjusting()) {
|
if (!event.getValueIsAdjusting()) {
|
||||||
@ -70,13 +81,6 @@ class MiniTimelinePanel extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates new form MiniTimelinePanel
|
|
||||||
*/
|
|
||||||
@ThreadConfined(type = ThreadConfined.ThreadType.AWT)
|
|
||||||
MiniTimelinePanel() {
|
|
||||||
initComponents();
|
|
||||||
dateListPanel.addSelectionListener(dateListener);
|
dateListPanel.addSelectionListener(dateListener);
|
||||||
artifactListPanel.addSelectionListener(artifactListener);
|
artifactListPanel.addSelectionListener(artifactListener);
|
||||||
leftSplitPane.setLeftComponent(dateListPanel);
|
leftSplitPane.setLeftComponent(dateListPanel);
|
||||||
@ -110,8 +114,8 @@ class MiniTimelinePanel extends javax.swing.JPanel {
|
|||||||
/**
|
/**
|
||||||
* Handle the event which indicates the artifacts have been retrieved.
|
* Handle the event which indicates the artifacts have been retrieved.
|
||||||
*
|
*
|
||||||
* @param artifactresultEvent The event which indicates the artifacts have
|
* @param miniTimelineResultEvent The event which indicates the artifacts
|
||||||
* been retrieved.
|
* have been retrieved.
|
||||||
*/
|
*/
|
||||||
@Subscribe
|
@Subscribe
|
||||||
void handleMiniTimelineResultEvent(DiscoveryEventUtils.MiniTimelineResultEvent miniTimelineResultEvent) {
|
void handleMiniTimelineResultEvent(DiscoveryEventUtils.MiniTimelineResultEvent miniTimelineResultEvent) {
|
||||||
@ -152,7 +156,7 @@ class MiniTimelinePanel extends javax.swing.JPanel {
|
|||||||
setLayout(new java.awt.BorderLayout());
|
setLayout(new java.awt.BorderLayout());
|
||||||
|
|
||||||
mainSplitPane.setResizeWeight(0.4);
|
mainSplitPane.setResizeWeight(0.4);
|
||||||
mainSplitPane.setToolTipText(org.openide.util.NbBundle.getMessage(MiniTimelinePanel.class, "MiniTimelinePanel.mainSplitPane.toolTipText")); // NOI18N
|
mainSplitPane.setToolTipText("");
|
||||||
mainSplitPane.setMinimumSize(new java.awt.Dimension(0, 0));
|
mainSplitPane.setMinimumSize(new java.awt.Dimension(0, 0));
|
||||||
mainSplitPane.setPreferredSize(new java.awt.Dimension(0, 0));
|
mainSplitPane.setPreferredSize(new java.awt.Dimension(0, 0));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user