public ParseErrorsPanel(UnparsableOntologyException e, final URI loc) { setLayout(new BorderLayout(12, 12)); tabs = new JTabbedPane(); tabs.setPreferredSize(new Dimension(700, 500)); final java.util.List<OWLParser> parsers = new ArrayList<>(e.getExceptions().keySet()); int counter = 1; for (OWLParser parser : parsers){ Throwable parseError = e.getExceptions().get(parser); ErrorExplainer.ErrorExplanation<? extends Throwable> explanation = errorExplainer.getErrorExplanation(parseError, true); final ErrorPanel<? extends Throwable> errorPanel = new ParseErrorPanel<>(explanation, loc); OWLDocumentFormatFactory supportedFormatFactory = parser.getSupportedFormat(); OWLDocumentFormat documentFormat = supportedFormatFactory.get(); tabs.addTab("(" + counter + ") " + documentFormat.getKey(), errorPanel); counter++; } add(new JLabel("<html>Could not parse the ontology found at: " + loc + "<p>The following formats were tried:</html>"), BorderLayout.NORTH); add(tabs, BorderLayout.CENTER); } }
public ParseErrorsPanel(UnparsableOntologyException e, final URI loc) { setLayout(new BorderLayout(12, 12)); tabs = new JTabbedPane(); tabs.setPreferredSize(new Dimension(700, 500)); final java.util.List<OWLParser> parsers = new ArrayList<>(e.getExceptions().keySet()); int counter = 1; for (OWLParser parser : parsers){ Throwable parseError = e.getExceptions().get(parser); ErrorExplainer.ErrorExplanation<? extends Throwable> explanation = errorExplainer.getErrorExplanation(parseError, true); final ErrorPanel<? extends Throwable> errorPanel = new ParseErrorPanel<>(explanation, loc); OWLDocumentFormatFactory supportedFormatFactory = parser.getSupportedFormat(); OWLDocumentFormat documentFormat = supportedFormatFactory.get(); tabs.addTab("(" + counter + ") " + documentFormat.getKey(), errorPanel); counter++; } add(new JLabel("<html>Could not parse the ontology found at: " + loc + "<p>The following formats were tried:</html>"), BorderLayout.NORTH); add(tabs, BorderLayout.CENTER); } }