changeset 5205:aa2b54350f69

RT-31427 Ensemble8: [Cursor sample content overlaps description area]
author dmasada
date Fri, 27 Sep 2013 16:47:55 -0700
parents cc58b4072446
children e9eb2ae5945d
files apps/samples/Ensemble8/src/samples/java/ensemble/samples/scenegraph/events/cursor/CursorApp.java
diffstat 1 files changed, 34 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/apps/samples/Ensemble8/src/samples/java/ensemble/samples/scenegraph/events/cursor/CursorApp.java	Fri Sep 27 16:12:48 2013 -0700
+++ b/apps/samples/Ensemble8/src/samples/java/ensemble/samples/scenegraph/events/cursor/CursorApp.java	Fri Sep 27 16:47:55 2013 -0700
@@ -38,6 +38,7 @@
 import javafx.scene.Parent;
 import javafx.scene.Scene;
 import javafx.scene.control.Label;
+import javafx.scene.control.ScrollPane;
 import javafx.scene.layout.TilePane;
 import javafx.stage.Stage;
 
@@ -51,43 +52,50 @@
 public class CursorApp extends Application {
     
     public Parent createContent() {
+
+        ScrollPane root = new ScrollPane();
+        root.setPrefSize(435, 269);
+        root.setMinSize(ScrollPane.USE_PREF_SIZE, ScrollPane.USE_PREF_SIZE);
+        root.setMaxSize(ScrollPane.USE_PREF_SIZE, ScrollPane.USE_PREF_SIZE);
+
         TilePane tilePaneRoot = new TilePane(5, 5);
         tilePaneRoot.setHgap(2);
         tilePaneRoot.setVgap(2);
         tilePaneRoot.getChildren().addAll(
-            createBox(Cursor.DEFAULT),
-            createBox(Cursor.CROSSHAIR),
-            createBox(Cursor.TEXT),
-            createBox(Cursor.WAIT),
-            createBox(Cursor.SW_RESIZE),
-            createBox(Cursor.SE_RESIZE),
-            createBox(Cursor.NW_RESIZE),
-            createBox(Cursor.NE_RESIZE),
-            createBox(Cursor.N_RESIZE),
-            createBox(Cursor.S_RESIZE),
-            createBox(Cursor.W_RESIZE),
-            createBox(Cursor.E_RESIZE),
-            createBox(Cursor.OPEN_HAND),
-            createBox(Cursor.CLOSED_HAND),
-            createBox(Cursor.HAND),
-            createBox(Cursor.DISAPPEAR),
-            createBox(Cursor.MOVE),
-            createBox(Cursor.H_RESIZE),
-            createBox(Cursor.V_RESIZE),
-            createBox(Cursor.NONE)
-        );       
-        return tilePaneRoot;
+                createBox(Cursor.DEFAULT),
+                createBox(Cursor.CROSSHAIR),
+                createBox(Cursor.TEXT),
+                createBox(Cursor.WAIT),
+                createBox(Cursor.SW_RESIZE),
+                createBox(Cursor.SE_RESIZE),
+                createBox(Cursor.NW_RESIZE),
+                createBox(Cursor.NE_RESIZE),
+                createBox(Cursor.N_RESIZE),
+                createBox(Cursor.S_RESIZE),
+                createBox(Cursor.W_RESIZE),
+                createBox(Cursor.E_RESIZE),
+                createBox(Cursor.OPEN_HAND),
+                createBox(Cursor.CLOSED_HAND),
+                createBox(Cursor.HAND),
+                createBox(Cursor.DISAPPEAR),
+                createBox(Cursor.MOVE),
+                createBox(Cursor.H_RESIZE),
+                createBox(Cursor.V_RESIZE),
+                createBox(Cursor.NONE));
+        root.setContent(tilePaneRoot);
+        return root;
     }
-    
+
     private Node createBox(Cursor cursor) {
         Label label = new Label(cursor.toString());
         label.setAlignment(Pos.CENTER);
-        label.setPrefSize(85, 85);
+        label.setWrapText(true);
+        label.setPrefSize(85, 65);
         label.setStyle("-fx-border-color: #aaaaaa; -fx-background-color: #dddddd;");
         label.setCursor(cursor);
         return label;
-    }  
-    
+    }
+
     @Override
     public void start(Stage primaryStage) throws Exception {
         primaryStage.setScene(new Scene(createContent()));