...I've drawn the circles on the canvas, they are not part of my svg document such that the actual file is not altered, the the circles are not individual elements - any ideas :(
yasmin > Hello, > For events, I attach an event to the entire document. For > individual elements, this may work. You'll need to get your circle as > an org.w3c.dom.Element. > > EventTarget eventTarget = (EventTarget) yourElement; > eventTarget.addEventListener(SVGConstants.SVG_EVENT_MOUSEDOWN, new > YourEventListener(), false); > > Michael Bishop > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Monday, February 27, 2006 12:13 PM > To: [email protected] > Subject: Red Spots > > > Hi Michael Bishop, > > I have been beavering on my project and have successfully converted my > screen coordinates to documents and can interact with my database to > retrieve the information for the current view and show red spots on the > areas where accidents have happend on the map ...now I need to make the > red spots active so when a user clicks on a red spot the relevant > information about that particular accident is displayed ...i simply used > the following code to create the red spot: > > Graphics spot = canvas.getGraphics(); > spot.setColor(Color.RED); > spot.fillOval(x,y,22,22); > spot.dispose(); > > but i cant assign an ActionEvent to the spot ...Any ideas? > > Many thanks in advance :) > > Yasmin > > > > >> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> >> <HTML> >> <HEAD> >> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; > charset=iso-8859-1"> >> >> >> <META NAME="Generator" CONTENT="MS Exchange Server version > 6.5.7226.0"> >> <TITLE>RE: Coordinates</TITLE> >> </HEAD> >> <BODY> >> <DIV id=idOWAReplyText99836 dir=ltr> >> <DIV dir=ltr><FONT face=Arial color=#000000 size=2>Element element > >> svgDocument.createElement(SVGConstants.SVG_CIRCLE_TAG);</FONT></DIV> >> <DIV dir=ltr><FONT face=Arial >> size=2>element.setAttribute(SVGConstants.SVG_CX_ATTR, >> xPosition);</FONT></DIV> >> <DIV dir=ltr><FONT face=Arial >> size=2>element.setAttribute(SVGConstants.SVG_CY_ATTR, >> yPosition);</FONT></DIV> >> <DIV dir=ltr><FONT face=Arial >> size=2>element.setAttribute(SVGConstants.SVG_R_ATTR, > radius);</FONT></DIV> >> <DIV dir=ltr><FONT face=Arial >> size=2>element.setAttribute(SVGConstants.SVG_FILL_ATTR, >> "red");</FONT></DIV> >> <DIV dir=ltr><FONT face=Arial >> size=2>svgDocument.getDocumentElement.append(element);</FONT></DIV> >> <DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV> >> <DIV dir=ltr><FONT face=Arial size=2>Use code completion or the Batik >> Javadoc. Most of those SVGConstants references are probably >> wrong.</FONT></DIV> >> <DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV> >> <DIV dir=ltr><FONT face=Arial size=2>Michael Bishop</FONT></DIV></DIV> >> <DIV dir=ltr><BR> >> <HR tabIndex=-1> >> <FONT face=Tahoma size=2><B>From:</B> [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED]<BR><B>Sent:</B> Sun 2/19/2006 3:07 >> PM<BR><B>To:</B> [email protected]<BR><B>Subject:</B> > RE: >> Coordinates<BR></FONT><BR></DIV> >> <DIV> >> <P><FONT size=2>me again!<BR><BR>...I think I don't need to convert > back >> to >> screen coordinates I should be<BR>able to use the document > coordinates, >> but how >> can I draw a red-spot<BR>(filled circle) and a given location on the >> canvas?<BR><BR>ThankU in advance<BR><BR>yasmin<BR><BR>> > <!DOCTYPE >> HTML >> PUBLIC "-//W3C//DTD HTML 3.2//EN"><BR>> <HTML><BR>> >> <HEAD><BR>> <META HTTP-EQUIV="Content-Type" >> CONTENT="text/html; >> charset=iso-8859-1"><BR>><BR>><BR>> <META > NAME="Generator" >> CONTENT="MS Exchange Server version 6.5.7226.0"><BR>> >> <TITLE>Coordinates</TITLE><BR>> </HEAD><BR>> >> <BODY><BR>> <DIV id=idOWAReplyText8269 dir=ltr><BR>> >> <DIV >> dir=ltr><FONT face=Arial color=#000000 size=2>Not sure; > haven't >> done<BR>> it in<BR>> reverse.&nbsp; There is a method for an >> SVGLocatable called getScreenCTM<BR>> that<BR>> may be of >> use.</FONT></DIV><BR>> <DIV dir=ltr><FONT >> face=Arial >> size=2></FONT>&nbsp;</DIV><BR>> <DIV >> dir=ltr><FONT face=Arial size=2>Michael >> Bishop</FONT></DIV></DIV><BR>> <DIV >> dir=ltr><BR><BR>> <HR tabIndex=-1><BR>> <FONT >> face=Tahoma size=2><B>From:</B> >> [EMAIL PROTECTED]<BR>> >> [<A >> > href="mailto:[EMAIL PROTECTED]">mailto:[EMAIL PROTECTED]</A> > ]<BR><B>Sent:</B> >> Sun 2/19/2006 1:08<BR>> PM<BR><B>To:</B> >> > [email protected]<BR><B>Subject:</B>< > BR>> >> Coordinates<BR></FONT><BR></DIV><BR>> >> <DIV><BR>> <P><FONT size=2>Hi Michael >> Bishop,<BR><BR>...I've converted my screen<BR>> > coordinates >> to my >> document coordinates - now<BR>I'm trying to convert<BR>> >> document<BR>> coordinates to screen coordinate so that > at<BR>that >> point >> on the map, I<BR>> can draw<BR>> a red_spot on the canvas...any >> ideas?<BR><BR>ThankU in<BR>> >> > advance<BR><BR>yasmin<BR><BR><BR>--------- > ------------------------------------------------------------<BR>To > <BR>> >> unsubscribe, e-mail: >> [EMAIL PROTECTED]<BR>For<BR>> >> additional >> commands, e-mail:<BR>> >> > [EMAIL PROTECTED]<BR></FONT></P> > </DIV><BR>><BR>> >> </BODY><BR>> >> > </HTML><BR><BR><BR><BR>------------------------------------------- > --------------------------<BR>To >> unsubscribe, e-mail: > [EMAIL PROTECTED]<BR>For >> additional commands, e-mail: >> [EMAIL PROTECTED]<BR></FONT></P></DIV> >> >> </BODY> >> </HTML> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
