JDK-8088670 : Remove use of internal classes methods from toys
  • Type: Bug
  • Component: javafx
  • Sub-Component: samples
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-04-07
  • Updated: 2015-08-29
  • Resolved: 2015-08-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Fixed
Related Reports
Relates :  
Description
See RT-40184 for a description of the general problem. As with the shipping samples we need to remove the references to com.sun.** FX classes in order for them to continue working with the modular JDK.

Since the toys are all supposed to be self-contained, we don't want to create common utility classes in most cases; we will likely end up remove much of the code that was using the internal classes and methods (e.g., performance tracking).

Exceptions might be made in some cases, but we don't want wholesale copying of internal FX classes.
Comments
I have filed JDK-8134716 as a follow up work once Control work is done.
29-08-2015

Changeset: b759c97f60fa Author: Chien Yang <chien.yang@oracle.com> Date: 2015-08-28 16:55 -0700 URL: http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/b759c97f60fa
29-08-2015

+1
28-08-2015

Here is the new webrev after receiving from feedback Dave, Kevin and Leif: http://cr.openjdk.java.net/~ckyang/JDK-8088670/webrev.01/ 1) Reverted the change to HelloHighContrast in order avoid code conflict with Leif's work. I will file a separate JIRA to complete this work and dialog (Control). 2) Moved robot testing out of HelloSanity and create a new Robot test project in tests/manual. 3) Removed unnecessary performance tracker use in some toys. Here is the remaining internal classes referenced in toys after this fix: ./Hello/src/main/java/hello/dialog/dialogs/CommandLinksDialog.java:import com.sun.javafx.scene.control.skin.AccordionSkin; ./Hello/src/main/java/hello/dialog/dialogs/CommandLinksDialog.java:import com.sun.javafx.scene.control.skin.resources.ControlResources; ./Hello/src/main/java/hello/dialog/dialogs/ExceptionDialog.java:import com.sun.javafx.scene.control.skin.AccordionSkin; ./Hello/src/main/java/hello/dialog/dialogs/FontSelectorDialog.java:import com.sun.javafx.scene.control.skin.AccordionSkin; ./Hello/src/main/java/hello/dialog/wizard/Wizard.java:import com.sun.javafx.scene.control.skin.AccordionSkin; ./Hello/src/main/java/hello/HelloFPS.java:import com.sun.javafx.perf.PerformanceTracker; ./Hello/src/main/java/hello/HelloHighContrast.java:import com.sun.javafx.css.StyleManager; ./iOS/iPodAccessTest/src/ipodaccesstest/IPodAccessTest.java:import com.sun.javafx.ext.device.ios.ipod.MediaQuery; ./iOS/iPodAccessTest/src/ipodaccesstest/IPodAccessTest.java:import com.sun.javafx.ext.device.ios.ipod.MediaItem; ./iOS/iPodAccessTest/src/ipodaccesstest/IPodAccessTest.java:import com.sun.javafx.ext.device.ios.ipod.MediaFilter;
28-08-2015

4) HelloHighContrast: This is being changed as part of the CSS work. However, it still uses PlatformImpl.setAccessibilityTheme(). Maybe that method should be provided in Application also, akin to setUserAgentStylesheet()?
26-08-2015

Dave, Jonathan and Kevin, This isn't the final fix. I just want you to review it and let me know your thought to the proposed fix on the following affected toys: http://cr.openjdk.java.net/~ckyang/JDK-8088670/webrev.00/ 1) Dialog related toys are left untouched for Jonathan to fix as part of the Control work. 2) iOS toys are left untouched since we don't build plus it is an ext that we may want to obsolete. 3) HelloFPS: Pending on public API support 4) HelloHighContrast: Propose to move to tests/manual since it uses internal class for testing 5) HelloSanity (uses TestBuilder): Propose to move to tests/manual since it uses internal class for testing 6) Industrial: Propose to remove performance tracker for now. We can add it back if its support is made public.
26-08-2015

Per discussion with Elina and an earlier recommendation from David, we should remove (for now) Glass robot from HelloSanity. We should also preserve the existing HelloSanity with robot since it is useful for testing.
04-05-2015

Patch with partial solution is attached
04-05-2015

