You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by tavolate <Ag...@external.thalesaleniaspace.com> on 2007/12/06 17:48:17 UTC

GVT Builder problem

Hi,
 is it possible to create a GraphicsNode from an Element of a SVG Document?

Ex:

  
  UserAgentAdapter mUserAgent = new UserAgentAdapter();  
  BridgeContext mCtx = new BridgeContext(mUserAgent);     
  mCtx.setDynamicState(BridgeContext.DYNAMIC);
  GVTBuilder mBuilder = new DynamicGVTBuilder();

  GraphicsNode mGVTElement = mBuilder.build(mCtx, element);


element is a part of SVG document for example a rect tag (I can get it with
document.getElementByTagName(...)).


Thank you
   aGO!
-- 
View this message in context: http://www.nabble.com/GVT-Builder-problem-tf4957114.html#a14195869
Sent from the Batik - Users mailing list archive at Nabble.com.


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


Re: GVT Builder problem

Posted by tavolate <Ag...@external.thalesaleniaspace.com>.
I' have written a software to edit some special SVG file. To do that I used
the GED framework and Batik. My idea was to draw over the figure the image
created by Batik graphicnode. In this way I could use all helps given by
GED. For redimension and other effect I had to modify the Element and then
ask Batik the new Image.


Zenobios wrote:
> 
> Hi,
> 
> thx, I found this out just a few minutes ago :). I'm interested in what
> you were trying to do by creating Figures for the different elements. I'm
> trying to just draw SVG Images in Inkscape (e.g.) and then automatically
> generate appropriate figures, which have a special behaviour while
> resizing them, i.e. I don't have an uniform scaling but some elements grow
> other than the others.
> 
> Zenobios
> 
> 
> tavolate wrote:
>> 
>> HI, I use this code to init the SVGDom
>>    
>>    UserAgentAdapter mUserAgent = new UserAgentAdapter(); 
>>    BridgeContext mCtx = new BridgeContext(mUserAgent); 
>>    mCtx.setDynamicState(BridgeContext.DYNAMIC);
>>    GVTBuilder mBuilder = new DynamicGVTBuilder();
>>  
>>    GraphicsNode mGVTElement = mBuilder.build(mCtx, mDocument);
>>    
>> 
>> (mDocument id the root of the dom org.w3c.dom.Document)
>> 
>> and to get the GraphicsNode I use:
>> 
>>    mCtx.getGraphicsNode(pElement);
>> 
>> (Element is a org.w3c.dom.Element)
>> 
>> I hope this can help you!
>> 
>> Ciao
>> 
>> aGO!
>> 
>> 
>> 
>> Zenobios wrote:
>>> 
>>> Hi,
>>> 
>>> sorry for pushing this old thread. But I want to do exactly the same and
>>> I have exactly the same problem: After build(ctx,element) the returned
>>> GraphicsNode is null...
>>> 
>>> Any suggestions?
>>> 
>>> Cheers,
>>> Zenobios
>>> 
>>> 
>>> tavolate wrote:
>>>> 
>>>> I'm trying to do an SVG Editor with Batik and Eclipse.
>>>> I use the Batik DOM to manage the SVG file and after some process I
>>>> draw the SVG elements as image inside a Figure (Draw2d). For each child
>>>> node (text, rect, g..) inside the SVG DOM I would like to make a
>>>> GraphicsNode. So when I modify for example x and y coordinates with my
>>>> editor, I have to modify x and y coordinates of node and then redraw
>>>> it.
>>>> 
>>>> With the code below, mGVTElement after the build is NULL.
>>>> 
>>>> 
>>>> thomas.deweese wrote:
>>>>> 
>>>>> Hi aGO,
>>>>> 
>>>>> tavolate <Ag...@external.thalesaleniaspace.com> wrote on 
>>>>> 12/06/2007 11:48:17 AM:
>>>>> 
>>>>>>  is it possible to create a GraphicsNode from an Element of a SVG 
>>>>> Document?
>>>>> 
>>>>>      Yes, you have more or less shown the code below.
>>>>> The code below can't work in all cases (in particular the
>>>>> fact that you have set the context dynamic seems like trouble).
>>>>> So what are you trying to do in a wider sense?
>>>>> 
>>>>>      Or what problems are you having with the code 
>>>>> below? 
>>>>> 
>>>>>> Ex:
>>>>>> 
>>>>>>   UserAgentAdapter mUserAgent = new UserAgentAdapter(); 
>>>>>>   BridgeContext mCtx = new BridgeContext(mUserAgent); 
>>>>>>   mCtx.setDynamicState(BridgeContext.DYNAMIC);
>>>>>>   GVTBuilder mBuilder = new DynamicGVTBuilder();
>>>>>> 
>>>>>>   GraphicsNode mGVTElement = mBuilder.build(mCtx, element);
>>>>>> 
>>>>>> 
>>>>>> element is a part of SVG document for example a rect tag (I can get
>>>>>> it 
>>>>> with
>>>>>> document.getElementByTagName(...)).
>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/GVT-Builder-problem-tp14195869p18318336.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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


