Autopsy  4.21.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
Classes | Public Member Functions | Private Attributes | Static Private Attributes | List of all members
org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer Class Reference

Inherits org.sleuthkit.autopsy.corecomponentinterfaces.TextViewer.


class  DisplayDropDownChangeListener
class  ExtractAndTranslateTextTask
class  OCRDropdownChangeListener
class  SelectionChangeListener

Public Member Functions

TextViewer createInstance ()
Component getComponent ()
String getTitle ()
String getToolTip ()
int isPreferred (Node node)
boolean isSupported (Node node)
void resetComponent ()
void setNode (Node selectedNode)
void setNode (final Node node)

Private Attributes

volatile ExtractAndTranslateTextTask backgroundTask
final ExecutorService executorService = Executors.newSingleThreadExecutor(translationThreadFactory)
volatile Node node
final TranslationContentPanel panel = new TranslationContentPanel()
final ThreadFactory translationThreadFactory = new ThreadFactoryBuilder().setNameFormat("translation-content-viewer-%d").build()

Static Private Attributes

static final List< String > INSTALLED_LANGUAGE_PACKS = PlatformUtil.getOcrLanguagePacks()
static final Logger logger = Logger.getLogger(TranslatedTextViewer.class.getName())
static final int MAX_EXTRACT_SIZE_BYTES = 25600

Detailed Description

A TextViewer that displays machine translation of text.

Definition at line 59 of file

Member Function Documentation

TextViewer org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.createInstance ( )

Create and return a new instance of your viewer. The reason that this is needed is because the specific viewer modules will be found via NetBeans Lookup and the type will only be TextViewer. This method is used to get an instance of your specific type.

A new instance of the viewer

Implements org.sleuthkit.autopsy.corecomponentinterfaces.TextViewer.

Definition at line 107 of file

Component org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.getComponent ( )

Return the Swing Component to display. Implementations of this method that extend JPanel and do a 'return this;'. Otherwise return an internal instance of the JPanel.

the component which is displayed for this viewer

Implements org.sleuthkit.autopsy.corecomponentinterfaces.TextViewer.

Definition at line 112 of file

String org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.getTitle ( )

Returns the title of this viewer to display in the tab.

the title of TextViewer

Implements org.sleuthkit.autopsy.corecomponentinterfaces.TextViewer.

Definition at line 96 of file

String org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.getToolTip ( )

Returns a short description of this viewer to use as a tool tip for its tab.

the tooltip for this TextViewer

Implements org.sleuthkit.autopsy.corecomponentinterfaces.TextViewer.

Definition at line 102 of file

int org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.isPreferred ( Node  node)

Checks whether the given viewer is preferred for the Node. This is a bit subjective, but the idea is that Autopsy wants to display the most relevant tab. The more generic the viewer, the lower the return value should be. This will only be called on viewers that support the given node (i.e., isSupported() has already returned true).

The following are some examples of the current levels in use. If the selected node is an artifact, the level may be determined by both the artifact and its associated file.

Level 6 - Used for data artifact viewers. These have higher priority over file content viewers because a Node will likely have the ‘source’ file for a data artifact and we want to give the artifact priority. Currently used by the Data Artifacts viewer.

Level 5 - Used for type-specific file content viewers that are optimized for that type, such as displaying an image or a PDF file with images and proper layout. Currently used by the Application viewer.

Level 4 - Used for type-specific file content viewers that are not optimized. For example, displaying only the plain text from a PDF would be at this level, but displaying the same PDF with images and layout would be level 5. Currently used by the Text viewer that returns text from Solr.

Level 3 - Used for viewing Data Artifacts that refer to files and the user may want to view the files more than the artifact itself. This is currently used by the Data Artifact viewer when a Web Download artifact is selected.

Level 2 - Used for viewing Analysis Results. This is a lower priority than Data Artifacts and file content because Analysis Results are used to identify content of interest and therefore the content itself should be shown. Currently used by the Analysis Results viewer. * Level 1 - Used for metadata viewers that give more information and context about the primary file or artifact. Currently used by Metadata, Annotations, Context, Other Occurrences, and OS Account.

Level 0 - Used for general purpose file content viewers that are not file specific and will always be enabled. Currently used by Text/Strings and Hex.

nodeNode to check for preference
an int (0-10) higher return means the viewer has higher priority

Implements org.sleuthkit.autopsy.corecomponentinterfaces.TextViewer.

Definition at line 141 of file

References org.sleuthkit.autopsy.contentviewers.utils.ViewerPriority.viewerPriority.LevelZero.

boolean org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.isSupported ( Node  node)

Checks whether the given node is supported by the viewer. This will be used to enable or disable the tab for the viewer.

nodeNode to check for support
True if the node can be displayed / processed, else false

Implements org.sleuthkit.autopsy.corecomponentinterfaces.TextViewer.

Definition at line 127 of file

References org.sleuthkit.autopsy.texttranslation.TextTranslationService.getInstance(), and org.sleuthkit.autopsy.texttranslation.TextTranslationService.hasProvider().

void org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.resetComponent ( )

Resets the contents of the viewer / component.

Implements org.sleuthkit.autopsy.corecomponentinterfaces.TextViewer.

Definition at line 117 of file

void org.sleuthkit.autopsy.corecomponentinterfaces.TextViewer.setNode ( Node  selectedNode)

Autopsy will call this when this panel is focused with the file that should be analyzed. When called with null, must clear all references to previous nodes.

selectedNodethe node which is used to determine what is displayed in this viewer

Implemented in org.sleuthkit.autopsy.contentviewers.textcontentviewer.StringsTextViewer.

void org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.setNode ( final Node  node)

Member Data Documentation

volatile ExtractAndTranslateTextTask org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.backgroundTask

Definition at line 68 of file

final ExecutorService org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.executorService = Executors.newSingleThreadExecutor(translationThreadFactory)

Definition at line 71 of file

final List<String> org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.INSTALLED_LANGUAGE_PACKS = PlatformUtil.getOcrLanguagePacks()

Definition at line 64 of file

final Logger org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.logger = Logger.getLogger(TranslatedTextViewer.class.getName())

Definition at line 61 of file

final int org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.MAX_EXTRACT_SIZE_BYTES = 25600

Definition at line 63 of file

volatile Node org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.node

Definition at line 67 of file

final TranslationContentPanel org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.panel = new TranslationContentPanel()

Definition at line 65 of file

final ThreadFactory org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.translationThreadFactory = new ThreadFactoryBuilder().setNameFormat("translation-content-viewer-%d").build()

Definition at line 70 of file

The documentation for this class was generated from the following file:

Copyright © 2012-2022 Basis Technology. Generated on: Tue Feb 6 2024
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.