| Author | DaveJarvis <email> |
|---|---|
| Date | 2021-11-06 16:32:07 GMT-0700 |
| Commit | 27e9fcb35347b4c73d8575385925b581e8d80005 |
| Parent | ec5a935 |
| Delta | 8 lines added, 9 lines removed, 1-line decrease |
| import javafx.beans.property.BooleanProperty; | ||
| import javafx.beans.property.SimpleBooleanProperty; | ||
| +import org.w3c.dom.Document; | ||
| import org.xhtmlrenderer.layout.SharedContext; | ||
| import org.xhtmlrenderer.render.Box; | ||
| import static java.lang.Boolean.FALSE; | ||
| import static java.lang.Boolean.TRUE; | ||
| -import static javax.swing.SwingUtilities.invokeLater; | ||
| /** | ||
| * @param baseUri URI to use for finding relative files, such as images. | ||
| */ | ||
| - void render( final org.w3c.dom.Document doc, final String baseUri ) { | ||
| - invokeLater( () -> setDocument( doc, baseUri, XNH ) ); | ||
| + void render( final Document doc, final String baseUri ) { | ||
| + setDocument( doc, baseUri, XNH ); | ||
| } | ||
| */ | ||
| public void render( final String html ) { | ||
| - final var soup = parse( decorate( html ) ); | ||
| - final var doc = CONVERTER.fromJsoup( soup ); | ||
| + final var doc = CONVERTER.fromJsoup( parse( decorate( html ) ) ); | ||
| doc.setDocumentURI( getBaseUri() ); | ||
| invokeLater( () -> mPreview.render( doc, getBaseUri() ) ); | ||
| - fireDocumentChangedEvent(html); | ||
| + fireDocumentChangedEvent( html ); | ||
| } | ||
| @Override | ||
| - public void componentMoved( final ComponentEvent e ) { } | ||
| + public void componentMoved( final ComponentEvent e ) {} | ||
| @Override | ||
| - public void componentShown( final ComponentEvent e ) { } | ||
| + public void componentShown( final ComponentEvent e ) {} | ||
| @Override | ||
| - public void componentHidden( final ComponentEvent e ) { } | ||
| + public void componentHidden( final ComponentEvent e ) {} | ||
| private static String toStylesheetString( final URL url ) { | ||