Re: GVT Builder problem

Posted by Zenobios <an...@gmx.de>.
Hi,

thx, I found this out just a few minutes ago :). I'm interested in what you
were trying to do by creating Figures for the different elements. I'm trying
to just draw SVG Images in Inkscape (e.g.) and then automatically generate
appropriate figures, which have a special behaviour while resizing them,
i.e. I don't have an uniform scaling but some elements grow other than the
others.

Zenobios


tavolate wrote:
> 
> HI, I use this code to init the SVGDom
>    
>    UserAgentAdapter mUserAgent = new UserAgentAdapter(); 
>    BridgeContext mCtx = new BridgeContext(mUserAgent); 
>    mCtx.setDynamicState(BridgeContext.DYNAMIC);
>    GVTBuilder mBuilder = new DynamicGVTBuilder();
>  
>    GraphicsNode mGVTElement = mBuilder.build(mCtx, mDocument);
>    
> 
> (mDocument id the root of the dom org.w3c.dom.Document)
> 
> and to get the GraphicsNode I use:
> 
>    mCtx.getGraphicsNode(pElement);
> 
> (Element is a org.w3c.dom.Element)
> 
> I hope this can help you!
> 
> Ciao
> 
> aGO!
> 
> 
> 
> Zenobios wrote:
>> 
>> Hi,
>> 
>> sorry for pushing this old thread. But I want to do exactly the same and
>> I have exactly the same problem: After build(ctx,element) the returned
>> GraphicsNode is null...
>> 
>> Any suggestions?
>> 
>> Cheers,
>> Zenobios
>> 
>> 
>> tavolate wrote:
>>> 
>>> I'm trying to do an SVG Editor with Batik and Eclipse.
>>> I use the Batik DOM to manage the SVG file and after some process I draw
>>> the SVG elements as image inside a Figure (Draw2d). For each child node
>>> (text, rect, g..) inside the SVG DOM I would like to make a
>>> GraphicsNode. So when I modify for example x and y coordinates with my
>>> editor, I have to modify x and y coordinates of node and then redraw it.
>>> 
>>> With the code below, mGVTElement after the build is NULL.
>>> 
>>> 
>>> thomas.deweese wrote:
>>>> 
>>>> Hi aGO,
>>>> 
>>>> tavolate <Ag...@external.thalesaleniaspace.com> wrote on 
>>>> 12/06/2007 11:48:17 AM:
>>>> 
>>>>>  is it possible to create a GraphicsNode from an Element of a SVG 
>>>> Document?
>>>> 
>>>>      Yes, you have more or less shown the code below.
>>>> The code below can't work in all cases (in particular the
>>>> fact that you have set the context dynamic seems like trouble).
>>>> So what are you trying to do in a wider sense?
>>>> 
>>>>      Or what problems are you having with the code 
>>>> below? 
>>>> 
>>>>> Ex:
>>>>> 
>>>>>   UserAgentAdapter mUserAgent = new UserAgentAdapter(); 
>>>>>   BridgeContext mCtx = new BridgeContext(mUserAgent); 
>>>>>   mCtx.setDynamicState(BridgeContext.DYNAMIC);
>>>>>   GVTBuilder mBuilder = new DynamicGVTBuilder();
>>>>> 
>>>>>   GraphicsNode mGVTElement = mBuilder.build(mCtx, element);
>>>>> 
>>>>> 
>>>>> element is a part of SVG document for example a rect tag (I can get it 
>>>> with
>>>>> document.getElementByTagName(...)).
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/GVT-Builder-problem-tp14195869p18317335.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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


