Merge branch 'develop' of github.com:sleuthkit/autopsy into develop

This commit is contained in:
Richard Cordovano 2020-03-24 17:28:07 -04:00
commit 419f867db8
22 changed files with 625 additions and 156 deletions

View File

@ -806,15 +806,6 @@ public interface CentralRepository {
public void processSelectClause(String selectClause, InstanceTableCallback instanceTableCallback) throws CentralRepoException;
/**
* Returns list of all correlation types.
*
* @return list of Correlation types
* @throws CentralRepoException
*/
List<CorrelationAttributeInstance.Type> getCorrelationTypes() throws CentralRepoException;
/**
* Get account type by type name.
*

View File

@ -3134,27 +3134,12 @@ abstract class RdbmsCentralRepo implements CentralRepository {
@Override
public List<CorrelationAttributeInstance.Type> getDefinedCorrelationTypes() throws CentralRepoException {
Connection conn = connect();
List<CorrelationAttributeInstance.Type> aTypes = new ArrayList<>();
PreparedStatement preparedStatement = null;
ResultSet resultSet = null;
String sql = "SELECT * FROM correlation_types";
try {
preparedStatement = conn.prepareStatement(sql);
resultSet = preparedStatement.executeQuery();
while (resultSet.next()) {
aTypes.add(getCorrelationTypeFromResultSet(resultSet));
synchronized (typeCache) {
if (isCRTypeCacheInitialized == false) {
getCorrelationTypesFromCr();
}
return aTypes;
} catch (SQLException ex) {
throw new CentralRepoException("Error getting all correlation types.", ex); // NON-NLS
} finally {
CentralRepoDbUtil.closeStatement(preparedStatement);
CentralRepoDbUtil.closeResultSet(resultSet);
CentralRepoDbUtil.closeConnection(conn);
return new ArrayList<>(typeCache.asMap().values());
}
}
@ -3285,45 +3270,6 @@ abstract class RdbmsCentralRepo implements CentralRepository {
}
}
/**
* Returns a list of all correlation types. It uses the cache to build the
* list. If the cache is empty, it reads from the database and loads up the
* cache.
*
* @return List of correlation types.
* @throws CentralRepoException
*/
@Override
public List<CorrelationAttributeInstance.Type> getCorrelationTypes() throws CentralRepoException {
synchronized (typeCache) {
if (isCRTypeCacheInitialized == false) {
getCorrelationTypesFromCr();
}
return new ArrayList<>(typeCache.asMap().values());
}
}
/**
* Gets a Correlation type with the specified name.
*
* @param correlationtypeName Correlation type name
* @return Correlation type matching the given name, null if none matches.
*
* @throws CentralRepoException
*/
public CorrelationAttributeInstance.Type getCorrelationTypeByName(String correlationtypeName) throws CentralRepoException {
List<CorrelationAttributeInstance.Type> correlationTypesList = getCorrelationTypes();
CorrelationAttributeInstance.Type correlationType
= correlationTypesList.stream()
.filter(x -> correlationtypeName.equalsIgnoreCase(x.getDisplayName()))
.findAny()
.orElse(null);
return null;
}
/**
* Get the EamArtifact.Type that has the given Type.Id from the central repo

View File

@ -123,7 +123,7 @@ final public class CommonAttributeCaseSearchResults {
if (currentCaseDataSourceMap == null) { //there are no results
return filteredCaseNameToDataSourcesTree;
}
CorrelationAttributeInstance.Type attributeType = CentralRepository.getInstance().getCorrelationTypes()
CorrelationAttributeInstance.Type attributeType = CentralRepository.getInstance().getDefinedCorrelationTypes()
.stream()
.filter(filterType -> filterType.getId() == resultTypeId)
.findFirst().get();

View File

@ -129,7 +129,7 @@ final public class CommonAttributeCountSearchResults {
}
CentralRepository eamDb = CentralRepository.getInstance();
CorrelationAttributeInstance.Type attributeType = eamDb.getCorrelationTypes()
CorrelationAttributeInstance.Type attributeType = eamDb.getDefinedCorrelationTypes()
.stream()
.filter(filterType -> filterType.getId() == this.resultTypeId)
.findFirst().get();

View File

@ -255,7 +255,7 @@ final class CommonAttributePanel extends javax.swing.JDialog implements Observer
filterByDocuments = interCasePanel.documentsCheckboxIsSelected();
}
if (corType == null) {
corType = CentralRepository.getInstance().getCorrelationTypes().get(0);
corType = CentralRepository.getInstance().getDefinedCorrelationTypes().get(0);
}
if (caseId == InterCasePanel.NO_CASE_SELECTED) {
builder = new AllInterCaseCommonAttributeSearcher(filterByMedia, filterByDocuments, corType, percentageThreshold);
@ -366,7 +366,7 @@ final class CommonAttributePanel extends javax.swing.JDialog implements Observer
filterByDocuments = interCasePanel.documentsCheckboxIsSelected();
}
if (corType == null) {
corType = CentralRepository.getInstance().getCorrelationTypes().get(0);
corType = CentralRepository.getInstance().getDefinedCorrelationTypes().get(0);
}
if (caseId == InterCasePanel.NO_CASE_SELECTED) {
builder = new AllInterCaseCommonAttributeSearcher(filterByMedia, filterByDocuments, corType, percentageThreshold);

View File

@ -118,7 +118,7 @@ public final class InterCasePanel extends javax.swing.JPanel {
void setupCorrelationTypeFilter() {
this.correlationTypeFilters = new HashMap<>();
try {
List<CorrelationAttributeInstance.Type> types = CentralRepository.getInstance().getCorrelationTypes();
List<CorrelationAttributeInstance.Type> types = CentralRepository.getInstance().getDefinedCorrelationTypes();
for (CorrelationAttributeInstance.Type type : types) {
correlationTypeFilters.put(type.getDisplayName(), type);
this.correlationTypeComboBox.addItem(type.getDisplayName());

View File

@ -111,7 +111,7 @@ final class CorrelationCaseChildNodeFactory extends ChildFactory<CorrelationCase
private CorrelationAttributeInstance.Type getCorrelationType(Account.Type accountType) throws CentralRepoException {
if (correlationTypeMap == null) {
correlationTypeMap = new HashMap<>();
List<CorrelationAttributeInstance.Type> correcationTypeList = CentralRepository.getInstance().getCorrelationTypes();
List<CorrelationAttributeInstance.Type> correcationTypeList = CentralRepository.getInstance().getDefinedCorrelationTypes();
correcationTypeList.forEach((type) -> {
correlationTypeMap.put(type.getId(), type);
});

View File

@ -55,16 +55,19 @@ public class BingTranslatorSettingsPanel extends javax.swing.JPanel {
authenticationKeyField.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
testResultValueLabel.setText("");
firePropertyChange("SettingChanged", true, false);
}
@Override
public void removeUpdate(DocumentEvent e) {
testResultValueLabel.setText("");
firePropertyChange("SettingChanged", true, false);
}
@Override
public void changedUpdate(DocumentEvent e) {
testResultValueLabel.setText("");
firePropertyChange("SettingChanged", true, false);
}
@ -256,6 +259,7 @@ public class BingTranslatorSettingsPanel extends javax.swing.JPanel {
String selectedCode = ((LanguageWrapper) targetLanguageComboBox.getSelectedItem()).getLanguageCode();
if (!StringUtils.isBlank(selectedCode) && !selectedCode.equals(targetLanguageCode)) {
targetLanguageCode = selectedCode;
testResultValueLabel.setText("");
firePropertyChange("SettingChanged", true, false);
}
}//GEN-LAST:event_targetLanguageComboBoxSelected

View File

@ -337,6 +337,7 @@ public class GoogleTranslatorSettingsPanel extends javax.swing.JPanel {
if (dialogResult == JFileChooser.APPROVE_OPTION) {
credentialsPathField.setText(fileChooser.getSelectedFile().getPath());
populateTargetLanguageComboBox();
testResultValueLabel.setText("");
firePropertyChange("SettingChanged", true, false);
}
}//GEN-LAST:event_browseButtonActionPerformed
@ -407,6 +408,7 @@ public class GoogleTranslatorSettingsPanel extends javax.swing.JPanel {
if (!StringUtils.isBlank(selectedCode) && !selectedCode.equals(targetLanguageCode)) {
targetLanguageCode = selectedCode;
populateTargetLanguageComboBox();
testResultValueLabel.setText("");
firePropertyChange("SettingChanged", true, false);
}
}

View File

@ -6,13 +6,6 @@ OptionsCategory_Name_KeywordSearchOptions=Keyword Search
OptionsCategory_Keywords_KeywordSearchOptions=Keyword Search
ListBundleName=Keyword Lists
ListBundleConfig=Keyword List Configuration
ExtractedContentPanel.hitLabel.text=Matches on page:
ExtractedContentPanel.hitCountLabel.text=-
ExtractedContentPanel.hitOfLabel.text=of
ExtractedContentPanel.hitTotalLabel.text=-
ExtractedContentPanel.hitButtonsLabel.text=Match
ExtractedContentPanel.hitPreviousButton.text=
ExtractedContentPanel.hitNextButton.text=
ExtractedContentPanel.copyMenuItem.text=Copy
ExtractedContentPanel.selectAllMenuItem.text=Select All
KeywordSearchEditListPanel.saveListButton.text=Copy List
@ -33,7 +26,6 @@ KeywordSearchListsManagementPanel.importButton.text=Import List
KeywordSearchListsViewerPanel.searchAddButton.text=Search
KeywordSearchListsViewerPanel.manageListsButton.text=Manage Lists
KeywordSearchListsViewerPanel.ingestIndexLabel.text=Files Indexed:
ExtractedContentPanel.hitLabel.toolTipText=
KeywordSearchEditListPanel.ingestMessagesCheckbox.text=Send ingest inbox messages for each hit
KeywordSearchEditListPanel.ingestMessagesCheckbox.toolTipText=Send messages during ingest when hits on keywords from this list occur
KeywordSearchEditListPanel.keywordOptionsLabel.text=Keyword Options
@ -299,15 +291,6 @@ SolrSearchService.ServiceName=Solr Keyword Search Service
SolrSearchService.IndexReadOnlyDialog.title=Text Index Is Read-Only
SolrSearchService.IndexReadOnlyDialog.msg=<html>The text index for this case is read-only. <br />You will be able to see existing keyword search results and perform exact match and substring match keyword searches,<br />but you will not be able to add new text to the index or perform regex searches. You may instead open the case<br /> with your previous version of this application.</html>
SolrSearchService.DeleteDataSource.msg=Error Deleting Solr data for data source id {0}
ExtractedContentPanel.jLabel1.text=Text Source:
ExtractedContentPanel.pagePreviousButton.actionCommand=pagePreviousButton
ExtractedContentPanel.pagePreviousButton.text=
ExtractedContentPanel.pageNextButton.text=
ExtractedContentPanel.pageCurLabel.text=-
ExtractedContentPanel.pageOfLabel.text=of
ExtractedContentPanel.pageTotalLabel.text=-
ExtractedContentPanel.pageButtonsLabel.text=Page
ExtractedContentPanel.pagesLabel.text=Page:
DropdownSingleTermSearchPanel.dataSourceCheckBox.text=Restrict search to the selected data sources:
DropdownListSearchPanel.dataSourceCheckBox.text=Restrict search to the selected data sources:
DropdownSingleTermSearchPanel.ingestIndexLabel.text=Files Indexed:
@ -318,3 +301,21 @@ DropdownListSearchPanel.jSaveSearchResults.text=Save search results
GlobalEditListPanel.ingestWarningLabel.text=Ingest is ongoing, some settings will be unavailable until it finishes.
KeywordSearchGlobalLanguageSettingsPanel.ingestWarningLabel.text=Ingest is ongoing, some settings will be unavailable until it finishes.
KeywordSearchGlobalSearchSettingsPanel.ingestWarningLabel.text=Ingest is ongoing, some settings will be unavailable until it finishes.
ExtractedContentPanel.hitCountLabel.text=-
ExtractedContentPanel.hitPreviousButton.text=
ExtractedContentPanel.hitTotalLabel.text=-
ExtractedContentPanel.hitOfLabel.text=of
ExtractedContentPanel.hitNextButton.text=
ExtractedContentPanel.hitButtonsLabel.text=Match
ExtractedContentPanel.hitLabel.toolTipText=
ExtractedContentPanel.hitLabel.text=Matches on page:
ExtractedContentPanel.pageCurLabel.text=-
ExtractedContentPanel.pagePreviousButton.actionCommand=pagePreviousButton
ExtractedContentPanel.pagePreviousButton.text=
ExtractedContentPanel.pageNextButton.text=
ExtractedContentPanel.pagesLabel.text=Page:
ExtractedContentPanel.pageTotalLabel.text=-
ExtractedContentPanel.pageButtonsLabel.text=Page
ExtractedContentPanel.pageOfLabel.text=of
ExtractedContentPanel.jLabel1.text=Text Source:
ExtractedContentPanel.AccessibleContext.accessibleName=

View File

@ -42,13 +42,6 @@ OptionsCategory_Name_KeywordSearchOptions=Keyword Search
OptionsCategory_Keywords_KeywordSearchOptions=Keyword Search
ListBundleName=Keyword Lists
ListBundleConfig=Keyword List Configuration
ExtractedContentPanel.hitLabel.text=Matches on page:
ExtractedContentPanel.hitCountLabel.text=-
ExtractedContentPanel.hitOfLabel.text=of
ExtractedContentPanel.hitTotalLabel.text=-
ExtractedContentPanel.hitButtonsLabel.text=Match
ExtractedContentPanel.hitPreviousButton.text=
ExtractedContentPanel.hitNextButton.text=
ExtractedContentPanel.copyMenuItem.text=Copy
ExtractedContentPanel.selectAllMenuItem.text=Select All
KeywordSearchEditListPanel.saveListButton.text=Copy List
@ -69,7 +62,6 @@ KeywordSearchListsManagementPanel.importButton.text=Import List
KeywordSearchListsViewerPanel.searchAddButton.text=Search
KeywordSearchListsViewerPanel.manageListsButton.text=Manage Lists
KeywordSearchListsViewerPanel.ingestIndexLabel.text=Files Indexed:
ExtractedContentPanel.hitLabel.toolTipText=
KeywordSearchEditListPanel.ingestMessagesCheckbox.text=Send ingest inbox messages for each hit
KeywordSearchEditListPanel.ingestMessagesCheckbox.toolTipText=Send messages during ingest when hits on keywords from this list occur
KeywordSearchEditListPanel.keywordOptionsLabel.text=Keyword Options
@ -358,15 +350,6 @@ SolrSearchService.ServiceName=Solr Keyword Search Service
SolrSearchService.IndexReadOnlyDialog.title=Text Index Is Read-Only
SolrSearchService.IndexReadOnlyDialog.msg=<html>The text index for this case is read-only. <br />You will be able to see existing keyword search results and perform exact match and substring match keyword searches,<br />but you will not be able to add new text to the index or perform regex searches. You may instead open the case<br /> with your previous version of this application.</html>
SolrSearchService.DeleteDataSource.msg=Error Deleting Solr data for data source id {0}
ExtractedContentPanel.jLabel1.text=Text Source:
ExtractedContentPanel.pagePreviousButton.actionCommand=pagePreviousButton
ExtractedContentPanel.pagePreviousButton.text=
ExtractedContentPanel.pageNextButton.text=
ExtractedContentPanel.pageCurLabel.text=-
ExtractedContentPanel.pageOfLabel.text=of
ExtractedContentPanel.pageTotalLabel.text=-
ExtractedContentPanel.pageButtonsLabel.text=Page
ExtractedContentPanel.pagesLabel.text=Page:
DropdownSingleTermSearchPanel.dataSourceCheckBox.text=Restrict search to the selected data sources:
DropdownListSearchPanel.dataSourceCheckBox.text=Restrict search to the selected data sources:
DropdownSingleTermSearchPanel.ingestIndexLabel.text=Files Indexed:
@ -377,3 +360,25 @@ DropdownListSearchPanel.jSaveSearchResults.text=Save search results
GlobalEditListPanel.ingestWarningLabel.text=Ingest is ongoing, some settings will be unavailable until it finishes.
KeywordSearchGlobalLanguageSettingsPanel.ingestWarningLabel.text=Ingest is ongoing, some settings will be unavailable until it finishes.
KeywordSearchGlobalSearchSettingsPanel.ingestWarningLabel.text=Ingest is ongoing, some settings will be unavailable until it finishes.
ExtractedContentPanel.hitCountLabel.text=-
ExtractedContentPanel.hitPreviousButton.text=
ExtractedContentPanel.hitTotalLabel.text=-
ExtractedContentPanel.hitOfLabel.text=of
ExtractedContentPanel.hitNextButton.text=
ExtractedContentPanel.hitButtonsLabel.text=Match
ExtractedContentPanel.hitLabel.toolTipText=
ExtractedContentPanel.hitLabel.text=Matches on page:
ExtractedContentPanel.pageCurLabel.text=-
ExtractedContentPanel.pagePreviousButton.actionCommand=pagePreviousButton
ExtractedContentPanel.pagePreviousButton.text=
ExtractedContentPanel.pageNextButton.text=
ExtractedContentPanel.pagesLabel.text=Page:
ExtractedContentPanel.pageTotalLabel.text=-
ExtractedContentPanel.pageButtonsLabel.text=Page
ExtractedContentPanel.pageOfLabel.text=of
ExtractedContentPanel.jLabel1.text=Text Source:
ExtractedContentPanel.AccessibleContext.accessibleName=
TextZoomPanel.zoomInButton.text=
TextZoomPanel.zoomOutButton.text=
TextZoomPanel.zoomResetButton.text=Reset
TextZoomPanel.zoomTextField.text=

View File

@ -42,13 +42,6 @@ OptionsCategory_Name_KeywordSearchOptions=\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u
OptionsCategory_Keywords_KeywordSearchOptions=\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22
ListBundleName=\u30ad\u30fc\u30ef\u30fc\u30c9\u30ea\u30b9\u30c8
ListBundleConfig=\u30ad\u30fc\u30ef\u30fc\u30c9\u30ea\u30b9\u30c8\u69cb\u6210
ExtractedContentPanel.hitLabel.text=\u30da\u30fc\u30b8\u4e0a\u306e\u4e00\u81f4\u3059\u308b\u7d50\u679c:
ExtractedContentPanel.hitCountLabel.text=-
ExtractedContentPanel.hitOfLabel.text=/
ExtractedContentPanel.hitTotalLabel.text=-
ExtractedContentPanel.hitButtonsLabel.text=\u4e00\u81f4\u3059\u308b\u7d50\u679c
ExtractedContentPanel.hitPreviousButton.text=
ExtractedContentPanel.hitNextButton.text=
ExtractedContentPanel.copyMenuItem.text=\u30b3\u30d4\u30fc
ExtractedContentPanel.selectAllMenuItem.text=\u3059\u3079\u3066\u9078\u629e
KeywordSearchEditListPanel.saveListButton.text=\u30ea\u30b9\u30c8\u3092\u30b3\u30d4\u30fc
@ -69,7 +62,6 @@ KeywordSearchListsManagementPanel.importButton.text=\u30ea\u30b9\u30c8\u3092\u30
KeywordSearchListsViewerPanel.searchAddButton.text=\u691c\u7d22
KeywordSearchListsViewerPanel.manageListsButton.text=\u30ea\u30b9\u30c8\u3092\u7ba1\u7406
KeywordSearchListsViewerPanel.ingestIndexLabel.text=\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb:
ExtractedContentPanel.hitLabel.toolTipText=
KeywordSearchEditListPanel.ingestMessagesCheckbox.text=\u30d2\u30c3\u30c8\u3054\u3068\u306b\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u53d7\u4fe1\u7bb1\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u4fe1
KeywordSearchEditListPanel.ingestMessagesCheckbox.toolTipText=\u3053\u306e\u30ea\u30b9\u30c8\u306e\u30ad\u30fc\u30ef\u30fc\u30c9\u3067\u30d2\u30c3\u30c8\u304c\u767a\u751f\u3057\u305f\u3068\u304d\u306b\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u4e2d\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u4fe1
KeywordSearchEditListPanel.keywordOptionsLabel.text=\u30ad\u30fc\u30ef\u30fc\u30c9\u30aa\u30d7\u30b7\u30e7\u30f3
@ -355,15 +347,6 @@ SolrSearchService.exceptionMessage.noIndexMetadata=\u30b1\u30fc\u30b9\u30c7\u30a
SolrSearchService.ServiceName=Solr\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u30b5\u30fc\u30d3\u30b9
SolrSearchService.IndexReadOnlyDialog.title=\u30c6\u30ad\u30b9\u30c8\u7d22\u5f15\u306f\u8aad\u307f\u53d6\u308a\u5c02\u7528\u3067\u3059
SolrSearchService.IndexReadOnlyDialog.msg=<html>\u3053\u306e\u30b1\u30fc\u30b9\u306e\u30c6\u30ad\u30b9\u30c8\u7d22\u5f15\u306f\u8aad\u307f\u53d6\u308a\u5c02\u7528\u3067\u3059\u3002<br />\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u7d50\u679c\u3092\u78ba\u8a8d\u3057\u3001\u5b8c\u5168\u4e00\u81f4\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u3068\u90e8\u5206\u4e00\u81f4\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u3092\u5b9f\u884c\u3067\u304d\u307e\u3059<br />\u304c\u3001\u7d22\u5f15\u306b\u65b0\u898f\u30c6\u30ad\u30b9\u30c8\u3092\u8ffd\u52a0\u307e\u305f\u306f\u6b63\u898f\u8868\u73fe\u691c\u7d22\u3092\u5b9f\u884c\u3067\u304d\u307e\u305b\u3093\u3002\u305d\u306e\u4ee3\u308f\u308a\u306b\u3001\u3053\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067<br />\u30b1\u30fc\u30b9\u3092\u958b\u3051\u307e\u3059\u3002</html>
ExtractedContentPanel.jLabel1.text=\u30c6\u30ad\u30b9\u30c8\u30bd\u30fc\u30b9:
ExtractedContentPanel.pagePreviousButton.actionCommand=pagePreviousButton
ExtractedContentPanel.pagePreviousButton.text=
ExtractedContentPanel.pageNextButton.text=
ExtractedContentPanel.pageCurLabel.text=-
ExtractedContentPanel.pageOfLabel.text=/
ExtractedContentPanel.pageTotalLabel.text=-
ExtractedContentPanel.pageButtonsLabel.text=\u30da\u30fc\u30b8
ExtractedContentPanel.pagesLabel.text=\u30da\u30fc\u30b8:
DropdownSingleTermSearchPanel.dataSourceCheckBox.text=\u9078\u629e\u3057\u305f\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u306b\u691c\u7d22\u3092\u5236\u9650:
DropdownListSearchPanel.dataSourceCheckBox.text=\u9078\u629e\u3057\u305f\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u306b\u691c\u7d22\u3092\u5236\u9650:
DropdownSingleTermSearchPanel.ingestIndexLabel.text=\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb:
@ -374,3 +357,20 @@ DropdownListSearchPanel.jSaveSearchResults.text=\u691c\u7d22\u7d50\u679c\u3092\u
GlobalEditListPanel.ingestWarningLabel.text=\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u304c\u9032\u884c\u4e2d\u3067\u3059\u3002\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u304c\u5b8c\u4e86\u3059\u308b\u307e\u3067\u4e00\u90e8\u306e\u8a2d\u5b9a\u3092\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3002
KeywordSearchGlobalLanguageSettingsPanel.ingestWarningLabel.text=\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u304c\u9032\u884c\u4e2d\u3067\u3059\u3002\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u304c\u5b8c\u4e86\u3059\u308b\u307e\u3067\u4e00\u90e8\u306e\u8a2d\u5b9a\u3092\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3002
KeywordSearchGlobalSearchSettingsPanel.ingestWarningLabel.text=\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u304c\u9032\u884c\u4e2d\u3067\u3059\u3002\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u304c\u5b8c\u4e86\u3059\u308b\u307e\u3067\u4e00\u90e8\u306e\u8a2d\u5b9a\u3092\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3002
ExtractedContentPanel.hitCountLabel.text=-
ExtractedContentPanel.hitPreviousButton.text=
ExtractedContentPanel.hitTotalLabel.text=-
ExtractedContentPanel.hitOfLabel.text=/
ExtractedContentPanel.hitNextButton.text=
ExtractedContentPanel.hitButtonsLabel.text=\u4e00\u81f4\u3059\u308b\u7d50\u679c
ExtractedContentPanel.hitLabel.toolTipText=
ExtractedContentPanel.hitLabel.text=\u30da\u30fc\u30b8\u4e0a\u306e\u4e00\u81f4\u3059\u308b\u7d50\u679c:
ExtractedContentPanel.pageCurLabel.text=-
ExtractedContentPanel.pagePreviousButton.actionCommand=pagePreviousButton
ExtractedContentPanel.pagePreviousButton.text=
ExtractedContentPanel.pageNextButton.text=
ExtractedContentPanel.pagesLabel.text=\u30da\u30fc\u30b8:
ExtractedContentPanel.pageTotalLabel.text=-
ExtractedContentPanel.pageButtonsLabel.text=\u30da\u30fc\u30b8
ExtractedContentPanel.pageOfLabel.text=/
ExtractedContentPanel.jLabel1.text=\u30c6\u30ad\u30b9\u30c8\u30bd\u30fc\u30b9:

View File

@ -26,6 +26,9 @@
</Container>
</NonVisualComponents>
<Properties>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[100, 0]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[100, 58]"/>
</Property>
@ -45,8 +48,8 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="controlScrollPane" alignment="0" pref="54" max="32767" attributes="0"/>
<Component id="extractedScrollPane" alignment="0" pref="54" max="32767" attributes="0"/>
<Component id="controlScrollPane" alignment="0" pref="980" max="32767" attributes="0"/>
<Component id="extractedScrollPane" alignment="0" pref="980" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
@ -104,7 +107,7 @@
<Container class="javax.swing.JPanel" name="controlPanel">
<Properties>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 0]"/>
<Dimension value="[0, 20]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[600, 81]"/>
@ -146,7 +149,9 @@
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
<Component id="pageNextButton" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jSeparator1" min="-2" max="-2" attributes="0"/>
<Component id="jSeparator3" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="zoomPanel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
@ -165,7 +170,6 @@
<Component id="pageButtonsLabel" linkSize="1" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="pagePreviousButton" linkSize="1" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="pageNextButton" linkSize="1" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="jSeparator1" linkSize="1" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="sourceComboBox" linkSize="1" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="pagesLabel" linkSize="1" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="hitLabel" linkSize="1" alignment="2" min="-2" max="-2" attributes="0"/>
@ -177,6 +181,8 @@
<Component id="hitOfLabel" linkSize="1" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="hitTotalLabel" linkSize="1" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="hitButtonsLabel" linkSize="1" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="jSeparator3" linkSize="1" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="zoomPanel" linkSize="1" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
</Group>
@ -300,11 +306,6 @@
</Property>
</Properties>
</Component>
<Component class="javax.swing.JSeparator" name="jSeparator1">
<Properties>
<Property name="orientation" type="int" value="1"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="hitLabel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
@ -426,6 +427,32 @@
<Property name="orientation" type="int" value="1"/>
</Properties>
</Component>
<Component class="javax.swing.JSeparator" name="jSeparator3">
<Properties>
<Property name="orientation" type="int" value="1"/>
</Properties>
</Component>
<Container class="javax.swing.JPanel" name="zoomPanel">
<Properties>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 20]"/>
</Property>
<Property name="name" type="java.lang.String" value="" noResource="true"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[200, 20]"/>
</Property>
</Properties>
<AccessibilityProperties>
<Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/keywordsearch/Bundle.properties" key="ExtractedContentPanel.AccessibleContext.accessibleName" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</AccessibilityProperties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new TextZoomPanel(this)"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
</Container>
</SubComponents>
</Container>
</SubComponents>

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2019 Basis Technology Corp.
* Copyright 2011-2020 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -20,6 +20,7 @@ package org.sleuthkit.autopsy.keywordsearch;
import java.awt.ComponentOrientation;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.util.ArrayList;
@ -27,7 +28,9 @@ import java.util.List;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.logging.Level;
import javax.swing.JLabel;
import javax.swing.SizeRequirements;
import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import javax.swing.text.Element;
import javax.swing.text.View;
@ -36,6 +39,7 @@ import javax.swing.text.html.HTMLEditorKit;
import javax.swing.text.html.HTMLEditorKit.HTMLFactory;
import javax.swing.text.html.InlineView;
import javax.swing.text.html.ParagraphView;
import javax.swing.text.html.StyleSheet;
import org.apache.commons.lang3.StringUtils;
import org.netbeans.api.progress.ProgressHandle;
import org.openide.util.NbBundle;
@ -48,11 +52,20 @@ import org.sleuthkit.autopsy.coreutils.TextUtil;
* combo-box to select between multiple sources.
*/
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
class ExtractedContentPanel extends javax.swing.JPanel {
class ExtractedContentPanel extends javax.swing.JPanel implements ResizableTextPanel {
private static final Logger logger = Logger.getLogger(ExtractedContentPanel.class.getName());
// set font as close as possible to default
private static final Font DEFAULT_FONT = new JLabel().getFont();
private static final long serialVersionUID = 1L;
private String contentName;
private int curSize;
private final StyleSheet styleSheet;
private final HTMLEditorKit editorKit;
private String lastKnownAnchor = null;
ExtractedContentPanel() {
initComponents();
@ -65,7 +78,7 @@ class ExtractedContentPanel extends javax.swing.JPanel {
* extractedTextPane taken form this website:
* http://java-sl.com/tip_html_letter_wrap.html.
*/
HTMLEditorKit editorKit = new HTMLEditorKit() {
editorKit = new HTMLEditorKit() {
private static final long serialVersionUID = 1L;
@Override
@ -119,13 +132,9 @@ class ExtractedContentPanel extends javax.swing.JPanel {
};
}
};
/*
* set font size manually in an effort to get fonts in this panel to
* look similar to what is in the 'String View' content viewer.
*/
editorKit.getStyleSheet().addRule("body {font-size: 8.5px;}"); //NON-NLS
extractedTextPane.setEditorKit(editorKit);
// get the style sheet for editing font size
styleSheet = editorKit.getStyleSheet();
sourceComboBox.addItemListener(itemEvent -> {
if (itemEvent.getStateChange() == ItemEvent.SELECTED) {
refreshCurrentMarkup();
@ -134,7 +143,48 @@ class ExtractedContentPanel extends javax.swing.JPanel {
extractedTextPane.setComponentPopupMenu(rightClickMenu);
copyMenuItem.addActionListener(actionEvent -> extractedTextPane.copy());
selectAllMenuItem.addActionListener(actionEvent -> extractedTextPane.selectAll());
// TextZoomPanel could not be directly instantiated in Swing WYSIWYG editor
// (because it was package private, couldn't use constructor, etc.)
// so it was identified as a JPanel for the WYSIWYG. This function is called for
// initial setup so the font size of this panel as well as the font size indicated
// in the TextZoomPanel are correct
SwingUtilities.invokeLater(() -> {
if (zoomPanel instanceof TextZoomPanel)
((TextZoomPanel) this.zoomPanel).resetSize();
});
}
private void setStyleSheetSize(StyleSheet styleSheet, int size) {
styleSheet.addRule("body {font-family:\"" + DEFAULT_FONT.getFamily() + "\"; font-size:" + size + "pt; } ");
}
@Override
public int getTextSize() {
return curSize;
}
@Override
public void setTextSize(int newSize) {
curSize = newSize;
String curText = extractedTextPane.getText();
setStyleSheetSize(styleSheet, curSize);
editorKit.setStyleSheet(styleSheet);
extractedTextPane.setEditorKit(editorKit);
extractedTextPane.setText(curText);
if (lastKnownAnchor != null)
scrollToAnchor(lastKnownAnchor);
}
/**
* This method is called from within the constructor to initialize the form.
@ -161,7 +211,6 @@ class ExtractedContentPanel extends javax.swing.JPanel {
pageNextButton = new javax.swing.JButton();
pagePreviousButton = new javax.swing.JButton();
pageCurLabel = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JSeparator();
hitLabel = new javax.swing.JLabel();
hitButtonsLabel = new javax.swing.JLabel();
hitNextButton = new javax.swing.JButton();
@ -170,6 +219,8 @@ class ExtractedContentPanel extends javax.swing.JPanel {
hitPreviousButton = new javax.swing.JButton();
hitCountLabel = new javax.swing.JLabel();
jSeparator2 = new javax.swing.JSeparator();
jSeparator3 = new javax.swing.JSeparator();
zoomPanel = new TextZoomPanel(this);
copyMenuItem.setText(org.openide.util.NbBundle.getMessage(ExtractedContentPanel.class, "ExtractedContentPanel.copyMenuItem.text")); // NOI18N
rightClickMenu.add(copyMenuItem);
@ -177,6 +228,7 @@ class ExtractedContentPanel extends javax.swing.JPanel {
selectAllMenuItem.setText(org.openide.util.NbBundle.getMessage(ExtractedContentPanel.class, "ExtractedContentPanel.selectAllMenuItem.text")); // NOI18N
rightClickMenu.add(selectAllMenuItem);
setMinimumSize(new java.awt.Dimension(100, 0));
setPreferredSize(new java.awt.Dimension(100, 58));
extractedScrollPane.setBackground(new java.awt.Color(255, 255, 255));
@ -193,7 +245,7 @@ class ExtractedContentPanel extends javax.swing.JPanel {
controlScrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
controlScrollPane.setPreferredSize(new java.awt.Dimension(600, 100));
controlPanel.setMinimumSize(new java.awt.Dimension(0, 0));
controlPanel.setMinimumSize(new java.awt.Dimension(0, 20));
controlPanel.setPreferredSize(new java.awt.Dimension(600, 81));
sourceComboBox.setModel(new javax.swing.DefaultComboBoxModel<org.sleuthkit.autopsy.keywordsearch.IndexedText>());
@ -233,8 +285,6 @@ class ExtractedContentPanel extends javax.swing.JPanel {
pageCurLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
pageCurLabel.setText(org.openide.util.NbBundle.getMessage(ExtractedContentPanel.class, "ExtractedContentPanel.pageCurLabel.text")); // NOI18N
jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
hitLabel.setText(org.openide.util.NbBundle.getMessage(ExtractedContentPanel.class, "ExtractedContentPanel.hitLabel.text")); // NOI18N
hitLabel.setToolTipText(org.openide.util.NbBundle.getMessage(ExtractedContentPanel.class, "ExtractedContentPanel.hitLabel.toolTipText")); // NOI18N
@ -276,6 +326,12 @@ class ExtractedContentPanel extends javax.swing.JPanel {
jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL);
jSeparator3.setOrientation(javax.swing.SwingConstants.VERTICAL);
zoomPanel.setMinimumSize(new java.awt.Dimension(150, 20));
zoomPanel.setName(""); // NOI18N
zoomPanel.setPreferredSize(new java.awt.Dimension(200, 20));
javax.swing.GroupLayout controlPanelLayout = new javax.swing.GroupLayout(controlPanel);
controlPanel.setLayout(controlPanelLayout);
controlPanelLayout.setHorizontalGroup(
@ -312,7 +368,9 @@ class ExtractedContentPanel extends javax.swing.JPanel {
.addGap(0, 0, 0)
.addComponent(pageNextButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(zoomPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
@ -329,7 +387,6 @@ class ExtractedContentPanel extends javax.swing.JPanel {
.addComponent(pageButtonsLabel)
.addComponent(pagePreviousButton)
.addComponent(pageNextButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(sourceComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(pagesLabel)
.addComponent(hitLabel)
@ -340,11 +397,15 @@ class ExtractedContentPanel extends javax.swing.JPanel {
.addComponent(pageTotalLabel)
.addComponent(hitOfLabel)
.addComponent(hitTotalLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(hitButtonsLabel))
.addComponent(hitButtonsLabel)
.addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(zoomPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 0, 0))
);
controlPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {hitButtonsLabel, hitCountLabel, hitLabel, hitNextButton, hitOfLabel, hitPreviousButton, hitTotalLabel, jLabel1, jSeparator1, jSeparator2, pageButtonsLabel, pageCurLabel, pageNextButton, pageOfLabel, pagePreviousButton, pageTotalLabel, pagesLabel, sourceComboBox});
controlPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {hitButtonsLabel, hitCountLabel, hitLabel, hitNextButton, hitOfLabel, hitPreviousButton, hitTotalLabel, jLabel1, jSeparator2, jSeparator3, pageButtonsLabel, pageCurLabel, pageNextButton, pageOfLabel, pagePreviousButton, pageTotalLabel, pagesLabel, sourceComboBox, zoomPanel});
zoomPanel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ExtractedContentPanel.class, "ExtractedContentPanel.AccessibleContext.accessibleName")); // NOI18N
controlScrollPane.setViewportView(controlPanel);
@ -352,8 +413,8 @@ class ExtractedContentPanel extends javax.swing.JPanel {
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(controlScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 54, Short.MAX_VALUE)
.addComponent(extractedScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 54, Short.MAX_VALUE)
.addComponent(controlScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 980, Short.MAX_VALUE)
.addComponent(extractedScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 980, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -377,8 +438,8 @@ class ExtractedContentPanel extends javax.swing.JPanel {
private javax.swing.JButton hitPreviousButton;
private javax.swing.JLabel hitTotalLabel;
private javax.swing.JLabel jLabel1;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JSeparator jSeparator2;
private javax.swing.JSeparator jSeparator3;
private javax.swing.JLabel pageButtonsLabel;
private javax.swing.JLabel pageCurLabel;
private javax.swing.JButton pageNextButton;
@ -389,6 +450,7 @@ class ExtractedContentPanel extends javax.swing.JPanel {
private javax.swing.JPopupMenu rightClickMenu;
private javax.swing.JMenuItem selectAllMenuItem;
private javax.swing.JComboBox<org.sleuthkit.autopsy.keywordsearch.IndexedText> sourceComboBox;
private javax.swing.JPanel zoomPanel;
// End of variables declaration//GEN-END:variables
void refreshCurrentMarkup() {
@ -404,6 +466,7 @@ class ExtractedContentPanel extends javax.swing.JPanel {
* the content.
*/
final void setSources(String contentName, List<IndexedText> sources) {
this.lastKnownAnchor = null;
this.contentName = contentName;
setPanelText(null, false);
@ -451,6 +514,7 @@ class ExtractedContentPanel extends javax.swing.JPanel {
}
void scrollToAnchor(String anchor) {
lastKnownAnchor = anchor;
extractedTextPane.scrollToReference(anchor);
}

View File

@ -0,0 +1,39 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2020 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sleuthkit.autopsy.keywordsearch;
/**
* This interface allows for retrieving current text size and setting the new text size
* for a panel.
*/
interface ResizableTextPanel {
/**
* Retrieves the font size (in px).
* @return the font size (in px).
*/
int getTextSize();
/**
* Sets the font size (in px).
* @param newSize the new font size (in px).
*/
void setTextSize(int newSize);
}

View File

@ -0,0 +1,163 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 20]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[200, 20]"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="zoomTextField" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Component id="zoomOutButton" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Component id="zoomInButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="zoomResetButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jSeparator2" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jSeparator2" min="-2" max="-2" attributes="0"/>
<Group type="103" alignment="0" groupAlignment="0" attributes="0">
<Component id="zoomTextField" alignment="2" max="32767" attributes="0"/>
<Component id="zoomOutButton" alignment="2" max="32767" attributes="0"/>
<Component id="zoomInButton" alignment="2" max="32767" attributes="0"/>
<Component id="zoomResetButton" alignment="2" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JTextField" name="zoomTextField">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="horizontalAlignment" type="int" value="4"/>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/keywordsearch/Bundle.properties" key="TextZoomPanel.zoomTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[50, 2147483647]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[50, 20]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[50, 20]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="zoomOutButton">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/org/sleuthkit/autopsy/keywordsearch/zoom-out.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/keywordsearch/Bundle.properties" key="TextZoomPanel.zoomOutButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="borderPainted" type="boolean" value="false"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="horizontalTextPosition" type="int" value="0"/>
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
<Insets value="[0, 0, 0, 0]"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[20, 20]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[20, 20]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[20, 20]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="zoomOutButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="zoomInButton">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/org/sleuthkit/autopsy/keywordsearch/zoom-in.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/keywordsearch/Bundle.properties" key="TextZoomPanel.zoomInButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="borderPainted" type="boolean" value="false"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="horizontalTextPosition" type="int" value="0"/>
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
<Insets value="[0, 0, 0, 0]"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[20, 20]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[20, 20]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[20, 20]"/>
</Property>
<Property name="rolloverEnabled" type="boolean" value="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="zoomInButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JToolBar$Separator" name="jSeparator2">
<Properties>
<Property name="orientation" type="int" value="1"/>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[6, 20]"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
</Component>
<Component class="javax.swing.JButton" name="zoomResetButton">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/keywordsearch/Bundle.properties" key="TextZoomPanel.zoomResetButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="borderPainted" type="boolean" value="false"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="horizontalTextPosition" type="int" value="0"/>
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
<Insets value="[0, 0, 0, 0]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[50, 20]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[70, 20]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="zoomResetButtonActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>

View File

@ -0,0 +1,221 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2020 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sleuthkit.autopsy.keywordsearch;
import javax.swing.JLabel;
import javax.swing.JPanel;
import org.openide.util.NbBundle;
/**
* This panel shows current text size and allows for increasing or decreasing font size.
*/
class TextZoomPanel extends JPanel {
static final int DEFAULT_SIZE = new JLabel().getFont().getSize();
private static final long serialVersionUID = 1L;
private static final double[] ZOOM_STEPS = {
0.0625, 0.125, 0.25, 0.375, 0.5, 0.75,
1, 1.5, 2, 2.5, 3, 4, 5, 6, 8, 10};
// Identifies the center index in zoom steps (what identifies 100%).
private static final int DEFAULT_STEP_IDX = 6;
// The component to receive zoom updates.
private final ResizableTextPanel zoomable;
// On initialization, set to 100%.
private int curStepIndex = DEFAULT_STEP_IDX;
/**
* Creates new form TextZoomPanel.
* @param zoomable the component that will receive text resize events
*/
TextZoomPanel(ResizableTextPanel zoomable) {
this.zoomable = zoomable;
initComponents();
updateEnabled();
setZoomText();
}
private void updateEnabled() {
boolean shouldEnable = this.zoomable != null;
this.zoomInButton.setEnabled(shouldEnable);
this.zoomOutButton.setEnabled(shouldEnable);
this.zoomResetButton.setEnabled(shouldEnable);
this.zoomTextField.setEnabled(shouldEnable);
}
/**
* resets the font size displayed and triggers the ResizableTextPanel to
* set their font to default size (i.e. JLabel().getFont().getSize())
*/
synchronized void resetSize() {
zoomStep(DEFAULT_STEP_IDX);
}
private synchronized void zoomStep(int newStep) {
if (this.zoomable != null && newStep >= 0 && newStep < ZOOM_STEPS.length) {
curStepIndex = newStep;
zoomable.setTextSize((int)Math.round(ZOOM_STEPS[curStepIndex] * (double)DEFAULT_SIZE));
setZoomText();
}
}
private synchronized void zoomDecrement() {
zoomStep(curStepIndex - 1);
}
private synchronized void zoomIncrement() {
zoomStep(curStepIndex + 1);
}
private void setZoomText() {
String percent = Long.toString(Math.round(ZOOM_STEPS[this.curStepIndex] * 100));
zoomTextField.setText(percent + "%");
}
@NbBundle.Messages({
"TextZoomPanel.zoomTextField.text=",
"TextZoomPanel.zoomOutButton.text=",
"TextZoomPanel.zoomInButton.text=",
"TextZoomPanel.zoomResetButton.text=Reset"
})
/**
* 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
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
zoomTextField = new javax.swing.JTextField();
zoomOutButton = new javax.swing.JButton();
zoomInButton = new javax.swing.JButton();
javax.swing.JToolBar.Separator jSeparator2 = new javax.swing.JToolBar.Separator();
zoomResetButton = new javax.swing.JButton();
setMinimumSize(new java.awt.Dimension(150, 20));
setPreferredSize(new java.awt.Dimension(200, 20));
zoomTextField.setEditable(false);
zoomTextField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
zoomTextField.setText(org.openide.util.NbBundle.getMessage(TextZoomPanel.class, "TextZoomPanel.zoomTextField.text")); // NOI18N
zoomTextField.setMaximumSize(new java.awt.Dimension(50, 2147483647));
zoomTextField.setMinimumSize(new java.awt.Dimension(50, 20));
zoomTextField.setPreferredSize(new java.awt.Dimension(50, 20));
zoomOutButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/zoom-out.png"))); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(zoomOutButton, org.openide.util.NbBundle.getMessage(TextZoomPanel.class, "TextZoomPanel.zoomOutButton.text")); // NOI18N
zoomOutButton.setBorderPainted(false);
zoomOutButton.setFocusable(false);
zoomOutButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
zoomOutButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
zoomOutButton.setMaximumSize(new java.awt.Dimension(20, 20));
zoomOutButton.setMinimumSize(new java.awt.Dimension(20, 20));
zoomOutButton.setPreferredSize(new java.awt.Dimension(20, 20));
zoomOutButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
zoomOutButtonActionPerformed(evt);
}
});
zoomInButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/zoom-in.png"))); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(zoomInButton, org.openide.util.NbBundle.getMessage(TextZoomPanel.class, "TextZoomPanel.zoomInButton.text")); // NOI18N
zoomInButton.setBorderPainted(false);
zoomInButton.setFocusable(false);
zoomInButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
zoomInButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
zoomInButton.setMaximumSize(new java.awt.Dimension(20, 20));
zoomInButton.setMinimumSize(new java.awt.Dimension(20, 20));
zoomInButton.setPreferredSize(new java.awt.Dimension(20, 20));
zoomInButton.setRolloverEnabled(true);
zoomInButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
zoomInButtonActionPerformed(evt);
}
});
jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL);
jSeparator2.setMaximumSize(new java.awt.Dimension(6, 20));
org.openide.awt.Mnemonics.setLocalizedText(zoomResetButton, org.openide.util.NbBundle.getMessage(TextZoomPanel.class, "TextZoomPanel.zoomResetButton.text")); // NOI18N
zoomResetButton.setBorderPainted(false);
zoomResetButton.setFocusable(false);
zoomResetButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
zoomResetButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
zoomResetButton.setMinimumSize(new java.awt.Dimension(50, 20));
zoomResetButton.setPreferredSize(new java.awt.Dimension(70, 20));
zoomResetButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
zoomResetButtonActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(zoomTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(zoomOutButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(zoomInButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(zoomResetButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(zoomTextField, javax.swing.GroupLayout.Alignment.CENTER, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(zoomOutButton, javax.swing.GroupLayout.Alignment.CENTER, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(zoomInButton, javax.swing.GroupLayout.Alignment.CENTER, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(zoomResetButton, javax.swing.GroupLayout.Alignment.CENTER, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
private void zoomOutButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_zoomOutButtonActionPerformed
zoomDecrement();
}//GEN-LAST:event_zoomOutButtonActionPerformed
private void zoomInButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_zoomInButtonActionPerformed
zoomIncrement();
}//GEN-LAST:event_zoomInButtonActionPerformed
private void zoomResetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_zoomResetButtonActionPerformed
resetSize();
}//GEN-LAST:event_zoomResetButtonActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton zoomInButton;
private javax.swing.JButton zoomOutButton;
private javax.swing.JButton zoomResetButton;
private javax.swing.JTextField zoomTextField;
// End of variables declaration//GEN-END:variables
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -9,9 +9,15 @@ There are two types of modules:
\section module_install_nbm Installing NetBeans Modules
If you have an NBM file, then it may contain one or more Autopsy modules. To install it, use the plugin manager at "Tools", "Plugins".
\image html module_install_netbeans.png
Choose the "Downloaded" tab and then choose "Add Plugins". Browse to the NBM file. It may require you to restart Autopsy.
\section module_install_python Installing Python Modules
If you have a ZIP file with a Python module in it, then unzip the file and you should get a folder. Open the Python module library folder using "Tools", "Python Plugins". Copy the module folder into there and Autopsy should identify and use it next time it loads modules.
If you have a ZIP file with a Python module in it, then unzip the file and you should get a folder. Open the Python module library folder through Autopsy using "Tools", "Python Plugins".
\image html module_install_python.png
On Windows this will be under your user directory in "AppData\Roaming\autopsy\python_modules". Copy the module folder into there and Autopsy should identify and use it next time it loads modules.
*/