Search in sources :

Example 1 with XMLWindow

use of loci.formats.gui.XMLWindow in project bioformats by openmicroscopy.

the class DisplayHandler method displayOMEXML.

/**
 * Displays OME-XML metadata in a tree in its own window.
 */
public XMLWindow displayOMEXML() throws FormatException, IOException {
    if (!options.isShowOMEXML())
        return null;
    XMLWindow metaWindow = null;
    metaWindow = new XMLWindow("OME Metadata - " + process.getIdName());
    Exception exc = null;
    try {
        ServiceFactory factory = new ServiceFactory();
        OMEXMLService service = factory.getInstance(OMEXMLService.class);
        metaWindow.setXML(service.getOMEXML(process.getOMEMetadata()));
        WindowTools.placeWindow(metaWindow);
        metaWindow.setVisible(true);
    } catch (DependencyException e) {
        exc = e;
    } catch (ServiceException e) {
        exc = e;
    } catch (ParserConfigurationException e) {
        exc = e;
    } catch (SAXException e) {
        exc = e;
    }
    if (exc != null)
        throw new FormatException(exc);
    // save reference to OME-XML window
    xmlWindow = metaWindow;
    return metaWindow;
}
Also used : ServiceException(loci.common.services.ServiceException) ServiceFactory(loci.common.services.ServiceFactory) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) XMLWindow(loci.formats.gui.XMLWindow) DependencyException(loci.common.services.DependencyException) ServiceException(loci.common.services.ServiceException) DependencyException(loci.common.services.DependencyException) FormatException(loci.formats.FormatException) IOException(java.io.IOException) InvocationTargetException(java.lang.reflect.InvocationTargetException) ReflectException(loci.common.ReflectException) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) SAXException(org.xml.sax.SAXException) OMEXMLService(loci.formats.services.OMEXMLService) FormatException(loci.formats.FormatException) SAXException(org.xml.sax.SAXException)

Aggregations

IOException (java.io.IOException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)1 ReflectException (loci.common.ReflectException)1 DependencyException (loci.common.services.DependencyException)1 ServiceException (loci.common.services.ServiceException)1 ServiceFactory (loci.common.services.ServiceFactory)1 FormatException (loci.formats.FormatException)1 XMLWindow (loci.formats.gui.XMLWindow)1 OMEXMLService (loci.formats.services.OMEXMLService)1 SAXException (org.xml.sax.SAXException)1