Re: GVT Builder problem

Posted by tavolate <Ag...@external.thalesaleniaspace.com>.
HI, I use this code to init the SVGDom
   
   UserAgentAdapter mUserAgent = new UserAgentAdapter(); 
   BridgeContext mCtx = new BridgeContext(mUserAgent); 
   mCtx.setDynamicState(BridgeContext.DYNAMIC);
   GVTBuilder mBuilder = new DynamicGVTBuilder();
 
   GraphicsNode mGVTElement = mBuilder.build(mCtx, element);
   

and to get the GraphicsNode I use:

   mCtx.getGraphicsNode(pElement);

(Element is a org.w3c.dom.Element)

I hope this can help you!

Ciao

aGO!



Zenobios wrote:
> 
> Hi,
> 
> sorry for pushing this old thread. But I want to do exactly the same and I
> have exactly the same problem: After build(ctx,element) the returned
> GraphicsNode is null...
> 
> Any suggestions?
> 
> Cheers,
> Zenobios
> 
> 
> tavolate wrote:
>> 
>> I'm trying to do an SVG Editor with Batik and Eclipse.
>> I use the Batik DOM to manage the SVG file and after some process I draw
>> the SVG elements as image inside a Figure (Draw2d). For each child node
>> (text, rect, g..) inside the SVG DOM I would like to make a GraphicsNode.
>> So when I modify for example x and y coordinates with my editor, I have
>> to modify x and y coordinates of node and then redraw it.
>> 
>> With the code below, mGVTElement after the build is NULL.
>> 
>> 
>> thomas.deweese wrote:
>>> 
>>> Hi aGO,
>>> 
>>> tavolate <Ag...@external.thalesaleniaspace.com> wrote on 
>>> 12/06/2007 11:48:17 AM:
>>> 
>>>>  is it possible to create a GraphicsNode from an Element of a SVG 
>>> Document?
>>> 
>>>      Yes, you have more or less shown the code below.
>>> The code below can't work in all cases (in particular the
>>> fact that you have set the context dynamic seems like trouble).
>>> So what are you trying to do in a wider sense?
>>> 
>>>      Or what problems are you having with the code 
>>> below? 
>>> 
>>>> Ex:
>>>> 
>>>>   UserAgentAdapter mUserAgent = new UserAgentAdapter(); 
>>>>   BridgeContext mCtx = new BridgeContext(mUserAgent); 
>>>>   mCtx.setDynamicState(BridgeContext.DYNAMIC);
>>>>   GVTBuilder mBuilder = new DynamicGVTBuilder();
>>>> 
>>>>   GraphicsNode mGVTElement = mBuilder.build(mCtx, element);
>>>> 
>>>> 
>>>> element is a part of SVG document for example a rect tag (I can get it 
>>> with
>>>> document.getElementByTagName(...)).
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/GVT-Builder-problem-tp14195869p18316107.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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


Re: GVT Builder problem

Posted by th...@kodak.com.
Hi Zenobios,

Zenobios <an...@gmx.de> wrote on 07/08/2008 02:29:38 AM:

> What I need is the following:
>    Split down a SVG Document into it's groups, where I don't need the 
parent
>    group to include other groups, since for them a new figure will be 
created
>    and added to the parent figure (which is associated with the parent 
group).
>    Maybe a bit difficult to explain. 

   So it seems to me that you are going to great lengths to reproduce
the 'use' element.  So given a 'host' document "A.svg" and a source
of these 'figures' document "B.svg".

   You can using DOM create a use element:
        Element useE = docA.createElementNS(SVG_NS, "use");

   Have it replicate the figure from B.svg:
        useE.setAttributeNS(XLINK_NS, "xlink:href", "B.svg#g2337");
        useE.setAttributeNS(null, "x", "1234");
        useE.setAttributeNS(null, "y", "5678");

   Alternately you could potentially import the group (docA.importNode) 
you want into the Host document A.svg and simply append it (appendChild).


