Examples of SVGPanel


Examples of com.kitfox.svg.app.beans.SVGPanel

   }
  

  private SVGPanel configSVGIcon(String imageFile)
  {
        SVGPanel svgIcon;
        FileInputStream fis = null;
        try {
            fis = new FileInputStream(imageFile);
        } catch (Exception e) {
             System.out.println("File not found: " + imageFile);
             return null;
        }
        URI uri = SVGCache.getSVGUniverse().loadSVG(fis, imageFile);
        svgIcon = new SVGPanel();
        svgIcon.setAntiAlias(true);
        svgIcon.setSvgURI(uri);
        try {
            fis.close();
        } catch (Exception e) {
             System.out.println("File not found: " + imageFile);
        }
View Full Code Here

Examples of com.kitfox.svg.app.beans.SVGPanel

            BlockBox box,
            UserAgentCallback uac,
            int cssWidth,
            int cssHeight) {

        SVGPanel panel = new SVGPanel();
        String content = null;
        JComponent cc = null;
        try {
            Element elem = box.getElement();
            if (elem == null || ! isSVGEmbedded(elem)) {
                return null;
            }

            // HACK: the easiest way to integrate with Salamander is to have it read
            // our SVG from a file--so, push the content to a temporary file, yuck!
            content = getSVGElementContent(elem);

            String path = elem.getAttribute("data");
            XRLog.general(Level.FINE, "Rendering embedded SVG via object tag from: " + path);
            XRLog.general(Level.FINE, "Content is: " + content);
            panel.setAntiAlias(true);
            panel.setSvgResourcePath(path);

            int width = panel.getSVGWidth();
            int height = panel.getSVGHeight();

            if ( cssWidth > 0 ) width = cssWidth;

            if ( cssHeight > 0 ) height = cssHeight;

            String val = elem.getAttribute("width");
            if ( val != null && val.length() > 0 ) {
                width = Integer.valueOf(val).intValue();
            }
            val = elem.getAttribute("height");
            if ( val != null && val.length() > 0 ) {
                height = Integer.valueOf(val).intValue();
            }
            panel.setScaleToFit(true);
            panel.setPreferredSize(new Dimension(width, height));
            panel.setSize(panel.getPreferredSize());

            cc = panel;
        } catch (SVGException e) {
            XRLog.general(Level.WARNING, "Could not replace SVG element; rendering failed" +
                    " in SVG renderer. Skipping and using blank JPanel.", e);
View Full Code Here

Examples of com.kitfox.svg.app.beans.SVGPanel

            BlockBox box,
            UserAgentCallback uac,
            int cssWidth,
            int cssHeight) {

        SVGPanel panel = new SVGPanel();
        String content = null;
        JComponent cc = null;
        try {
            Element elem = box.getElement();
            if (elem == null || ! isSVGEmbedded(elem)) {
                return null;
            }

            // HACK: the easiest way to integrate with Salamander is to have it read
            // our SVG from a file--so, push the content to a temporary file, yuck!
            content = getSVGElementContent(elem);

            String path = elem.getAttribute("data");
            XRLog.general(Level.FINE, "Rendering embedded SVG via object tag from: " + path);
            XRLog.general(Level.FINE, "Content is: " + content);
            panel.setAntiAlias(true);
            panel.setSvgResourcePath(path);

            int width = panel.getSVGWidth();
            int height = panel.getSVGHeight();

            if ( cssWidth > 0 ) width = cssWidth;

            if ( cssHeight > 0 ) height = cssHeight;

            String val = elem.getAttribute("width");
            if ( val != null && val.length() > 0 ) {
                width = Integer.valueOf(val).intValue();
            }
            val = elem.getAttribute("height");
            if ( val != null && val.length() > 0 ) {
                height = Integer.valueOf(val).intValue();
            }
            panel.setScaleToFit(true);
            panel.setPreferredSize(new Dimension(width, height));
            panel.setSize(panel.getPreferredSize());

            cc = panel;
        } catch (SVGException e) {
            XRLog.general(Level.WARNING, "Could not replace SVG element; rendering failed" +
                    " in SVG renderer. Skipping and using blank JPanel.", e);
View Full Code Here

Examples of fr.dz.paint.panel.SvgPanel

    JFrame frame = new JFrame();
    SvgPlayer sp = new SvgPlayer();

    Balise b =sp.parse(f);
    JPanel panel = new SvgPanel(b);
    frame.getContentPane().add(panel);
    frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

    // on ajoute le texte "Hello, World!" dans la fen�tre
View Full Code Here

Examples of fr.dz.paint.panel.SvgPanel

        Balise b =SvgPlayer.getSvgPlayer().parse(f);
        //file=f;
       
        //mise en place du panel
        setLayout(new BorderLayout());
        SVGPanel = new SvgPanel(b);
        JScrollPane jspSvg= new JScrollPane(SVGPanel);
       
        LogPanel = new LogPanel(f.getCanonicalPath());
        //JScrollPane jspLog= new JScrollPane(LogPanel);
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.