public void run() { int estimatedTextSize = estimateRenderedTextLength(activeOntology); TextAreaWriter textAreaWriter = new TextAreaWriter(this, textArea, estimatedTextSize); Writer w = new BufferedWriter(textAreaWriter); try { renderOntology(activeOntology, w); w.close(); } catch (InterruptedIOException ioe) { // ignore } catch (Exception e) { logger.error("error rendering ontology", e); } finally { synchronized (textArea) { try { SwingUtilities.invokeAndWait(() -> { textArea.setCursor(oldCursor); logger.debug("set text done"); }); } catch (InterruptedException | InvocationTargetException e) { // ignore } renderThread = null; } } } };
public void run() { int estimatedTextSize = estimateRenderedTextLength(activeOntology); TextAreaWriter textAreaWriter = new TextAreaWriter(this, textArea, estimatedTextSize); Writer w = new BufferedWriter(textAreaWriter); try { renderOntology(activeOntology, w); w.close(); } catch (InterruptedIOException ioe) { // ignore } catch (Exception e) { logger.error("error rendering ontology", e); } finally { synchronized (textArea) { try { SwingUtilities.invokeAndWait(() -> { textArea.setCursor(oldCursor); logger.debug("set text done"); }); } catch (InterruptedException | InvocationTargetException e) { // ignore } renderThread = null; } } } };