Class MainFrame

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class MainFrame extends JFrame
Class comment for MainFrame.java goes here.
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      The Constant serialVersionUID.
      See Also:
    • logLevels

      public static List<Level> logLevels
      The log levels.
    • loggerPropertiesFileName

      private static final String loggerPropertiesFileName
      The Constant loggerPropertiesFileName.
      See Also:
    • defaultText

      private static final String defaultText
      The Constant defaultText.
      See Also:
    • titleText

      private static final String titleText
      The Constant titleText.
      See Also:
    • htmlGrayColor

      static final String htmlGrayColor
      The Constant htmlGrayColor.
      See Also:
    • indexReposRootLabel

      private static final String indexReposRootLabel
      The Constant indexReposRootLabel.
      See Also:
    • noIndexReposLabel

      private static final String noIndexReposLabel
      The Constant noIndexReposLabel.
      See Also:
    • textArea

      private JTextArea textArea
      The text area.
    • indexTree

      private JTree indexTree
      The index tree.
    • fsTree

      private JTree fsTree
      The fs tree.
    • statusPanel

      private JPanel statusPanel
      The status panel.
    • statusBar

      private JTextField statusBar
      The status bar.
    • fileStatus

      private JTextField fileStatus
      The file status.
    • aeStatus

      private JTextField aeStatus
      The ae status.
    • caretStatus

      private JTextField caretStatus
      The caret status.
    • textTitleBorder

      private Border textTitleBorder
      The text title border.
    • isDirty

      private boolean isDirty
      The is dirty.
    • textScrollPane

      private JScrollPane textScrollPane
      The text scroll pane.
    • indexTreeScrollPane

      private JScrollPane indexTreeScrollPane
      The index tree scroll pane.
    • fsTreeScrollPane

      private JScrollPane fsTreeScrollPane
      The fs tree scroll pane.
    • fileMenu

      private JMenu fileMenu
      The file menu.
    • fileSaveItem

      private JMenuItem fileSaveItem
      The file save item.
    • editMenu

      private JMenu editMenu
      The edit menu.
    • undoItem

      private JMenuItem undoItem
      The undo item.
    • undoMgr

      private UndoMgr undoMgr
      The undo mgr.
    • cutAction

      private Action cutAction
      The cut action.
    • copyAction

      private Action copyAction
      The copy action.
    • allAnnotationViewerItem

      private JMenuItem allAnnotationViewerItem
      The all annotation viewer item.
    • acdItem

      private JMenuItem acdItem
      The acd item.
    • tsViewerItem

      private JMenuItem tsViewerItem
      The ts viewer item.
    • reRunMenu

      private JMenuItem reRunMenu
      The re run menu.
    • runCPCMenu

      private JMenuItem runCPCMenu
      The run CPC menu.
    • runOnCasMenuItem

      private JMenuItem runOnCasMenuItem
      The run on cas menu item.
    • showPerfReportItem

      private JMenuItem showPerfReportItem
      The show perf report item.
    • textPopup

      private JPopupMenu textPopup
      The text popup.
    • xcasReadItem

      private JMenuItem xcasReadItem
      The xcas read item.
    • xcasWriteItem

      private JMenuItem xcasWriteItem
      The xcas write item.
    • xmiCasReadItem

      private JMenuItem xmiCasReadItem
      The xmi cas read item.
    • xmiCasWriteItem

      private JMenuItem xmiCasWriteItem
      The xmi cas write item.
    • typeSystemWriteItem

      private JMenuItem typeSystemWriteItem
      The type system write item.
    • typeSystemReadItem

      private JMenuItem typeSystemReadItem
      The type system read item.
    • recentTextFileMenu

      private JMenu recentTextFileMenu
      The recent text file menu.
    • recentDescFileMenu

      private JMenu recentDescFileMenu
      The recent desc file menu.
    • iniFile

      private File iniFile
      The ini file.
    • codePages

      private List<String> codePages
      The code pages.
    • codePage

      private String codePage
      The code page.
    • cpMenu

      private JMenu cpMenu
      The cp menu.
    • cpButtons

      private ButtonGroup cpButtons
      The cp buttons.
    • languagePrefsList

      String languagePrefsList
      The language prefs list.
    • languages

      private List<String> languages
      The languages.
    • langMenu

      private JMenu langMenu
      The lang menu.
    • langButtons

      private ButtonGroup langButtons
      The lang buttons.
    • LANGUAGE_DEFAULT

      private static final String LANGUAGE_DEFAULT
      The Constant LANGUAGE_DEFAULT.
      See Also:
    • language

      private String language
      The language.
    • defaultLanguages

      private static final String defaultLanguages
      The Constant defaultLanguages.
      See Also:
    • textFile

      private File textFile
      The text file.
    • fileOpenDir

      private File fileOpenDir
      The file open dir.
    • annotOpenDir

      private File annotOpenDir
      The annot open dir.
    • xcasFileOpenDir

      private File xcasFileOpenDir
      The xcas file open dir.
    • colorSettingsDir

      private File colorSettingsDir
      The color settings dir.
    • indexLabel

      private String indexLabel
      The index label.
    • index

      private FSIndex index
      The index.
    • isAnnotationIndex

      private boolean isAnnotationIndex
      The is annotation index.
    • cas

      private CAS cas
      The cas.
    • aeDescriptorFile

      private File aeDescriptorFile
      The ae descriptor file.
    • ae

      private AnalysisEngine ae
      The ae.
    • logFile

      private File logFile
      The log file.
    • log

      private Logger log
      The log.
    • colorSettingFile

      private File colorSettingFile
      The color setting file.
    • selectionColor

      private static final Color selectionColor
      The Constant selectionColor.
    • preferences

      private Properties preferences
      The preferences.
    • lastRunProcessTrace

      private ProcessTrace lastRunProcessTrace
      The last run process trace.
    • textDirPref

      public static final String textDirPref
      The Constant textDirPref.
      See Also:
    • aeDirPref

      public static final String aeDirPref
      The Constant aeDirPref.
      See Also:
    • xcasDirPref

      public static final String xcasDirPref
      The Constant xcasDirPref.
      See Also:
    • textSizePref

      public static final String textSizePref
      The Constant textSizePref.
      See Also:
    • indexTreeSizePref

      public static final String indexTreeSizePref
      The Constant indexTreeSizePref.
      See Also:
    • fsTreeSizePref

      public static final String fsTreeSizePref
      The Constant fsTreeSizePref.
      See Also:
    • tsWindowSizePref

      public static final String tsWindowSizePref
      The Constant tsWindowSizePref.
      See Also:
    • annotViewSizePref

      public static final String annotViewSizePref
      The Constant annotViewSizePref.
      See Also:
    • logViewSizePref

      public static final String logViewSizePref
      The Constant logViewSizePref.
      See Also:
    • widthSuffix

      public static final String widthSuffix
      The Constant widthSuffix.
      See Also:
    • heightSuffix

      public static final String heightSuffix
      The Constant heightSuffix.
      See Also:
    • colorFilePref

      private static final String colorFilePref
      The Constant colorFilePref.
      See Also:
    • colorDirPref

      private static final String colorDirPref
      The Constant colorDirPref.
      See Also:
    • cpCurrentPref

      private static final String cpCurrentPref
      The Constant cpCurrentPref.
      See Also:
    • langCurrentPref

      private static final String langCurrentPref
      The Constant langCurrentPref.
      See Also:
    • langListPref

      private static final String langListPref
      The Constant langListPref.
      See Also:
    • textFileListPref

      private static final String textFileListPref
      The Constant textFileListPref.
      See Also:
    • descFileListPref

      private static final String descFileListPref
      The Constant descFileListPref.
      See Also:
    • dataPathPref

      private static final String dataPathPref
      The Constant dataPathPref.
      See Also:
    • textDimensionDefault

      private static final Dimension textDimensionDefault
      The Constant textDimensionDefault.
    • fsTreeDimensionDefault

      private static final Dimension fsTreeDimensionDefault
      The Constant fsTreeDimensionDefault.
    • logFileDimensionDefault

      private static final Dimension logFileDimensionDefault
      The Constant logFileDimensionDefault.
    • DEFAULT_STYLE_NAME

      public static final String DEFAULT_STYLE_NAME
      The Constant DEFAULT_STYLE_NAME.
      See Also:
    • styleMap

      private Map<String,Style> styleMap
      The style map.
    • maxRecentSize

      private static final int maxRecentSize
      The Constant maxRecentSize.
      See Also:
    • recentTextFiles

      private final RecentFilesList recentTextFiles
      The recent text files.
    • textFileNameList

      private final List<String> textFileNameList
      The text file name list.
    • recentDescFiles

      private final RecentFilesList recentDescFiles
      The recent desc files.
    • descFileNameList

      private final List<String> descFileNameList
      The desc file name list.
    • cursorOwningComponents

      private List<Component> cursorOwningComponents
      The cursor owning components.
    • cursorCache

      private List<Cursor> cursorCache
      The cursor cache.
    • dataPathName

      private String dataPathName
      The data path name.
    • sofaSelectionComboBox

      private JComboBox sofaSelectionComboBox
      The sofa selection combo box.
    • sofaSelectionPanel

      private JPanel sofaSelectionPanel
      The sofa selection panel.
    • exitOnClose

      private boolean exitOnClose
      The exit on close.
  • Constructor Details

    • MainFrame

      public MainFrame(File iniFile)
      Constructor for MainFrame.
      Parameters:
      iniFile - the ini file
      Throws:
      HeadlessException - -
  • Method Details

    • runAE

      public void runAE(boolean doCasReset)
      Run AE.
      Parameters:
      doCasReset - the do cas reset
    • runCPC

      public void runCPC()
      Run CPC.
    • setDataPath

      public void setDataPath(String dataPath)
      Sets the data path.
      Parameters:
      dataPath - the new data path
    • loadAEDescriptor

      public void loadAEDescriptor(File descriptorFile)
      Load AE descriptor.
      Parameters:
      descriptorFile - the descriptor file
    • handleException

      public void handleException(Throwable e)
      Handle exception.
      Parameters:
      e - the e
    • handleException

      protected void handleException(Throwable e, StringBuffer msg)
      Handle exception.
      Parameters:
      e - the e
      msg - the msg
    • showError

      private void showError(String msg)
      Show error.
      Parameters:
      msg - the msg
    • loadFile

      public void loadFile()
      Load file.
    • loadXmiFile

      public void loadXmiFile(File xmiCasFile)
      Load xmi file.
      Parameters:
      xmiCasFile - the xmi cas file
    • getMnemonic

      private static final int getMnemonic(int i)
      Gets the mnemonic.
      Parameters:
      i - the i
      Returns:
      the mnemonic
    • createRecentTextFileItem

      private final JMenuItem createRecentTextFileItem(int num, File file)
      Creates the recent text file item.
      Parameters:
      num - the num
      file - the file
      Returns:
      the j menu item
    • addRecentTextFile

      private void addRecentTextFile(File file)
      Adds the recent text file.
      Parameters:
      file - the file
    • createRecentDescFileItem

      private final JMenuItem createRecentDescFileItem(int num, File file)
      Creates the recent desc file item.
      Parameters:
      num - the num
      file - the file
      Returns:
      the j menu item
    • addRecentDescFile

      private void addRecentDescFile(File file)
      Adds the recent desc file.
      Parameters:
      file - the file
    • setText

      public void setText(String text)
      Set the text to be analyzed.
      Parameters:
      text - The text.
    • loadTextFile

      public void loadTextFile(File textFile1)
      Load a text file.
      Parameters:
      textFile1 - The text file.
    • setTextNoTitle

      public void setTextNoTitle(String text)
      Sets the text no title.
      Parameters:
      text - the new text no title
    • setTitle

      public void setTitle()
      Sets the title.
    • saveFile

      public boolean saveFile()
      Save file.
      Returns:
      true, if successful
    • confirmOverwrite

      public boolean confirmOverwrite(File f)
      Confirm overwrite.
      Parameters:
      f - the f
      Returns:
      true, if successful
    • createTextArea

      private void createTextArea()
      Creates the text area.
    • populateEditMenu

      private void populateEditMenu()
      Populate edit menu.
    • createEditActionMap

      private HashMap<Object,Action> createEditActionMap()
      Creates the edit action map.
      Returns:
      the hash map
    • createMenuBar

      private JMenuBar createMenuBar()
      Creates the menu bar.
      Returns:
      the j menu bar
    • createEditMenu

      private JMenu createEditMenu()
      Creates the edit menu.
      Returns:
      the j menu
    • createHelpMenu

      private JMenu createHelpMenu()
      Creates the help menu.
      Returns:
      the j menu
    • createFileMenu

      private void createFileMenu()
      Creates the file menu.
    • setEnableCasFileReadingAndWriting

      public final void setEnableCasFileReadingAndWriting()
      Sets the enable cas file reading and writing.
    • addCursorOwningComponent

      private final void addCursorOwningComponent(Component comp)
      Adds the cursor owning component.
      Parameters:
      comp - the comp
    • setWaitCursor

      private final void setWaitCursor()
      Sets the wait cursor.
    • resetCursor

      public final void resetCursor()
      Reset cursor.
    • createCodePages

      public void createCodePages()
      Creates the code pages.
    • resetTrees

      public void resetTrees()
      Reset trees.
    • createCPMenu

      private void createCPMenu()
      Creates the CP menu.
    • resetCPMenu

      public void resetCPMenu()
      Reset CP menu.
    • addLanguage

      public void addLanguage(String language1)
      Adds the language.
      Parameters:
      language1 - the language 1
    • createLangMenu

      private void createLangMenu()
      Creates the lang menu.
    • resetLangMenu

      public void resetLangMenu()
      Reset lang menu.
    • createLanguages

      public void createLanguages()
      Creates the languages.
    • createRunMenu

      private JMenu createRunMenu()
      Creates the run menu.
      Returns:
      the j menu
    • createToolsMenu

      private JMenu createToolsMenu()
      Creates the tools menu.
      Returns:
      the j menu
    • createStatusBar

      private void createStatusBar()
      Creates the status bar.
    • setCaretStatus

      public void setCaretStatus(int dot, int mark)
      Sets the caret status.
      Parameters:
      dot - the dot
      mark - the mark
    • setFileStatusMessage

      public void setFileStatusMessage()
      Sets the file status message.
    • setAEStatusMessage

      private void setAEStatusMessage()
      Sets the AE status message.
    • setStatusbarMessage

      public void setStatusbarMessage(String message)
      Sets the statusbar message.
      Parameters:
      message - the new statusbar message
    • initializeLogging

      private void initializeLogging()
      Initialize logging.
    • init

      private void init()
      Inits the.
    • initFileLists

      private final void initFileLists()
      Inits the file lists.
    • setupAE

      protected boolean setupAE(File aeFile)
      Setup AE.
      Parameters:
      aeFile - the ae file
      Returns:
      true, if successful
    • initCas

      private final void initCas()
      Inits the cas.
    • internalRunAE

      protected void internalRunAE(boolean doCasReset)
      Internal run AE.
      Parameters:
      doCasReset - the do cas reset
    • initIRTree

      private void initIRTree()
      Inits the IR tree.
    • initFSTree

      private void initFSTree()
      Inits the FS tree.
    • deleteFSTree

      private void deleteFSTree()
      Delete FS tree.
    • updateIndexTree

      public void updateIndexTree(boolean useCAS)
      Update index tree.
      Parameters:
      useCAS - the use CAS
    • updateFSTree

      public void updateFSTree(String indexName, FSIndex index1)
      Update FS tree.
      Parameters:
      indexName - the index name
      index1 - the index 1
    • getAnnotationsAtPos

      private ArrayList<FSNode> getAnnotationsAtPos(int pos, List<FSNode> annots)
      Gets the annotations at pos.
      Parameters:
      pos - the pos
      annots - the annots
      Returns:
      the annotations at pos
    • createTypeTree

      private DefaultMutableTreeNode createTypeTree(Type type, TypeSystem ts, String label, FSIndexRepository ir)
      Creates the type tree.
      Parameters:
      type - the type
      ts - the ts
      label - the label
      ir - the ir
      Returns:
      the default mutable tree node
    • loadProgramPreferences

      private void loadProgramPreferences() throws IOException
      Load program preferences.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • setPreferredSize

      public void setPreferredSize(JComponent comp, String propPrefix)
      Sets the preferred size.
      Parameters:
      comp - the comp
      propPrefix - the prop prefix
    • getDimension

      public Dimension getDimension(String propPrefix)
      Gets the dimension.
      Parameters:
      propPrefix - the prop prefix
      Returns:
      the dimension
    • stringListToString

      private static final String stringListToString(List<String> list)
      String list to string.
      Parameters:
      list - the list
      Returns:
      the string
    • stringToArrayList

      private static final List<String> stringToArrayList(String s)
      String to array list.
      Parameters:
      s - the s
      Returns:
      the list
    • saveProgramPreferences

      public void saveProgramPreferences() throws IOException
      Save program preferences.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • saveColorPreferences

      public void saveColorPreferences(File file) throws IOException
      Save color preferences.
      Parameters:
      file - the file
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • loadColorPreferences

      public void loadColorPreferences(File file) throws IOException
      Load color preferences.
      Parameters:
      file - the file
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • initKeyMap

      private void initKeyMap()
      Inits the key map.
    • showTextPopup

      public void showTextPopup(int x, int y)
      Show text popup.
      Parameters:
      x - the x
      y - the y
    • getIndexTree

      public JTree getIndexTree()
      Gets the index tree.
      Returns:
      the index tree
    • getFsTree

      public JTree getFsTree()
      Gets the fs tree.
      Returns:
      the fs tree
    • getTextArea

      public JTextArea getTextArea()
      Gets the text area.
      Returns:
      the text area
    • getCas

      public CAS getCas()
      Gets the cas.
      Returns:
      the cas
    • isDirty

      public boolean isDirty()
      Checks if is dirty.
      Returns:
      true, if is dirty
    • setDirty

      public void setDirty(boolean isDirty)
      Sets the dirty.
      Parameters:
      isDirty - the new dirty
    • getPreferences

      public Properties getPreferences()
      Gets the preferences.
      Returns:
      the preferences
    • getIndexLabel

      public String getIndexLabel()
      Gets the index label.
      Returns:
      the index label
    • getIndex

      public FSIndex getIndex()
      Gets the index.
      Returns:
      the index
    • getStyleMap

      public Map<String,Style> getStyleMap()
      Gets the style map.
      Returns:
      the style map
    • getAe

      public AnalysisEngine getAe()
      Gets the ae.
      Returns:
      the ae
    • setIndexLabel

      public void setIndexLabel(String indexLabel)
      Sets the index label.
      Parameters:
      indexLabel - the new index label
    • isAnnotationIndex

      public boolean isAnnotationIndex()
      Checks if is annotation index.
      Returns:
      true, if is annotation index
    • setAnnotationIndex

      public void setAnnotationIndex(boolean isAnnotationIndex)
      Sets the annotation index.
      Parameters:
      isAnnotationIndex - the new annotation index
    • setIndex

      public void setIndex(FSIndex index)
      Sets the index.
      Parameters:
      index - the new index
    • setAllAnnotationViewerItemEnable

      public void setAllAnnotationViewerItemEnable(boolean enabled)
      Sets the all annotation viewer item enable.
      Parameters:
      enabled - the new all annotation viewer item enable
    • getFileOpenDir

      public File getFileOpenDir()
      Gets the file open dir.
      Returns:
      the file open dir
    • setFileOpenDir

      public void setFileOpenDir(File fileOpenDir)
      Sets the file open dir.
      Parameters:
      fileOpenDir - the new file open dir
    • getTextFile

      public File getTextFile()
      Gets the text file.
      Returns:
      the text file
    • setTextFile

      public void setTextFile(File textFile)
      Sets the text file.
      Parameters:
      textFile - the new text file
    • setSaveTextFileEnable

      public void setSaveTextFileEnable(boolean enabled)
      Sets the save text file enable.
      Parameters:
      enabled - the new save text file enable
    • getUndoMgr

      public UndoMgr getUndoMgr()
      Gets the undo mgr.
      Returns:
      the undo mgr
    • setUndoEnabled

      public void setUndoEnabled(boolean enabled)
      Sets the undo enabled.
      Parameters:
      enabled - the new undo enabled
    • getXcasFileOpenDir

      public File getXcasFileOpenDir()
      Gets the xcas file open dir.
      Returns:
      the xcas file open dir
    • setXcasFileOpenDir

      public void setXcasFileOpenDir(File xcasFileOpenDir)
      Sets the xcas file open dir.
      Parameters:
      xcasFileOpenDir - the new xcas file open dir
    • setCas

      public void setCas(CAS cas)
      Sets the cas.
      Parameters:
      cas - the new cas
    • setRunOnCasEnabled

      public void setRunOnCasEnabled()
      Sets the run on cas enabled.
    • destroyAe

      public void destroyAe()
      Destroy ae.
    • setRerunEnabled

      public void setRerunEnabled(boolean enabled)
      Sets the rerun enabled.
      Parameters:
      enabled - the new rerun enabled
    • setTypeSystemViewerEnabled

      public void setTypeSystemViewerEnabled(boolean enabled)
      Sets the type system viewer enabled.
      Parameters:
      enabled - the new type system viewer enabled
    • getColorSettingsDir

      public File getColorSettingsDir()
      Gets the color settings dir.
      Returns:
      the color settings dir
    • setColorSettingsDir

      public void setColorSettingsDir(File colorSettingsDir)
      Sets the color settings dir.
      Parameters:
      colorSettingsDir - the new color settings dir
    • getColorSettingFile

      public File getColorSettingFile()
      Gets the color setting file.
      Returns:
      the color setting file
    • setColorSettingFile

      public void setColorSettingFile(File colorSettingFile)
      Sets the color setting file.
      Parameters:
      colorSettingFile - the new color setting file
    • getAnnotOpenDir

      public File getAnnotOpenDir()
      Gets the annot open dir.
      Returns:
      the annot open dir
    • setAnnotOpenDir

      public void setAnnotOpenDir(File annotOpenDir)
      Sets the annot open dir.
      Parameters:
      annotOpenDir - the new annot open dir
    • getDataPathName

      public String getDataPathName()
      Gets the data path name.
      Returns:
      the data path name
    • setDataPathName

      public void setDataPathName(String dataPathName)
      Sets the data path name.
      Parameters:
      dataPathName - the new data path name
    • getCodePage

      public String getCodePage()
      Gets the code page.
      Returns:
      the code page
    • setCodePage

      public void setCodePage(String codePage)
      Sets the code page.
      Parameters:
      codePage - the new code page
    • getCodePages

      public List<String> getCodePages()
      Gets the code pages.
      Returns:
      the code pages
    • getLanguage

      public String getLanguage()
      Gets the language.
      Returns:
      the language
    • setLanguage

      public void setLanguage(String language)
      Sets the language.
      Parameters:
      language - the new language
    • getLanguages

      public List<String> getLanguages()
      Gets the languages.
      Returns:
      the languages
    • getLanguagePrefsList

      public String getLanguagePrefsList()
      Gets the language prefs list.
      Returns:
      the language prefs list
    • setLanguagePrefsList

      public void setLanguagePrefsList(String languagePrefsList)
      Sets the language prefs list.
      Parameters:
      languagePrefsList - the new language prefs list
    • handleSofas

      public void handleSofas()
      Handle sofas.
    • isExitOnClose

      public boolean isExitOnClose()
      Checks if is exit on close.
      Returns:
      true, if is exit on close
    • setExitOnClose

      public void setExitOnClose(boolean exitOnClose)
      Set exit-on-close behavior. Normally, CVD will shut down the JVM it's running in when it's main window is being closed. Calling setExitOnClose(false) prevents that. It is then the caller's task to shut down the JVM.
      Parameters:
      exitOnClose - the new exit on close