mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 10:17:41 +00:00
tweaking
This commit is contained in:
parent
21ea947b66
commit
42b04b7491
@ -18,6 +18,7 @@
|
||||
*/
|
||||
package org.sleuthkit.autopsy.datasourcesummary.datamodel;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
@ -54,9 +55,7 @@ import static org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TEX
|
||||
public class DataSourceUserActivitySummary {
|
||||
|
||||
private static final BlackboardArtifact.Type TYPE_DEVICE_ATTACHED = new BlackboardArtifact.Type(TSK_DEVICE_ATTACHED);
|
||||
private static final BlackboardArtifact.Type TYPE_MESSAGE = new BlackboardArtifact.Type(TSK_MESSAGE);
|
||||
private static final BlackboardArtifact.Type TYPE_WEB_SEARCH_QUERY = new BlackboardArtifact.Type(TSK_WEB_SEARCH_QUERY);
|
||||
|
||||
|
||||
private static final BlackboardAttribute.Type TYPE_DATETIME = new BlackboardAttribute.Type(TSK_DATETIME);
|
||||
private static final BlackboardAttribute.Type TYPE_DATETIME_ACCESSED = new BlackboardAttribute.Type(TSK_DATETIME_ACCESSED);
|
||||
private static final BlackboardAttribute.Type TYPE_DEVICE_ID = new BlackboardAttribute.Type(TSK_DEVICE_ID);
|
||||
@ -68,6 +67,11 @@ public class DataSourceUserActivitySummary {
|
||||
private static final BlackboardAttribute.Type TYPE_DOMAIN = new BlackboardAttribute.Type(TSK_DOMAIN);
|
||||
private static final BlackboardAttribute.Type TYPE_PROG_NAME = new BlackboardAttribute.Type(TSK_PROG_NAME);
|
||||
|
||||
private static final Comparator<TopAccountResult> TOP_ACCOUNT_RESULT_DATE_COMPARE = (a,b) -> a.getLastAccess().compareTo(b.getLastAccess());
|
||||
private static final Comparator<TopWebSearchResult> TOP_WEBSEARCH_RESULT_DATE_COMPARE = (a,b) -> a.getDateAccessed().compareTo(b.getDateAccessed());
|
||||
private static final String ROOT_HUB_IDENTIFIER = "ROOT_HUB";
|
||||
|
||||
|
||||
private static final long SLEEP_TIME = 5000;
|
||||
|
||||
/**
|
||||
@ -107,7 +111,7 @@ public class DataSourceUserActivitySummary {
|
||||
private final java.util.logging.Logger logger;
|
||||
|
||||
public DataSourceUserActivitySummary() {
|
||||
this(SleuthkitCaseProvider.DEFAULT, TextTranslationService.getInstance(),
|
||||
this(SleuthkitCaseProvider.DEFAULT, TextTranslationService.getInstance(),
|
||||
org.sleuthkit.autopsy.coreutils.Logger.getLogger(DataSourceUserActivitySummary.class.getName()));
|
||||
}
|
||||
|
||||
@ -118,17 +122,43 @@ public class DataSourceUserActivitySummary {
|
||||
}
|
||||
|
||||
public List<TopWebSearchResult> getMostRecentWebSearches(DataSource dataSource, int count) throws SleuthkitCaseProviderException, TskCoreException {
|
||||
List<TopWebSearchResult> results =
|
||||
DataSourceInfoUtilities.getArtifacts(caseProvider.get(), TYPE_WEB_SEARCH_QUERY, dataSource, TYPE_DATETIME_ACCESSED, SortOrder.DESCENDING, count)
|
||||
if (count <= 0) {
|
||||
throw new IllegalArgumentException("Count must be greater than 0");
|
||||
}
|
||||
|
||||
List<TopWebSearchResult> results = caseProvider.get().getBlackboard().getArtifacts(TSK_WEB_SEARCH_QUERY.getTypeID(), dataSource.getId())
|
||||
.stream()
|
||||
.map(artifact -> new TopWebSearchResult(
|
||||
DataSourceInfoUtilities.getStringOrNull(artifact, TYPE_TEXT),
|
||||
DataSourceInfoUtilities.getDateOrNull(artifact, TYPE_DATETIME_ACCESSED),
|
||||
// get items where search string and date is not null
|
||||
.map(artifact -> {
|
||||
String searchString = DataSourceInfoUtilities.getStringOrNull(artifact, TYPE_TEXT);
|
||||
Date dateAccessed = DataSourceInfoUtilities.getDateOrNull(artifact, TYPE_DATETIME_ACCESSED);
|
||||
if (StringUtils.isBlank(searchString) || dateAccessed == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new TopWebSearchResult(
|
||||
searchString,
|
||||
dateAccessed,
|
||||
DataSourceInfoUtilities.getStringOrNull(artifact, TYPE_DOMAIN),
|
||||
DataSourceInfoUtilities.getStringOrNull(artifact, TYPE_PROG_NAME)
|
||||
))
|
||||
);
|
||||
})
|
||||
// remove null records
|
||||
.filter(result -> result != null && StringUtils.isNotBlank(result.getSearchString()))
|
||||
// get these messages grouped by search to string
|
||||
.collect(Collectors.groupingBy((result) -> result.getSearchString().toUpperCase()))
|
||||
.entrySet()
|
||||
.stream()
|
||||
// get the most recent access per account type
|
||||
.map((entry) -> entry.getValue().stream().max(TOP_WEBSEARCH_RESULT_DATE_COMPARE).get())
|
||||
// get most recent accounts accessed
|
||||
.sorted(TOP_WEBSEARCH_RESULT_DATE_COMPARE.reversed())
|
||||
.limit(count)
|
||||
// get as list
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
||||
|
||||
// get translation if possible
|
||||
for (TopWebSearchResult result : results) {
|
||||
if (StringUtils.isNotBlank(result.getSearchString()) && translationService.hasProvider()) {
|
||||
String translated = null;
|
||||
@ -137,37 +167,60 @@ public class DataSourceUserActivitySummary {
|
||||
} catch (NoServiceProviderException | TranslationException ex) {
|
||||
logger.log(Level.WARNING, String.format("There was an error translating text: '%s'", result.getSearchString()), ex);
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(translated)) {
|
||||
result.setTranslatedResult(translated);
|
||||
|
||||
// set translation if there is a translation and that value differs from original
|
||||
if (StringUtils.isNotBlank(translated) && !translated.toUpperCase().trim().equals(result.getSearchString().toUpperCase())) {
|
||||
result.setTranslatedResult(translated);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<TopDeviceAttachedResult> getRecentDevices(DataSource dataSource, int count) throws SleuthkitCaseProviderException, TskCoreException {
|
||||
return DataSourceInfoUtilities.getArtifacts(caseProvider.get(), TYPE_DEVICE_ATTACHED, dataSource, TYPE_DATETIME, SortOrder.DESCENDING, count)
|
||||
return DataSourceInfoUtilities.getArtifacts(caseProvider.get(), TYPE_DEVICE_ATTACHED, dataSource, TYPE_DATETIME, SortOrder.DESCENDING, 0)
|
||||
.stream()
|
||||
.map(artifact -> new TopDeviceAttachedResult(
|
||||
DataSourceInfoUtilities.getStringOrNull(artifact, TYPE_DEVICE_ID),
|
||||
DataSourceInfoUtilities.getDateOrNull(artifact, TYPE_DATETIME),
|
||||
DataSourceInfoUtilities.getStringOrNull(artifact, TYPE_DEVICE_MAKE),
|
||||
DataSourceInfoUtilities.getStringOrNull(artifact, TYPE_DEVICE_MODEL),
|
||||
DataSourceInfoUtilities.getStringOrNull(artifact, TYPE_MAC_ADDRESS)
|
||||
))
|
||||
DataSourceInfoUtilities.getStringOrNull(artifact, TYPE_DEVICE_ID),
|
||||
DataSourceInfoUtilities.getDateOrNull(artifact, TYPE_DATETIME),
|
||||
DataSourceInfoUtilities.getStringOrNull(artifact, TYPE_DEVICE_MAKE),
|
||||
DataSourceInfoUtilities.getStringOrNull(artifact, TYPE_DEVICE_MODEL),
|
||||
DataSourceInfoUtilities.getStringOrNull(artifact, TYPE_MAC_ADDRESS)
|
||||
))
|
||||
.filter(result -> result.getDeviceModel() == null || !result.getDeviceModel().trim().toUpperCase().equals(ROOT_HUB_IDENTIFIER))
|
||||
.limit(count)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
public List<TopAccountResult> getRecentAccounts(DataSource dataSource, int count) throws SleuthkitCaseProviderException, TskCoreException {
|
||||
// TODO fix this for groupings
|
||||
return DataSourceInfoUtilities.getArtifacts(caseProvider.get(), TYPE_MESSAGE, dataSource, TYPE_DATETIME, SortOrder.DESCENDING, count)
|
||||
if (count <= 0) {
|
||||
throw new IllegalArgumentException("Count must be greater than 0");
|
||||
}
|
||||
|
||||
return caseProvider.get().getBlackboard().getArtifacts(TSK_MESSAGE.getTypeID(), dataSource.getId())
|
||||
.stream()
|
||||
.map(artifact -> new TopAccountResult(
|
||||
DataSourceInfoUtilities.getStringOrNull(artifact, TYPE_MESSAGE_TYPE),
|
||||
DataSourceInfoUtilities.getDateOrNull(artifact, TYPE_DATETIME)
|
||||
))
|
||||
// get message type and date (or null if one of those attributes does not exist)
|
||||
.map(artifact -> {
|
||||
String type = DataSourceInfoUtilities.getStringOrNull(artifact, TYPE_MESSAGE_TYPE);
|
||||
Date date = DataSourceInfoUtilities.getDateOrNull(artifact, TYPE_DATETIME);
|
||||
return (StringUtils.isNotBlank(type) && date != null) ? new TopAccountResult(type, date) : null;
|
||||
})
|
||||
// remove null records
|
||||
.filter(result -> result != null)
|
||||
// get these messages grouped by account type
|
||||
.collect(Collectors.groupingBy(TopAccountResult::getAccountType))
|
||||
.entrySet()
|
||||
.stream()
|
||||
// get the most recent access per account type
|
||||
.map((entry) -> entry.getValue().stream().max(TOP_ACCOUNT_RESULT_DATE_COMPARE).get())
|
||||
// get most recent accounts accessed
|
||||
.sorted(TOP_ACCOUNT_RESULT_DATE_COMPARE.reversed())
|
||||
// limit to count
|
||||
.limit(count)
|
||||
// get as list
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,6 @@ DataSourceSummaryCountsPanel.byCategoryLabel.text=Files by Category
|
||||
DataSourceSummaryCountsPanel.resultsByTypeLabel.text=Results by Type
|
||||
DataSourceSummaryUserActivityPanel.programsRunLabel.text=Recent Programs
|
||||
DataSourceSummaryUserActivityPanel.recentDomainsLabel.text=Recent Domains
|
||||
DataSourceSummaryUserActivityPanel.recentDomainsLabel1.text=Recent Domains
|
||||
DataSourceSummaryUserActivityPanel.recentDomainsLabel2.text=Recent Domains
|
||||
DataSourceSummaryUserActivityPanel.recentDomainsLabel3.text=Recent Domains
|
||||
DataSourceSummaryUserActivityPanel.topWebSearchLabel.text=Recent Web Searches
|
||||
DataSourceSummaryUserActivityPanel.topDevicesAttachedLabel.text=Recent Devices Attached
|
||||
DataSourceSummaryUserActivityPanel.recentAccountsLabel.text=Recent Accounts
|
||||
|
@ -75,8 +75,16 @@ DataSourceSummaryTabbedPane_ingestHistoryTab_title=Ingest History
|
||||
DataSourceSummaryTabbedPane_userActivityTab_title=User Activity
|
||||
DataSourceSummaryUserActivityPanel.programsRunLabel.text=Recent Programs
|
||||
DataSourceSummaryUserActivityPanel.recentDomainsLabel.text=Recent Domains
|
||||
DataSourceSummaryUserActivityPanel.topWebSearchLabel.text=Recent Web Searches
|
||||
DataSourceSummaryUserActivityPanel.topDevicesAttachedLabel.text=Recent Devices Attached
|
||||
DataSourceSummaryUserActivityPanel.recentAccountsLabel.text=Recent Accounts
|
||||
DataSourceSummaryUserActivityPanel_noDataExists=No communication data exists
|
||||
DataSourceSummaryUserActivityPanel_tab_title=User Activity
|
||||
DataSourceSummaryUserActivityPanel_TopAccountTableModel_accountType_header=Account Type
|
||||
DataSourceSummaryUserActivityPanel_TopAccountTableModel_lastAccess_header=Last Accessed
|
||||
DataSourceSummaryUserActivityPanel_TopDeviceAttachedTableModel_dateAccessed_header=Last Accessed
|
||||
DataSourceSummaryUserActivityPanel_TopDeviceAttachedTableModel_deviceId_header=Device Id
|
||||
DataSourceSummaryUserActivityPanel_TopDeviceAttachedTableModel_makeModel_header=Make and Model
|
||||
DataSourceSummaryUserActivityPanel_TopDomainsTableModel_domain_header=Domain
|
||||
DataSourceSummaryUserActivityPanel_TopDomainsTableModel_lastAccess_header=Last Access
|
||||
DataSourceSummaryUserActivityPanel_TopDomainsTableModel_url_header=URL
|
||||
@ -84,4 +92,7 @@ DataSourceSummaryUserActivityPanel_TopProgramsTableModel_count_header=Run Times
|
||||
DataSourceSummaryUserActivityPanel_TopProgramsTableModel_folder_header=Folder
|
||||
DataSourceSummaryUserActivityPanel_TopProgramsTableModel_lastrun_header=Last Run
|
||||
DataSourceSummaryUserActivityPanel_TopProgramsTableModel_name_header=Program
|
||||
DataSourceSummaryUserActivityPanel_TopWebSearchTableModel_dateAccessed_header=Date Accessed
|
||||
DataSourceSummaryUserActivityPanel_TopWebSearchTableModel_searchString_header=Search String
|
||||
DataSourceSummaryUserActivityPanel_TopWebSearchTableModel_translatedResult_header=Translated
|
||||
ViewSummaryInformationAction.name.text=View Summary Information
|
||||
|
@ -97,13 +97,13 @@
|
||||
<Properties>
|
||||
<Property name="alignmentX" type="float" value="0.0"/>
|
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[700, 187]"/>
|
||||
<Dimension value="[700, 106]"/>
|
||||
</Property>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[700, 187]"/>
|
||||
<Dimension value="[700, 106]"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[700, 187]"/>
|
||||
<Dimension value="[700, 106]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
@ -166,13 +166,13 @@
|
||||
<Properties>
|
||||
<Property name="alignmentX" type="float" value="0.0"/>
|
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[700, 187]"/>
|
||||
<Dimension value="[700, 106]"/>
|
||||
</Property>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[700, 187]"/>
|
||||
<Dimension value="[700, 106]"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[700, 187]"/>
|
||||
<Dimension value="[700, 106]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
@ -201,11 +201,11 @@
|
||||
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.RigidArea"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="recentDomainsLabel1">
|
||||
<Component class="javax.swing.JLabel" name="topWebSearchLabel">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="2"/>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/datasourcesummary/ui/Bundle.properties" key="DataSourceSummaryUserActivityPanel.recentDomainsLabel1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/datasourcesummary/ui/Bundle.properties" key="DataSourceSummaryUserActivityPanel.topWebSearchLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
@ -231,21 +231,21 @@
|
||||
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.RigidArea"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Container class="javax.swing.JPanel" name="recentDomainsTablePanel1">
|
||||
<Container class="javax.swing.JPanel" name="topWebSearches">
|
||||
<Properties>
|
||||
<Property name="alignmentX" type="float" value="0.0"/>
|
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[700, 187]"/>
|
||||
<Dimension value="[700, 106]"/>
|
||||
</Property>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[700, 187]"/>
|
||||
<Dimension value="[700, 106]"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[700, 187]"/>
|
||||
<Dimension value="[700, 106]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="recentDomainsTable"/>
|
||||
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="topWebSearchesTable"/>
|
||||
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||
</AuxValues>
|
||||
@ -270,11 +270,11 @@
|
||||
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.RigidArea"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="recentDomainsLabel2">
|
||||
<Component class="javax.swing.JLabel" name="topDevicesAttachedLabel">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="2"/>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/datasourcesummary/ui/Bundle.properties" key="DataSourceSummaryUserActivityPanel.recentDomainsLabel2.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/datasourcesummary/ui/Bundle.properties" key="DataSourceSummaryUserActivityPanel.topDevicesAttachedLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
@ -300,21 +300,21 @@
|
||||
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.RigidArea"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Container class="javax.swing.JPanel" name="recentDomainsTablePanel2">
|
||||
<Container class="javax.swing.JPanel" name="recentDevicesAttached">
|
||||
<Properties>
|
||||
<Property name="alignmentX" type="float" value="0.0"/>
|
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[700, 187]"/>
|
||||
<Dimension value="[700, 106]"/>
|
||||
</Property>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[700, 187]"/>
|
||||
<Dimension value="[700, 106]"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[700, 187]"/>
|
||||
<Dimension value="[700, 106]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="recentDomainsTable"/>
|
||||
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="topDevicesAttachedTable"/>
|
||||
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||
</AuxValues>
|
||||
@ -339,11 +339,11 @@
|
||||
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.RigidArea"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="recentDomainsLabel3">
|
||||
<Component class="javax.swing.JLabel" name="recentAccountsLabel">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="2"/>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/datasourcesummary/ui/Bundle.properties" key="DataSourceSummaryUserActivityPanel.recentDomainsLabel3.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/datasourcesummary/ui/Bundle.properties" key="DataSourceSummaryUserActivityPanel.recentAccountsLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
@ -369,21 +369,21 @@
|
||||
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.RigidArea"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Container class="javax.swing.JPanel" name="recentDomainsTablePanel3">
|
||||
<Container class="javax.swing.JPanel" name="topAccounts">
|
||||
<Properties>
|
||||
<Property name="alignmentX" type="float" value="0.0"/>
|
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[700, 187]"/>
|
||||
<Dimension value="[700, 106]"/>
|
||||
</Property>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[700, 187]"/>
|
||||
<Dimension value="[700, 106]"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[700, 187]"/>
|
||||
<Dimension value="[700, 106]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="recentDomainsTable"/>
|
||||
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="topAccountsTable"/>
|
||||
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||
</AuxValues>
|
||||
|
@ -135,17 +135,13 @@ public class DataSourceSummaryUserActivityPanel extends BaseDataSourceSummaryPan
|
||||
Bundle.DataSourceSummaryUserActivityPanel_TopProgramsTableModel_count_header(),
|
||||
(prog) -> {
|
||||
String runTimes = prog.getRunTimes() == null ? "" : Long.toString(prog.getRunTimes());
|
||||
return new DefaultCellModel(runTimes)
|
||||
.setHorizontalAlignment(HorizontalAlign.RIGHT);
|
||||
return new DefaultCellModel(runTimes);
|
||||
},
|
||||
80),
|
||||
// last run date column
|
||||
new ColumnModel<>(
|
||||
Bundle.DataSourceSummaryUserActivityPanel_TopProgramsTableModel_lastrun_header(),
|
||||
(prog) -> {
|
||||
return new DefaultCellModel(getFormatted(prog.getLastRun()))
|
||||
.setHorizontalAlignment(HorizontalAlign.RIGHT);
|
||||
},
|
||||
(prog) -> new DefaultCellModel(getFormatted(prog.getLastRun())),
|
||||
150)
|
||||
));
|
||||
|
||||
@ -166,10 +162,7 @@ public class DataSourceSummaryUserActivityPanel extends BaseDataSourceSummaryPan
|
||||
// last accessed column
|
||||
new ColumnModel<>(
|
||||
Bundle.DataSourceSummaryUserActivityPanel_TopDomainsTableModel_lastAccess_header(),
|
||||
(recentDomain) -> {
|
||||
return new DefaultCellModel(getFormatted(recentDomain.getLastVisit()))
|
||||
.setHorizontalAlignment(HorizontalAlign.RIGHT);
|
||||
},
|
||||
(recentDomain) -> new DefaultCellModel(getFormatted(recentDomain.getLastVisit())),
|
||||
150)
|
||||
));
|
||||
|
||||
@ -184,8 +177,7 @@ public class DataSourceSummaryUserActivityPanel extends BaseDataSourceSummaryPan
|
||||
// last accessed
|
||||
new ColumnModel<>(
|
||||
Bundle.DataSourceSummaryUserActivityPanel_TopWebSearchTableModel_dateAccessed_header(),
|
||||
(webSearch) -> new DefaultCellModel(getFormatted(webSearch.getDateAccessed()))
|
||||
.setHorizontalAlignment(HorizontalAlign.RIGHT),
|
||||
(webSearch) -> new DefaultCellModel(getFormatted(webSearch.getDateAccessed())),
|
||||
150
|
||||
),
|
||||
// translated value
|
||||
@ -207,8 +199,7 @@ public class DataSourceSummaryUserActivityPanel extends BaseDataSourceSummaryPan
|
||||
// last accessed
|
||||
new ColumnModel<>(
|
||||
Bundle.DataSourceSummaryUserActivityPanel_TopDeviceAttachedTableModel_dateAccessed_header(),
|
||||
(device) -> new DefaultCellModel(getFormatted(device.getDateAccessed()))
|
||||
.setHorizontalAlignment(HorizontalAlign.RIGHT),
|
||||
(device) -> new DefaultCellModel(getFormatted(device.getDateAccessed())),
|
||||
150
|
||||
),
|
||||
// make and model
|
||||
@ -237,8 +228,7 @@ public class DataSourceSummaryUserActivityPanel extends BaseDataSourceSummaryPan
|
||||
// last accessed
|
||||
new ColumnModel<>(
|
||||
Bundle.DataSourceSummaryUserActivityPanel_TopAccountTableModel_lastAccess_header(),
|
||||
(account) -> new DefaultCellModel(getFormatted(account.getLastAccess()))
|
||||
.setHorizontalAlignment(HorizontalAlign.RIGHT),
|
||||
(account) -> new DefaultCellModel(getFormatted(account.getLastAccess())),
|
||||
150
|
||||
)
|
||||
));
|
||||
@ -255,27 +245,27 @@ public class DataSourceSummaryUserActivityPanel extends BaseDataSourceSummaryPan
|
||||
// set up data acquisition methods
|
||||
dataFetchComponents = Arrays.asList(
|
||||
// top programs query
|
||||
new DataFetchComponents<DataSource, List<TopProgramsResult>>(
|
||||
new DataFetchComponents<>(
|
||||
(dataSource) -> topProgramsData.getTopPrograms(dataSource, TOP_PROGS_COUNT),
|
||||
(result) -> topProgramsTable.showDataFetchResult(result, JTablePanel.getDefaultErrorMessage(),
|
||||
Bundle.DataSourceSummaryUserActivityPanel_noDataExists())),
|
||||
// top domains query
|
||||
new DataFetchComponents<DataSource, List<TopDomainsResult>>(
|
||||
new DataFetchComponents<>(
|
||||
(dataSource) -> topDomainsData.getRecentDomains(dataSource, TOP_DOMAINS_COUNT),
|
||||
(result) -> recentDomainsTable.showDataFetchResult(result, JTablePanel.getDefaultErrorMessage(),
|
||||
Bundle.DataSourceSummaryUserActivityPanel_noDataExists())),
|
||||
// top web searches query
|
||||
new DataFetchComponents<DataSource, List<TopWebSearchResult>>(
|
||||
new DataFetchComponents<>(
|
||||
(dataSource) -> topDomainsData.getMostRecentWebSearches(dataSource, TOP_SEARCHES_COUNT),
|
||||
(result) -> topWebSearchesTable.showDataFetchResult(result, JTablePanel.getDefaultErrorMessage(),
|
||||
Bundle.DataSourceSummaryUserActivityPanel_noDataExists())),
|
||||
// top devices query
|
||||
new DataFetchComponents<DataSource, List<TopDeviceAttachedResult>>(
|
||||
new DataFetchComponents<>(
|
||||
(dataSource) -> topDomainsData.getRecentDevices(dataSource, TOP_DEVICES_COUNT),
|
||||
(result) -> topDevicesAttachedTable.showDataFetchResult(result, JTablePanel.getDefaultErrorMessage(),
|
||||
Bundle.DataSourceSummaryUserActivityPanel_noDataExists())),
|
||||
// top accounts query
|
||||
new DataFetchComponents<DataSource, List<TopAccountResult>>(
|
||||
new DataFetchComponents<>(
|
||||
(dataSource) -> topDomainsData.getRecentAccounts(dataSource, TOP_ACCOUNTS_COUNT),
|
||||
(result) -> topAccountsTable.showDataFetchResult(result, JTablePanel.getDefaultErrorMessage(),
|
||||
Bundle.DataSourceSummaryUserActivityPanel_noDataExists()))
|
||||
@ -326,17 +316,17 @@ public class DataSourceSummaryUserActivityPanel extends BaseDataSourceSummaryPan
|
||||
javax.swing.Box.Filler filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 2), new java.awt.Dimension(0, 2), new java.awt.Dimension(0, 2));
|
||||
javax.swing.JPanel recentDomainsTablePanel = recentDomainsTable;
|
||||
javax.swing.Box.Filler filler4 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 20), new java.awt.Dimension(0, 20), new java.awt.Dimension(0, 20));
|
||||
javax.swing.JLabel recentDomainsLabel1 = new javax.swing.JLabel();
|
||||
javax.swing.JLabel topWebSearchLabel = new javax.swing.JLabel();
|
||||
javax.swing.Box.Filler filler5 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 2), new java.awt.Dimension(0, 2), new java.awt.Dimension(0, 2));
|
||||
javax.swing.JPanel recentDomainsTablePanel1 = recentDomainsTable;
|
||||
javax.swing.JPanel topWebSearches = topWebSearchesTable;
|
||||
javax.swing.Box.Filler filler6 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 20), new java.awt.Dimension(0, 20), new java.awt.Dimension(0, 20));
|
||||
javax.swing.JLabel recentDomainsLabel2 = new javax.swing.JLabel();
|
||||
javax.swing.JLabel topDevicesAttachedLabel = new javax.swing.JLabel();
|
||||
javax.swing.Box.Filler filler7 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 2), new java.awt.Dimension(0, 2), new java.awt.Dimension(0, 2));
|
||||
javax.swing.JPanel recentDomainsTablePanel2 = recentDomainsTable;
|
||||
javax.swing.JPanel recentDevicesAttached = topDevicesAttachedTable;
|
||||
javax.swing.Box.Filler filler8 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 20), new java.awt.Dimension(0, 20), new java.awt.Dimension(0, 20));
|
||||
javax.swing.JLabel recentDomainsLabel3 = new javax.swing.JLabel();
|
||||
javax.swing.JLabel recentAccountsLabel = new javax.swing.JLabel();
|
||||
javax.swing.Box.Filler filler9 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 2), new java.awt.Dimension(0, 2), new java.awt.Dimension(0, 2));
|
||||
javax.swing.JPanel recentDomainsTablePanel3 = recentDomainsTable;
|
||||
javax.swing.JPanel topAccounts = topAccountsTable;
|
||||
|
||||
setLayout(new java.awt.BorderLayout());
|
||||
|
||||
@ -355,9 +345,9 @@ public class DataSourceSummaryUserActivityPanel extends BaseDataSourceSummaryPan
|
||||
contentPanel.add(filler1);
|
||||
|
||||
topProgramsTablePanel.setAlignmentX(0.0F);
|
||||
topProgramsTablePanel.setMaximumSize(new java.awt.Dimension(700, 187));
|
||||
topProgramsTablePanel.setMinimumSize(new java.awt.Dimension(700, 187));
|
||||
topProgramsTablePanel.setPreferredSize(new java.awt.Dimension(700, 187));
|
||||
topProgramsTablePanel.setMaximumSize(new java.awt.Dimension(700, 106));
|
||||
topProgramsTablePanel.setMinimumSize(new java.awt.Dimension(700, 106));
|
||||
topProgramsTablePanel.setPreferredSize(new java.awt.Dimension(700, 106));
|
||||
contentPanel.add(topProgramsTablePanel);
|
||||
contentPanel.add(filler3);
|
||||
|
||||
@ -367,46 +357,46 @@ public class DataSourceSummaryUserActivityPanel extends BaseDataSourceSummaryPan
|
||||
contentPanel.add(filler2);
|
||||
|
||||
recentDomainsTablePanel.setAlignmentX(0.0F);
|
||||
recentDomainsTablePanel.setMaximumSize(new java.awt.Dimension(700, 187));
|
||||
recentDomainsTablePanel.setMinimumSize(new java.awt.Dimension(700, 187));
|
||||
recentDomainsTablePanel.setPreferredSize(new java.awt.Dimension(700, 187));
|
||||
recentDomainsTablePanel.setMaximumSize(new java.awt.Dimension(700, 106));
|
||||
recentDomainsTablePanel.setMinimumSize(new java.awt.Dimension(700, 106));
|
||||
recentDomainsTablePanel.setPreferredSize(new java.awt.Dimension(700, 106));
|
||||
contentPanel.add(recentDomainsTablePanel);
|
||||
contentPanel.add(filler4);
|
||||
|
||||
recentDomainsLabel1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
|
||||
org.openide.awt.Mnemonics.setLocalizedText(recentDomainsLabel1, org.openide.util.NbBundle.getMessage(DataSourceSummaryUserActivityPanel.class, "DataSourceSummaryUserActivityPanel.recentDomainsLabel1.text")); // NOI18N
|
||||
contentPanel.add(recentDomainsLabel1);
|
||||
topWebSearchLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
|
||||
org.openide.awt.Mnemonics.setLocalizedText(topWebSearchLabel, org.openide.util.NbBundle.getMessage(DataSourceSummaryUserActivityPanel.class, "DataSourceSummaryUserActivityPanel.topWebSearchLabel.text")); // NOI18N
|
||||
contentPanel.add(topWebSearchLabel);
|
||||
contentPanel.add(filler5);
|
||||
|
||||
recentDomainsTablePanel1.setAlignmentX(0.0F);
|
||||
recentDomainsTablePanel1.setMaximumSize(new java.awt.Dimension(700, 187));
|
||||
recentDomainsTablePanel1.setMinimumSize(new java.awt.Dimension(700, 187));
|
||||
recentDomainsTablePanel1.setPreferredSize(new java.awt.Dimension(700, 187));
|
||||
contentPanel.add(recentDomainsTablePanel1);
|
||||
topWebSearches.setAlignmentX(0.0F);
|
||||
topWebSearches.setMaximumSize(new java.awt.Dimension(700, 106));
|
||||
topWebSearches.setMinimumSize(new java.awt.Dimension(700, 106));
|
||||
topWebSearches.setPreferredSize(new java.awt.Dimension(700, 106));
|
||||
contentPanel.add(topWebSearches);
|
||||
contentPanel.add(filler6);
|
||||
|
||||
recentDomainsLabel2.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
|
||||
org.openide.awt.Mnemonics.setLocalizedText(recentDomainsLabel2, org.openide.util.NbBundle.getMessage(DataSourceSummaryUserActivityPanel.class, "DataSourceSummaryUserActivityPanel.recentDomainsLabel2.text")); // NOI18N
|
||||
contentPanel.add(recentDomainsLabel2);
|
||||
topDevicesAttachedLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
|
||||
org.openide.awt.Mnemonics.setLocalizedText(topDevicesAttachedLabel, org.openide.util.NbBundle.getMessage(DataSourceSummaryUserActivityPanel.class, "DataSourceSummaryUserActivityPanel.topDevicesAttachedLabel.text")); // NOI18N
|
||||
contentPanel.add(topDevicesAttachedLabel);
|
||||
contentPanel.add(filler7);
|
||||
|
||||
recentDomainsTablePanel2.setAlignmentX(0.0F);
|
||||
recentDomainsTablePanel2.setMaximumSize(new java.awt.Dimension(700, 187));
|
||||
recentDomainsTablePanel2.setMinimumSize(new java.awt.Dimension(700, 187));
|
||||
recentDomainsTablePanel2.setPreferredSize(new java.awt.Dimension(700, 187));
|
||||
contentPanel.add(recentDomainsTablePanel2);
|
||||
recentDevicesAttached.setAlignmentX(0.0F);
|
||||
recentDevicesAttached.setMaximumSize(new java.awt.Dimension(700, 106));
|
||||
recentDevicesAttached.setMinimumSize(new java.awt.Dimension(700, 106));
|
||||
recentDevicesAttached.setPreferredSize(new java.awt.Dimension(700, 106));
|
||||
contentPanel.add(recentDevicesAttached);
|
||||
contentPanel.add(filler8);
|
||||
|
||||
recentDomainsLabel3.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
|
||||
org.openide.awt.Mnemonics.setLocalizedText(recentDomainsLabel3, org.openide.util.NbBundle.getMessage(DataSourceSummaryUserActivityPanel.class, "DataSourceSummaryUserActivityPanel.recentDomainsLabel3.text")); // NOI18N
|
||||
contentPanel.add(recentDomainsLabel3);
|
||||
recentAccountsLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
|
||||
org.openide.awt.Mnemonics.setLocalizedText(recentAccountsLabel, org.openide.util.NbBundle.getMessage(DataSourceSummaryUserActivityPanel.class, "DataSourceSummaryUserActivityPanel.recentAccountsLabel.text")); // NOI18N
|
||||
contentPanel.add(recentAccountsLabel);
|
||||
contentPanel.add(filler9);
|
||||
|
||||
recentDomainsTablePanel3.setAlignmentX(0.0F);
|
||||
recentDomainsTablePanel3.setMaximumSize(new java.awt.Dimension(700, 187));
|
||||
recentDomainsTablePanel3.setMinimumSize(new java.awt.Dimension(700, 187));
|
||||
recentDomainsTablePanel3.setPreferredSize(new java.awt.Dimension(700, 187));
|
||||
contentPanel.add(recentDomainsTablePanel3);
|
||||
topAccounts.setAlignmentX(0.0F);
|
||||
topAccounts.setMaximumSize(new java.awt.Dimension(700, 106));
|
||||
topAccounts.setMinimumSize(new java.awt.Dimension(700, 106));
|
||||
topAccounts.setPreferredSize(new java.awt.Dimension(700, 106));
|
||||
contentPanel.add(topAccounts);
|
||||
|
||||
contentScrollPane.setViewportView(contentPanel);
|
||||
|
||||
|
@ -19,8 +19,11 @@
|
||||
package org.sleuthkit.autopsy.datasourcesummary.uiutils;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.Insets;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JTable;
|
||||
import javax.swing.border.Border;
|
||||
import javax.swing.table.DefaultTableCellRenderer;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
@ -80,6 +83,11 @@ public class CellModelTableCellRenderer extends DefaultTableCellRenderer {
|
||||
* @return The horizontal alignment for the text in the cell.
|
||||
*/
|
||||
HorizontalAlign getHorizontalAlignment();
|
||||
|
||||
/**
|
||||
* @return The insets for the cell text.
|
||||
*/
|
||||
Insets getInsets();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -90,6 +98,7 @@ public class CellModelTableCellRenderer extends DefaultTableCellRenderer {
|
||||
private final String text;
|
||||
private String tooltip;
|
||||
private HorizontalAlign horizontalAlignment;
|
||||
private Insets insets;
|
||||
|
||||
/**
|
||||
* Main constructor.
|
||||
@ -138,6 +147,21 @@ public class CellModelTableCellRenderer extends DefaultTableCellRenderer {
|
||||
this.horizontalAlignment = alignment;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Insets getInsets() {
|
||||
return insets;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the insets for the text within the cell
|
||||
* @param insets The insets.
|
||||
* @return As a utility, returns this.
|
||||
*/
|
||||
public DefaultCellModel setInsets(Insets insets) {
|
||||
this.insets = insets;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
@ -145,7 +169,8 @@ public class CellModelTableCellRenderer extends DefaultTableCellRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
private static int DEFAULT_ALIGNMENT = JLabel.LEFT;
|
||||
private static final int DEFAULT_ALIGNMENT = JLabel.LEFT;
|
||||
private static final Border DEFAULT_BORDER = BorderFactory.createEmptyBorder(1,5,1,5);
|
||||
|
||||
@Override
|
||||
public Component getTableCellRendererComponent(JTable table, Object value,
|
||||
@ -186,6 +211,14 @@ public class CellModelTableCellRenderer extends DefaultTableCellRenderer {
|
||||
defaultCell.setToolTipText(null);
|
||||
}
|
||||
|
||||
// sets the padding for cell text within the cell.
|
||||
Insets insets = cellModel.getInsets();
|
||||
if (insets != null) {
|
||||
defaultCell.setBorder(BorderFactory.createEmptyBorder(insets.top, insets.left, insets.bottom, insets.right));
|
||||
} else {
|
||||
defaultCell.setBorder(DEFAULT_BORDER);
|
||||
}
|
||||
|
||||
// sets the JLabel alignment (left, center, right) or default alignment
|
||||
// if no alignment is specified
|
||||
int alignment = (cellModel.getHorizontalAlignment() == null)
|
||||
|
Loading…
x
Reference in New Issue
Block a user