> the element was created via loading the svg doc and then getting a 
special
> element with for instance:
> 
> Element e = getSvgDoc().getElementById("g2337");
> 
> I tested that e != null and is not. After some testing I figured out, 
that I
> have to build the whole document and the get my special element from the
> BridgeContext. But thats not what I need. 

   Ok, so the code below is ment to build an entire document, for many
'simple' SVG elements it might work anyway, but for some elements the
GVTBuilder will need to have been associated with an SVG Document Element.
Depending on the exact details of what you are doing you may be able to
use the GVTBuilder that came from the 'host' document. 


   Even if you got that to work, I think your approach needs rethinking, 
it seems to me that you are trying to 'fight the system'.  I'll say 
that almost any time you find yourself mucking with the GVT directly
you should step back and ask if you can accomplish the same thing 
through only the DOM.  Your mixing of DOM and GVT is a double warning
sign to me that perhaps you aren't aware of what you can accomplish
through simply using the DOM.


> thomas.deweese wrote:
> > 
> > Hi Zenobios,
> > 
> > Zenobios <an...@gmx.de> wrote on 07/07/2008 08:40:46 AM:
> > 
> >> sorry for pushing this old thread. But I want to do exactly the same 
and 
> > I
> >> have exactly the same problem: After build(ctx,element) the returned
> >> GraphicsNode is null...
> > 
> >    I would suspect that either your elements aren't in the SVG 
namespace
> > or 'element' is null.  Can you show the code that creates 'element'?
> > 
> >> tavolate wrote:
> >> > 
> >> > I'm trying to do an SVG Editor with Batik and Eclipse.
> >> > I use the Batik DOM to manage the SVG file and after some process I 

> > draw
> >> > the SVG elements as image inside a Figure (Draw2d). For each child 
> > node
> >> > (text, rect, g..) inside the SVG DOM I would like to make a 
> > GraphicsNode.
> >> > So when I modify for example x and y coordinates with my editor, I 
> > have to
> >> > modify x and y coordinates of node and then redraw it.
> > 
> > 
> > 
> >> > 
> >> > With the code below, mGVTElement after the build is NULL.
> >> > 
> >> > 
> >> > thomas.deweese wrote:
> >> >> 
> >> >> Hi aGO,
> >> >> 
> >> >> tavolate <Ag...@external.thalesaleniaspace.com> wrote 
on 
> >> >> 12/06/2007 11:48:17 AM:
> >> >> 
> >> >>>  is it possible to create a GraphicsNode from an Element of a SVG 

> >> >> Document?
> >> >> 
> >> >>      Yes, you have more or less shown the code below.
> >> >> The code below can't work in all cases (in particular the
> >> >> fact that you have set the context dynamic seems like trouble).
> >> >> So what are you trying to do in a wider sense?
> >> >> 
> >> >>      Or what problems are you having with the code 
> >> >> below? 
> >> >> 
> >> >>> Ex:
> >> >>> 
> >> >>>   UserAgentAdapter mUserAgent = new UserAgentAdapter(); 
> >> >>>   BridgeContext mCtx = new BridgeContext(mUserAgent); 
> >> >>>   mCtx.setDynamicState(BridgeContext.DYNAMIC);
> >> >>>   GVTBuilder mBuilder = new DynamicGVTBuilder();
> >> >>> 
> >> >>>   GraphicsNode mGVTElement = mBuilder.build(mCtx, element);
> >> >>> 
> >> >>> 
> >> >>> element is a part of SVG document for example a rect tag (I can 
get 
> > it 
> >> >> with
> >> >>> document.getElementByTagName(...)).
> >> >> 
> >> >> 
> >> > 
> >> > 
> >> 
> >> -- 
> >> View this message in context: http://www.nabble.com/GVT-Builder-
> >> problem-tp14195869p18315781.html
> >> Sent from the Batik - Users mailing list archive at Nabble.com.
> >> 
> >> 
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: 
batik-users-unsubscribe@xmlgraphics.apache.org
> >> For additional commands, e-mail: 
batik-users-help@xmlgraphics.apache.org
> >> 
> > 
> > 
> 
> -- 
> View this message in context: http://www.nabble.com/GVT-Builder-
> problem-tp14195869p18332662.html
> Sent from the Batik - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 

