xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tacio Santos" <tacio.san...@gmail.com>
Subject Re: finding the transformed location of a svg group
Date Wed, 07 Mar 2007 17:23:28 GMT
oops, sorry, what I actually meant was:

public void moveEllipseToPos( String ellipseId, String dstId ){
   SVGDocument document = this.getSVGDocument();
   final Element dst_e =  document.getElementById(dstId);
   final Element ellipse = document.getElementById(ellipseId);
   SVGLocatable dst_loc = (SVGLocatable) dst_e;

   final double dest_x=dst_loc.getBBox().getX();
   final double dest_y=dst_loc.getBBox().getY();
   this.getUpdateManager().getUpdateRunnableQueue().invokeLater(
      new Runnable() {
         public void run() {
         ellipse.setAttributeNS(null, "cx", "" +dest_x);
         ellipse.setAttributeNS(null, "cy", "" +dest_y);
      }});
}



On 3/7/07, Bishop, Michael W. CONTR J9C880 <Michael.Bishop@je.jfcom.mil> wrote:
> ...well, you're not doing anything with srcId; you never reference that
> ID or the element it belongs to.
>
> Michael Bishop
>
> -----Original Message-----
> From: Tacio Santos [mailto:tacio.santos@gmail.com]
> Sent: Wednesday, March 07, 2007 11:04 AM
> To: batik-users@xmlgraphics.apache.org
> Subject: finding the transformed location of a svg group
>
> Hi,
> I know this is certainly a basic question, but I'm having problems
> getting the location of svg groups on the JSVGCanvas. What I want to
> achieve is to move an ellipse (identified by srcId) over a svg group
> (dstId). I've read that I may have somehow to use
> getTransformToElement , but I don't know how. Could someone give me
> some help?
>
> thanks in advance,
> Tacio
>
> PS: this is what I'm curently doing
>
> public void moveEllipseToPos( String srcId, String dstId ){
>    SVGDocument document = this.getSVGDocument();
>    final Element dst_e = document.getElementById(dstId);
>    SVGLocatable dst_loc = (SVGLocatable) dst_e;
>    final double dest_x=dst_loc.getBBox().getX();
>    final double dest_y=dst_loc.getBBox().getY();
>    canvas.getUpdateManager().getUpdateRunnableQueue().invokeLater(
>    new Runnable() {
>       public void run() {
>       dst_e.setAttributeNS(null, "cx", "" +dest_x);
>       dst_e.setAttributeNS(null, "cy", "" +dest_y);
>       }});
> }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
>

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


Mime
View raw message