Autopsy  4.19.3
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.contentviewers.TranslatablePanel Class Reference

Inherits JPanel.

Classes

interface  ContentComponent
 
class  OnTranslation
 
class  TranslatablePanelException
 
class  TranslatedText
 
class  TranslateOption
 

Public Member Functions

 TranslatablePanel (ContentComponent contentComponent)
 

Private Attributes

volatile OnTranslation backgroundTask = null
 
final Object backgroundTaskLock = new Object()
 
volatile TranslatedText cachedTranslated
 
final Object cachedTranslatedLock = new Object()
 
String content
 
final ContentComponent contentComponent
 
String contentDescriptor
 
final ExecutorService executorService = Executors.newSingleThreadExecutor(translationThreadFactory)
 
boolean prevTranslateSelection
 
final TextTranslationService translationService
 
final ThreadFactory translationThreadFactory = new ThreadFactoryBuilder().setNameFormat("translatable-panel-%d").build()
 
final ImageIcon warningIcon = new ImageIcon(TranslatablePanel.class.getResource("/org/sleuthkit/autopsy/images/warning16.png"))
 

Static Private Attributes

static final ComponentOrientation DEFAULT_ORIENTATION = ComponentOrientation.LEFT_TO_RIGHT
 
static final long serialVersionUID = 1L
 
javax.swing.JLabel statusLabel
 
javax.swing.JComboBox< TranslateOptiontranslateComboBox
 
javax.swing.JPanel translationBar
 
final void reset ()
 
void setContent (String content, String contentDescriptor)
 
TranslatedText getCachedTranslated ()
 
void setCachedTranslated (TranslatedText translated)
 
void cancelPendingTranslation ()
 
void runTranslationTask ()
 
void clearStatus ()
 
synchronized void setStatus (String msg, boolean showWarningIcon)
 
void setTranslationEnabled ()
 
void setChildComponentContent (String content)
 
synchronized void setChildComponentContent (String content, ComponentOrientation orientation)
 
void additionalInit (Component rootComponent, String origOptionText, String translatedOptionText)
 
void handleComboBoxChange (TranslateOption translateOption)
 
void initComponents ()
 
void translateComboBoxActionPerformed (java.awt.event.ActionEvent evt)
 
String retrieveTranslation (String input) throws TranslationException, NoServiceProviderException
 

Detailed Description

This is a panel for translation with a subcomponent that allows for translation.

Definition at line 40 of file TranslatablePanel.java.

Constructor & Destructor Documentation

org.sleuthkit.autopsy.contentviewers.TranslatablePanel.TranslatablePanel ( ContentComponent  contentComponent)

Member Function Documentation

void org.sleuthkit.autopsy.contentviewers.TranslatablePanel.additionalInit ( Component  rootComponent,
String  origOptionText,
String  translatedOptionText 
)
private

This method is for items that are programmatically initialized.

Definition at line 351 of file TranslatablePanel.java.

References org.sleuthkit.autopsy.contentviewers.TranslatablePanel.translateComboBox.

void org.sleuthkit.autopsy.contentviewers.TranslatablePanel.cancelPendingTranslation ( )
private
void org.sleuthkit.autopsy.contentviewers.TranslatablePanel.clearStatus ( )
private
TranslatedText org.sleuthkit.autopsy.contentviewers.TranslatablePanel.getCachedTranslated ( )
private
void org.sleuthkit.autopsy.contentviewers.TranslatablePanel.handleComboBoxChange ( TranslateOption  translateOption)
private
void org.sleuthkit.autopsy.contentviewers.TranslatablePanel.initComponents ( )
private

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.

Definition at line 390 of file TranslatablePanel.java.

References org.sleuthkit.autopsy.contentviewers.TranslatablePanel.statusLabel, org.sleuthkit.autopsy.contentviewers.TranslatablePanel.translateComboBox, org.sleuthkit.autopsy.contentviewers.TranslatablePanel.translateComboBoxActionPerformed(), and org.sleuthkit.autopsy.contentviewers.TranslatablePanel.translationBar.

final void org.sleuthkit.autopsy.contentviewers.TranslatablePanel.reset ( )

This resets the component to an empty state and sets the translation bar visibility based on whether there is a provider.

Definition at line 266 of file TranslatablePanel.java.

References org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setContent().

Referenced by org.sleuthkit.autopsy.contentviewers.artifactviewers.MessageArtifactViewer.resetComponent().

String org.sleuthkit.autopsy.contentviewers.TranslatablePanel.retrieveTranslation ( String  input) throws TranslationException, NoServiceProviderException
protected

This is where actual translation takes place allowed to be overridden for the sake of varying translatable content (i.e. html, rtf, etc).