Re: GVT Builder problem

Posted by Zenobios <an...@gmx.de>.
Hi,

the element was created via loading the svg doc and then getting a special
element with for instance:

Element e = getSvgDoc().getElementById("g2337");

I tested that e != null and is not. After some testing I figured out, that I
have to build the whole document and the get my special element from the
BridgeContext. But thats not what I need. What I need is the following:
Split down a SVG Document into it's groups, where I don't need the parent
group to include other groups, since for them a new figure will be created
and added to the parent figure (which is associated with the parent group).
Maybe a bit difficult to explain. 



thomas.deweese wrote:
> 
> Hi Zenobios,
> 
> Zenobios <an...@gmx.de> wrote on 07/07/2008 08:40:46 AM:
> 
>> sorry for pushing this old thread. But I want to do exactly the same and 
> I
>> have exactly the same problem: After build(ctx,element) the returned
>> GraphicsNode is null...
> 
>    I would suspect that either your elements aren't in the SVG namespace
> or 'element' is null.  Can you show the code that creates 'element'?
> 
>> tavolate wrote:
>> > 
>> > I'm trying to do an SVG Editor with Batik and Eclipse.
>> > I use the Batik DOM to manage the SVG file and after some process I 
> draw
>> > the SVG elements as image inside a Figure (Draw2d). For each child 
> node
>> > (text, rect, g..) inside the SVG DOM I would like to make a 
> GraphicsNode.
>> > So when I modify for example x and y coordinates with my editor, I 
> have to
>> > modify x and y coordinates of node and then redraw it.
> 
> 
> 
>> > 
>> > With the code below, mGVTElement after the build is NULL.
>> > 
>> > 
>> > thomas.deweese wrote:
>> >> 
>> >> Hi aGO,
>> >> 
>> >> tavolate <Ag...@external.thalesaleniaspace.com> wrote on 
>> >> 12/06/2007 11:48:17 AM:
>> >> 
>> >>>  is it possible to create a GraphicsNode from an Element of a SVG 
>> >> Document?
>> >> 
>> >>      Yes, you have more or less shown the code below.
>> >> The code below can't work in all cases (in particular the
>> >> fact that you have set the context dynamic seems like trouble).
>> >> So what are you trying to do in a wider sense?
>> >> 
>> >>      Or what problems are you having with the code 
>> >> below? 
>> >> 
>> >>> Ex:
>> >>> 
>> >>>   UserAgentAdapter mUserAgent = new UserAgentAdapter(); 
>> >>>   BridgeContext mCtx = new BridgeContext(mUserAgent); 
>> >>>   mCtx.setDynamicState(BridgeContext.DYNAMIC);
>> >>>   GVTBuilder mBuilder = new DynamicGVTBuilder();
>> >>> 
>> >>>   GraphicsNode mGVTElement = mBuilder.build(mCtx, element);
>> >>> 
>> >>> 
>> >>> element is a part of SVG document for example a rect tag (I can get 
> it 
>> >> with
>> >>> document.getElementByTagName(...)).
>> >> 
>> >> 
>> > 
>> > 
>> 
>> -- 
>> View this message in context: http://www.nabble.com/GVT-Builder-
>> problem-tp14195869p18315781.html
>> Sent from the Batik - Users mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
>> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/GVT-Builder-problem-tp14195869p18332662.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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


Re: GVT Builder problem

Posted by th...@kodak.com.
Hi Zenobios,

Zenobios <an...@gmx.de> wrote on 07/07/2008 08:40:46 AM:

> sorry for pushing this old thread. But I want to do exactly the same and 
I
> have exactly the same problem: After build(ctx,element) the returned
> GraphicsNode is null...

   I would suspect that either your elements aren't in the SVG namespace
or 'element' is null.  Can you show the code that creates 'element'?

> tavolate wrote:
> > 
> > I'm trying to do an SVG Editor with Batik and Eclipse.
> > I use the Batik DOM to manage the SVG file and after some process I 
draw
> > the SVG elements as image inside a Figure (Draw2d). For each child 
node
> > (text, rect, g..) inside the SVG DOM I would like to make a 
GraphicsNode.
> > So when I modify for example x and y coordinates with my editor, I 
have to
> > modify x and y coordinates of node and then redraw it.



