From b8605cd240c2d005beae6559184dfc3f969bab7f Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Fri, 8 Jan 2021 13:27:10 -0500 Subject: [PATCH 1/8] 6167 beta constructor to use associated file for lookup of artifactNode --- .../datamodel/BlackboardArtifactNode.java | 97 ++++++++++++++++--- .../ui/ContentViewerDetailsPanel.java | 4 +- 2 files changed, 85 insertions(+), 16 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java index efdfb12c48..8777e0e3bd 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java @@ -234,7 +234,7 @@ public class BlackboardArtifactNode extends AbstractContentNode artifact.getSleuthkitCase().getContentById(objectID)); if (content == null) { - content = contentCache.get(objectID, () -> artifact.getSleuthkitCase().getContentById(objectID)); + return Lookups.fixed(artifact); + } else { + return Lookups.fixed(artifact, content); } } catch (ExecutionException ex) { logger.log(Level.SEVERE, MessageFormat.format("Error getting source content (artifact objID={0}", artifact.getId()), ex); //NON-NLS - content = null; - } - if (content == null) { return Lookups.fixed(artifact); + } + } + + /** + * Creates a Lookup object for this node and populates it with both the + * artifact this node represents and its source content. + * + * @param artifact The artifact this node represents. + * @param lookupIsAssociatedFile True if the Content lookup should be made + * for the associated file instead of the + * parent file. + * + * @return The Lookup. + */ + private static Lookup createLookup(BlackboardArtifact artifact, boolean lookupIsAssociatedFile) { + Content content = null; + if (lookupIsAssociatedFile) { + try { + content = getPathIdFile(artifact); + } catch (ExecutionException ex) { + logger.log(Level.SEVERE, MessageFormat.format("Error getting source content (artifact objID={0}", artifact.getId()), ex); //NON-NLS + content = null; + } + if (content == null) { + return Lookups.fixed(artifact); + } else { + return Lookups.fixed(artifact, content); + } } else { - return Lookups.fixed(artifact, content); + return createLookup(artifact); } } @@ -982,7 +1049,7 @@ public class BlackboardArtifactNode extends AbstractContentNode Date: Fri, 8 Jan 2021 13:28:42 -0500 Subject: [PATCH 2/8] 7167 add import for beta annotation --- .../org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java index 8777e0e3bd..5bfca75425 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java @@ -18,6 +18,7 @@ */ package org.sleuthkit.autopsy.datamodel; +import com.google.common.annotations.Beta; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import java.beans.PropertyChangeEvent; From 9ab0a5d2b4706214b73882b13c3ae361deae6c4c Mon Sep 17 00:00:00 2001 From: Kelly Kelly Date: Mon, 11 Jan 2021 15:36:35 -0500 Subject: [PATCH 3/8] Fixed persona error message dialog --- .../artifactviewers/MessageAccountPanel.java | 9 ++++++--- .../artifactviewers/PersonaAccountFetcher.java | 10 ++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/MessageAccountPanel.java b/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/MessageAccountPanel.java index 8cf4337163..fbf1ada856 100755 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/MessageAccountPanel.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/MessageAccountPanel.java @@ -586,6 +586,7 @@ final class MessageAccountPanel extends JPanel { // Set up each matching account. We don't know what type of account we have, so check all the types to // find any matches. try { + boolean showErrorMessage = true; for (CentralRepoAccount.CentralRepoAccountType type : CentralRepository.getInstance().getAllAccountTypes()) { try { // Try to load any matching accounts of this type. Throws an InvalidAccountIDException if the account is the @@ -593,13 +594,15 @@ final class MessageAccountPanel extends JPanel { CentralRepoAccount account = CentralRepository.getInstance().getAccount(type, accountContainer.getAccount().getTypeSpecificID()); if (account != null) { personaPanel.addAccount(account, Bundle.MessageAccountPanel_account_justification(), Persona.Confidence.HIGH); - } else { - createPersonaDialog.setStartupPopupMessage(Bundle.MessageAccountPanel_id_not_found_in_cr(accountContainer.getAccount().getTypeSpecificID())); - } + showErrorMessage = false; + } } catch (InvalidAccountIDException ex2) { // These are expected when the account identifier doesn't match the format of the account type. } } + if(showErrorMessage) { + createPersonaDialog.setStartupPopupMessage(Bundle.MessageAccountPanel_id_not_found_in_cr(accountContainer.getAccount().getTypeSpecificID())); + } } catch (CentralRepoException ex) { logger.log(Level.SEVERE, "Error looking up account types in the central repository", ex); } diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/PersonaAccountFetcher.java b/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/PersonaAccountFetcher.java index 0601c0893d..020a2645b6 100755 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/PersonaAccountFetcher.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/PersonaAccountFetcher.java @@ -200,6 +200,7 @@ class PersonaAccountFetcher extends SwingWorker> // Set up each matching account. We don't know what type of account we have, so check all the types to // find any matches. try { + boolean showErrorMessage = true; for (CentralRepoAccount.CentralRepoAccountType type : CentralRepository.getInstance().getAllAccountTypes()) { try { // Try to load any matching accounts of this type. Throws an InvalidAccountIDException if the account is the @@ -207,16 +208,17 @@ class PersonaAccountFetcher extends SwingWorker> CentralRepoAccount account = CentralRepository.getInstance().getAccount(type, personaSearcherData.getAccountIdentifer()); if (account != null) { personaPanel.addAccount(account, Bundle.PersonaAccountFetcher_account_justification(), Persona.Confidence.HIGH); + showErrorMessage = false; } - if((personaSearcherData.getAccountIdentifer() != null && - !personaSearcherData.getAccountIdentifer().isEmpty()) && account == null) { - dialog.setStartupPopupMessage(Bundle.PersonaAccountFetcher_not_account_in_cr(personaSearcherData.getAccountIdentifer())); - } } catch (InvalidAccountIDException ex2) { // These are expected when the account identifier doesn't match the format of the account type. } } + if ((personaSearcherData.getAccountIdentifer() != null + && !personaSearcherData.getAccountIdentifer().isEmpty()) && showErrorMessage) { + dialog.setStartupPopupMessage(Bundle.PersonaAccountFetcher_not_account_in_cr(personaSearcherData.getAccountIdentifer())); + } } catch (CentralRepoException ex) { logger.log(Level.SEVERE, "Error looking up account types in the central repository", ex); } From ab008b25623419ee2f402b85e82c1c044d0c936c Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Mon, 11 Jan 2021 15:39:23 -0500 Subject: [PATCH 4/8] 7167 check that content is not artifact --- .../contentviewers/textcontentviewer/StringsTextViewer.java | 3 ++- .../sleuthkit/autopsy/corecomponents/DataContentViewerHex.java | 3 ++- .../autopsy/corecomponents/DataContentViewerUtility.java | 3 --- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/textcontentviewer/StringsTextViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/textcontentviewer/StringsTextViewer.java index 1d4a6aef03..666c38d070 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/textcontentviewer/StringsTextViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/textcontentviewer/StringsTextViewer.java @@ -25,6 +25,7 @@ import org.openide.util.lookup.ServiceProvider; import org.sleuthkit.autopsy.corecomponentinterfaces.TextViewer; import org.sleuthkit.autopsy.corecomponents.DataContentViewerUtility; import org.sleuthkit.autopsy.datamodel.StringContent; +import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.Content; /** @@ -81,7 +82,7 @@ public class StringsTextViewer implements TextViewer { return false; } Content content = DataContentViewerUtility.getDefaultContent(node); - return (content != null && content.getSize() > 0); + return (content != null && !(content instanceof BlackboardArtifact) && content.getSize() > 0); } @Override diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.java index be8f854b96..10188826b1 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.java @@ -46,6 +46,7 @@ import static org.sleuthkit.autopsy.corecomponents.Bundle.*; import org.sleuthkit.autopsy.coreutils.FileUtil; import org.sleuthkit.autopsy.datamodel.ContentUtils; import org.sleuthkit.autopsy.datamodel.DataConversion; +import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.TskCoreException; @@ -606,7 +607,7 @@ public class DataContentViewerHex extends javax.swing.JPanel implements DataCont return false; } Content content = DataContentViewerUtility.getDefaultContent(node); - return content != null && content.getSize() > 0; + return content != null && !(content instanceof BlackboardArtifact) && content.getSize() > 0; } @Override diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerUtility.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerUtility.java index d460a16f03..2356a25a3b 100755 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerUtility.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerUtility.java @@ -32,9 +32,6 @@ public class DataContentViewerUtility { * preferring to return any Content object other than a BlackboardArtifact * object. * - * This method was written with the needs of the hex and strings content - * viewers in mind - the algorithm is exactly what those viewers require. - * * @param node A display Node object. * * @return If there are multiple Content objects associated with the Node, From 5a289f1f1e7a22270d0d9ce2b0b5471c634728a4 Mon Sep 17 00:00:00 2001 From: Kelly Kelly Date: Tue, 12 Jan 2021 16:40:13 -0500 Subject: [PATCH 5/8] Change the TSK_RECENT_OBJECT time attribute --- .../autopsy/report/infrastructure/TableReportGenerator.java | 2 +- .../datasourcesummary/datamodel/RecentFilesSummaryTest.java | 2 +- .../autopsy/recentactivity/Bundle.properties-MERGED | 2 +- .../sleuthkit/autopsy/recentactivity/ExtractRegistry.java | 6 +++--- .../autopsy/recentactivity/RecentDocumentsByLnk.java | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/report/infrastructure/TableReportGenerator.java b/Core/src/org/sleuthkit/autopsy/report/infrastructure/TableReportGenerator.java index 0e2d9dc976..ca6722911e 100644 --- a/Core/src/org/sleuthkit/autopsy/report/infrastructure/TableReportGenerator.java +++ b/Core/src/org/sleuthkit/autopsy/report/infrastructure/TableReportGenerator.java @@ -1348,7 +1348,7 @@ class TableReportGenerator { new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH))); columns.add(new AttributeColumn(NbBundle.getMessage(this.getClass(), "ReportGenerator.artTableColHdr.dateTime"), - new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME))); + new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED ))); attributeTypeSet.remove(new Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH_ID)); } else if (BlackboardArtifact.ARTIFACT_TYPE.TSK_INSTALLED_PROG.getTypeID() == artifactTypeId) { diff --git a/Core/test/unit/src/org/sleuthkit/autopsy/datasourcesummary/datamodel/RecentFilesSummaryTest.java b/Core/test/unit/src/org/sleuthkit/autopsy/datasourcesummary/datamodel/RecentFilesSummaryTest.java index ff73c428b9..0acda3954a 100644 --- a/Core/test/unit/src/org/sleuthkit/autopsy/datasourcesummary/datamodel/RecentFilesSummaryTest.java +++ b/Core/test/unit/src/org/sleuthkit/autopsy/datasourcesummary/datamodel/RecentFilesSummaryTest.java @@ -256,7 +256,7 @@ public class RecentFilesSummaryTest { */ private BlackboardArtifact getRecentDocumentArtifact(DataSource ds, long artifactId, Long dateTime, String path) { return getArtifact(ds, artifactId, ARTIFACT_TYPE.TSK_RECENT_OBJECT, Arrays.asList( - Pair.of(ATTRIBUTE_TYPE.TSK_DATETIME, dateTime), + Pair.of(ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED , dateTime), Pair.of(ATTRIBUTE_TYPE.TSK_PATH, path) )); } diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Bundle.properties-MERGED b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Bundle.properties-MERGED index 77d6eb550f..86bf343c8f 100755 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Bundle.properties-MERGED +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Bundle.properties-MERGED @@ -88,7 +88,7 @@ ExtractZone_progress_Msg=Extracting :Zone.Identifer files ExtractZone_Restricted=Restricted Sites Zone ExtractZone_Trusted=Trusted Sites Zone OpenIDE-Module-Display-Category=Ingest Module -OpenIDE-Module-Long-Description=Recent Activity ingest module.\n\nThe module extracts useful information about the recent user activity on the disk image being ingested, such as:\n\n- Recently open documents,\n- Web activity (sites visited, stored cookies, book marked sites, search engine queries, file downloads),\n- Recently attached devices,\n- Installed programs.\n\nThe module currently supports Windows only disk images.\nThe plugin is also fully functional when deployed on Windows version of Autopsy. +OpenIDE-Module-Long-Description=Recent Activity ingest module.\n\n\The module extracts useful information about the recent user activity on the disk image being ingested, such as:\n\n- Recently open documents,\n- Web activity (sites visited, stored cookies, book marked sites, search engine queries, file downloads),\n- Recently attached devices,\n- Installed programs.\n\nThe module currently supports Windows only disk images.\nThe plugin is also fully functional when deployed on Windows version of Autopsy. OpenIDE-Module-Name=RecentActivity OpenIDE-Module-Short-Description=Recent Activity finder ingest module Chrome.moduleName=Chromium diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractRegistry.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractRegistry.java index 9117d6de50..3d7b216cde 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractRegistry.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractRegistry.java @@ -1503,7 +1503,7 @@ class ExtractRegistry extends Extract { } Collection attributes = new ArrayList<>(); attributes.add(new BlackboardAttribute(TSK_PATH, getName(), fileName)); - attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME, getName(), adobeUsedTime)); + attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED, getName(), adobeUsedTime)); attributes.add(new BlackboardAttribute(TSK_COMMENT, getName(), comment)); BlackboardArtifact bba = createArtifactWithAttributes(ARTIFACT_TYPE.TSK_RECENT_OBJECT, regFile, attributes); if (bba != null) { @@ -1744,7 +1744,7 @@ class ExtractRegistry extends Extract { String fileName = fileNameTokens[1]; Collection attributes = new ArrayList<>(); attributes.add(new BlackboardAttribute(TSK_PATH, getName(), fileName)); - attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME, getName(), docDate)); + attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED, getName(), docDate)); attributes.add(new BlackboardAttribute(TSK_COMMENT, getName(), comment)); BlackboardArtifact bba = createArtifactWithAttributes(ARTIFACT_TYPE.TSK_RECENT_OBJECT, regFile, attributes); if (bba != null) { @@ -1807,7 +1807,7 @@ class ExtractRegistry extends Extract { } Collection attributes = new ArrayList<>(); attributes.add(new BlackboardAttribute(TSK_PATH, getName(), fileName)); - attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME, getName(), usedTime)); + attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED, getName(), usedTime)); attributes.add(new BlackboardAttribute(TSK_COMMENT, getName(), comment)); BlackboardArtifact bba = createArtifactWithAttributes(ARTIFACT_TYPE.TSK_RECENT_OBJECT, regFile, attributes); if (bba != null) { diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/RecentDocumentsByLnk.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/RecentDocumentsByLnk.java index 2b93720fcd..7b65b0c824 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/RecentDocumentsByLnk.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/RecentDocumentsByLnk.java @@ -119,7 +119,7 @@ class RecentDocumentsByLnk extends Extract { NbBundle.getMessage(this.getClass(), "RecentDocumentsByLnk.parentModuleName.noSpace"), Util.findID(dataSource, path))); - bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME, + bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED, NbBundle.getMessage(this.getClass(), "RecentDocumentsByLnk.parentModuleName.noSpace"), recentFile.getCrtime())); From 923b2ccaff3d9310a71e9329733f320f0b74630a Mon Sep 17 00:00:00 2001 From: Kelly Kelly Date: Wed, 13 Jan 2021 11:59:52 -0500 Subject: [PATCH 6/8] Fixed dump script TL description regex --- test/script/tskdbdiff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/script/tskdbdiff.py b/test/script/tskdbdiff.py index 5907678372..567c084ba4 100644 --- a/test/script/tskdbdiff.py +++ b/test/script/tskdbdiff.py @@ -638,7 +638,7 @@ def normalize_db_entry(line, files_table, vs_parts_table, vs_info_table, fs_info return line def cleanupEventDescription(description): - test = re.search("^\D+:\d+$", description) + test = re.search("^'\D+:\d+'$", description) if test is not None: return re.sub(":\d+", ":", description) else: From f5e1a8268af84c3f4957f8a988d2db0832c3e9d9 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Wed, 13 Jan 2021 12:12:06 -0500 Subject: [PATCH 7/8] 7221 give columns in discovery domain tables tooltips --- .../autopsy/discovery/ui/ArtifactsListPanel.java | 10 +++++++++- .../discovery/ui/MiniTimelineArtifactListPanel.java | 7 +++++++ .../discovery/ui/MiniTimelineDateListPanel.java | 7 +++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ui/ArtifactsListPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ui/ArtifactsListPanel.java index fb4a835acf..33e8b1c8f8 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ui/ArtifactsListPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ui/ArtifactsListPanel.java @@ -25,6 +25,7 @@ import java.util.logging.Level; import javax.swing.JPopupMenu; import javax.swing.event.ListSelectionListener; import javax.swing.table.AbstractTableModel; +import javax.swing.table.TableCellRenderer; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang.StringUtils; import org.openide.util.NbBundle; @@ -32,6 +33,7 @@ import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.datamodel.ContentUtils; +import org.sleuthkit.autopsy.guiutils.SimpleTableCellRenderer; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; import org.sleuthkit.datamodel.TimeUtilities; @@ -56,6 +58,11 @@ final class ArtifactsListPanel extends AbstractArtifactListPanel { ArtifactsListPanel(BlackboardArtifact.ARTIFACT_TYPE artifactType) { tableModel = new DomainArtifactTableModel(artifactType); initComponents(); + // add the cell renderer to all columns + TableCellRenderer renderer = new SimpleTableCellRenderer(); + for (int i = 0; i < tableModel.getColumnCount(); ++i) { + artifactsTable.getColumnModel().getColumn(i).setCellRenderer(renderer); + } artifactsTable.getRowSorter().toggleSortOrder(0); artifactsTable.getRowSorter().toggleSortOrder(0); } @@ -391,7 +398,8 @@ final class ArtifactsListPanel extends AbstractArtifactListPanel { public Object getValueAt(int rowIndex, int columnIndex) { return Bundle.ArtifactsListPanel_noResultsFound_text(); } - @Override + + @Override public String getColumnName(int column) { switch (column) { case 0: diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ui/MiniTimelineArtifactListPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ui/MiniTimelineArtifactListPanel.java index 3ac2cf6e9d..87a59edcf4 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ui/MiniTimelineArtifactListPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ui/MiniTimelineArtifactListPanel.java @@ -25,10 +25,12 @@ import java.util.logging.Level; import javax.swing.JPopupMenu; import javax.swing.event.ListSelectionListener; import javax.swing.table.AbstractTableModel; +import javax.swing.table.TableCellRenderer; import org.apache.commons.lang.StringUtils; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.ThreadConfined; +import org.sleuthkit.autopsy.guiutils.SimpleTableCellRenderer; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; import org.sleuthkit.datamodel.BlackboardAttribute.Type; @@ -54,6 +56,11 @@ class MiniTimelineArtifactListPanel extends AbstractArtifactListPanel { MiniTimelineArtifactListPanel() { tableModel = new TypeDescriptionTableModel(); initComponents(); + // add the cell renderer to all columns + TableCellRenderer renderer = new SimpleTableCellRenderer(); + for (int i = 0; i < tableModel.getColumnCount(); ++i) { + artifactsTable.getColumnModel().getColumn(i).setCellRenderer(renderer); + } artifactsTable.getRowSorter().toggleSortOrder(0); artifactsTable.getRowSorter().toggleSortOrder(0); } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ui/MiniTimelineDateListPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ui/MiniTimelineDateListPanel.java index b25ccc75c4..39f5f28813 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ui/MiniTimelineDateListPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ui/MiniTimelineDateListPanel.java @@ -23,9 +23,11 @@ import java.util.List; import javax.swing.JPanel; import javax.swing.event.ListSelectionListener; import javax.swing.table.AbstractTableModel; +import javax.swing.table.TableCellRenderer; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.discovery.search.MiniTimelineResult; +import org.sleuthkit.autopsy.guiutils.SimpleTableCellRenderer; import org.sleuthkit.datamodel.BlackboardArtifact; /** @@ -42,6 +44,11 @@ class MiniTimelineDateListPanel extends JPanel { @ThreadConfined(type = ThreadConfined.ThreadType.AWT) MiniTimelineDateListPanel() { initComponents(); + // add the cell renderer to all columns + TableCellRenderer renderer = new SimpleTableCellRenderer(); + for (int i = 0; i < tableModel.getColumnCount(); ++i) { + jTable1.getColumnModel().getColumn(i).setCellRenderer(renderer); + } jTable1.getRowSorter().toggleSortOrder(0); jTable1.getRowSorter().toggleSortOrder(0); } From 4b994a6a98d914bc46ab364a03faf4d2f7319c34 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Wed, 13 Jan 2021 14:48:48 -0500 Subject: [PATCH 8/8] 7221-keep columns from changing sizes when type of artifact changes --- .../artifactviewers/GeneralPurposeArtifactViewer.form | 9 +++++++-- .../artifactviewers/GeneralPurposeArtifactViewer.java | 6 ++++-- .../autopsy/discovery/ui/ContentViewerDetailsPanel.form | 2 +- .../autopsy/discovery/ui/ContentViewerDetailsPanel.java | 2 +- .../autopsy/discovery/ui/DomainArtifactsTabPanel.form | 3 +++ .../autopsy/discovery/ui/DomainArtifactsTabPanel.java | 1 + 6 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/GeneralPurposeArtifactViewer.form b/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/GeneralPurposeArtifactViewer.form index 0179bb756e..4a4133f5e4 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/GeneralPurposeArtifactViewer.form +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/GeneralPurposeArtifactViewer.form @@ -16,13 +16,13 @@ - + - + @@ -30,6 +30,11 @@ + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/GeneralPurposeArtifactViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/GeneralPurposeArtifactViewer.java index db66946a31..1b07ecd754 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/GeneralPurposeArtifactViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/artifactviewers/GeneralPurposeArtifactViewer.java @@ -215,16 +215,18 @@ public class GeneralPurposeArtifactViewer extends AbstractArtifactDetailsPanel i detailsScrollPane = new javax.swing.JScrollPane(); + detailsScrollPane.setPreferredSize(new java.awt.Dimension(300, 0)); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(detailsScrollPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 62, Short.MAX_VALUE) + .addComponent(detailsScrollPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addComponent(detailsScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 93, Short.MAX_VALUE) + .addComponent(detailsScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(0, 0, 0)) ); }// //GEN-END:initComponents diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ui/ContentViewerDetailsPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/ui/ContentViewerDetailsPanel.form index 9281965410..f3718bad99 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ui/ContentViewerDetailsPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/ui/ContentViewerDetailsPanel.form @@ -3,7 +3,7 @@
- + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ui/ContentViewerDetailsPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ui/ContentViewerDetailsPanel.java index 7e6aa833ee..4132947918 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ui/ContentViewerDetailsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ui/ContentViewerDetailsPanel.java @@ -50,7 +50,7 @@ final class ContentViewerDetailsPanel extends AbstractArtifactDetailsPanel { // //GEN-BEGIN:initComponents private void initComponents() { - setPreferredSize(new java.awt.Dimension(500, 0)); + setPreferredSize(new java.awt.Dimension(300, 0)); setLayout(new java.awt.BorderLayout()); }// //GEN-END:initComponents diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ui/DomainArtifactsTabPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/ui/DomainArtifactsTabPanel.form index 8b939f2521..bdef0da96f 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ui/DomainArtifactsTabPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/ui/DomainArtifactsTabPanel.form @@ -12,6 +12,9 @@ + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ui/DomainArtifactsTabPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ui/DomainArtifactsTabPanel.java index 754415705d..1cc29aef1d 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ui/DomainArtifactsTabPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ui/DomainArtifactsTabPanel.java @@ -180,6 +180,7 @@ final class DomainArtifactsTabPanel extends JPanel { mainSplitPane.setDividerLocation(350); mainSplitPane.setResizeWeight(0.1); + setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); setMinimumSize(new java.awt.Dimension(0, 0)); setLayout(new java.awt.BorderLayout()); }// //GEN-END:initComponents