changeset 1166:85b700eea97b 2.2-b11

Automated merge with ssh://jpgodine@jfxsrc.us.oracle.com//javafx/2.2/MASTER/jfx//rt
author jpgodine@JPGODINE-LAP.st-users.us.oracle.com
date Tue, 29 May 2012 09:13:28 -0700
parents 0ea7e10711c9 6fb22b665cf6
children 87d53f13f4d4 c8c19d5e7527 39958459bb92 d39767c34385
files javafx-ui-common/src/javafx/scene/Scene.java javafx-ui-common/src/javafx/scene/doc-files/cssref.html
diffstat 5 files changed, 57 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-common/src/com/sun/javafx/application/PlatformImpl.java	Mon May 28 20:05:11 2012 -0700
+++ b/javafx-ui-common/src/com/sun/javafx/application/PlatformImpl.java	Tue May 29 09:13:28 2012 -0700
@@ -38,6 +38,8 @@
 import com.sun.javafx.tk.TKListener;
 import com.sun.javafx.tk.TKStage;
 import com.sun.javafx.tk.Toolkit;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 
 public class PlatformImpl {
 
@@ -48,6 +50,7 @@
     private static AtomicBoolean listenersRegistered = new AtomicBoolean(false);
     private static TKListener toolkitListener = null;
     private static volatile boolean implicitExit = true;
+    private static boolean taskbarApplication = true;
     private static AtomicInteger pendingRunnables = new AtomicInteger(0);
     private static AtomicInteger numWindows = new AtomicInteger(0);
     private static volatile boolean firstWindowShown = false;
@@ -58,6 +61,25 @@
     private final static Object runLaterLock = new Object();
 
     /**
+     * Set a flag indicating whether this application should show up in the
+     * task bar. The default value is true.
+     *
+     * @param taskbarApplication the new value of this attribute
+     */
+    public static void setTaskbarApplication(boolean taskbarApplication) {
+        PlatformImpl.taskbarApplication = taskbarApplication;
+    }
+
+    /**
+     * Returns the current value of the taskBarApplication flag.
+     *
+     * @return the current state of the flag.
+     */
+    public static boolean isTaskbarApplication() {
+        return taskbarApplication;
+    }
+
+    /**
      * This method is invoked typically on the main thread. At this point,
      * the JavaFX Application Thread has not been started. Any attempt
      * to call startup twice results in an exception.
@@ -78,6 +100,15 @@
             return;
         }
 
+        if (!taskbarApplication) {
+            AccessController.doPrivileged(new PrivilegedAction<Void>() {
+                @Override public Void run() {
+                    System.setProperty("com.sun.glass.taskbarApplication", "false");
+                    return null;
+                }
+            });
+        }
+
         // Create Toolkit listener and register it with the Toolkit.
         // Call notifyFinishListeners when we get notified.
         toolkitListener = new TKListener() {
--- a/javafx-ui-common/src/javafx/scene/Node.java	Mon May 28 20:05:11 2012 -0700
+++ b/javafx-ui-common/src/javafx/scene/Node.java	Tue May 29 09:13:28 2012 -0700
@@ -319,9 +319,8 @@
 @IDProperty("id")
 public abstract class Node implements EventTarget {
 
-     // PERF: TODO remove before shipping
      static {
-          PerformanceTracker.logEvent("Node.fx class loaded");
+          PerformanceTracker.logEvent("Node class loaded");
      }
 
     /**************************************************************************
@@ -2952,12 +2951,22 @@
      * to promote from a RectBounds to a BoxBounds (3D).
      */
     BaseBounds getTransformedBounds(BaseBounds bounds, BaseTransform tx) {
-        // TODO couldn't we also take a fastpath for cases where tx is
-        // simply a translation?
         updateLocalToParentTransform();
-        if (tx.isIdentity()) {
+        if (tx.isTranslateOrIdentity()) {
             updateTxBounds();
             bounds = bounds.deriveWithNewBounds(txBounds);
+            if (!tx.isIdentity()) {
+                final double translateX = tx.getMxt();
+                final double translateY = tx.getMyt();
+                final double translateZ = tx.getMzt();
+                bounds = bounds.deriveWithNewBounds(
+                                    (float) (bounds.getMinX() + translateX),
+                                    (float) (bounds.getMinY() + translateY),
+                                    (float) (bounds.getMinZ() + translateZ),
+                                    (float) (bounds.getMaxX() + translateX),
+                                    (float) (bounds.getMaxY() + translateY),
+                                    (float) (bounds.getMaxZ() + translateZ));
+            }
             return bounds;
         } else if (localToParentTx.isIdentity()) {
             return getLocalBounds(bounds, tx);
@@ -3854,9 +3863,8 @@
     @Deprecated
     public final Node impl_pickNode(double parentX, double parentY) {
 
-        // TODO this check for whether there is no scene is dubious and complicates testing
         // In some conditions we can omit picking this node or subgraph
-        if (getScene() == null || !isVisible() || isDisable() || isMouseTransparent()) {
+        if (!isVisible() || isDisable() || isMouseTransparent()) {
             return null;
         }
 
@@ -3917,9 +3925,8 @@
     @Deprecated
     public final Node impl_pickNode(PickRay pickRay) {
 
-        // TODO this check for whether there is no scene is dubious and complicates testing
         // In some conditions we can omit picking this node or subgraph
-        if (getScene() == null || !isVisible() || isDisable() || isMouseTransparent()) {
+        if (!isVisible() || isDisable() || isMouseTransparent()) {
             return null;
         }
 
@@ -3955,19 +3962,6 @@
      */
     @Deprecated
     protected final boolean impl_intersects(PickRay pickRay) {
-        // TODO: Need to handle clip and effect
-        return contentIntersects(pickRay);
-    }
-
-    /**
-     * Returns true if the content of this node contains given coordinates.
-     * "Content" doesn't include filters like effect or clip.
-     *
-     * @param pickRay
-     * @return true if node's content contains passed point, false otherwise
-     */
-    private boolean contentIntersects(PickRay pickRay) {
-
         double origZ = pickRay.getOriginNoClone().z;
         double dirZ = pickRay.getDirectionNoClone().z;
         // Handle the case where pickRay is almost parallel to the Z-plane
--- a/javafx-ui-common/src/javafx/scene/Scene.java	Mon May 28 20:05:11 2012 -0700
+++ b/javafx-ui-common/src/javafx/scene/Scene.java	Tue May 29 09:13:28 2012 -0700
@@ -1105,8 +1105,8 @@
         int yMin = (int)Math.floor(y);
         int xMax = (int)Math.ceil(x + w);
         int yMax = (int)Math.ceil(y + h);
-        int width = xMax - xMin;
-        int height = yMax - yMin;
+        int width = Math.max(xMax - xMin, 1);
+        int height = Math.max(yMax - yMin, 1);
         if (wimg == null) {
             wimg = new WritableImage(width, height);
         } else {
--- a/javafx-ui-common/src/javafx/scene/doc-files/cssref.html	Mon May 28 20:05:11 2012 -0700
+++ b/javafx-ui-common/src/javafx/scene/doc-files/cssref.html	Tue May 29 09:13:28 2012 -0700
@@ -2992,6 +2992,12 @@
       </thead>
       <tbody>
         <tr>
+          <td class="propertyname">-fx-context-menu-enabled</td>
+          <td class="value"><a href="#typeboolean" class="typelink">&lt;boolean&gt;</a></td>
+          <td>true</td>
+          <td>&nbsp;</td>
+        </tr>
+        <tr>
           <td class="propertyname">-fx-font-smoothing-type</td>
           <td class="value">[ gray | lcd ] </td>
           <td>lcd</td>
--- a/javafx-ui-controls/src/javafx/scene/control/TextInputControl.java	Mon May 28 20:05:11 2012 -0700
+++ b/javafx-ui-controls/src/javafx/scene/control/TextInputControl.java	Tue May 29 09:13:28 2012 -0700
@@ -50,6 +50,7 @@
 import java.text.BreakIterator;
 
 import com.sun.javafx.Utils;
+import com.sun.javafx.beans.annotations.MovedFromSubclass;
 import com.sun.javafx.binding.ExpressionHelper;
 import com.sun.javafx.css.StyleManager;
 
@@ -170,6 +171,7 @@
         }
     };
     public final StringProperty promptTextProperty() { return promptText; }
+    @MovedFromSubclass
     public final String getPromptText() { return promptText.get(); }
     public final void setPromptText(String value) { promptText.set(value); }