Class 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.
    • 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
      • 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
    • Constructor Detail

      • PrefsMediator

        public PrefsMediator()
        Instantiates a new prefs mediator.
    • 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 set
        outputDirToSave - 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 run
        inter - the inter
        view - the view
      • setFileSelectors

        public void setFileSelectors​(FileSelector input,
                                     FileSelector output,
                                     FileSelector xml)
        Sets the file selectors.
        Parameters:
        input - the input
        output - the output
        xml - the xml
      • fieldFocusLost

        public void fieldFocusLost()
        Field focus lost.