changeset 474:5d036f19cdf0 2.1-b14

Automated merge with ssh://jpgodine@jfxsrc.us.oracle.com//javafx/2.1/MASTER/jfx/rt
author jpgodine@JPGODINE-LAP.st-users.us.oracle.com
date Tue, 21 Feb 2012 11:05:26 -0800
parents f1f9250942e5 9c735c19425d
children 4b9d01d9ba92 1db52c557d59 38646c36672e
files javafx-ui-common/src/com/sun/javafx/jmx/SGMXBeanAccessor.java javafx-ui-common/src/javafx/scene/Node.java
diffstat 6 files changed, 64 insertions(+), 75 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-concurrent/src/javafx/concurrent/Worker.java	Tue Feb 21 10:27:36 2012 -0500
+++ b/javafx-concurrent/src/javafx/concurrent/Worker.java	Tue Feb 21 11:05:26 2012 -0800
@@ -223,7 +223,7 @@
     public double getWorkDone();
 
     /**
-     * Gets the ReadOnlyLongProperty representing the current progress.
+     * Gets the ReadOnlyDoubleProperty representing the current progress.
      *
      * @return The property representing the amount of work done
      */
@@ -233,7 +233,7 @@
      * Indicates a maximum value for the {@link #workDoneProperty} property. The
      * totalWork will either be -1 (indicating that the amount of work
      * to do is indeterminate), or it will be a non-zero value less than or
-     * equal to Long.MAX_VALUE.
+     * equal to Double.MAX_VALUE.
      *
      * @see #workDoneProperty
      * @see #progressProperty
@@ -242,7 +242,7 @@
     public double getTotalWork();
 
     /**
-     * Gets the ReadOnlyLongProperty representing the maximum amount of work
+     * Gets the ReadOnlyDoubleProperty representing the maximum amount of work
      * that needs to be done. These "work units" have meaning to the Worker
      * implementation, such as the number of bytes that need to be downloaded
      * or the number of images to process or some other such metric.
@@ -265,7 +265,7 @@
     public double getProgress();
 
     /**
-     * Gets the ReadOnlyLongProperty representing the progress.
+     * Gets the ReadOnlyDoubleProperty representing the progress.
      *
      * @return the property representing the progress
      */
--- a/javafx-ui-common/src/com/sun/javafx/application/LauncherImpl.java	Tue Feb 21 10:27:36 2012 -0500
+++ b/javafx-ui-common/src/com/sun/javafx/application/LauncherImpl.java	Tue Feb 21 11:05:26 2012 -0800
@@ -25,7 +25,7 @@
 
 package com.sun.javafx.application;
 
-import com.sun.javafx.jmx.SGMXBeanAccessor;
+import com.sun.javafx.jmx.MXExtension;
 import com.sun.javafx.runtime.SystemProperties;
 import com.sun.javafx.PlatformUtil;
 import java.lang.reflect.Constructor;
@@ -156,7 +156,7 @@
             final String[] args) throws Exception {
 
         if (SystemProperties.isDebug()) {
-            SGMXBeanAccessor.registerSGMXBean();
+            MXExtension.initializeIfAvailable();
         }
 
         final CountDownLatch startupLatch = new CountDownLatch(1);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/jmx/MXExtension.java	Tue Feb 21 11:05:26 2012 -0800
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.javafx.jmx;
+
+import com.sun.javafx.Logging;
+
+public abstract class MXExtension {
+    private static final String EXTENSION_CLASS_NAME =
+            System.getProperty("javafx.debug.jmx.class",
+                               "com.oracle.javafx.jmx.MXExtensionImpl");
+
+    public abstract void intialize() throws Exception;
+
+    public static void initializeIfAvailable() {
+        try {
+            final Class<MXExtension> mxExtensionClass =
+                    (Class<MXExtension>) Class.forName(EXTENSION_CLASS_NAME);
+
+            final MXExtension mxExtension = mxExtensionClass.newInstance();
+            mxExtension.intialize();
+        } catch (final Exception e) {
+            Logging.getJavaFXLogger().info(
+                    "Failed to initialize management extension", e);
+        }
+
+    }
+}
--- a/javafx-ui-common/src/com/sun/javafx/jmx/SGMXBeanAccessor.java	Tue Feb 21 10:27:36 2012 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.javafx.jmx;
-
-import com.oracle.javafx.jmx.SGMXBean;
-
-import javax.management.*;
-import java.lang.Object;
-import java.lang.management.ManagementFactory;
-
-/**
- * This class provides utility methods for Scene-graph JMX bean.
- */
-public class SGMXBeanAccessor {
-
-    private static final String sgBeanClass = System.getProperty("javafx.debug.jmx.class", "com.oracle.javafx.jmx.SGMXBeanImpl");
-
-    /**
-     * Instantiates and registers Scene-graph JMX bean ({@link SGMXBean})
-     * into default MBean server.
-     */
-    public static void registerSGMXBean() {
-        final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
-
-        try {
-            Object mxBean = Class.forName(sgBeanClass).newInstance();
-            if (!(mxBean instanceof SGMXBean)) {
-                throw new IllegalArgumentException("JMX: " + sgBeanClass + " does not implement " +
-                    SGMXBean.class.getName() + " interface.");
-            }
-
-            ObjectName mbeanName = new ObjectName("com.oracle.javafx.jmx:type=SGBean");
-            mbs.registerMBean(mxBean, mbeanName);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-}
--- a/javafx-ui-common/src/com/sun/javafx/tk/Toolkit.java	Tue Feb 21 10:27:36 2012 -0500
+++ b/javafx-ui-common/src/com/sun/javafx/tk/Toolkit.java	Tue Feb 21 11:05:26 2012 -0800
@@ -467,12 +467,12 @@
                                           boolean smooth);
     
     /*
-     * platformImage could be 
-     *   - an object returned by renderToImage method
+     * The loadPlatformImage method supports the following image types:
+     *   - an object returned by the renderToImage method
      *   - an instance of com.sun.prism.Image (in case of prism)
-     *   - an instance of BufferedImage (in case of SwingToolkit)
-     * TODO: distinguish methods for loading platform and external images  
-     *       when JavaFX Image has got a new constructor: Image(ImageLoader) 
+     *   - an instance of an external image object, which can be a BufferedImage 
+     * If JavaFX Image had one more constructor Image(ImageLoader), 
+     * we could introduce a different method for external image loading support.
      */
     
     public abstract ImageLoader loadPlatformImage(Object platformImage);
--- a/javafx-ui-common/src/javafx/scene/Node.java	Tue Feb 21 10:27:36 2012 -0500
+++ b/javafx-ui-common/src/javafx/scene/Node.java	Tue Feb 21 11:05:26 2012 -0800
@@ -416,9 +416,9 @@
 
     /**
      * Called only by Text to update the state and clear dirtybits in the PG graph
-     * TODO: This must be removed, and TextHelper should work with a PG node
-     * directly or some other means rather than using this method. This is a very
-     * dangerous method to have.
+     * TODO: This must be removed as soon as RT-13735 is complete, since
+     * TextHelper should work with a PG node directly or some other means rather
+     * than using this method.
      *
      * @treatAsPrivate implementation detail
      * @deprecated This is an internal API that is not intended for use and will be removed in the next version