changeset 5981:5aca75258738

RT-34744 [Touch, Lens] Scrolling is only possible using scroll bars Reviewed-by: dblaukop kcr jgiles
author Rafi Tayar <rafi.tayar@oracle.com>
date Mon, 06 Jan 2014 11:23:36 +0200
parents 44acc56c806e
children 423cf238579d
files buildSrc/armv6hf.gradle buildSrc/armv6sf.gradle buildSrc/x86egl.gradle modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ListViewSkin.java modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TableViewSkinBase.java modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TreeViewSkin.java
diffstat 6 files changed, 97 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/buildSrc/armv6hf.gradle	Fri Jan 03 13:32:45 2014 -0800
+++ b/buildSrc/armv6hf.gradle	Mon Jan 06 11:23:36 2014 +0200
@@ -183,11 +183,17 @@
 )
 
 ARMV6HF.javafxPlatformProperties ="""javafx.platform=eglfb
+directfb.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
+directfb.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
+directfb.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
 directfb.glass.platform=Lens
 directfb.glass.lens=dfb
 directfb.prism.order=sw
 directfb.com.sun.javafx.isEmbedded=true
 directfb.com.sun.javafx.scene.control.skin.FXVK.cache=true
+eglfb.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
+eglfb.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
+eglfb.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
 eglfb.glass.platform=Lens
 eglfb.glass.lens=eglfb
 eglfb.prism.order=es2
@@ -202,12 +208,18 @@
 eglfb.doNativeComposite=true
 eglfb.com.sun.javafx.scene.control.skin.FXVK.cache=true
 eglfb.prism.glDepthSize=0
+fb.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
+fb.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
+fb.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
 fb.glass.platform=Lens
 fb.glass.lens=fb
 fb.prism.order=sw
 fb.com.sun.javafx.isEmbedded=true
 fb.glass.restrictWindowToScreen=true
 fb.com.sun.javafx.scene.control.skin.FXVK.cache=true
+eglx11.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
+eglx11.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
+eglx11.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
 eglx11.glass.platform=Lens
 eglx11.glass.lens=eglx11
 eglx11.prism.order=es2
@@ -221,6 +233,9 @@
 eglx11.com.sun.javafx.isEmbedded=true
 eglx11.com.sun.javafx.scene.control.skin.FXVK.cache=true
 eglx11.prism.glDepthSize=0
+gtk.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
+gtk.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
+gtk.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
 gtk.glass.platform=gtk
 gtk.prism.order=sw
 gtk.com.sun.javafx.isEmbedded=true
--- a/buildSrc/armv6sf.gradle	Fri Jan 03 13:32:45 2014 -0800
+++ b/buildSrc/armv6sf.gradle	Mon Jan 06 11:23:36 2014 +0200
@@ -201,11 +201,17 @@
 )
 
 ARMV6SF.javafxPlatformProperties = """javafx.platform=eglfb
+directfb.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
+directfb.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
+directfb.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
 directfb.glass.platform=Lens
 directfb.glass.lens=dfb
 directfb.prism.order=sw
 directfb.com.sun.javafx.isEmbedded=true
 directfb.com.sun.javafx.scene.control.skin.FXVK.cache=true
+eglfb.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
+eglfb.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
+eglfb.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
 eglfb.maxTextureSize=2048
 eglfb.glass.platform=Lens
 eglfb.glass.lens=eglfb
@@ -221,12 +227,18 @@
 eglfb.com.sun.javafx.isEmbedded=true
 eglfb.com.sun.javafx.scene.control.skin.FXVK.cache=true
 eglfb.prism.glDepthSize=0
+fb.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
+fb.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
+fb.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
 fb.glass.platform=Lens
 fb.glass.lens=fb
 fb.prism.order=sw
 fb.com.sun.javafx.isEmbedded=true
 fb.glass.restrictWindowToScreen=true
 fb.com.sun.javafx.scene.control.skin.FXVK.cache=true
+eglx11.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
+eglx11.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
+eglx11.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
 eglx11.glass.platform=Lens
 eglx11.glass.lens=eglx11
 eglx11.prism.order=es2
@@ -240,6 +252,9 @@
 eglx11.com.sun.javafx.isEmbedded=true
 eglx11.com.sun.javafx.scene.control.skin.FXVK.cache=true
 eglx11.prism.glDepthSize=0
+gtk.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
+gtk.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
+gtk.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
 gtk.glass.platform=gtk
 gtk.prism.order=sw
 gtk.com.sun.javafx.isEmbedded=true
