<AWT Dev> [10] JDK-8178361: JFileChooser does not allow to open folders with a double tap when using the touch screen interface

Alexey Ivanov alexey.ivanov at oracle.com
Mon Sep 25 12:00:47 UTC 2017


Hi Shashi,


On 25/09/2017 06:59, Shashidhara Veerabhadraiah wrote:
> RE: <AWT Dev> [10] JDK-8178361: JFileChooser does not allow to open 
> folders with a double tap when using the touch screen interface
>
> Hi Alexey, Please see below for my replies:
>
> <<...>> <<...>> <<...>>
>
> Thanks and regards,
>
> Shashi
>
> -----Original Message-----
> From:Alexey Ivanov
> Sent:Friday, September 22, 2017 5:26 PM
> To: Shashidhara Veerabhadraiah 
> <shashidhara.veerabhadraiah at oracle.com>; Sergey Bylokhov 
> <sergey.bylokhov at oracle.com>
> Cc:awt-dev at openjdk.java.net
> Subject:Re: <AWT Dev> [10] JDK-8178361: JFileChooser does not allow to 
> open folders with a double tap when using the touch screen interface
>
> Hi Shashi,
>
> On 19/09/2017 04:35, Shashidhara Veerabhadraiah wrote:
>
> > Hi Sergey, When I checked it was not working on the Java applications. 
> None of the controls could take touch click events but it used to 
> highlight because when we touch on the touch screen interface the 
> system moves the cursor over to the touch point thereby enabling mouse 
> focus events being sent.
>
> I cannot grasp the meaning of this sentence.
>
> What are touch click events?
>
> */[Shashi]/**/Below are therelatedmacros:/*
>
> #define WM_LBUTTONDOWN                  0x0201
>
> #define WM_LBUTTONDBLCLK                0x0203
>
> #define WM_POINTERDOWN                   0x0246
>
> */[Shashi]/*More appropriately, touchdoubletap events.On a technical 
> note,wheneverI did a double tap touch on the folder I could get 
> WM_POINTERDOWN(0x0246)and none of the left button down or left button 
> double click events. I have attached the proof for the same captured 
> as text file(for both touch double tap and a mouse double click 
> events).Please note that this behavior is seen after theremoval 
> ofEnableMouseInPointer() as it is/_not_/ required anymore(Please see 
> for the reply to your other email). I could not get left double click 
> event but instead only the left button down events via the mouse 
> double click. I think we use the time gap between the left button down 
> events and then convert to a double click event internally.
>

Double clicks as |WM_LBUTTONDBLCLK| are never received by AWT windows 
because |CS_DOUBLE| style is not set. The number of clicks is counted in 
|WmMouseDown| and is included in |MouseEvent|.

Yet the complete picture is still unclear to me. So when you double-tap, 
you get |WM_LBUTTONDOWN|, |WM_LBUTTONUP|, and then |WM_POINTERDOWN| 
followed by |WM_POINTERUP|, right?


> */[Shashi]/**/So in a way we can conclude that after we do 
> a/**/touch/**/double ta/**/p action there was no left button down 
> events that we received./**/Please note that this is the behavior if 
> we do a double tap touch/**/_on_/**/the file icon./*
>

Is the behaviour different if you double-tap on another component?

> What are mouse focus events?
>
> */[Shashi]/**/Since there are 2 components in the file chooser. One is 
> the icon and another is the file name. In the Java implementation the 
> file chooser dialog has the icon 
> r/**/epresentations/**/being/**/pretty small and usually it is 
> difficult to exactly/**/tap/**/on the icon!! If there is/**/a/**/touch 
> tap onto the file name we do receive/**/left button down and as well 
> as pointer down messages./**/I have attached a file containing the 
> proof of it for the same./*
>

It's a bit weird.
If you double-click a folder name with mouse, |JFileChooser| opens the 
folder.
If you delay the second click, |JFileChooser| initiates file name editing.
It corresponds to the behaviour of Windows Explorer for example.

When I double-tap a folder name in |JFileChooser|, it usually goes into 
name editing mode. It could be related to the fact that mouse is more 
accurate than a tap: it's easier to double-click than to double-tap. I 
mean that when you double-tap, the coordinates of the second tap could 
be /farther away/ from the first tap. Is it the case?


> */[Shashi]/**/This is actually a surprise for me and als/**/o tells me 
> that the type of an icon component and the file name components are 
> having different/**/behaviors/**/./**/I am not sure how I can change 
> this/**/behaviorof the icon component/**/./*
>
> <<...>>
>
> With this fix,we can touchon all the icons as highlighted aboveand 
> have the required actions being performed as expected, which 
> was/_not_/happening earlier.
>
> So the fix is not JFileChooser-specific, is it?
>
> */[Shashi]/**/No it is not./**/It enables the touch for all the 
> components./*
>

You should've mentioned it in your review request.
Otherwise, it looked as if the change is |JFileChooser| specific because 
you discussed only this component.


Regards,
Alexey


> Regards,
>
> Alexey
>
> >
>
> > Thanks and regards,
>
> > Shashi
>
> >
>
> > -----Original Message-----
>
> > From: Sergey Bylokhov
>
> > Sent: Tuesday, September 19, 2017 3:39 AM
>
> > To:shashidhara.veerabhadraiah at oracle.com<mailto:shashidhara.veerabhadraiah at oracle.com>>> 
> Shashidhara
>
> > Veerabhadraiah 
> <shashidhara.veerabhadraiah at oracle.com<mailto:shashidhara.veerabhadraiah at oracle.com>>
>
> > Cc:awt-dev at openjdk.java.net<mailto:awt-dev at openjdk.java.net>
>
> > Subject: Re: <AWT Dev> [10] JDK-8178361: JFileChooser does not allow
>
> > to open folders with a double tap when using the touch screen
>
> > interface
>
> >
>
> > Hi, Shashi.
>
> > Why the bug is JFileChooser specific?
>
> > Does it means that it works for other elements(buttons/lists/menu/etc)?
>
> >
>
> > On 9/18/17 08:58, Shashidhara Veerabhadraiah wrote:
>
> >> Hi All, Please review this software changes for the /_enhancement_/
>
> >> JDK-8178361.
>
> >>
>
> >> Issue: Request was filed to enable the touch event processing for
>
> >> Java client applications.
>
> >>
>
> >> Fix: Windows platform offers 'pointer' implementation thro' which one
>
> >> can tap for the touch inputs as well. A typical 'pointer' function
>
> >> may contain touch, pen, touch pad or mouse inputs. This allows for a
>
> >> uniform input processing though the event source may defer. This fix
>
> >> enables the 'touch' events(via TOUCH pointer) to be passed to the
>
> >> components using the other type of pointer 'mouse'. Essentially there
>
> >> is a conversion put in place to convert a touch event input into a
>
> >> left click mouse event. I think this is the right thing to do
>
> >> considering desktop scenarios to which the typical Java applications
>
> >> that gets exposed to. This is also the same behavior on my touch
>
> >> enabled windows 10 laptop as well. Please let me know if a different 
> behavior is expected. Below is the output:
>
> >>
>
> >> Now touch event works as a typical mouse left click as in general.
>
> >> But there is an issue because the icon size of the Java UI is
>
> >> typically small, touching that icon exactly is sometimes difficult.
>
> >> This is handled by an Windows application by having larger icon size
>
> >> or icon view as a standard. Hence I believe this is outside the scope
>
> >> this software update. Any changes to it would be done later as a new
>
> >> bug or an enhancement.
>
> >>
>
> >> Bug ID:https://bugs.openjdk.java.net/browse/JDK-8178361
>
> >>
>
> >> Webrev:http://cr.openjdk.java.net/~sveerabhadra/8178361/webrev.00/<http://cr.openjdk.java.net/%7Esveerabhadra/8178361/webrev.00/>
>
> >>
>
> >> Thanks and regards,
>
> >>
>
> >> Shashi
>
> >>
>
> >
>
> > --
>
> > Best regards, Sergey.
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20170925/a5333f2e/attachment-0001.html>


More information about the awt-dev mailing list