> > 
> > With the code below, mGVTElement after the build is NULL.
> > 
> > 
> > thomas.deweese wrote:
> >> 
> >> Hi aGO,
> >> 
> >> tavolate <Ag...@external.thalesaleniaspace.com> wrote on 
> >> 12/06/2007 11:48:17 AM:
> >> 
> >>>  is it possible to create a GraphicsNode from an Element of a SVG 
> >> Document?
> >> 
> >>      Yes, you have more or less shown the code below.
> >> The code below can't work in all cases (in particular the
> >> fact that you have set the context dynamic seems like trouble).
> >> So what are you trying to do in a wider sense?
> >> 
> >>      Or what problems are you having with the code 
> >> below? 
> >> 
> >>> Ex:
> >>> 
> >>>   UserAgentAdapter mUserAgent = new UserAgentAdapter(); 
> >>>   BridgeContext mCtx = new BridgeContext(mUserAgent); 
> >>>   mCtx.setDynamicState(BridgeContext.DYNAMIC);
> >>>   GVTBuilder mBuilder = new DynamicGVTBuilder();
> >>> 
> >>>   GraphicsNode mGVTElement = mBuilder.build(mCtx, element);
> >>> 
> >>> 
> >>> element is a part of SVG document for example a rect tag (I can get 
it 
> >> with
> >>> document.getElementByTagName(...)).
> >> 
> >> 
> > 
> > 
> 
> -- 
> View this message in context: http://www.nabble.com/GVT-Builder-
> problem-tp14195869p18315781.html
> Sent from the Batik - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 

Re: GVT Builder problem

Posted by Zenobios <an...@gmx.de>.
Hi,

sorry for pushing this old thread. But I want to do exactly the same and I
have exactly the same problem: After build(ctx,element) the returned
GraphicsNode is null...

Any suggestions?

Cheers,
Zenobios


tavolate wrote:
> 
> I'm trying to do an SVG Editor with Batik and Eclipse.
> I use the Batik DOM to manage the SVG file and after some process I draw
> the SVG elements as image inside a Figure (Draw2d). For each child node
> (text, rect, g..) inside the SVG DOM I would like to make a GraphicsNode.
> So when I modify for example x and y coordinates with my editor, I have to
> modify x and y coordinates of node and then redraw it.
> 
> With the code below, mGVTElement after the build is NULL.
> 
> 
> thomas.deweese wrote:
>> 
>> Hi aGO,
>> 
>> tavolate <Ag...@external.thalesaleniaspace.com> wrote on 
>> 12/06/2007 11:48:17 AM:
>> 
>>>  is it possible to create a GraphicsNode from an Element of a SVG 
>> Document?
>> 
>>      Yes, you have more or less shown the code below.
>> The code below can't work in all cases (in particular the
>> fact that you have set the context dynamic seems like trouble).
>> So what are you trying to do in a wider sense?
>> 
>>      Or what problems are you having with the code 
>> below? 
>> 
>>> Ex:
>>> 
>>>   UserAgentAdapter mUserAgent = new UserAgentAdapter(); 
>>>   BridgeContext mCtx = new BridgeContext(mUserAgent); 
>>>   mCtx.setDynamicState(BridgeContext.DYNAMIC);
>>>   GVTBuilder mBuilder = new DynamicGVTBuilder();
>>> 
>>>   GraphicsNode mGVTElement = mBuilder.build(mCtx, element);
>>> 
>>> 
>>> element is a part of SVG document for example a rect tag (I can get it 
>> with
>>> document.getElementByTagName(...)).
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/GVT-Builder-problem-tp14195869p18315781.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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


Re: GVT Builder problem

Posted by tavolate <Ag...@external.thalesaleniaspace.com>.
I'm trying to do an SVG Editor with Batik and Eclipse.
I use the Batik DOM to manage the SVG file and after some process I draw the
SVG elements as image inside a Figure (Draw2d). For each child node (text,
rect, g..) inside the SVG DOM I would like to make a GraphicsNode. So when I
modify for example x and y coordinates with my editor, I have to modify x
and y coordinates of node and then redraw it.

