You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by Elvena Fong <ef...@sabiosciences.com> on 2009/12/17 16:33:01 UTC

Batik & Eclipse Beginner

Apologies to anyone if I'm asking a question that's already been asked
before.  I've been trying to search through the archives, but not having
much luck.  

 

I am relatively new to both Batik and Eclipse.  I recently installed Eclipse
to try to use Batik.  I am also a beginner-level Java programmer.  Batik's
the first 3rd party library I've tried to use, so I also have some
theoretical questions about the best way to use Batik.  

 

 

 

Now, I am able to add the Batik .jar libraries to Eclipse, make a test
program, and get it to compile.   But if I try to use the source files (all
the files under the "sources/" folder) instead to compile, I cannot because
there're at least several other libraries for which I'm missing the source
code.  Are the source files purely for reference only?  They are not
supposed to be used for compiling?  Or is there something I'm doing wrongly?
How are most people using Batik?

 

 

 

This also brings me to my next question.  When working with a library as
large as Batik, is it generally better to edit the source files directly and
then compile them, or is it the preferred way to extend existing classes?  I
ask because I am running into situations where I want to add features to a
class that might be used by many other classes, but I don't want to go
through and extend all those other classes to make sure that they use my
modified class instead.  Since that might sound a bit confusing, let me put
forward a theoretical example:

 

Suppose there is a class Graph, which uses a class Rectangle, which uses a
class Edge.  The class Graph also has access to the Edge class to make
lines.  Now, let's say I made a new class, called MyEdge, which extends
class Edge.  I want both Graph and Rectangle to use this new class instead.
Is there a way to do it without having to make new classes called MyGraph
and MyRectangle to reference the new class?  

 

Sorry if my question might not be really appropriate, but I'm just wondering
since I've been looking at the JSVCanvas class in Batik, and as right now I
cannot seem to get the source files to compile and am instead relying on the
.jar library files, I'm trying to think of how I could extend classes used
by that class without having to extend everything in between.  If there's
also another resource to which I could turn that might better answer this
question, please let me know.  

 

 

 

Thanks in advance for your time.  

 

Sincerely,

Elvena


Re: Batik & Eclipse Beginner

Posted by Helder Magalhães <he...@gmail.com>.
Hi Elvena,


Sorry for late reply... ;-)


> I am relatively new to both Batik and Eclipse.  I recently installed Eclipse
> to try to use Batik.  I am also a beginner-level Java programmer.  Batik’s
> the first 3rd party library I’ve tried to use, so I also have some
> theoretical questions about the best way to use Batik.

Welcome to the community! :-)


> Now, I am able to add the Batik .jar libraries to Eclipse, make a test
> program, and get it to compile.   But if I try to use the source files (all
> the files under the “sources/” folder) instead to compile, I cannot because
> there’re at least several other libraries for which I’m missing the source
> code.  Are the source files purely for reference only?  They are not
> supposed to be used for compiling?  Or is there something I’m doing wrongly?
>  How are most people using Batik?

The "standard" way of building Batik is though it's build
infrastructure (based in Apache Ant). Take a look at the
"build.bat/build.sh" scripts and the "build.xml", which will probably
be a good start-up. :-)

Nevertheless, I recall threads in the mailing list about people using
Eclipse as IDE to work on/integrate with Batik. Just crawl through the
archives and you'll probably find out interesting information. ;-)


> This also brings me to my next question.  When working with a library as
> large as Batik, is it generally better to edit the source files directly and
> then compile them, or is it the preferred way to extend existing classes?

Well, the "Extending Batik" [1] page should provide enough information
on this. Said that, if you come up with things you believe to be
interesting to improve/add to the framework, then sharing them with
the mailing list/bug tracker can benefit the whole community! :-)


> Thanks in advance for your time.
>
> Sincerely,
>
> Elvena

Hope this helps,
 Helder


[1] http://xmlgraphics.apache.org/batik/using/extending.html

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org