xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Javid Alimohideen" <javid...@gmail.com>
Subject RE: Identifying each circle
Date Sat, 18 Mar 2006 20:00:35 GMT
Hi Yasmin,
Sorry I wasn't very clear, I was using that piece of code for my 'g'
elements, so I suggest you create a text element when a user clicks on your
circle and translate it to the circle's position. If you look at Thomas's
code (look couple of emails before) that uses SVGLocatable to get the
position of circle and use that position to set the co-ordinate positions of
your new text element.

Thanks,
Javid

-----Original Message-----
From: rafiqy@blueyonder.co.uk [mailto:rafiqy@blueyonder.co.uk]
Sent: Saturday, March 18, 2006 1:28 PM
To: batik-users@xmlgraphics.apache.org
Subject: RE: Identifying each circle


Hi Javid,

How did you declare the variable 'rg' and also the 'CircleElement' does
not have 'appendChild() method???

Thx

yasmin



> Hi Yasmin,
> I guess when you need to add text, you have to create a text element and
> append it to the circle element. That's how I display the text. Something
> like this.
>
> Element textID = svgDocument.createElementNS(SVG_NS, "text");
> Element textSpan = svgDocument.createElementNS(SVG_NS, "tspan");
> textSpan.setAttributeNS(null, "x", "15");
> textSpan.setAttributeNS(null, "y", "25");
> textSpan.setAttributeNS(null, "fill", "#17238C");
> textSpan.setAttributeNS(null, "font-family", "'Arial-BoldMT'");
> textSpan.setAttributeNS(null, "text-anchor", "middle");
> textSpan.setAttributeNS(null, "font-size", "18");
>
> rg.w3c.dom.Text tempText = (org.w3c.dom.Text)
> svgDocument.createTextNode("Your text goes here");
> textSpan.appendChild(tempText);
> textID.appendChild(textSpan);
> circleElement.appendChild(textID);
>
> Hope it helps.
>
> Javid
>
> -----Original Message-----
> From: rafiqy@blueyonder.co.uk [mailto:rafiqy@blueyonder.co.uk]
> Sent: Saturday, March 18, 2006 11:19 AM
> To: batik-users@xmlgraphics.apache.org
> Subject: Identifying each circle
>
>
> Hi Thomas,
>
> With the zooming problem if I set 'r' from '0.001' to '1' then the
> 'circle-rings' appear on the canvas!
>
> Anyway, I would like to be able to identify each 'circle' when I click it,
> i.e, attach a number (1,2,3...), so the user can have a visual reference
> for each circle. How can I attach a number, I tried:
>
>
> String num = Integer.parseInt(num) // Keeps record of num of Clickd
> Circles
> elt.setAttributeNS(null,"text",num);
>
> Thx
>
>
>
>
> ---------------------------------------------------------------------
> 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


---------------------------------------------------------------------
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