public SwtUniversalImageSvg( SvgImage svg ) { // get GraphicsNode and size from svg document UserAgentAdapter userAgentAdapter = new UserAgentAdapter(); DocumentLoader documentLoader = new DocumentLoader( userAgentAdapter ); BridgeContext ctx = new BridgeContext( userAgentAdapter, documentLoader ); GVTBuilder builder = new GVTBuilder(); svgGraphicsNode = builder.build( ctx, svg.getDocument() ); svgGraphicsSize = ctx.getDocumentSize(); }
public Main(File []files, Dimension size) { setBackground(Color.black); this.files = files; UserAgentAdapter ua = new UserAgentAdapter(); renderer = new StaticRenderer(); userAgent = ua; loader = new DocumentLoader(userAgent); ctx = new BridgeContext(userAgent, loader); ua.setBridgeContext(ctx);
/** * Returns the medium font size. */ public float getMediumFontSize() { // 9pt (72pt = 1in) return 9f * 25.4f / (72f * getPixelUnitToMillimeter()); }
/** * Should we prevent users from running scripts? If yes, then add it here. * * @param string * @param parsedURL * @param parsedURL1 * @return */ public ScriptSecurity getScriptSecurity( final String string, final ParsedURL parsedURL, final ParsedURL parsedURL1 ) { return super.getScriptSecurity( string, parsedURL, parsedURL1 ); } }
/** * Display the specified error (forwards call to displayError(String)) */ public void displayError(Exception e) { displayError(e.getMessage()); }
/** * Display the specified error message (forwards call to displayMessage). */ public void displayError(String message) { displayMessage(message); }
public Main(File []files, Dimension size) { setBackground(Color.black); this.files = files; UserAgentAdapter ua = new UserAgentAdapter(); renderer = new StaticRenderer(); userAgent = ua; loader = new DocumentLoader(userAgent); ctx = new BridgeContext(userAgent, loader); ua.setBridgeContext(ctx);
/** * Returns the medium font size. */ public float getMediumFontSize() { // 9pt (72pt = 1in) return 9f * 25.4f / (72f * getPixelUnitToMillimeter()); }
/** * This method throws a SecurityException if the script * of given type, found at url and referenced from docURL * should not be loaded. * * This is a convenience method to call checkLoadScript * on the ScriptSecurity strategy returned by * getScriptSecurity. * * @param scriptType type of script, as found in the * type attribute of the <script> element. * @param scriptURL url for the script, as defined in * the script's xlink:href attribute. If that * attribute was empty, then this parameter should * be null * @param docURL url for the document into which the * script was found. */ public void checkLoadScript(String scriptType, ParsedURL scriptURL, ParsedURL docURL) throws SecurityException { ScriptSecurity s = getScriptSecurity(scriptType, scriptURL, docURL); if (s != null) { s.checkLoadScript(); } }
/** * Display the specified error (forwards call to displayError(String)) */ public void displayError(Exception e) { displayError(e.getMessage()); }
/** * Display the specified error message (forwards call to displayMessage). */ public void displayError(String message) { displayMessage(message); }
public SwingUniversalImageSvg( SvgImage svg ) { // get GraphicsNode and size from svg document UserAgentAdapter userAgentAdapter = new UserAgentAdapter(); DocumentLoader documentLoader = new DocumentLoader( userAgentAdapter ); BridgeContext ctx = new BridgeContext( userAgentAdapter, documentLoader ); GVTBuilder builder = new GVTBuilder(); svgGraphicsNode = builder.build( ctx, svg.getDocument() ); svgGraphicsSize = ctx.getDocumentSize(); }
public Main(File []files, Dimension size) { setBackground(Color.black); this.files = files; UserAgentAdapter ua = new UserAgentAdapter(); renderer = new StaticRenderer(); userAgent = ua; loader = new DocumentLoader(userAgent); ctx = new BridgeContext(userAgent, loader); ua.setBridgeContext(ctx);
/** * Returns the size of a px CSS unit in millimeters. * This will be removed after next release. * @see #getPixelUnitToMillimeter() */ public float getPixelToMM() { return getPixelUnitToMillimeter(); }
/** * This method throws a SecurityException if the script * of given type, found at url and referenced from docURL * should not be loaded. * * This is a convenience method to call checkLoadScript * on the ScriptSecurity strategy returned by * getScriptSecurity. * * @param scriptType type of script, as found in the * type attribute of the <script> element. * @param scriptURL url for the script, as defined in * the script's xlink:href attribute. If that * attribute was empty, then this parameter should * be null * @param docURL url for the document into which the * script was found. */ public void checkLoadScript(String scriptType, ParsedURL scriptURL, ParsedURL docURL) throws SecurityException { ScriptSecurity s = getScriptSecurity(scriptType, scriptURL, docURL); if (s != null) { s.checkLoadScript(); } }
/** * Display the specified error (forwards call to displayError(String)) */ public void displayError(Exception e) { displayError(e.getMessage()); }
/** * Display the specified error message (forwards call to displayMessage). */ public void displayError(String message) { displayMessage(message); }
/** * Retrieves a Batik {@link GraphicsNode} for a given SVG. * * @param svgLocation an URL that specifies the SVG. * @return the corresponding GraphicsNode. * @throws IOException * @throws URISyntaxException */ GraphicsNode getGraphicNode(Document doc) { // instantiates objects needed for building the node UserAgent userAgent = new UserAgentAdapter(); DocumentLoader loader = new DocumentLoader(userAgent); BridgeContext ctx = new BridgeContext(userAgent, loader); ctx.setDynamic(true); // creates node builder and builds node GVTBuilder builder = new GVTBuilder(); return builder.build(ctx, doc); }
/** * Returns the size of a px CSS unit in millimeters. * This will be removed after next release. * @see #getPixelUnitToMillimeter() */ public float getPixelToMM() { return getPixelUnitToMillimeter(); }
/** * This method throws a SecurityException if the script * of given type, found at url and referenced from docURL * should not be loaded. * * This is a convenience method to call checkLoadScript * on the ScriptSecurity strategy returned by * getScriptSecurity. * * @param scriptType type of script, as found in the * type attribute of the <script> element. * @param scriptURL url for the script, as defined in * the script's xlink:href attribute. If that * attribute was empty, then this parameter should * be null * @param docURL url for the document into which the * script was found. */ public void checkLoadScript(String scriptType, ParsedURL scriptURL, ParsedURL docURL) throws SecurityException { ScriptSecurity s = getScriptSecurity(scriptType, scriptURL, docURL); if (s != null) { s.checkLoadScript(); } }