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 "Baron, Randy {PRG~Basel}" <RA...@Roche.COM> on 2003/03/13 12:54:48 UTC

Interactors and MouseEvents

hi-
  I'm trying to figure out how to use the Interactors (and why actually,
instead of just using listeners).  I made a small test class that
displays an svg document (a couple of circles) and adds a custom
Interactor.  I wanted to print out some info when I clicked on the
JSVGCanvas, like what Element was clicked on.  I did this before in a
different way, by adding listeners to the JSVGCanvas (snippet below).  I
was wondering if the same info could be obtained from within the
Interactor context (some kind of 'casting' java.awt.event.MouseEvent
into an org.w3c.dom.events.MouseEvent)?
   In the end I need to write a program that displays svg elements (no
big surprise) and allows the user to modify them (location or other
properties) and so need to know what element is clicked on.
 
-Randy
 
 
---------------------------
Snippet of code to get info about object clicked on:
 
 public void registerListeners() {
        Element maindoc = (Element)  document.getDocumentElement();
        EventTarget doctarg = (EventTarget) maindoc;
        doctarg.addEventListener("click", new OnMouseClick(), false);
 }
 
/** Prints out some info about what was clicked on */
  public class OnMouseClick implements EventListener {
        public void handleEvent(Event evt) {
            int mx, my;
            int sx, sy;
            Element svgRoot = document.getDocumentElement();
            String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
 
            MouseEvent mevt = (MouseEvent) evt;
            mx = mevt.getClientX();
            my = mevt.getClientY();
            sx = mevt.getScreenX();
            sy = mevt.getScreenY();
 
            SVGElement targ = (SVGElement) mevt.getTarget();
 
            System.out.println("   Mouse X:" + mx + " Y: " + my);
            System.out.println("   in screen coordinates - x: " + sx + "
y: " + sy);
            System.out.println("   Type of event: " + mevt.getType());
            System.out.println("   getTarget: " + mevt.getTarget());
            System.out.println("   getCurrentTarget: " +
mevt.getCurrentTarget());
            System.out.println("   Element id = " + targ.getId());
 
 
            if (targ instanceof
org.apache.batik.dom.svg.SVGOMTextElement) {
                double maxX, maxY, minX, minY;
                int rx, ry, rw, rh;
                
                SVGOMTextElement ttarg = (SVGOMTextElement) targ;
                SVGRect rectsiz = new AnSVGRect();
                
                System.out.println("HIT SOME TEXT");
                NodeList nlist = targ.getChildNodes();
                System.out.println(" text node length: " +
nlist.getLength());
                System.out.println(" text node item: " + " ele: " +
nlist.item(1));
         //   ....etc.
 

RE: Interactors and MouseEvents

Posted by Thomas E Deweese <th...@kodak.com>.
>>>>> "BR" == Baron, Randy {PRG~Basel} <RA...@Roche.COM> writes:

BR> I'm trying to figure out how to use the Interactors (and why
BR> actually, instead of just using listeners).  I made a small test
BR> class that displays an svg document (a couple of circles) and adds
BR> a custom Interactor.  

    Interactors are useful to handle 'tool focus' in the Canvas.  For
what you want I don't think it will help that much.

BR> I wanted to print out some info when I clicked on the JSVGCanvas,
BR> like what Element was clicked on.  I did this before in a
BR> different way, by adding listeners to the JSVGCanvas (snippet
BR> below).  I was wondering if the same info could be obtained from
BR> within the Interactor context (some kind of 'casting'
BR> java.awt.event.MouseEvent into an org.w3c.dom.events.MouseEvent)?

    If you want DOM events you should register your listeners with the
DOM.  Batik propogates the UI events to the DOM for you.

BR> In the end I need to write a program that displays svg elements
BR> (no big surprise) and allows the user to modify them (location or
BR> other properties) and so need to know what element is clicked on.

    Use the DOM.
     
BR> -Randy
 
 
BR> --------------------------- Snippet of code to get info about
BR> object clicked on:
 
BR>  public void registerListeners() { Element maindoc = (Element)
BR> document.getDocumentElement(); EventTarget doctarg = (EventTarget)
BR> maindoc; doctarg.addEventListener("click", new OnMouseClick(),
BR> false); }
 
BR> /** Prints out some info about what was clicked on */ public class
BR> OnMouseClick implements EventListener { public void
BR> handleEvent(Event evt) { int mx, my; int sx, sy; Element svgRoot =
BR> document.getDocumentElement(); String svgNS =
BR> SVGDOMImplementation.SVG_NAMESPACE_URI;
 
BR>             MouseEvent mevt = (MouseEvent) evt; mx =
BR> mevt.getClientX(); my = mevt.getClientY(); sx = mevt.getScreenX();
BR> sy = mevt.getScreenY();
 
BR>             SVGElement targ = (SVGElement) mevt.getTarget();
 
BR>             System.out.println(" Mouse X:" + mx + " Y: " + my);
BR> System.out.println(" in screen coordinates - x: " + sx + " y: " +
BR> sy); System.out.println(" Type of event: " + mevt.getType());
BR> System.out.println(" getTarget: " + mevt.getTarget());
BR> System.out.println(" getCurrentTarget: " +
BR> mevt.getCurrentTarget()); System.out.println(" Element id = " +
BR> targ.getId());
 
 
BR>             if (targ instanceof
BR> org.apache.batik.dom.svg.SVGOMTextElement) { double maxX, maxY,
BR> minX, minY; int rx, ry, rw, rh;
                
BR>                 SVGOMTextElement ttarg = (SVGOMTextElement) targ;
BR> SVGRect rectsiz = new AnSVGRect();
                
BR>                 System.out.println("HIT SOME TEXT"); NodeList
BR> nlist = targ.getChildNodes(); System.out.println(" text node
BR> length: " + nlist.getLength()); System.out.println(" text node
BR> item: " + " ele: " + nlist.item(1)); // ....etc.
 
BR> <html xmlns:o="urn:schemas-microsoft-com:office:office"
BR> xmlns:w="urn:schemas-microsoft-com:office:word"
BR> xmlns="http://www.w3.org/TR/REC-html40">

BR> <head> <meta http-equiv=Content-Type content="text/html;
BR> charset=us-ascii"> <meta name=ProgId content=Word.Document> <meta
BR> name=Generator content="Microsoft Word 10"> <meta name=Originator
BR> content="Microsoft Word 10"> <link rel=File-List
BR> href="cid:filelist.xml@01C2E95F.BA826D70"> <!--[if gte mso
BR> 9]><xml> <o:OfficeDocumentSettings> <o:DoNotRelyOnCSS/>
BR> </o:OfficeDocumentSettings> </xml><![endif]--><!--[if gte mso
BR> 9]><xml> <w:WordDocument>
BR> <w:DocumentKind>DocumentEmail</w:DocumentKind> <w:EnvelopeVis/>
BR> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/>
BR> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> </w:Compatibility>
BR> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
BR> </w:WordDocument> </xml><![endif]--> <style> <!-- /* Style
BR> Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal
BR> {mso-style-parent:""; margin:0in; margin-bottom:.0001pt;
BR> mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times
BR> New Roman"; mso-fareast-font-family:"Times New Roman";} a:link,
BR> span.MsoHyperlink {color:blue; text-decoration:underline;
BR> text-underline:single;} a:visited, span.MsoHyperlinkFollowed
BR> {color:purple; text-decoration:underline; text-underline:single;}
BR> p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig {margin:0in;
BR> margin-bottom:.0001pt; mso-pagination:widow-orphan;
BR> font-size:12.0pt; font-family:"Times New Roman";
BR> mso-fareast-font-family:"Times New Roman";} span.EmailStyle17
BR> {mso-style-type:personal-compose; mso-style-noshow:yes;
BR> mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt;
BR> font-family:Arial; mso-ascii-font-family:Arial;
BR> mso-hansi-font-family:Arial; mso-bidi-font-family:Arial;
BR> color:windowtext;} @page Section1 {size:8.5in 11.0in; margin:1.0in
BR> 1.25in 1.0in 1.25in; mso-header-margin:.5in;
BR> mso-footer-margin:.5in; mso-paper-source:0;} div.Section1
BR> {page:Section1;}
-->
BR> </style> <!--[if gte mso 10]> <style> /* Style Definitions */
BR> table.MsoNormalTable {mso-style-name:"Table Normal";
BR> mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0;
BR> mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in
BR> 5.4pt 0in 5.4pt; mso-para-margin:0in;
BR> mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan;
BR> font-size:10.0pt; font-family:"Times New Roman";} </style>
BR> <![endif]--> </head>

BR> <body lang=EN-US link=blue vlink=purple style='tab-interval:.5in'>

BR> <div class=Section1>

BR> <p class=MsoAutoSig><font size=3 face="Times New Roman"><span
BR> style='font-size:
BR> 12.0pt;mso-no-proof:yes'>hi-<o:p></o:p></span></font></p>

BR> <p class=MsoAutoSig><font size=3 face="Times New Roman"><span
BR> style='font-size: 12.0pt;mso-no-proof:yes'><span
BR> style='mso-spacerun:yes'>&nbsp; </span>I'm trying to figure out
BR> how to use the Interactors (and why actually, instead of just
BR> using listeners). <span style='mso-spacerun:yes'>&nbsp;</span>I
BR> made a small test class that displays an svg document (a couple of
BR> circles) and adds a custom Interactor.<span
BR> style='mso-spacerun:yes'>&nbsp; </span>I wanted to print out some
BR> info when I clicked on the JSVGCanvas, like what Element was
BR> clicked on.<span style='mso-spacerun:yes'>&nbsp; </span>I did this
BR> before in a different way, by adding listeners to the JSVGCanvas
BR> (snippet below).<span style='mso-spacerun:yes'>&nbsp; </span>I was
BR> wondering if the same info could be obtained from within the
BR> Interactor context (some kind of 'casting'
BR> java.awt.event.MouseEvent into an o</span></font><font size=2
BR> face="Courier New"><span style='font-size:
BR> 10.0pt;font-family:"Courier
BR> New"'>rg.w3c.dom.events.MouseEvent)?<o:p></o:p></span></font></p>

BR> <p class=MsoAutoSig><font size=2 face="Courier New"><span
BR> style='font-size: 10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp; </span>In the end I need to
BR> write a program that displays svg elements (no big surprise) and
BR> allows the user to modify them (location or other properties) and
BR> so need to know what element is clicked
BR> on.<o:p></o:p></span></font></p>

BR> <p class=MsoAutoSig><font size=3 face="Times New Roman"><span
BR> style='font-size:
BR> 12.0pt;mso-no-proof:yes'><o:p>&nbsp;</o:p></span></font></p>

BR> <p class=MsoAutoSig><font size=3 face="Times New Roman"><span
BR> style='font-size:
BR> 12.0pt;mso-no-proof:yes'>-Randy<o:p></o:p></span></font></p>

BR> <p class=MsoAutoSig><font size=3 face="Times New Roman"><span
BR> style='font-size:
BR> 12.0pt;mso-no-proof:yes'><o:p>&nbsp;</o:p></span></font></p>

BR> <p class=MsoAutoSig><font size=3 face="Times New Roman"><span
BR> style='font-size:
BR> 12.0pt;mso-no-proof:yes'><o:p>&nbsp;</o:p></span></font></p>

BR> <p class=MsoAutoSig><font size=3 face="Times New Roman"><span
BR> style='font-size:
BR> 12.0pt;mso-no-proof:yes'>---------------------------<o:p></o:p></span></font></p>

BR> <p class=MsoAutoSig><font size=3 face="Times New Roman"><span
BR> style='font-size: 12.0pt;mso-no-proof:yes'>Snippet of code to get
BR> info about object clicked on:<o:p></o:p></span></font></p>

BR> <p class=MsoAutoSig><font size=3 face="Times New Roman"><span
BR> style='font-size:
BR> 12.0pt;mso-no-proof:yes'><o:p>&nbsp;</o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;</span>public void
BR> registerListeners() {<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>Element maindoc = (Element)<span
BR> style='mso-spacerun:yes'>&nbsp;
BR> </span>document.getDocumentElement();<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>EventTarget doctarg = (EventTarget)
BR> maindoc;<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>doctarg.addEventListener(&quot;click&quot;, new
BR> OnMouseClick(), false);<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;</span>}<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier
BR> New"'><o:p>&nbsp;</o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'>/** Prints out
BR> some info about what was clicked on
BR> */<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp; </span>public class OnMouseClick
BR> implements EventListener {<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>public void handleEvent(Event evt)
BR> {<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>int mx, my;<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>int sx, sy;<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>Element svgRoot =
BR> document.getDocumentElement();<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>String svgNS =
BR> SVGDOMImplementation.SVG_NAMESPACE_URI;<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier
BR> New"'><o:p>&nbsp;</o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>MouseEvent mevt = (MouseEvent)
BR> evt;<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>mx = mevt.getClientX();<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>my = mevt.getClientY();<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>sx = mevt.getScreenX();<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>sy = mevt.getScreenY();<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier
BR> New"'><o:p>&nbsp;</o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>SVGElement targ = (SVGElement)
BR> mevt.getTarget();<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier
BR> New"'><o:p>&nbsp;</o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>System.out.println(&quot;<span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp; </span>Mouse X:&quot; + mx +
BR> &quot; Y: &quot; + my);<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>System.out.println(&quot; <span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;</span>in screen coordinates
BR> - x: &quot; + sx + &quot; y: &quot; +
BR> sy);<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>System.out.println(&quot;<span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp; </span>Type of event: &quot;
BR> + mevt.getType());<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>System.out.println(&quot;<span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp; </span>getTarget: &quot; +
BR> mevt.getTarget());<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>System.out.println(&quot;<span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp; </span>getCurrentTarget:
BR> &quot; + mevt.getCurrentTarget());<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>System.out.println(&quot;<span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp; </span>Element id = &quot; +
BR> targ.getId());<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier
BR> New"'><o:p>&nbsp;</o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier
BR> New"'><o:p>&nbsp;</o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span><span style='mso-spacerun:yes'>&nbsp;&nbsp;</span>if (targ
BR> instanceof org.apache.batik.dom.svg.SVGOMTextElement)
BR> {<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>double maxX, maxY, minX, minY;<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>int rx, ry, rw, rh;<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span><o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>SVGOMTextElement ttarg = (SVGOMTextElement)
BR> targ;<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>SVGRect rectsiz = new
BR> AnSVGRect();<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span><o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>System.out.println(&quot;HIT SOME
BR> TEXT&quot;);<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>NodeList nlist =
BR> targ.getChildNodes();<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;</span>System.out.println(&quot;
BR> text node length: &quot; +<span style='mso-spacerun:yes'>&nbsp;
BR> </span>nlist.getLength());<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier New"'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>System.out.println(&quot; text node item: &quot; + &quot;
BR> ele: &quot; + nlist.item(1));<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=3 face="Times New Roman"><span style='font-size:12.0pt'><span
BR> style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BR> </span>//<span style='mso-spacerun:yes'>&nbsp;&nbsp;
BR> </span>....etc.<o:p></o:p></span></font></p>

BR> <p class=MsoNormal
BR> style='mso-layout-grid-align:none;text-autospace:none'><font
BR> size=2 face="Courier New"><span
BR> style='font-size:10.0pt;font-family:"Courier
BR> New"'><o:p>&nbsp;</o:p></span></font></p>

BR> </div>

BR> </body>

BR> </html>
BR>