[prev in list] [next in list] [prev in thread] [next in thread] 

List:       batik-users
Subject:    Re: TextSelectionEvent
From:       "K. W. Landry" <kwlandry () gmail ! com>
Date:       2006-12-31 19:17:11
Message-ID: 9c828e4f0612311117u17835bd1v5f295840cdbc585a () mail ! gmail ! com
[Download RAW message or body]

Thomas,
Thanks, that's exactly what I need, I'll take a look at the Solitaire
example now.

Just a quick question, I guess I'm having trouble getting my head around
where DOMTextEvent is best used. What is the difference, if any, between
using DOMTextEvent and doing an addEventListener such as:

        evtTgt.addEventListener("keypress", new EventListener(){
            public void handleEvent(Event evt) {
//                evt.stopPropagation();
                DOMKeyEvent q = (DOMKeyEvent)evt;
                eid = evt.getTimeStamp();
                log.debug("SVGKeyListeners("+eid+")-KeyPress Event, Detail
is: "+q.getDetail()+", KeyCode is: "+q.getKeyCode());
                SVGOMElement soe = (SVGOMElement)evt.getCurrentTarget();
                d.execDOMMethod(nsURI, soe, "keypress", evt, eid);
                }
            }, false);

?

Is DOMTextEvent strictly for creating/generating an Event of the type Text
Event? If so, then what is DOMTextEvent.getData for? Is this where the
implementation provides the data to the calling method of the data the
implementation represents as the Text in the event?

Sorry for working this out on your time but I'm full in the thick of it and
don't want to have to backtrack to re-code if I don't have to,
Thanks,

K. W. Landry





On 12/31/06, thomas.deweese@kodak.com <thomas.deweese@kodak.com> wrote:
>
>
> Hi KW.
>
> "K. W. Landry" <kwlandry@gmail.com> wrote on 12/24/2006 08:08:02 PM:
>
> > Can anyone point me to any code segments that utilize DOMTextEvent?
>
>    Well we use DOMTextEvent for 'text entry' (typing on the
> keyboard).  I don't think there is any DOM 'TextSelectionEvent'.
>
> > I'm trying to work out how to leverage it in creating an edit
> > session for text on the jsvgcanvas.  I've read about using a
> > component instead but this effort has to be 100% DOM based.
>
>    The solitaire example does this, in the
> samples/solitaire/script/board.js.  This actually uses
> "keypress" events, but the idea is the same.
>

[Attachment #3 (text/html)]

Thomas, <br>Thanks, that&#39;s exactly what I need, I&#39;ll take a look at the \
Solitaire example now.<br><br>Just a quick question, I guess I&#39;m having trouble \
getting my head around where DOMTextEvent is best used. What is the difference, if \
any, between using DOMTextEvent and doing an addEventListener such as:  \
<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
evtTgt.addEventListener(&quot;keypress&quot;, new \
EventListener(){<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
public void handleEvent(Event evt) {<br>//&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; evt.stopPropagation();<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DOMKeyEvent q = \
(DOMKeyEvent)evt; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; eid = evt.getTimeStamp();<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
log.debug(&quot;SVGKeyListeners(&quot;+eid+&quot;)-KeyPress Event, Detail is: \
&quot;+q.getDetail()+&quot;, KeyCode is: \
&quot;+q.getKeyCode());<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; SVGOMElement soe = (SVGOMElement)evt.getCurrentTarget(); \
<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
d.execDOMMethod(nsURI, soe, &quot;keypress&quot;, evt, eid);<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }, false);<br><br>?<br><br>Is DOMTextEvent \
strictly for creating/generating an Event of the type Text Event? If so, then what is \
 DOMTextEvent.getData for? Is this where the implementation provides the data to the \
calling method of the data the implementation represents as the Text in the \
event?&nbsp; <br><br>Sorry for working this out on your time but I&#39;m full in the \
thick of it and don&#39;t want to have to backtrack to re-code if I don&#39;t have \
to,  <br>Thanks,<br><br>K. W. Landry<br><br><br> <br><br><br><div><span \
class="gmail_quote">On 12/31/06, <b class="gmail_sendername"><a \
href="mailto:thomas.deweese@kodak.com">thomas.deweese@kodak.com</a></b> &lt;<a \
href="mailto:thomas.deweese@kodak.com"> thomas.deweese@kodak.com</a>&gt; \
wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, \
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <br><font \
face="sans-serif" size="2">Hi KW.</font> <br>
<br><font size="2"><tt>&quot;K. W. Landry&quot; &lt;<a \
href="mailto:kwlandry@gmail.com" target="_blank" onclick="return \
top.js.OpenExtLink(window,event,this)">kwlandry@gmail.com</a>&gt; wrote on 12/24/2006 \
08:08:02 PM:<span class="q"><br> <br>
&gt; Can anyone point me to any code segments that utilize DOMTextEvent?
<br>
</span></tt></font>
<br><font size="2"><tt>&nbsp; &nbsp;Well we use DOMTextEvent for &#39;text entry&#39;
(typing on the</tt></font>
<br><font size="2"><tt>keyboard). &nbsp;I don&#39;t think there is any DOM \
&#39;TextSelectionEvent&#39;.</tt></font> <span class="q"><br>
<br><font size="2"><tt>&gt; I&#39;m trying to work out how to leverage it in
creating an edit <br>
&gt; session for text on the jsvgcanvas. &nbsp;I&#39;ve read about using a
<br>
&gt; component instead but this effort has to be 100% DOM based. &nbsp;
<br>
</tt></font>
<br></span><font size="2"><tt>&nbsp; &nbsp;The solitaire example does this, in the
</tt></font>
<br><font size="2"><tt>samples/solitaire/script/board.js. &nbsp;This actually
uses</tt></font>
<br><font size="2"><tt>&quot;keypress&quot; events, but the idea is the \
same.</tt></font> <br>
</blockquote></div><br>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic