Class PrefsMediator
- java.lang.Object
-
- org.apache.uima.tools.docanalyzer.PrefsMediator
-
public class PrefsMediator extends java.lang.ObjectThe Class PrefsMediator.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringdefaultInputDirThe default input dir.private java.lang.StringdefaultOutputDirThe default output dir.private java.lang.StringencodingThe encoding.private static java.lang.StringENCODINGThe Constant ENCODING.private static java.lang.StringINDIRThe Constant INDIR.private java.lang.StringinputDirThe input dir.private java.lang.StringinputFileFormatThe input file format.private static java.lang.StringINPUTFILEFORMATThe Constant INPUTFILEFORMAT.private FileSelectorinputFileSelectorThe input file selector.private javax.swing.JButtoninterButtonThe view button.private java.lang.StringlanguageThe language.private static java.lang.StringLANGUAGEThe Constant LANGUAGE.private booleanlenientThe lenient.private static java.lang.StringLENIENTThe Constant LENIENT.private static java.lang.StringOUTDIRThe Constant OUTDIR.private java.lang.StringoutputDirThe output dir.private FileSelectoroutputFileSelectorThe output file selector.private java.util.prefs.PreferencesprefsThe prefs.private javax.swing.JButtonrunButtonThe view button.private static java.lang.StringTAEDESCRIPTORThe Constant TAEDESCRIPTOR.private java.lang.StringtaeDirThe tae dir.private javax.swing.JButtonviewButtonThe view button.private java.lang.StringviewTypeThe view type.private static java.lang.StringVIEWTYPEThe Constant VIEWTYPE.private FileSelectorxmlFileSelectorThe xml file selector.private java.lang.StringxmlTagThe xml tag.private static java.lang.StringXMLTAGThe 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 voidfieldFocusLost()Field focus lost.java.lang.StringgetEncoding()Gets the encoding.java.lang.StringgetInputDir()Gets the input dir.java.lang.StringgetInputFileFormat()Gets the input file format.java.lang.StringgetLanguage()Gets the language.java.lang.BooleangetLenient()Gets the lenient.java.lang.StringgetOutputDir()Gets the output dir.java.io.FilegetStylemapFile()returns the new edited stylemap file.java.lang.StringgetTAEfile()Gets the TA efile.java.lang.StringgetTAEFileNameRoot()Gets the TAE file name root.java.lang.StringgetTAEPath()get the path to the TAE that is where the StyleMap file should be written.java.lang.StringgetViewType()Gets the view type.java.lang.StringgetXmlTag()Gets the xml tag.private intindexOfLastFileSeparator(java.lang.String path)Gets index of last file separator character in a file path.voidrestorePreferences()Restore preferences.voidsavePreferences()Save preferences.voidsetDocButtons(javax.swing.JButton run, javax.swing.JButton inter, javax.swing.JButton view)Sets the doc buttons.voidsetEncoding(java.lang.String encoding)Sets the encoding.voidsetFileSelectors(FileSelector input, FileSelector output, FileSelector xml)Sets the file selectors.voidsetInputDir(java.lang.String inputDir)Sets the input dir.voidsetInputFileFormat(java.lang.String inputFileFormat)Sets the input file format.voidsetLanguage(java.lang.String language)Sets the language.voidsetLenient(java.lang.Boolean lenient)Sets the lenient.voidsetOutputDir(java.lang.String outputDir)Sets the output dir.voidsetOutputDirForInteractiveMode(java.lang.String outputDir, java.lang.String outputDirToSave)Special case of setOutpuDir needed for interactive mode.voidsetTAEfile(java.lang.String edir)Sets the TA efile.voidsetViewType(java.lang.String viewType)Sets the view type.voidsetXmlTag(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.
-
-