mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06: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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
List<BlackboardArtifact> artifacts = new ArrayList<>();
|
||||
Map<String, List<BlackboardArtifact>> dateMap = new HashMap<>();
|
||||
@ -220,11 +232,21 @@ public class DomainSearch {
|
||||
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 {
|
||||
for (BlackboardAttribute attribute : artifact.getAttributes()) {
|
||||
if (attribute.getAttributeType().getTypeName().startsWith("TSK_DATETIME")) {
|
||||
String dateString = attribute.getDisplayString();
|
||||
if (dateString.length()>=10){
|
||||
if (dateString.length() >= 10) {
|
||||
return dateString.substring(0, 10);
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ public class MiniTimelineResult {
|
||||
/**
|
||||
* 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() {
|
||||
return artifactList.size();
|
||||
|
@ -60,4 +60,3 @@ DomainSummaryPanel.totalVisitsLabel.text=
|
||||
FileDetailsPanel.instancesList.border.title=Instances
|
||||
CookieDetailsPanel.jLabel1.text=Artifact:
|
||||
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) {
|
||||
if (miniTimelineWorker != null && !miniTimelineWorker.isDone()) {
|
||||
miniTimelineWorker.cancel(true);
|
||||
|
@ -137,8 +137,11 @@ class MiniTimelineArtifactListPanel extends JPanel {
|
||||
tableModel.fireTableDataChanged();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the UI components.
|
||||
*/
|
||||
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();
|
||||
jTable1 = new javax.swing.JTable();
|
||||
|
||||
@ -234,7 +237,7 @@ class MiniTimelineArtifactListPanel extends JPanel {
|
||||
}
|
||||
}
|
||||
} 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();
|
||||
}
|
||||
|
@ -36,8 +36,6 @@ class MiniTimelineDateListPanel extends JPanel {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final DateCountTableModel tableModel = new DateCountTableModel();
|
||||
|
||||
;
|
||||
|
||||
/**
|
||||
* 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() {
|
||||
int selectedIndex = jTable1.getSelectionModel().getLeadSelectionIndex();
|
||||
if (selectedIndex < jTable1.getSelectionModel().getMinSelectionIndex() || jTable1.getSelectionModel().getMaxSelectionIndex() < 0 || selectedIndex > jTable1.getSelectionModel().getMaxSelectionIndex()) {
|
||||
@ -123,8 +128,11 @@ class MiniTimelineDateListPanel extends JPanel {
|
||||
tableModel.fireTableDataChanged();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the UI components.
|
||||
*/
|
||||
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();
|
||||
jTable1 = new javax.swing.JTable();
|
||||
|
||||
|
@ -27,9 +27,7 @@
|
||||
<Container class="javax.swing.JSplitPane" name="mainSplitPane">
|
||||
<Properties>
|
||||
<Property name="resizeWeight" type="double" value="0.4"/>
|
||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<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="toolTipText" type="java.lang.String" value=""/>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[0, 0]"/>
|
||||
</Property>
|
||||
|
@ -30,6 +30,9 @@ import org.sleuthkit.autopsy.coreutils.ThreadConfined;
|
||||
import org.sleuthkit.autopsy.discovery.search.DiscoveryEventUtils;
|
||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||
|
||||
/**
|
||||
* Panel to display the entire mini timeline feature.
|
||||
*/
|
||||
class MiniTimelinePanel extends javax.swing.JPanel {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -39,44 +42,45 @@ class MiniTimelinePanel extends javax.swing.JPanel {
|
||||
private DomainArtifactsTabPanel.ArtifactRetrievalStatus status = DomainArtifactsTabPanel.ArtifactRetrievalStatus.UNPOPULATED;
|
||||
private AbstractArtifactDetailsPanel rightPanel = new GeneralPurposeArtifactViewer();
|
||||
private static final Logger logger = Logger.getLogger(MiniTimelinePanel.class.getName());
|
||||
|
||||
private final ListSelectionListener artifactListener = new ListSelectionListener() {
|
||||
@Override
|
||||
public void valueChanged(ListSelectionEvent event) {
|
||||
if (!event.getValueIsAdjusting()) {
|
||||
BlackboardArtifact artifact = artifactListPanel.getSelectedArtifact();
|
||||
if (artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_CACHE.getTypeID() || artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_DOWNLOAD.getTypeID()) {
|
||||
rightPanel = new ContentViewerDetailsPanel();
|
||||
} else {
|
||||
rightPanel = new GeneralPurposeArtifactViewer();
|
||||
}
|
||||
rightPanel.setArtifact(artifact);
|
||||
mainSplitPane.setRightComponent(new JScrollPane(rightPanel));
|
||||
validate();
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
};
|
||||
private final ListSelectionListener dateListener = new ListSelectionListener() {
|
||||
@Override
|
||||
public void valueChanged(ListSelectionEvent event) {
|
||||
if (!event.getValueIsAdjusting()) {
|
||||
artifactListPanel.removeListSelectionListener(artifactListener);
|
||||
artifactListPanel.addArtifacts(dateListPanel.getArtifactsForSelectedDate());
|
||||
artifactListPanel.addSelectionListener(artifactListener);
|
||||
artifactListPanel.selectFirst();
|
||||
validate();
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
};
|
||||
private final ListSelectionListener artifactListener;
|
||||
private final ListSelectionListener dateListener;
|
||||
|
||||
/**
|
||||
* Creates new form MiniTimelinePanel
|
||||
* Creates new form MiniTimelinePanel.
|
||||
*/
|
||||
@ThreadConfined(type = ThreadConfined.ThreadType.AWT)
|
||||
MiniTimelinePanel() {
|
||||
initComponents();
|
||||
artifactListener = new ListSelectionListener() {
|
||||
@Override
|
||||
public void valueChanged(ListSelectionEvent event) {
|
||||
if (!event.getValueIsAdjusting()) {
|
||||
BlackboardArtifact artifact = artifactListPanel.getSelectedArtifact();
|
||||
if (artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_CACHE.getTypeID() || artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_DOWNLOAD.getTypeID()) {
|
||||
rightPanel = new ContentViewerDetailsPanel();
|
||||
} else {
|
||||
rightPanel = new GeneralPurposeArtifactViewer();
|
||||
}
|
||||
rightPanel.setArtifact(artifact);
|
||||
mainSplitPane.setRightComponent(new JScrollPane(rightPanel));
|
||||
validate();
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
};
|
||||
dateListener = new ListSelectionListener() {
|
||||
@Override
|
||||
public void valueChanged(ListSelectionEvent event) {
|
||||
if (!event.getValueIsAdjusting()) {
|
||||
artifactListPanel.removeListSelectionListener(artifactListener);
|
||||
artifactListPanel.addArtifacts(dateListPanel.getArtifactsForSelectedDate());
|
||||
artifactListPanel.addSelectionListener(artifactListener);
|
||||
artifactListPanel.selectFirst();
|
||||
validate();
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
};
|
||||
dateListPanel.addSelectionListener(dateListener);
|
||||
artifactListPanel.addSelectionListener(artifactListener);
|
||||
leftSplitPane.setLeftComponent(dateListPanel);
|
||||
@ -110,8 +114,8 @@ class MiniTimelinePanel extends javax.swing.JPanel {
|
||||
/**
|
||||
* Handle the event which indicates the artifacts have been retrieved.
|
||||
*
|
||||
* @param artifactresultEvent The event which indicates the artifacts have
|
||||
* been retrieved.
|
||||
* @param miniTimelineResultEvent The event which indicates the artifacts
|
||||
* have been retrieved.
|
||||
*/
|
||||
@Subscribe
|
||||
void handleMiniTimelineResultEvent(DiscoveryEventUtils.MiniTimelineResultEvent miniTimelineResultEvent) {
|
||||
@ -152,7 +156,7 @@ class MiniTimelinePanel extends javax.swing.JPanel {
|
||||
setLayout(new java.awt.BorderLayout());
|
||||
|
||||
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.setPreferredSize(new java.awt.Dimension(0, 0));
|
||||
|
||||
|
@ -38,7 +38,7 @@ class MiniTimelineWorker extends SwingWorker<List<MiniTimelineResult>, Void> {
|
||||
|
||||
private final static Logger logger = Logger.getLogger(MiniTimelineWorker.class.getName());
|
||||
private final String domain;
|
||||
|
||||
|
||||
/**
|
||||
* Construct a new ArtifactsWorker.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user