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 Fabio Biscaro <bi...@webscience.it> on 2004/01/20 10:55:56 UTC
Selection and deselection
Hi Thomas. Thanks for your previous suggestions with selection.
Selection is really a big problem for me because i Need to know what
text is selected. I saw that there are not info about selected text, so
I tried to force selectio with selectSubString.
The problem is that I should also force deselection.
I tried to modify SVGOMTextContentElement adding a new method
deselectText(). I added this method to many classes
(SVGTextContentSupport, SVGTextContent, ...) up to ConcreteTextSelector
where I call your method clearSelection().
clearSelection() works very well many times but not every time. Sometime
selection is not cleared. Instead i see that selection is correctly
cleared by your checkSelectGesture(). I copied code from
checkSelectGesture():
if (selectionNode != null)
selectionNode.getRoot()
.removeTreeGraphicsNodeChangeListener(this);
To my deselectText() and sometime work, some other gave me a
concurrentException.
You last time said that it would be easy to add deselectAll() function
to SVGSVGElement but you couldnt add it because 1.5.1 is Stable.
Can you suggest me some code to implement deselectAll() or to correct my
deselectText()?
Thanks,
Just for reading,
fabio
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org
Re: Selection and deselection
Posted by Thomas DeWeese <Th...@Kodak.com>.
Fabio Biscaro wrote:
> Thanks for your previous suggestions with selection.
Hi Fabio,
No problem.
> Selection is really a big problem for me because i Need to know what
> text is selected. I saw that there are not info about selected text, so
> I tried to force selectio with selectSubString.
Sure, I understand.
> The problem is that I should also force deselection.
>
> I tried to modify SVGOMTextContentElement adding a new method
> deselectText(). I added this method to many classes
> (SVGTextContentSupport, SVGTextContent, ...) up to ConcreteTextSelector
> where I call your method clearSelection().
It would be much better to implement the official SVG DOM
method on SVGSVGElement rather than introducing a proprietary
method on Text Content.
> clearSelection() works very well many times but not every time. Sometime
> selection is not cleared. Instead i see that selection is correctly
> cleared by your checkSelectGesture(). I copied code from
> checkSelectGesture():
> if (selectionNode != null)
> selectionNode.getRoot()
> .removeTreeGraphicsNodeChangeListener(this);
> To my deselectText() and sometime work, some other gave me a
> concurrentException.
Well a concurrentException is a dead giveaway that you aren't
making your changes in the UpdateManager Thread. I suspect
that if you make your code that calls the method on the DOM
call it in the UpdateManager thread that all your problems will
go away (I suspect even just the 'clearSelection()' will work
- although the remove call doesn't hurt - it probably would be
a good idea to move that into the clearSelection method actually.
> You last time said that it would be easy to add deselectAll() function
> to SVGSVGElement but you couldnt add it because 1.5.1 is Stable.
>
> Can you suggest me some code to implement deselectAll() or to correct my
> deselectText()?
>
> Thanks,
> Just for reading,
> fabio
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org