logo       

Re: Basic question on JSvgCanvas: msg#00052

Subject: Re: Basic question on JSvgCanvas
Randy, it *was* batik 1.1.1, I've unzipped batik 1.5b4, and it compiled.
Well, thanks you again
And by the way, I think you're an *expert*, because experts are those who
can find the solution
Cheers
Sergey Beryozkin
----- Original Message -----
From: "Baron, Randy {PRG~Basel}" <RANDY.BARON@xxxxxxxxx>
To: "Siarhei Biarozkin" <sberyozkin@xxxxxxxxxx>
Sent: Wednesday, December 11, 2002 6:13 PM
Subject: RE: Basic question on JSvgCanvas


Well, the only other thing I can think of is that maybe you're using
Batik 1.1.1 instead of Batik 1.5b4 -- I just checked the javadoc for
1.1.1 and see that SVGGraphics2D has only one method getRoot(), which
takes no parameter, whereas in 1.5b4 there are two getRoot methods, one
of which takes an Element parameter.

-Randy

-----Original Message-----
From: Siarhei Biarozkin [mailto:sberyozkin@xxxxxxxxxx]
Sent: Wednesday, December 11, 2002 6:57 PM
To: Batik Users
Subject: Re: Basic question on JSvgCanvas

Thanks Randy,
Unfortunately, for some reasons beyond my understanding, the line (2)
doesn't compile

Element root = doc.getDocumentElement(); (1)
g.getRoot(root); (2)

I really have no idea why the compilation fails, there's only one Batik
distribution on my system, I'm not using CLASSPATH at all, etc.
Has someone else seen something similar before ?
Cheers
Sergey Beryozkin


----- Original Message -----
From: "Baron, Randy {PRG~Basel}" <RANDY.BARON@xxxxxxxxx>
To: "Batik Users" <batik-users@xxxxxxxxxxxxxx>
Sent: Wednesday, December 11, 2002 5:17 PM
Subject: RE: Basic question on JSvgCanvas


Hm, I have to admit I'm not exactly an svg or java guru.  I just had
been reading the archives because I'm working on svg too and thought
that the article I mentioned to you might have helped.
   Otherwise, what about running the code
http://xml.apache.org/batik/svggen.html#view ?  It uses the same call.
I just tried it on my machine (after sticking inside a 'main' method)
and it ran without a problem; drew red,green and blue circles.  If it
doesn't work, maybe the problem is outside of your code somewhere.

-Randy



-----Original Message-----
From: Siarhei Biarozkin [mailto:sberyozkin@xxxxxxxxxx]
Sent: Wednesday, December 11, 2002 5:42 PM
To: Batik Users
Subject: Re: Basic question on JSvgCanvas

Hi Randy
Thanks for the help, that example is the one which I actually looked at
http://xml.apache.org/batik/svggen.html#view when building my code.
I think my code does follow the guidelines, the only missing step is the
one
where an SVGDocument's instance is populated with an svg dom ,
docSvg.getRoot(Element), because this method doesn't compile, any ideas
why
it doesn't ( please see below an error message) ?
I'll try to populate SvgDocument using
docSvg.importNode(SvgGraphics2D.getRoot()), may it will help.
Cheers
Sergey Beryozkin

P.S. Below is an message on SVGGraphics2D.getRoot(Element);
SVGGraphics2D.getRoot() compiles ok

com/zandar//SVGView.java [41] getRoot() in
org.apache.batik.svggen.SVGGraphics2D cannot be applied to
(org.w3c.dom.Element)
        Element gRoot = gSvg.getRoot(docSvg.getDocumentElement());
                            ^
1 error
build.xml [29] Compile failed, messages should have been provided.

----- Original Message -----
From: "Baron, Randy {PRG~Basel}" <RANDY.BARON@xxxxxxxxx>
To: "Batik Users" <batik-users@xxxxxxxxxxxxxx>
Sent: Wednesday, December 11, 2002 4:23 PM
Subject: RE: Basic question on JSvgCanvas


Hi Seregy,
   Maybe this thread from the archive is relevant to what you want?:

http://koala.ilog.fr/batik/mlists/batik-users/archives/msg01828.html

-Randy

-----Original Message-----
From: Siarhei Biarozkin [mailto:sberyozkin@xxxxxxxxxx]
Sent: Wednesday, December 11, 2002 4:29 PM
To: batik-users@xxxxxxxxxxxxxx
Subject: Basic question on JSvgCanvas

Hello
Apologies if the question has been answered before, I've found no
relevant
info in archives.
My basic question is how to make JSvgCanvas to show an svg content
generated
by SvgGraphics2D. I'm working at Windows XP, with JDK 1.4.1
Particularly, I'm using both classes the following way :
I've a subclass of JSvgCanvas, and here its fragment :

class SvgView extends JSvgCanvas {
   SVGGraphics2D gSvg;
   SVGDocument docSvg;

   public SvgView() {

      // initialize SVGGraphics2D, as shown at Batik's Generator page
      DOMImplementation impl =
SVGDOMImplementation.getDOMImplementation();
      docSvg = (SVGDocument)impl.createDocument
(SVGDOMImplementation.SVG_NAMESPACE_URI, "svg", null);
      gSvg = new SVGGraphics2D(docSvg);
   }

   public void paintComponent(Graphics g)  {
          // first, let application components draw themselves as usual
into
SVGGraphics2D
          activeComponent.draw(gSvg);

          Element root = docSvg.getDocumentElement();
          // the following line doesn't compile
          // getRoot() can't be applied to org.w3.dom.Element
          // looks like getRoot(Element) method doesn't exist ??
          gSvg.getRoot(root);

          setSVGDocument(docSvg);

          // finally, draw itself
          super.paintComponent(g);
    }
}


   }
}

The result is that Svg graphics is not drawn,


Can you please tell me what am I missing in the code ?
Thanks
Seregy Beryozkin


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xxxxxxxxxxxxxx
For additional commands, e-mail: batik-users-help@xxxxxxxxxxxxxx


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xxxxxxxxxxxxxx
For additional commands, e-mail: batik-users-help@xxxxxxxxxxxxxx





---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xxxxxxxxxxxxxx
For additional commands, e-mail: batik-users-help@xxxxxxxxxxxxxx


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xxxxxxxxxxxxxx
For additional commands, e-mail: batik-users-help@xxxxxxxxxxxxxx





---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xxxxxxxxxxxxxx
For additional commands, e-mail: batik-users-help@xxxxxxxxxxxxxx


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe