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 Shekhar Bhati <sh...@gmail.com> on 2009/09/04 15:16:15 UTC

Issue in setting the canvas size( Mouse click not active in whole area of the applet)

Hi Batik experts,

I am using Batik in visualizing my application images.

I have a functionality of highlighting/unhighlighting objects ,which
is when I click on a particular object(image) , it gets highlighted
and if I click anywhere else on the frame(applet) it should get
unhighlighted.

The issue is when an object is highlighted then only between a fix
area only the unhighlighting is working.
Even when i try to track the mouse click action then also it is not
able to sense the click event beside that particular area..

Is it the problem of canvas size?

How can I enable my mouse click event all over the applet?

Thanks & regards,

Shekhar

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


Re: Issue in setting the canvas size( Mouse click not active in whole area of the applet)

Posted by Shekhar Bhati <sh...@gmail.com>.
Hi Jonathan,

Thanks for reply.

Our case is little different.We are not using actual SVG files, we
have jsp pages with embedded svg tags in that.
We have a frame in our application which has these images and this
ungighlighting only works only within some specific area of that
frame.
I will try to implement your suggestion in some way into my framewoek
and get back to you.

Thanks again.

On Tue, Sep 8, 2009 at 11:20 PM, jonathan
wood<jo...@gmail.com> wrote:
> Corrections...
>
> use a <rect> instead of a <g> for the glasspane and ensure it covers the
> entire svg/viewBox
>
> sorry for the confusion
>
>
> On Tue, Sep 8, 2009 at 1:47 PM, jonathan wood <jo...@gmail.com>
> wrote:
>>
>> Hi Shekhar,
>>
>>   If I understand correctly, you have 1 (or more) elements on the canvas
>> and you would like to highlight the clicked one and unhighlight when the
>> background is clicked.  The below assumes that...
>>
>> One method is to add a "glass pane" to the canvas in order to capture the
>> "off" events.
>>
>> Add a <g> behind all other elements.
>> ensure that the <g> tag pointer-events="all" or other (see
>> http://www.w3.org/TR/SVG/interact.html#PointerEventsProperty)
>> Add a listener for the <g>
>>
>> you'll have to manage the event bubbling with this method, but it is
>> pretty easy to implement
>>
>>
>> Hope this helps,
>>
>>
>> Jonathan
>>
>> On Tue, Sep 8, 2009 at 9:02 AM, Shekhar Bhati <sh...@gmail.com>
>> wrote:
>>>
>>> Can anyone suggest something regarding below mentioned issue with batik?
>>>
>>> Thanks,
>>> Shekhar
>>>
>>>
>>> ---------- Forwarded message ----------
>>> From: Shekhar Bhati <sh...@gmail.com>
>>> Date: Fri, Sep 4, 2009 at 6:46 PM
>>> Subject: Issue in setting the canvas size( Mouse click not active in
>>> whole area of the applet)
>>> To: batik-users@xmlgraphics.apache.org
>>>
>>>
>>> Hi Batik experts,
>>>
>>> I am using Batik in visualizing my application images.
>>>
>>> I have a functionality of highlighting/unhighlighting objects ,which
>>> is when I click on a particular object(image) , it gets highlighted
>>> and if I click anywhere else on the frame(applet) it should get
>>> unhighlighted.
>>>
>>> The issue is when an object is highlighted then only between a fix
>>> area only the unhighlighting is working.
>>> Even when i try to track the mouse click action then also it is not
>>> able to sense the click event beside that particular area..
>>>
>>> Is it the problem of canvas size?
>>>
>>> How can I enable my mouse click event all over the applet?
>>>
>>> Thanks & regards,
>>>
>>> Shekhar
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
>>> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>>>
>>
>
>

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


Re: Issue in setting the canvas size( Mouse click not active in whole area of the applet)

Posted by jonathan wood <jo...@gmail.com>.
Corrections...

use a <rect> instead of a <g> for the glasspane and ensure it covers the
entire svg/viewBox

sorry for the confusion


On Tue, Sep 8, 2009 at 1:47 PM, jonathan wood <jo...@gmail.com>wrote:

> Hi Shekhar,
>
>   If I understand correctly, you have 1 (or more) elements on the canvas
> and you would like to highlight the clicked one and unhighlight when the
> background is clicked.  The below assumes that...
>
> One method is to add a "glass pane" to the canvas in order to capture the
> "off" events.
>
> Add a <g> behind all other elements.
> ensure that the <g> tag pointer-events="all" or other (see
> http://www.w3.org/TR/SVG/interact.html#PointerEventsProperty)
> Add a listener for the <g>
>
> you'll have to manage the event bubbling with this method, but it is pretty
> easy to implement
>
>
> Hope this helps,
>
>
> Jonathan
>
>
> On Tue, Sep 8, 2009 at 9:02 AM, Shekhar Bhati <sh...@gmail.com>wrote:
>
>> Can anyone suggest something regarding below mentioned issue with batik?
>>
>> Thanks,
>> Shekhar
>>
>>
>> ---------- Forwarded message ----------
>> From: Shekhar Bhati <sh...@gmail.com>
>> Date: Fri, Sep 4, 2009 at 6:46 PM
>> Subject: Issue in setting the canvas size( Mouse click not active in
>> whole area of the applet)
>> To: batik-users@xmlgraphics.apache.org
>>
>>
>> Hi Batik experts,
>>
>> I am using Batik in visualizing my application images.
>>
>> I have a functionality of highlighting/unhighlighting objects ,which
>> is when I click on a particular object(image) , it gets highlighted
>> and if I click anywhere else on the frame(applet) it should get
>> unhighlighted.
>>
>> The issue is when an object is highlighted then only between a fix
>> area only the unhighlighting is working.
>> Even when i try to track the mouse click action then also it is not
>> able to sense the click event beside that particular area..
>>
>> Is it the problem of canvas size?
>>
>> How can I enable my mouse click event all over the applet?
>>
>> Thanks & regards,
>>
>> Shekhar
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
>> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>>
>>
>

Re: Issue in setting the canvas size( Mouse click not active in whole area of the applet)

Posted by jonathan wood <jo...@gmail.com>.
Hi Shekhar,

  If I understand correctly, you have 1 (or more) elements on the canvas and
you would like to highlight the clicked one and unhighlight when the
background is clicked.  The below assumes that...

One method is to add a "glass pane" to the canvas in order to capture the
"off" events.

Add a <g> behind all other elements.
ensure that the <g> tag pointer-events="all" or other (see
http://www.w3.org/TR/SVG/interact.html#PointerEventsProperty)
Add a listener for the <g>

you'll have to manage the event bubbling with this method, but it is pretty
easy to implement


Hope this helps,


Jonathan

On Tue, Sep 8, 2009 at 9:02 AM, Shekhar Bhati <sh...@gmail.com>wrote:

> Can anyone suggest something regarding below mentioned issue with batik?
>
> Thanks,
> Shekhar
>
>
> ---------- Forwarded message ----------
> From: Shekhar Bhati <sh...@gmail.com>
> Date: Fri, Sep 4, 2009 at 6:46 PM
> Subject: Issue in setting the canvas size( Mouse click not active in
> whole area of the applet)
> To: batik-users@xmlgraphics.apache.org
>
>
> Hi Batik experts,
>
> I am using Batik in visualizing my application images.
>
> I have a functionality of highlighting/unhighlighting objects ,which
> is when I click on a particular object(image) , it gets highlighted
> and if I click anywhere else on the frame(applet) it should get
> unhighlighted.
>
> The issue is when an object is highlighted then only between a fix
> area only the unhighlighting is working.
> Even when i try to track the mouse click action then also it is not
> able to sense the click event beside that particular area..
>
> Is it the problem of canvas size?
>
> How can I enable my mouse click event all over the applet?
>
> Thanks & regards,
>
> Shekhar
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
>

Issue in setting the canvas size( Mouse click not active in whole area of the applet)

Posted by Shekhar Bhati <sh...@gmail.com>.
Can anyone suggest something regarding below mentioned issue with batik?

Thanks,
Shekhar


---------- Forwarded message ----------
From: Shekhar Bhati <sh...@gmail.com>
Date: Fri, Sep 4, 2009 at 6:46 PM
Subject: Issue in setting the canvas size( Mouse click not active in
whole area of the applet)
To: batik-users@xmlgraphics.apache.org


Hi Batik experts,

I am using Batik in visualizing my application images.

I have a functionality of highlighting/unhighlighting objects ,which
is when I click on a particular object(image) , it gets highlighted
and if I click anywhere else on the frame(applet) it should get
unhighlighted.

The issue is when an object is highlighted then only between a fix
area only the unhighlighting is working.
Even when i try to track the mouse click action then also it is not
able to sense the click event beside that particular area..

Is it the problem of canvas size?

How can I enable my mouse click event all over the applet?

Thanks & regards,

Shekhar

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