Parameters
inputthe input content
Returns
the result of translation
Exceptions
TranslationException
NoServiceProviderException

Definition at line 296 of file TranslatablePanel.java.

References org.sleuthkit.autopsy.texttranslation.TextTranslationService.translate().

Referenced by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.OnTranslation.translate().

void org.sleuthkit.autopsy.contentviewers.TranslatablePanel.runTranslationTask ( )
private
void org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setCachedTranslated ( TranslatedText  translated)
private
void org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setChildComponentContent ( String  content)
private

The child component provided in the constructor will have its content set to the string provided.

Parameters
contentthe content to display in the child component

Definition at line 328 of file TranslatablePanel.java.

Referenced by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.handleComboBoxChange(), org.sleuthkit.autopsy.contentviewers.TranslatablePanel.OnTranslation.onTextDisplay(), and org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setContent().

synchronized void org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setChildComponentContent ( String  content,
ComponentOrientation  orientation 
)
private

The child component provided in the constructor will have its content set to the string provided.

Parameters
contentthe content to display in the child component
orientationthe orientation for the text

Definition at line 338 of file TranslatablePanel.java.

References org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setStatus().

void org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setContent ( String  content,
String  contentDescriptor 
)
synchronized void org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setStatus ( String  msg,
boolean  showWarningIcon 
)
private
void org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setTranslationEnabled ( )
private

This method sets the translation bar visibility based on whether or not there is a provided.

Definition at line 320 of file TranslatablePanel.java.

References org.sleuthkit.autopsy.texttranslation.TextTranslationService.hasProvider(), and org.sleuthkit.autopsy.contentviewers.TranslatablePanel.translateComboBox.

Referenced by org.sleuthkit.autopsy.contentviewers.TranslatablePanel.setContent().

void org.sleuthkit.autopsy.contentviewers.TranslatablePanel.translateComboBoxActionPerformed ( java.awt.event.ActionEvent  evt)
private

Member Data Documentation

volatile OnTranslation org.sleuthkit.autopsy.contentviewers.TranslatablePanel.backgroundTask = null
private

Definition at line 190 of file TranslatablePanel.java.

final Object org.sleuthkit.autopsy.contentviewers.TranslatablePanel.backgroundTaskLock = new Object()
private
volatile TranslatedText org.sleuthkit.autopsy.contentviewers.TranslatablePanel.cachedTranslated
private
final Object org.sleuthkit.autopsy.contentviewers.TranslatablePanel.cachedTranslatedLock = new Object()
private
String org.sleuthkit.autopsy.contentviewers.TranslatablePanel.content
private
final ContentComponent org.sleuthkit.autopsy.contentviewers.TranslatablePanel.contentComponent
private
String org.sleuthkit.autopsy.contentviewers.TranslatablePanel.contentDescriptor
private
final ComponentOrientation org.sleuthkit.autopsy.contentviewers.TranslatablePanel.DEFAULT_ORIENTATION = ComponentOrientation.LEFT_TO_RIGHT
staticprivate

Definition at line 173 of file TranslatablePanel.java.

final ExecutorService org.sleuthkit.autopsy.contentviewers.TranslatablePanel.executorService = Executors.newSingleThreadExecutor(translationThreadFactory)
private

Definition at line 180 of file TranslatablePanel.java.

boolean org.sleuthkit.autopsy.contentviewers.TranslatablePanel.prevTranslateSelection
private

Definition at line 187 of file TranslatablePanel.java.

final long org.sleuthkit.autopsy.contentviewers.TranslatablePanel.serialVersionUID = 1L
staticprivate

Definition at line 172 of file TranslatablePanel.java.

javax.swing.JLabel org.sleuthkit.autopsy.contentviewers.TranslatablePanel.statusLabel
private
javax.swing.JComboBox<TranslateOption> org.sleuthkit.autopsy.contentviewers.TranslatablePanel.translateComboBox
private
javax.swing.JPanel org.sleuthkit.autopsy.contentviewers.TranslatablePanel.translationBar
private
final TextTranslationService org.sleuthkit.autopsy.contentviewers.TranslatablePanel.translationService
private

Definition at line 178 of file TranslatablePanel.java.

final ThreadFactory org.sleuthkit.autopsy.contentviewers.TranslatablePanel.translationThreadFactory = new ThreadFactoryBuilder().setNameFormat("translatable-panel-%d").build()
private

Definition at line 179 of file TranslatablePanel.java.

final ImageIcon org.sleuthkit.autopsy.contentviewers.TranslatablePanel.warningIcon = new ImageIcon(TranslatablePanel.class.getResource("/org/sleuthkit/autopsy/images/warning16.png"))
private

Definition at line 175 of file TranslatablePanel.java.


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

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