You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by Tjorven Lauchardt <tl...@newbase.de> on 2003/11/21 11:47:53 UTC
mouseclick on textelement
Hallo,
I need some help! I have build up a DOM tree, containing plenty groups,
which always look that way:
<g>
<rect..../>
<text...>...</text>
</g>
I added an event listener to every group Element (addEventListener()).
The function handleEvent(evt) of this EventListener, I added, reads the
x- and y-coordinate of the mouseclick:
((MouseEvent)evt).getClientX();
((MouseEvent)evt).getClientY();
If I click on the rect-element, I get reasonable results out of this two
functions. If I click on the text-element, the results are way to low,
simply false.
How comes? Have I done something wrongly, or thought wrongly?
Thank you for your advice!
Regards,
Tjorven
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org
Re: mouseclick on textelement
Posted by Tjorven Lauchardt <tl...@newbase.de>.
Hi Thomas,
> Of course 30secs after I sent the message I found it. The fix
> is now in CVS. Please let me know if this fixes the problem in
> your larger application.
Yes, my problem is solved by that fix! Thank you very much!
Regards,
Tjorven
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org
Re: mouseclick on textelement
Posted by Thomas DeWeese <Th...@Kodak.com>.
Thomas DeWeese wrote:
> Just to update you, the problem seems to be in the use of
> a double buffering. If I change setDoubleBufferRendering to false
> the problem goes away.
>
> I am of course looking to solve this problem but the above may
> allow you to continue working.
Hi Tjorven,
Of course 30secs after I sent the message I found it. The fix
is now in CVS. Please let me know if this fixes the problem in
your larger application.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org
Re: mouseclick on textelement
Posted by Thomas DeWeese <Th...@Kodak.com>.
Tjorven Lauchardt wrote:
> Hallo,
>
>> Any chance of getting a stand-alone reproducible test case?
>> I have a number of example apps that change the class attribute
>> repeatedly on a group so there must be something more to it than
>> just this.
>
> I am trying to write one, but - of course - I can not reproduce the
> error. I am going on, perhapsed I find an error in my code or I can
> reproduce the error, I will mail you then!
Hi Tjorven,
Just to update you, the problem seems to be in the use of
a double buffering. If I change setDoubleBufferRendering to false
the problem goes away.
I am of course looking to solve this problem but the above may
allow you to continue working.
>> You say it does not update the DOM at all. Do you mean
>> that it does not update the display at all, or if you ask for
>> the class attribute back does it give the 'old' value?
>
> Yes, the display is not updated, the DOM is. Maybe it's a stylesheet
> problem...?
>
> kind regards,
>
> tjorven
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-dev-help@xml.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org
Re: mouseclick on textelement
Posted by Tjorven Lauchardt <tl...@newbase.de>.
Hallo,
> Any chance of getting a stand-alone reproducible test case?
> I have a number of example apps that change the class attribute
> repeatedly on a group so there must be something more to it than
> just this.
I am trying to write one, but - of course - I can not reproduce the
error. I am going on, perhapsed I find an error in my code or I can
reproduce the error, I will mail you then!
> You say it does not update the DOM at all. Do you mean
> that it does not update the display at all, or if you ask for
> the class attribute back does it give the 'old' value?
Yes, the display is not updated, the DOM is. Maybe it's a stylesheet
problem...?
kind regards,
tjorven
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org
Re: mouseclick on textelement
Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Tjorven,
Any chance of getting a stand-alone reproducible test case?
I have a number of example apps that change the class attribute
repeatedly on a group so there must be something more to it than
just this.
Tjorven Lauchardt wrote:
> getCanvas().getUpdateManager().getUpdateRunnableQueue().invokeLater(new
> Runnable() {
> public void run() {
> Element e = (Element)((Element)evt.getTarget()).getParentNode();
> e.setAttribute("class","hiddenChildrenmo");
>
> I registered mouseover-, mouseout- and click-eventlistener to diverse
> group-elements, the example shows one of the handlings for a
> mouseover-event. If I move my mouse over these groups, it changes the
> class for the first 1-8 times and then does not update the DOM at all.
> But the function run is always invoked...
> This problem does not occur with the 1.5-release...
You say it does not update the DOM at all. Do you mean
that it does not update the display at all, or if you ask for
the class attribute back does it give the 'old' value?
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org
Re: mouseclick on textelement
Posted by Tjorven Lauchardt <tl...@newbase.de>.
Thomas DeWeese wrote:
> I am extremely surprised to hear this. Can you provide any more
> information? What sort of updates etc?
>
for example:
//--------------------------------------------------------
public void handleEvent(final Event evt) {
if (getCanvas().getUpdateManager()!= null)
getCanvas().getUpdateManager().getUpdateRunnableQueue().invokeLater(new
Runnable() {
public void run() {
Element e =
(Element)((Element)evt.getTarget()).getParentNode();
e.setAttribute("class","hiddenChildrenmo");
}
});
}
//-----------------------------------------------
I registered mouseover-, mouseout- and click-eventlistener to diverse
group-elements, the example shows one of the handlings for a
mouseover-event. If I move my mouse over these groups, it changes the
class for the first 1-8 times and then does not update the DOM at all.
But the function run is always invoked...
This problem does not occur with the 1.5-release...
Thank you, tjorven
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org
Re: mouseclick on textelement
Posted by Thomas DeWeese <Th...@Kodak.com>.
Tjorven Lauchardt wrote:
>> If you aren't using CVS I suggest you try that I fixed a bug
>> relating to the coordinates of text elements in events. You can
>> download a nightly dump of CVS from Apache if you don't want to
>> learn how to use CVS.
>
>
> The CVS version solved the problem, but another one appeared, that did
> not occur with the old version: if an event is fired, i give some
> changes to the DOM tree in the updatemanager:
I am extremely surprised to hear this. Can you provide any more
information? What sort of updates etc?
> getCanvas().getUpdateManager().getUpdateRunnableQueue().invokeLater(new
> Runnable() { public void run() {//
> here my updates...}
> }
> });
> But those are only displayed at the first event, never again.
> As I did not have this problem with the old version: which class
> contains the bug fix about the text coordinates? I would change them as
> a first solution.
The commit was done at: 2003/08/22 03:49:06
You can check the batik-dev archives for the diffs.
But I would really like to try and figure out what the new problem is.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org
Re: mouseclick on textelement
Posted by Tjorven Lauchardt <tl...@newbase.de>.
Hi,
Thomas DeWeese wrote:
> If you aren't using CVS I suggest you try that I fixed a bug
> relating to the coordinates of text elements in events. You can
> download a nightly dump of CVS from Apache if you don't want to
> learn how to use CVS.
The CVS version solved the problem, but another one appeared, that did
not occur with the old version: if an event is fired, i give some
changes to the DOM tree in the updatemanager:
getCanvas().getUpdateManager().getUpdateRunnableQueue().invokeLater(new
Runnable() { public void run() {// here my updates...}
}
});
But those are only displayed at the first event, never again.
As I did not have this problem with the old version: which class
contains the bug fix about the text coordinates? I would change them as
a first solution.
Thank you,
tjorven
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org
Re: mouseclick on textelement
Posted by Thomas DeWeese <Th...@Kodak.com>.
Tjorven Lauchardt wrote:
> I need some help! I have build up a DOM tree, containing plenty groups,
> which always look that way:
If you aren't using CVS I suggest you try that I fixed a bug
relating to the coordinates of text elements in events. You can
download a nightly dump of CVS from Apache if you don't want to
learn how to use CVS.
> <g>
> <rect..../>
> <text...>...</text>
> </g>
> I added an event listener to every group Element (addEventListener()).
> The function handleEvent(evt) of this EventListener, I added, reads the
> x- and y-coordinate of the mouseclick:
> ((MouseEvent)evt).getClientX();
> ((MouseEvent)evt).getClientY();
> If I click on the rect-element, I get reasonable results out of this two
> functions. If I click on the text-element, the results are way to low,
> simply false.
> How comes? Have I done something wrongly, or thought wrongly?
>
> Thank you for your advice!
>
> Regards,
>
> Tjorven
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-dev-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org