List of internal classes used in apps/toys/**: ./Industrial/src/industrial/Controller.java:import com.sun.javafx.perf.PerformanceTracker; ./Industrial/src/industrial/Industrial.java:import com.sun.javafx.perf.PerformanceTracker; ./iOS/SensorsTest/src/sensorstest/SensorsPanel.java:com.sun.javafx.ext.device.ios.sensors.IOSLocationManager.addLocationListener( ./iOS/SensorsTest/src/sensorstest/SensorsPanel.java:new com.sun.javafx.ext.device.ios.sensors.IOSLocationManager.LocationListener() { ./iOS/SensorsTest/src/sensorstest/SensorsPanel.java:textAccelerometerA.setText(com.sun.javafx.ext.device.ios.sensors.IOSMotionManager.isAccelerometerAvailable() ? "AVAILABLE" : "NOT AVAILABLE"); ./iOS/SensorsTest/src/sensorstest/SensorsPanel.java:com.sun.javafx.ext.device.ios.sensors.IOSMotionManager.addAccelerationListener(new com.sun.javafx.ext.device.ios.sensors.IOSMotionManager.Listener() { ./iOS/SensorsTest/src/sensorstest/SensorsPanel.java:textGyroscopeA.setText(com.sun.javafx.ext.device.ios.sensors.IOSMotionManager.isGyroAvailable() ? "AVAILABLE" : "NOT AVAILABLE"); ./iOS/SensorsTest/src/sensorstest/SensorsPanel.java:com.sun.javafx.ext.device.ios.sensors.IOSMotionManager.addRotationListener(new com.sun.javafx.ext.device.ios.sensors.IOSMotionManager.Listener() { ./iOS/SensorsTest/src/sensorstest/SensorsPanel.java:textMagnetometerA.setText(com.sun.javafx.ext.device.ios.sensors.IOSLocationManager.isHeadingAvailable() ? "AVAILABLE" : "NOT AVAILABLE"); ./iOS/SensorsTest/src/sensorstest/SensorsPanel.java:com.sun.javafx.ext.device.ios.sensors.IOSLocationManager.addHeadingListener(new com.sun.javafx.ext.device.ios.sensors.IOSLocationManager.HeadingListener() { ./iOS/SensorsTest/src/sensorstest/SensorsPanel.java:com.sun.javafx.ext.device.ios.sensors.IOSDevice.getCurrentDevice().setProximityMonitoringEnabled(true); ./iOS/SensorsTest/src/sensorstest/SensorsPanel.java:System.out.println("PROXIMITY: " + com.sun.javafx.ext.device.ios.sensors.IOSDevice.getCurrentDevice().getProximityState()); ./iOS/SensorsTest/src/sensorstest/SensorsPanel.java:com.sun.javafx.ext.device.ios.sensors.IOSDevice.getCurrentDevice().setBatteryMonitoringEnabled(true); ./iOS/SensorsTest/src/sensorstest/SensorsPanel.java:textBatLevelValue.setText(String.valueOf(com.sun.javafx.ext.device.ios.sensors.IOSDevice.getCurrentDevice().getBatteryLevel())); ./iOS/SensorsTest/src/sensorstest/SensorsPanel.java:textBatStateValue.setText(String.valueOf(com.sun.javafx.ext.device.ios.sensors.IOSDevice.getCurrentDevice().getBatteryState())); ./iOS/SensorsTest/src/sensorstest/AttitudeIndicator.java:com.sun.javafx.ext.device.ios.sensors.IOSMotionManager.addAccelerationListener( ./iOS/SensorsTest/src/sensorstest/AttitudeIndicator.java:new com.sun.javafx.ext.device.ios.sensors.IOSMotionManager.Listener() { ./iOS/iPodAccessTest/src/ipodaccesstest/IPodAccessTest.java:import com.sun.javafx.ext.device.ios.ipod.MediaQuery; ./iOS/iPodAccessTest/src/ipodaccesstest/IPodAccessTest.java:import com.sun.javafx.ext.device.ios.ipod.MediaItem; ./iOS/iPodAccessTest/src/ipodaccesstest/IPodAccessTest.java:import com.sun.javafx.ext.device.ios.ipod.MediaFilter; ./Hello/src/main/java/hello/HelloRectangle3D.java:import com.sun.javafx.perf.PerformanceTracker; ./Hello/src/main/java/hello/HelloTouch.java:import com.sun.glass.ui.Robot; ./Hello/src/main/java/hello/dialog/wizard/Wizard.java:import com.sun.javafx.scene.control.skin.AccordionSkin; ./Hello/src/main/java/hello/dialog/dialogs/CommandLinksDialog.java:import com.sun.javafx.scene.control.skin.AccordionSkin; ./Hello/src/main/java/hello/dialog/dialogs/CommandLinksDialog.java:import com.sun.javafx.scene.control.skin.resources.ControlResources; ./Hello/src/main/java/hello/dialog/dialogs/ExceptionDialog.java:import com.sun.javafx.scene.control.skin.AccordionSkin; ./Hello/src/main/java/hello/dialog/dialogs/FontSelectorDialog.java:import com.sun.javafx.scene.control.skin.AccordionSkin; ./Hello/src/main/java/hello/HelloFPS.java:import com.sun.javafx.perf.PerformanceTracker; ./Hello/src/main/java/hello/HelloHighContrast.java:import com.sun.javafx.css.StyleManager; ./Hello/src/main/java/hello/HelloTiger.java:import com.sun.javafx.perf.PerformanceTracker; ./Hello/src/main/java/hello/TestBuilder.java:import com.sun.glass.events.KeyEvent; ./Hello/src/main/java/hello/TestBuilder.java:import com.sun.glass.ui.Robot; ./Hello/src/main/java/hello/TestBuilder.java:Robot robot = com.sun.glass.ui.Application.GetApplication().createRobot(); ./Hello/src/main/java/hello/TestBuilder.java:com.sun.glass.ui.Application.GetApplication().createRobot(); ./Hello/src/main/java/hello/TestBuilder.java:Robot robot = com.sun.glass.ui.Application.GetApplication().createRobot(); ./Hello/src/main/java/hello/TestBuilder.java:Robot robot = com.sun.glass.ui.Application.GetApplication().createRobot(); ./FX8-3DFeatures/src/fx83dfeatures/CameraController.java:import com.sun.javafx.geom.Vec2d; ./FX8-3DFeatures/src/fx83dfeatures/CameraController.java:import com.sun.javafx.geom.Vec3d; ./FX8-3DFeatures/src/fx83dfeatures/Camera3D.java:import com.sun.javafx.geom.Vec3d; ./FX8-3DFeatures/src/fx83dfeatures/Camera3D.java:import com.sun.javafx.geom.Vec3f;
16-04-2015

The first step is to generate a list of internal classes that are used by the java code in apps/toys/**
07-04-2015