HI, i was wondering if there is an equivalent to the emacscript commands
detailed following, within Batik Java:
var trans = document.documentElement.currentTranslate;
var scale = document.documentElement.currentScale;
I cannot seem to find them. I am programming drag routines for SVG
elements,
Works perfect now. Thanks.
I compiled the source from Batik 1.5, changing only the 6 files
mentioned in the patch, and made the Jar files with the Ant script.
Now all objects (SVG and PNG) respond to the DOWN, UP, DRAG, MOVE, OVER
and CLICK.
Thank you for the fast response and support.
Sorry to put you to work. Please post to the mailing list when you have
a solution or workaround for this situation, also if i can assist in any
way, i will be glad to try.
Andres.
Thomas DeWeese wrote:
Andres Toussaint wrote:
Hi Thomas, i appreciate your response.
I recreated a simplified
Thomas, thanks again, you have been very kind. I had not considered
SVGLocatable and SVGMatrix since they lack proper description it was not
clear what their function was.
I have succesfully accomplished the drag with getCurrentScale(), and
will try with the SVGMatrix, since it does seem like
OTECTED]
I have not added any patches or other modifications to the Batik code.
Thanks in advance,
Andres Toussaint
)
The class cast exception is happening in com.onemileup code which
is yours judging by your mail address.
Andres Toussaint wrote:
Hello all,
Previously I had a trouble with the mouseaction events on a
JSVGCanvas, that Thomas DeWeese was so kind to solve for us (covered
in the thread mousedrag
Hi All,
When I add two instances of the same image to my document via the image> , and add a actionListener to the group, only the first instance of the image> reacts to the actionEvents.
How can I have duplicate references to the same image inside my SVG, but that behave as individual instances
.
On Thursday, October 2, 2003, at 10:36 AM, Thomas DeWeese wrote:
Andres Toussaint wrote:
Hi All,
When I add two instances of the same image to my document via the
image , and add a actionListener to the group, only the first
instance of the image reacts to the actionEvents.
Hmm, are you sure
There is an opensource proyect i have been using a bit, for handling
WMF's, if it helps:
http://javametafile.sourceforge.net/
Hope this helps,
Andres.
On Wednesday, November 12, 2003, at 06:47 AM, Thomas DeWeese wrote:
Yoganarasimha G wrote:
Yeah, i know it's very lossy... and no idea at
Hi Kaushalya:
I have managed to do this using the graphics element of the parent that holds the JSVGCanvas item (in my case a Viewport object) I call the paint(), with the first item in the method beeing a paintChildren(), so the SVGCanvas gets painted, and then i draw the Graphics2D layer on top
pages.
Thanks in advance,
Andres Toussaint
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED
Hello:
I am interested to get some guideance in creating Java2D objects from my
JSVGCanvas SVGDocument. The purpose of this is to bridge it into a Java2D
to DXF (autoCad) converter that i am also working on.
Ultimately I think I would need to have a SVGtoDXFTranscoder, but i think
having a
anyway.
Peter
Andres Toussaint wrote:
Hello:
I am interested to get some guideance in creating Java2D objects from
my
JSVGCanvas SVGDocument. The purpose of this is to bridge it into a
Java2D
to DXF (autoCad) converter that i am also working on.
Ultimately I think I would need to have
ges are quite large (3500x1500 pts. average) and i do require to generate relatively accurate DXF output.
I would appreciate your help,
Andres Toussaint
PS. The method TextNode.getLocation() does not return an appropriate value (it returns 0,0), i think this may be a bug.
Hello:
I had a similar problem with the application i am building, since i use
large SVG´s and wanted to print them in tiles (for this i implemented a
new class i called TiledPrintTranscoder that extends
SVGAbstractTranscoder).
For your particular problem i would suggest the following:
Using
clipped in DXF?
Thanks,
Dave Neuendorf
Andres Toussaint wrote:
Hello:
I had a similar problem with the application i am building, since i
use large SVG´s and wanted to print them in tiles (for this i
implemented a new class i called TiledPrintTranscoder that extends
SVGAbstractTranscoder).
For your
Hi Mike:
That happened to me also, and it turned out that my original SVG file
was the source of the error. You have to specify the viewport with the
exact same dimensions as the width height attributes in your SVG
declaration:
svg width=1000 height =500 viewport=0 0 1000 500 .
...
/svg
Hi,
Since i had invested quite some time with this issue and have finally
done it, thanks to a wide variety of sources and help from other user´s
replies to the forums, i am submitting my solution to two options of
DnD situations.
DnD options:
1. ) from a JComponent, (like a JTree) into a
Hi Francesco:
I have found some possible situations:
First, on the svgCanvas.addSVGLoadEventDispatcherListener you are
calling registerListeners(), and in this method you are still calling
the onNewClickAction() method.
root.addEventListener( SVGConstants.SVG_MOUSEDOWN_EVENT_TYPE ,
Hi,
You need to read the GVT (Graphics vector tree).
The GVT holds the Java Graphics2D info of your SVG, so you can retrieve the coordinates in pairs, as you desire. To do so, you need to walk the GVT tree and extracting the data of the desired types.
Here is an excerpt on how to walk the GVT
Hi:
The way i did it is, i created a class called:
public class TiledPrintTranscoder extends SVGAbstractTranscoder
implements Printable { ... }
And on the printable implementation, i call the Print method, in which
i did a series of AffineTransforms similar to those you would do to
have a
Hi,
You should use definitely the JSVGScrollPane provided by Batik instead
of a ordinary Swing ScrollPane, in order to acurately display in the
scroll bars the extent of your document, specially since Batik does
allow you to zoom in or out, you need to translate that zoom level
Hello all:
I want to report what appears to be a bug in the SVGImageElementBridge
implementation. I have tried it with Batik release 1.5 and 1.5.1.
In a dynamic JSVGCanvas, on the UpdateManager thread, when i remove a
SVGOMImageElement (that represents an embedded SVG image, i.e.
Hi:
I found out that the AOI key is not implemented in the PrintTranscoder properly.
I made a solution, called TiledPrintTranscoder, which is descried in more detail in the thread (Batik users) named: x-tad-biggersvg to multipage tiff
Andres.
/x-tad-bigger
On Jun 16, 2004, at 5:24 AM, Bartosz
Hi:
Greetings to all the Batik Community.
I wanted to point out this Bug again, for it to be salvaged from
oblivion.
Regards,
Andres
Hello all:
I want to report what appears to be a bug in the SVGImageElementBridge
implementation. I have tried it with Batik release 1.5 and 1.5.1.
In a dynamic
Hi:
My suggestion is to read the Java Graphics 2D information you need from
the GVT tree.
Once you load a SVGDocument into a JSCGComponent (you do not need a
canvas to access the GVT), you can access the GVT by adding a
GVTTreeBuilderListener to your SVGComponent, in the gvtBuildCompleted
Hi Thomas:
Here is a sample application i made to analyze this situation, i do
hope it is useful.
// Start of SVGLeakTest.java
//
// SVGLeakTest.java
// Created By: Andres Toussaint
// Date: June 23, 2004
// Version 1.0
Hi:
What type of changes are you doing in the GVT component? Why not do the changes to the objects in the DOM and catch the UpdateManager to be sure the modifications are ready before saving.
I have to assume that you are doing Java2D modifications, beacuse if not, then i do not see the reason
how do you recover the actual visual coordinates of a rotated item in
the canvas?
When you click on the item, it gives you the coordinates as if the
object was not translated, i imagine to keep the hotspot active,
regardless of the transformation.
I need to get the actual translated (rotated)
How can i access the SVG Dom of a placed SVG as an image element?
Example:
svg contentScriptType=text/ecmascript width=3314 xmlns:xlink=http://www.w3.org/1999/xlink zoomAndPan=magnify contentStyleType=text/css viewBox=0 0 3314 1574 height=1574 preserveAspectRatio=xMidYMid meet
of a SVG and feeding it into the DXF converter. But basically it is a G2D to DXF, so it can be used for other applications, not only for SVG to DXF.
If anybody is interested, i can detail how I am recuperating the GVT Tree from my SVG, and how to parse it into DXF.
Andres Toussaint
One Mile Up, Inc
Hi Thomas:
This is exactly what i did.
I subclassed SVGImageElementBridge to get the SVG Document instead of a GVT Tree, if the image element is SVG content.
Since I assumed that the SVGImageElementBridge objects are volatile (could not figure out how to retrieve them once the GVT is built), i
Do we have any news on a future implementation of SMIL in Batik?
It would be a great feature if implemented.
Andres.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Hi:
We have developed, together with CadSoft tools (http://www.cadsofttools.com/) a G2D to DXF exporter that works fine with SVG to DXF (via SVG to G2D to DXF).
When your SVG is rendered in a SVGComponent, a GVTTree is built. That is, the SVG is converted into G2D objects, to be drawn into the
I have a SVGDocument to which i want to append a SVG element. The SVG
element is retrieved from a DB as SVG fragment in plain text (from a
MySQL TEXT field), something like this:
g id=toolbar
style=fill-rule:nonzero;clip-rule:nonzero;fill:#FFE95F;stroke:#00;
I am doing something similar. I have a WebObjects application in my
server, that uses Batik to build a properly built and encoded SVG file
from information stored in a DB (including JavaScripts) and it is then
served to the client, that in my case are both a Java Client App
running a Batik
Is each of your SVG tiles a separate JSVGCanvas?
Or are you loading your SVG Tiles as image> elements?
What is your output? A Java Swing window, a raster image, a web page?
On Jan 24, 2005, at 2:55 PM, Caron, Michael R wrote:
Hi all,
I'd like to open an SVG file to certain dimensions.
vas
svgThumbnail.setPreferredSize(new Dimension(ICON_HEIGHT, ICON_WIDTH));
borderedPanel.add(svgThumbnail);
// add the SVG
add(borderedPanel, BorderLayout.CENTER);
// add the status line
add(status, BorderLayout.SOUTH);
}
//...
Mike
From: And
In order to get an instance of the GVT Tree, you need to assign a
listener to a JSVGComponent, that will notify you when the GVT Tree is
built. At this stage, you can walk the tree until you find the
Component you are looking for.
As an example, look at the following code:
svg = new
Hi,
If you know with certainty the order of the definitions, you may use the following suggestion:
Instead of putting the diplay in def> elements, put them in svg> elements. By doing this, you have a unique placeholder for each in the GVT (a CanvasGraphicsNode is created for each embedded SVG
I want to know if there is any problem in adding my EventListeners to
specific Nodes before setting the document in the canvas.
I am building a SVGDocument programatically and then adding it to a
JSVGCanvas with svgCanvas.setDocument(). And i would like to initialize
my listeners during the
Thomas, thanks, this is a great simple approach. I will give it a try.
Just for the record, the approach solution indicated in the initial
question does work also, but of course it is not as simple.
Andres.
On Feb 14, 2005, at 10:59 AM, Thomas DeWeese wrote:
Andres Toussaint wrote:
My Main
Hi Tim,
Yes. you can parse XML and fetch either the BufferedImage, or the array of Graphics2D objects that represent the SVG.
Basically, you need to create a JSVGComponent (you do not need a JSVGCanvas since you are displaying in a AWT) and add the build and render listeners, so you are notified
Hi,
My own personal way of doing this would be to leave the drawing-rendering to Batik, and retrieve the BufferedImage it produces. To do so, you need a JSVGComponent (no need to add it into any container) to which you add a GVTRenderingListener and a UpdateListener. (see thread from feb.2005
Hi:
Please define what do you mean by overlay.
Is it a Swing paint() layer on top of your SVG JSVGCanvas? Or is it
another element of SVG on top of the first element?
For the dimensions of your SVG, the representation you see on screen is
a conversion of the units you indicate in your SVG Doc
Riis wrote:
Andres Toussaint wrote:
Hi:
Please define what do you mean by overlay.
Is it a Swing paint() layer on top of your SVG JSVGCanvas? Or is it another element of SVG on top of the first element?
I mean a Swing paint() layer
I have just noticed that the batik-users mail list Archive has stopped archiving as of Feb. 02, 2005, and also there is a VelocityServlet: Error processing the template when trying to access either the Jan 2005 of the View By Thread options.
I thought it pertinent to alert the community of this
The best option is to render the image in a JSVGComponent, and once it is available, encode it as a PNG.
The basic idea is to intercept the x-tad-biggergvtRenderingCompleted/x-tad-bigger event to recover the BufferedImage, and then encode this image to something your Cocoa App can handle, like a
something out.
Andres Toussaint
Bob Carpenter wrote:
I need to include some basic draw tools in our app - very much like Adobe's
SVG Draw demo. In fact, theirs would work perfect for our needs, but I
doubt they'd license it to us.
I need draw tools for two types of clients: Web (like Adobe's
Lasse:
Could you detail what it is you want to do with the overlays. I can
think of two uses for them:
1. Related to the SVG content. to draw Scale-unaware selection objects
(such as a bounding box, a resize or reshape indicator, etc.) or
elements that are not part of the drawing, such as
position, etc. Right?
How are the new positions will be calculated? By moving the indicators,
or by modifing the Zoom-pan of the map?
This is important to define the best approach.
Andres.
On Feb 28, 2005, at 10:38 AM, Lasse Riis wrote:
Andres Toussaint wrote:
Lasse:
Could you detail what it is you
My problem is that freehep only use a standard Graphics2D-enabled
component (i.e. JComponent) to be able to export. Batik, however, only
outputs images to it's custom JSVGCanvas, which is not directly
compatible with freehep.
You can Load your SVG into a JSVGComponent, and once the GVTTree is
I am not sure you are providing your rootGraphicsNode with the proper
Graphics object.
public void paint(Graphics g) {
this.g = (Graphics2D) g;
}
I don't think you need to override the paint() method in your class,
public void gvtBuildCompleted(GVTTreeBuilderEvent e) {
gvtTreeWalker =
Chandra:
Also, at what stage are you merging the files? Before loading them into
a org.w3c.dom.Document? Or you already have your SVGDocument objects
and want to insert one into the other?
If your problem is the second, this post may help you:
x-tad-smallerUse Document2.importNode(GroupNodeFromSVG1, true), to clone the first document
'under' the new document. Then just append the result where you
want it in the parent document.
In regards to stylesheets, it is your responsibility to make sure that both documents share a compatible
55 matches
Mail list logo