xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas DeWeese <Thomas.DeWe...@Kodak.com>
Subject Re: How do get the text that has been highligted
Date Tue, 08 Feb 2005 02:33:27 GMT
Hi Keith,

Keith Mayfield wrote:

> After a user has selected some text on the JSVGCanvas,
> which api's would give me the text that has been
> selected.  Some sample code would be great!!!

    Well the short answer is that it isn't that easy :/

    Probably the easiest thing to do is give yourself
access to the TextSelectionManager in the JGVTComponent.
then give yourself access to the textSelector in the
TextSelectionManager, this would then allow you to
register a SelectionListener to the canvas (this should
probably be exposed on the canvas).

    The selectionListener gets called with a SelectionEvent
from which you can get the current Selection Object.  I
think this is currently an AttributedCharacterIterator
but you can get just a string from that if you want.



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


Mime
View raw message