/** * Renders an XML Document instance. * Make sure that no relative resources are needed * * @param doc The document to render. */ public void setDocument(Document doc) { setDocument(doc, ""); }
/** * Set the document to be rendered, lays it out, and * renders it. * * @param url the URL for the document to render. */ public void setDocument(String url) { panel.setDocument(url); }
/** * Set the document to be rendered, lays it out, and * renders it. * * @param url the URL for the document to render. */ public void setDocument(String url) { panel.setDocument(url); }
/** * Sets the document to render, lays it out, and renders it. * * @param doc the Document to render * @param base_url base URL for relative links within the Document. */ public void setDocument(Document doc, String base_url) { panel.setDocument(doc, base_url); }
/** * Sets the document to render, lays it out, and renders it. * * @param doc the Document to render * @param base_url base URL for relative links within the Document. */ public void setDocument(Document doc, String base_url) { panel.setDocument(doc, base_url); }
/** * Renders an XML Document instance. * Make sure that no relative resources are needed * * @param doc The document to render. */ public void setDocument(Document doc) { setDocument(doc, ""); }
/** * Loads and renders a Document given a uri. * The uri is resolved by the UserAgentCallback * * @param uri */ public void setDocument(String uri) { setDocument(loadDocument(uri), uri); }
/** * Renders a Document using a URL as a base URL for relative * paths. * * @param doc The new document value * @param url The new document value */ public void setDocument(Document doc, String url) { resetScaleAccordingToPolicy(); lastLayoutSize = null; super.setDocument(doc, url); }
/** * Renders a Document using a URL as a base URL for relative * paths. * * @param doc The new document value * @param url The new document value */ public void setDocument(Document doc, String url) { resetScaleAccordingToPolicy(); lastLayoutSize = null; super.setDocument(doc, url); }
/** * Renders a Document read from an InputStream using a URL * as a base URL for relative paths. * * @param stream The stream to read the Document from. * @param url The URL used to resolve relative path references. */ public void setDocument(InputStream stream, String url) throws Exception { resetScaleAccordingToPolicy(); lastLayoutSize = null; super.setDocument(stream, url); }
/** * Loads and renders a Document given a uri. * The uri is resolved by the UserAgentCallback * * @param uri */ public void setDocument(String uri) { setDocument(loadDocument(uri), uri); }
/** * Renders a Document read from an InputStream using a URL * as a base URL for relative paths. * * @param stream The stream to read the Document from. * @param url The URL used to resolve relative path references. */ public void setDocument(InputStream stream, String url) throws Exception { resetScaleAccordingToPolicy(); lastLayoutSize = null; super.setDocument(stream, url); }
XHTMLPanel panel = new XHTMLPanel(); panel.setDocument("http://www.google.com");
/** * Renders a Document using a URL as a base URL for relative * paths. * * @param doc The new document value * @param url The new document value */ public void setDocument(Document doc, String url) { resetListeners(); setDocument(doc, url, new XhtmlNamespaceHandler()); }
/** * Renders a Document read from an InputStream using a URL * as a base URL for relative paths. * * @param stream The stream to read the Document from. * @param url The URL used to resolve relative path references. */ // TODO: should throw more specific exception (PWW 25/07/2006) public void setDocument(InputStream stream, String url) throws Exception { resetListeners(); setDocument(stream, url, new XhtmlNamespaceHandler()); }
/** * Resets all rendered fonts on the current document to the font size * specified in the document's styling instructions. */ public void resetFontSize() { SharedContext rc = getSharedContext(); rc.getTextRenderer().setFontScale(1.0F); setDocument(getDocument()); }
/** * Resets all rendered fonts on the current document to the font size * specified in the document's styling instructions. */ public void resetFontSize() { SharedContext rc = getSharedContext(); rc.getTextRenderer().setFontScale(1.0F); setDocument(getDocument()); }
public void init() throws Exception { Container contentPane = this.getContentPane(); XHTMLPanel panel = new XHTMLPanel(); panel.getSharedContext().getTextRenderer().setSmoothingThreshold(0); // Anti-aliasing for all font sizes panel.setDocument(new File("c:\\Temp\\MyExperiment\\T2 BioCatalogue Plugin\\BioCatalogue Plugin\\resources\\test.html")); FSScrollPane scroll = new FSScrollPane(panel); contentPane.add(scroll); this.setTitle("XHTML rendered test"); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.pack(); this.setSize(1024, 768); }
/** * Applies a change in scale for fonts using the rendering context's text * renderer. */ private void scaleFont(float scaleBy) { SharedContext rc = getSharedContext(); float fs = rc.getTextRenderer().getFontScale() * scaleBy; if (fs < minFontScale || fs > maxFontScale) return; rc.getTextRenderer().setFontScale(fs); setDocument(getDocument()); }
/** * Applies a change in scale for fonts using the rendering context's text * renderer. */ private void scaleFont(float scaleBy) { SharedContext rc = getSharedContext(); float fs = rc.getTextRenderer().getFontScale() * scaleBy; if (fs < minFontScale || fs > maxFontScale) return; rc.getTextRenderer().setFontScale(fs); setDocument(getDocument()); }