Class AnnotationViewerDialog

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

public class AnnotationViewerDialog extends JDialog implements ActionListener
Dialog that loads analyzed documents stored in XMI or XCAS format and allows them to be viewed using the Java-based CAS viewer or a web browser, in either an HTML/Javascript format or in the inline XML format.
See Also:
  • Field Details

  • Constructor Details

    • AnnotationViewerDialog

      public AnnotationViewerDialog(JFrame aParentFrame, String aDialogTitle, PrefsMediator med, File aStyleMapFile, String aPerformanceStats, TypeSystem aTypeSystem, String[] aTypesToDisplay, String interactiveTempFN, boolean javaViewerRBisSelected, boolean javaViewerUCRBisSelected, boolean xmlRBisSelected, CAS cas)
      Create an AnnotationViewer Dialog
      Parameters:
      aParentFrame - frame containing this panel
      aDialogTitle - title to display for the dialog
      med -
      aStyleMapFile - filename of style map to be used to view files in HTML
      aPerformanceStats - string representaiton of performance statistics, optional.
      aTypeSystem - the CAS Type System to which the XCAS files must conform.
      aTypesToDisplay - array of types that should be highlighted in the viewer. This can be set to the output types of the Analysis Engine. A value of null means to display all types.
      interactiveTempFN -
      javaViewerRBisSelected -
      javaViewerUCRBisSelected -
      xmlRBisSelected -
      cas -
    • AnnotationViewerDialog

      public AnnotationViewerDialog(JFrame aParentFrame, String aDialogTitle, PrefsMediator med, File aStyleMapFile, String aPerformanceStats, TypeSystem aTypeSystem, String[] aTypesToDisplay, boolean generatedStyleMap, CAS cas)
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent arg0)
      Specified by:
      actionPerformed in interface ActionListener
    • getDefaultCasViewName

      public String getDefaultCasViewName()
      Gets the name of the CAS View that will be displayed first in the annotation viewer.
    • setDefaultCasViewName

      public void setDefaultCasViewName(String defaultCasViewName)
      Sets the name of the CAS View that will be displayed first in the annotation viewer. It not set, defaults to CAS.NAME_DEFAULT_SOFA.
    • launchThatViewer

      public void launchThatViewer(String inputDirPath, String fileName, TypeSystem typeSystem, String[] aTypesToDisplay, boolean javaViewerRBisSelected, boolean javaViewerUCRBisSelected, boolean xmlRBisSelected, File styleMapFile, File viewerDirectory)
    • getTextValue

      public static String getTextValue(Node node)
      Assumes node has a text field and extracts its value. JMP
    • getFirstChildByName

      public static Node getFirstChildByName(Node node, String name)
      Gets the first child with a given name. JMP
    • getColorsForTypesFromFile

      public void getColorsForTypesFromFile(CasAnnotationViewer viewer, File aStyleMapFile)
      Reads in annotation-color associations from stylemap file. JMP Also reads checked value if present.
    • displayError

      public void displayError(String aErrorString)
      Displays an error message to the user.
      Parameters:
      aErrorString - error message to display
    • displayError

      public void displayError(Throwable aThrowable)
      Displays an error message to the user.
      Parameters:
      aThrowable - Throwable whose message is to be displayed.
    • promptForAE

      If the current AE filename is not know ask for it. Then parse the selected file and return the AnalysisEngineDescription object.
      Returns:
      the selected AnalysisEngineDescription, null if the user cancelled
      Throws:
      IOException
      InvalidXMLException
      ResourceInitializationException