Class PrefsMediator
- java.lang.Object
-
- org.apache.uima.tools.docanalyzer.PrefsMediator
-
public class PrefsMediator extends java.lang.Object
The Class PrefsMediator.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
defaultInputDir
The default input dir.private java.lang.String
defaultOutputDir
The default output dir.private java.lang.String
encoding
The encoding.private static java.lang.String
ENCODING
The Constant ENCODING.private static java.lang.String
INDIR
The Constant INDIR.private java.lang.String
inputDir
The input dir.private java.lang.String
inputFileFormat
The input file format.private static java.lang.String
INPUTFILEFORMAT
The Constant INPUTFILEFORMAT.private FileSelector
inputFileSelector
The input file selector.private javax.swing.JButton
interButton
The view button.private java.lang.String
language
The language.private static java.lang.String
LANGUAGE
The Constant LANGUAGE.private boolean
lenient
The lenient.private static java.lang.String
LENIENT
The Constant LENIENT.private static java.lang.String
OUTDIR
The Constant OUTDIR.private java.lang.String
outputDir
The output dir.private FileSelector
outputFileSelector
The output file selector.private java.util.prefs.Preferences
prefs
The prefs.private javax.swing.JButton
runButton
The view button.private static java.lang.String
TAEDESCRIPTOR
The Constant TAEDESCRIPTOR.private java.lang.String
taeDir
The tae dir.private javax.swing.JButton
viewButton
The view button.private java.lang.String
viewType
The view type.private static java.lang.String
VIEWTYPE
The Constant VIEWTYPE.private FileSelector
xmlFileSelector
The xml file selector.private java.lang.String
xmlTag
The xml tag.private static java.lang.String
XMLTAG
The Constant XMLTAG.
-
Constructor Summary
Constructors Constructor Description PrefsMediator()
Instantiates a new prefs mediator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fieldFocusLost()
Field focus lost.java.lang.String
getEncoding()
Gets the encoding.java.lang.String
getInputDir()
Gets the input dir.java.lang.String
getInputFileFormat()
Gets the input file format.java.lang.String
getLanguage()
Gets the language.java.lang.Boolean
getLenient()
Gets the lenient.java.lang.String
getOutputDir()
Gets the output dir.java.io.File
getStylemapFile()
returns the new edited stylemap file.java.lang.String
getTAEfile()
Gets the TA efile.java.lang.String
getTAEFileNameRoot()
Gets the TAE file name root.java.lang.String
getTAEPath()
get the path to the TAE that is where the StyleMap file should be written.java.lang.String
getViewType()
Gets the view type.java.lang.String
getXmlTag()
Gets the xml tag.private int
indexOfLastFileSeparator(java.lang.String path)
Gets index of last file separator character in a file path.void
restorePreferences()
Restore preferences.void
savePreferences()
Save preferences.void
setDocButtons(javax.swing.JButton run, javax.swing.JButton inter, javax.swing.JButton view)
Sets the doc buttons.void
setEncoding(java.lang.String encoding)
Sets the encoding.void
setFileSelectors(FileSelector input, FileSelector output, FileSelector xml)
Sets the file selectors.void
setInputDir(java.lang.String inputDir)
Sets the input dir.void
setInputFileFormat(java.lang.String inputFileFormat)
Sets the input file format.void
setLanguage(java.lang.String language)
Sets the language.void
setLenient(java.lang.Boolean lenient)
Sets the lenient.void
setOutputDir(java.lang.String outputDir)
Sets the output dir.void
setOutputDirForInteractiveMode(java.lang.String outputDir, java.lang.String outputDirToSave)
Special case of setOutpuDir needed for interactive mode.void
setTAEfile(java.lang.String edir)
Sets the TA efile.void
setViewType(java.lang.String viewType)
Sets the view type.void
setXmlTag(java.lang.String xmlTag)
Sets the xml tag.
-
-
-
Field Detail
-
inputFileSelector
private FileSelector inputFileSelector
The input file selector.
-
outputFileSelector
private FileSelector outputFileSelector
The output file selector.
-
xmlFileSelector
private FileSelector xmlFileSelector
The xml file selector.
-
runButton
private javax.swing.JButton runButton
The view button.
-
interButton
private javax.swing.JButton interButton
The view button.
-
viewButton
private javax.swing.JButton viewButton
The view button.
-
prefs
private java.util.prefs.Preferences prefs
The prefs.
-
taeDir
private java.lang.String taeDir
The tae dir.
-
outputDir
private java.lang.String outputDir
The output dir.
-
inputDir
private java.lang.String inputDir
The input dir.
-
defaultInputDir
private java.lang.String defaultInputDir
The default input dir.
-
defaultOutputDir
private java.lang.String defaultOutputDir
The default output dir.
-
inputFileFormat
private java.lang.String inputFileFormat
The input file format.
-
language
private java.lang.String language
The language.
-
encoding
private java.lang.String encoding
The encoding.
-
viewType
private java.lang.String viewType
The view type.
-
xmlTag
private java.lang.String xmlTag
The xml tag.
-
lenient
private boolean lenient
The lenient.
-
VIEWTYPE
private static final java.lang.String VIEWTYPE
The Constant VIEWTYPE.- See Also:
- Constant Field Values
-
ENCODING
private static final java.lang.String ENCODING
The Constant ENCODING.- See Also:
- Constant Field Values
-
INPUTFILEFORMAT
private static final java.lang.String INPUTFILEFORMAT
The Constant INPUTFILEFORMAT.- See Also:
- Constant Field Values
-
LANGUAGE
private static final java.lang.String LANGUAGE
The Constant LANGUAGE.- See Also:
- Constant Field Values
-
TAEDESCRIPTOR
private static final java.lang.String TAEDESCRIPTOR
The Constant TAEDESCRIPTOR.- See Also:
- Constant Field Values
-
OUTDIR
private static final java.lang.String OUTDIR
The Constant OUTDIR.- See Also:
- Constant Field Values
-
INDIR
private static final java.lang.String INDIR
The Constant INDIR.- See Also:
- Constant Field Values
-
XMLTAG
private static final java.lang.String XMLTAG
The Constant XMLTAG.- See Also:
- Constant Field Values
-
LENIENT
private static final java.lang.String LENIENT
The Constant LENIENT.- See Also:
- Constant Field Values
-
-
Method Detail
-
restorePreferences
public void restorePreferences()
Restore preferences.
-
savePreferences
public void savePreferences()
Save preferences.
-
getInputDir
public java.lang.String getInputDir()
Gets the input dir.- Returns:
- Returns the inputDir.
-
setInputDir
public void setInputDir(java.lang.String inputDir)
Sets the input dir.- Parameters:
inputDir
- The inputDir to set.
-
getOutputDir
public java.lang.String getOutputDir()
Gets the output dir.- Returns:
- Returns the outputDir.
-
setOutputDir
public void setOutputDir(java.lang.String outputDir)
Sets the output dir.- Parameters:
outputDir
- The outputDir to set.
-
setOutputDirForInteractiveMode
public void setOutputDirForInteractiveMode(java.lang.String outputDir, java.lang.String outputDirToSave)
Special case of setOutpuDir needed for interactive mode. In interactive mode, we append "/interactive_out" to the end, but we don't want to save this in the preferences. To support that, this method takes one parameter which is the output dir to be set and used by the application, and a second parameter to set the directory that is saved to the preferences.- Parameters:
outputDir
- the output dir to setoutputDirToSave
- the output dir to save to the preferences
-
getTAEfile
public java.lang.String getTAEfile()
Gets the TA efile.- Returns:
- Returns the tAEdir.
-
getTAEPath
public java.lang.String getTAEPath()
get the path to the TAE that is where the StyleMap file should be written.- Returns:
- the TAE path
-
getTAEFileNameRoot
public java.lang.String getTAEFileNameRoot()
Gets the TAE file name root.- Returns:
- the TAE file name root
-
indexOfLastFileSeparator
private int indexOfLastFileSeparator(java.lang.String path)
Gets index of last file separator character in a file path. Supports File.separator but also / on Windows.- Parameters:
path
- the path- Returns:
- index of the last file separator char. Returns -1 if none.
-
setTAEfile
public void setTAEfile(java.lang.String edir)
Sets the TA efile.- Parameters:
edir
- set the TAE directory
-
getEncoding
public java.lang.String getEncoding()
Gets the encoding.- Returns:
- Returns the encoding.
-
setEncoding
public void setEncoding(java.lang.String encoding)
Sets the encoding.- Parameters:
encoding
- The encoding to set.
-
getInputFileFormat
public java.lang.String getInputFileFormat()
Gets the input file format.- Returns:
- Returns the input file format.
-
setInputFileFormat
public void setInputFileFormat(java.lang.String inputFileFormat)
Sets the input file format.- Parameters:
inputFileFormat
- The input file format to set.
-
getLanguage
public java.lang.String getLanguage()
Gets the language.- Returns:
- Returns the language.
-
setLanguage
public void setLanguage(java.lang.String language)
Sets the language.- Parameters:
language
- The language to set.
-
getViewType
public java.lang.String getViewType()
Gets the view type.- Returns:
- Returns the view type.
-
setViewType
public void setViewType(java.lang.String viewType)
Sets the view type.- Parameters:
viewType
- The view type to set.
-
getXmlTag
public java.lang.String getXmlTag()
Gets the xml tag.- Returns:
- Returns the xmlTag.
-
setXmlTag
public void setXmlTag(java.lang.String xmlTag)
Sets the xml tag.- Parameters:
xmlTag
- The xmlTag to set.
-
getLenient
public java.lang.Boolean getLenient()
Gets the lenient.- Returns:
- Returns lenient.
-
setLenient
public void setLenient(java.lang.Boolean lenient)
Sets the lenient.- Parameters:
lenient
- The lenient to set.
-
getStylemapFile
public java.io.File getStylemapFile()
returns the new edited stylemap file.- Returns:
- the stylemap file
-
setDocButtons
public void setDocButtons(javax.swing.JButton run, javax.swing.JButton inter, javax.swing.JButton view)
Sets the doc buttons.- Parameters:
run
- the runinter
- the interview
- the view
-
setFileSelectors
public void setFileSelectors(FileSelector input, FileSelector output, FileSelector xml)
Sets the file selectors.- Parameters:
input
- the inputoutput
- the outputxml
- the xml
-
fieldFocusLost
public void fieldFocusLost()
Field focus lost.
-
-