--- a/buildSrc/x86egl.gradle	Fri Jan 03 13:32:45 2014 -0800
+++ b/buildSrc/x86egl.gradle	Mon Jan 06 11:23:36 2014 +0200
@@ -145,11 +145,17 @@
 )
 
 X86EGL.javafxPlatformProperties ="""javafx.platform=eglfb
+directfb.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
+directfb.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
+directfb.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
 directfb.glass.platform=Lens
 directfb.glass.lens=dfb
 directfb.prism.order=sw
 directfb.com.sun.javafx.isEmbedded=true
 directfb.com.sun.javafx.scene.control.skin.FXVK.cache=true
+eglfb.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
+eglfb.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
+eglfb.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
 eglfb.glass.platform=Lens
 eglfb.glass.lens=eglfb
 eglfb.prism.order=es2
@@ -161,12 +167,18 @@
 eglfb.com.sun.javafx.isEmbedded=true
 eglfb.doNativeComposite=true
 eglfb.com.sun.javafx.scene.control.skin.FXVK.cache=true
+fb.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
+fb.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
+fb.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
 fb.glass.platform=Lens
 fb.glass.lens=fb
 fb.prism.order=sw
 fb.com.sun.javafx.isEmbedded=true
 fb.glass.restrictWindowToScreen=true
 fb.com.sun.javafx.scene.control.skin.FXVK.cache=true
+eglx11.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
+eglx11.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
+eglx11.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
 eglx11.glass.platform=Lens
 eglx11.glass.lens=eglx11
 eglx11.prism.order=es2
@@ -177,6 +189,9 @@
 eglx11.embedded=eglx11
 eglx11.com.sun.javafx.isEmbedded=true
 eglx11.com.sun.javafx.scene.control.skin.FXVK.cache=true
+gtk.com.sun.javafx.scene.control.skin.ListViewSkin.pannable=true
+gtk.com.sun.javafx.scene.control.skin.TreeViewSkin.pannable=true
+gtk.com.sun.javafx.scene.control.skin.TableViewSkin.pannable=true
 gtk.glass.platform=gtk
 gtk.prism.order=sw
 gtk.com.sun.javafx.isEmbedded=true
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ListViewSkin.java	Fri Jan 03 13:32:45 2014 -0800
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ListViewSkin.java	Mon Jan 06 11:23:36 2014 +0200
@@ -40,6 +40,10 @@
 import javafx.scene.input.MouseEvent;
 import javafx.scene.layout.StackPane;
 import javafx.util.Callback;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
 import com.sun.javafx.scene.control.behavior.ListViewBehavior;
 import com.sun.javafx.scene.control.skin.resources.ControlResources;
 
@@ -58,6 +62,19 @@
 //    private Label placeholderLabel;
     private static final String EMPTY_LIST_TEXT = ControlResources.getString("ListView.noContent");
 
+    // RT-34744 : IS_PANNABLE will be false unless
+    // com.sun.javafx.scene.control.skin.ListViewSkin.pannable
+    // is set to true. This is done in order to make ListView functional
+    // on embedded systems with touch screens which do not generate scroll
+    // events for touch drag gestures.
+    private static final boolean IS_PANNABLE =
+            AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
+                @Override
+                public Boolean run() {
+                    return Boolean.getBoolean("com.sun.javafx.scene.control.skin.ListViewSkin.pannable");
+                }
+            });
+
     private ObservableList<T> listViewItems;
 
     public ListViewSkin(final ListView<T> listView) {
@@ -67,7 +84,7 @@
 
         // init the VirtualFlow
         flow.setId("virtual-flow");
-        flow.setPannable(false);
+        flow.setPannable(IS_PANNABLE);
         flow.setVertical(getSkinnable().getOrientation() == Orientation.VERTICAL);
         flow.setFocusTraversable(getSkinnable().isFocusTraversable());
         flow.setCreateCell(new Callback<VirtualFlow, ListCell<T>>() {
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TableViewSkinBase.java	Fri Jan 03 13:32:45 2014 -0800
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TableViewSkinBase.java	Mon Jan 06 11:23:36 2014 +0200
@@ -63,6 +63,9 @@
 import javafx.scene.control.TablePositionBase;
 import javafx.scene.control.TableSelectionModel;
 
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
 /**
  *
  * @param <M> The type of the item stored in the cell
@@ -137,7 +140,18 @@
     private int itemCount = -1;
     protected boolean forceCellRecreate = false;
 
-
+    // RT-34744 : IS_PANNABLE will be false unless
+    // com.sun.javafx.scene.control.skin.TableViewSkin.pannable
+    // is set to true. This is done in order to make TableView functional
+    // on embedded systems with touch screens which do not generate scroll
+    // events for touch drag gestures.
+    private static final boolean IS_PANNABLE =
+            AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
+                @Override
+                public Boolean run() {
+                    return Boolean.getBoolean("com.sun.javafx.scene.control.skin.TableViewSkin.pannable");
+                }
+            });
 
     /***************************************************************************
      *                                                                         *
@@ -157,7 +171,7 @@
     // init isn't a constructor, but it is part of the initialisation routine
     protected void init(final C control) {
         // init the VirtualFlow
-        flow.setPannable(false);
+        flow.setPannable(IS_PANNABLE);
         flow.setFocusTraversable(control.isFocusTraversable());
         flow.setCreateCell(new Callback<VirtualFlow, I>() {
             @Override public I call(VirtualFlow flow) {
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TreeViewSkin.java	Fri Jan 03 13:32:45 2014 -0800
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TreeViewSkin.java	Mon Jan 06 11:23:36 2014 +0200
@@ -39,15 +39,32 @@
 import javafx.scene.layout.StackPane;
 import javafx.util.Callback;
 import java.lang.ref.WeakReference;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
 import com.sun.javafx.scene.control.behavior.TreeViewBehavior;
 
 public class TreeViewSkin<T> extends VirtualContainerBase<TreeView<T>, TreeViewBehavior<T>, TreeCell<T>> {
 
+    // RT-34744 : IS_PANNABLE will be false unless
+    // com.sun.javafx.scene.control.skin.TreeViewSkin.pannable
+    // is set to true. This is done in order to make TreeView functional
+    // on embedded systems with touch screens which do not generate scroll
+    // events for touch drag gestures.
+    private static final boolean IS_PANNABLE =
+            AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
+                @Override
+                public Boolean run() {
+                    return Boolean.getBoolean("com.sun.javafx.scene.control.skin.TreeViewSkin.pannable");
+                }
+            });
+
+
     public TreeViewSkin(final TreeView treeView) {
         super(treeView, new TreeViewBehavior(treeView));
 
         // init the VirtualFlow
-        flow.setPannable(false);
+        flow.setPannable(IS_PANNABLE);
         flow.setFocusTraversable(getSkinnable().isFocusTraversable());
         flow.setCreateCell(new Callback<VirtualFlow, TreeCell<T>>() {
             @Override public TreeCell<T> call(VirtualFlow flow) {