With the code below, mGVTElement after the build is NULL.


thomas.deweese wrote:
> 
> Hi aGO,
> 
> tavolate <Ag...@external.thalesaleniaspace.com> wrote on 
> 12/06/2007 11:48:17 AM:
> 
>>  is it possible to create a GraphicsNode from an Element of a SVG 
> Document?
> 
>      Yes, you have more or less shown the code below.
> The code below can't work in all cases (in particular the
> fact that you have set the context dynamic seems like trouble).
> So what are you trying to do in a wider sense?
> 
>      Or what problems are you having with the code 
> below? 
> 
>> Ex:
>> 
>>   UserAgentAdapter mUserAgent = new UserAgentAdapter(); 
>>   BridgeContext mCtx = new BridgeContext(mUserAgent); 
>>   mCtx.setDynamicState(BridgeContext.DYNAMIC);
>>   GVTBuilder mBuilder = new DynamicGVTBuilder();
>> 
>>   GraphicsNode mGVTElement = mBuilder.build(mCtx, element);
>> 
>> 
>> element is a part of SVG document for example a rect tag (I can get it 
> with
>> document.getElementByTagName(...)).
> 
> 

-- 
View this message in context: http://www.nabble.com/GVT-Builder-problem-tf4957114.html#a14211551
Sent from the Batik - Users mailing list archive at Nabble.com.


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


Re: GVT Builder problem

Posted by tavolate <Ag...@external.thalesaleniaspace.com>.
I'm trying to do an SVG Editor with Batik and Eclipse.
I use the Batik DOM to manage the SVG file and after some process I draw the
SVG elements as image inside a Figure (Draw2d). For each child node (text,
rect, g..) inside the SVG DOM I would like to make a GraphicsNode. So when I
modify for example x and y coordinates with my editor, I have to modify x
and y coordinates of node and then redraw it.



thomas.deweese wrote:
> 
> Hi aGO,
> 
> tavolate <Ag...@external.thalesaleniaspace.com> wrote on 
> 12/06/2007 11:48:17 AM:
> 
>>  is it possible to create a GraphicsNode from an Element of a SVG 
> Document?
> 
>      Yes, you have more or less shown the code below.
> The code below can't work in all cases (in particular the
> fact that you have set the context dynamic seems like trouble).
> So what are you trying to do in a wider sense?
> 
>      Or what problems are you having with the code 
> below? 
> 
>> Ex:
>> 
>>   UserAgentAdapter mUserAgent = new UserAgentAdapter(); 
>>   BridgeContext mCtx = new BridgeContext(mUserAgent); 
>>   mCtx.setDynamicState(BridgeContext.DYNAMIC);
>>   GVTBuilder mBuilder = new DynamicGVTBuilder();
>> 
>>   GraphicsNode mGVTElement = mBuilder.build(mCtx, element);
>> 
>> 
>> element is a part of SVG document for example a rect tag (I can get it 
> with
>> document.getElementByTagName(...)).
> 
> 

-- 
View this message in context: http://www.nabble.com/GVT-Builder-problem-tf4957114.html#a14211551
Sent from the Batik - Users mailing list archive at Nabble.com.


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


Re: GVT Builder problem

Posted by th...@kodak.com.
Hi aGO,

tavolate <Ag...@external.thalesaleniaspace.com> wrote on 
12/06/2007 11:48:17 AM:

>  is it possible to create a GraphicsNode from an Element of a SVG 
Document?

     Yes, you have more or less shown the code below.
The code below can't work in all cases (in particular the
fact that you have set the context dynamic seems like trouble).
So what are you trying to do in a wider sense?

     Or what problems are you having with the code 
below? 

> Ex:
> 
>   UserAgentAdapter mUserAgent = new UserAgentAdapter(); 
>   BridgeContext mCtx = new BridgeContext(mUserAgent); 
>   mCtx.setDynamicState(BridgeContext.DYNAMIC);
>   GVTBuilder mBuilder = new DynamicGVTBuilder();
> 
>   GraphicsNode mGVTElement = mBuilder.build(mCtx, element);
> 
> 
> element is a part of SVG document for example a rect tag (I can get it 
with
> document.getElementByTagName(...)).