javafx: new & noteworthy - rain focus · pdf filetitle: javafx 9 - new and noteworthy...

92

Upload: nguyenbao

Post on 31-Jan-2018

229 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM
Page 2: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM
Page 3: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JavaFX:New&Noteworthy

KevinRushforth &JonathanGilesJavaClientGroupSeptember19,2016

Page 4: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

SafeHarborStatementThefollowingisintendedtooutlineourgeneralproductdirection.Itisintendedforinformationpurposesonly,andmaynotbeincorporatedintoanycontract.Itisnotacommitmenttodeliveranymaterial,code,orfunctionality,andshouldnotberelieduponinmakingpurchasingdecisions.Thedevelopment,release,andtimingofanyfeaturesorfunctionalitydescribedforOracle’sproductsremainsatthesolediscretionofOracle.

Page 5: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

Agenda

JDK8UpdateReleases

ComingupinJDK9

LookingbeyondJDK9– updatereleasesandJDK10

Q&A

1

2

3

4

Page 6: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JDK8UpdateReleases

6

Page 7: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JDK8UpdateReleases• TypicallyJDKupdatereleasesarenotintendedtobefeaturereleases• ForJavaFX,wehaveshippedsubstantialimprovements:– 8u20• 723bugsfixedand83enhancements

– 8u40• Accessibility,newcontrols(Spinner,FilteredText,Dialogs),LCDtextonCanvas,3Duser-definednormals.• 562bugsfixedand89enhancements

– 8u60• UpgradedtonewerWebKit,andimprovedHigh-DPIsupportonWindows.• 257bugsfixedand29enhancements

7

Page 8: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JDK8MaintenanceReleases• AlldevelopmenteffortisonJDK9• Nopost-8u60enhancementsforJDK8line• Afew criticalbugfixescanbebackportedtoourquarterlyreleases– 8u102releasedon19July2016– 8u112scheduledfor18Oct2016– 8u122scheduledfor17Jan2017– Etc.

8

Page 9: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

ComingupinJDK9

9

Page 10: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

ComingupinJavaFXinJDK9• Jigsawmodules– JavaFXisnowmodularized– Strongencapsulation– JEP253:PublicUIControlskinsandmoreCSSAPIs– NewAPIsforpreviouslynon-publicfeatures

• Otherimprovements:– HighDPI:Linuxsupport+APItoquery&controlscaling– JEP283:EnableGTK3onLinux– UpdatedGStreamer andWebKit– Smallerenhancements+Bugfixes

Page 11: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JigsawModularity

11

Page 12: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JigsawModularity• JigsawModularityisthe primaryfeatureforJDK9– JEP200:TheModularJDK (Umbrella)• JEP201:Modular SourceCode• JEP220:ModularRun-TimeImages• JEP260:Encapsulate MostInternal APIs• JEP261:ModuleSystem

• ModularizingJavaFXisourmaingoalforJDK9!– JDK-8092093:ModularizationsupportforJavaFX(Umbrella)– Thiswas(andis)averylargeeffort– Thelackofnon-Jigsaw-related‘big-ticket’featuresisaresult• Wedidaddseveral“smaller”enhancements(morelater)

Page 13: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JigsawModularity:PropertiesofModules• Amoduleisacollectionofpackages– Apackagebelongstoexactlyonemodule– Splitpackageshavelongbeendiscouraged;withmodulestheyareforbidden

• Amoduleisoneof:– Explicitmodule:amodulethatisdefinedbyamodule-info.javafile– Automatic(implicit)module:ajarfileonthemodule-pathwithoutamodule-info.java– Unnamedmodule:classesontheclasspath areinthe“unnamed”module

13

Page 14: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JigsawModularity:PropertiesofModules• Anexplicitmodulelistsitsinputs(requires)andoutputs(exports)initsmodule-info.javafile–Onlyexportedpackagesarevisible(moreonthislater)– Itcanonlyaccesspackagesfrommodulesthatitreads(requires)

• Anautomaticmoduleexportsallpackagesandreadsallmodulesandtheunnamedmodule– Usefulfortransitioningnon-modularapplications

• Theunnamedmodulealsoexportsallpackagesandreadsallmodules– Anexplicitmodulecannot“require”theunnamedmodule– Providescompatibility(noneedtoexplicitlylistthemodulesthatyouaccess)

14

Page 15: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JigsawModularity:PropertiesofModules

• Thejavalauncherloadsonlythetransitiveclosureofmodulesrequiredbytheapplication– Alldefaultmodulesloadedifyourapplicationmainclassisintheunnamedmodule

• javapackager canproduceabundledappwithonlyneededmodules

15

Page 16: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JigsawModularity:JavaFXModules• JavaFXsourcecodeisorganizedasmodules

16

modules/javafx.base/javafx.controls/javafx.graphics/...

Page 17: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JigsawModularity:JavaFXModules• JavaFXclassesandresourcesarelinkedintotheJDKimage– Nomorejfxrt.jar

• SWTinteropisstilldeliveredasaseparatejarfile:– Cannotbelinkedintoruntimeimagebecauseitdependsonthird-partyswt.jar– Itisan“automatic”module(meaningnomodule-info.class)– Renamedtojavafx-swt.jar(formerlyjfxswt.jar)• Automaticmodulenameisderivedas:javafx.swt

17

Page 18: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JDKModulesJREModules

JigsawModularity:JavaFXModules

18

Publicjavafx.basejavafx.controlsjavafx.fxmljavafx.graphicsjavafx.mediajavafx.swingjavafx.web

Publicjdk.packagerjdk.packager.services

Internaljavafx.deploy [closed]

Page 19: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JigsawModularity:JavaFXModules• JavaFXmodulegraphforruntime(JRE)modules:transitivereduction

19

javafx.graphics

javafx.controls

javafx.base

javafx.mediajavafx.fxml javafx.swing

javafx.web

Page 20: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JigsawModularity:JavaFXModules• AllJavaFXapplicationsrequirejavafx.graphics

20

javafx.graphics

javafx.controls

javafx.base

javafx.mediajavafx.fxml javafx.swing

javafx.web

Page 21: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JigsawModularity:JavaFXModules• AllJavaFXUIapplicationsrequirejavafx.controls

21

javafx.graphics

javafx.controls

javafx.base

javafx.mediajavafx.fxml javafx.swing

javafx.web

Page 22: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JigsawModularity:ApplicationImpact• Classesinnon-modularapplicationsareinthe“unnamed”module– Bydefault,theunnamedmodulereads(requires)allnamedmodulesinthesystem– Canaccesspublictypesinpubliclyexportedpackagesofallmoduleswithoutchanges

• Modularapplicationsneedtolisttheirdependenciesinmodule-info.java– Exportedpackagesofrequiredmodulesareaccessible– Hereisaminimalmodule-info.javaforanapplicationthatusesthejavafx.controls,javafx.graphics,andjavafx.base modules(controlsre-exportsgraphicsandbase)

22

module my.app {requires javafx.controls;

}

Page 23: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JigsawModularity:JavaFXPackages• Onlypubliclydocumentedpackagesareexported– Allareinthejavafx.* namespace

23

javafx.base modulepackage javafx.beans;package javafx.beans.binding;package javafx.beans.property;package javafx.beans.property.adapter;package javafx.beans.value;package javafx.collections;package javafx.collections.transformation;package javafx.event;package javafx.util;package javafx.util.converter;

javafx.controls modulepackage javafx.scene.chart;package javafx.scene.control;package javafx.scene.control.cell;package javafx.scene.control.skin;

javafx.fxml modulepackage javafx.fxml;

Page 24: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JigsawModularity:JavaFXPackages

24

javafx.graphics modulepackage javafx.animation;package javafx.application;package javafx.concurrent;package javafx.css;package javafx.css.converter;package javafx.geometry;package javafx.print;package javafx.scene;package javafx.scene.canvas;package javafx.scene.effect;package javafx.scene.image;package javafx.scene.input;package javafx.scene.layout;package javafx.scene.paint;package javafx.scene.shape;package javafx.scene.text;package javafx.scene.transform;package javafx.stage;

javafx.media modulepackage javafx.scene.media;

javafx.swing modulepackage javafx.embed.swing;

javafx.web modulepackage javafx.scene.web;

Page 25: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JigsawModularity:Availability• ChangesforJavaFXmodularityareinthemainOpenJFX repo:– http://hg.openjdk.java.net/openjfx/9-dev/rt

• StableearlyaccessJDK9buildsareavailableonjava.net:– https://jdk9.java.net/download/– Thesebuildsincludethejavafx.*modules

• EarlyaccessJigsawbuildsfromjake sandboxalsoonjava.net:– https://jdk9.java.net/jigsaw/– Thisincludes“workinprogress”proposedchangesforsetAccessible,etc.– Thesebuildsalsoincludethejavafx.*modules– Pleasedownloadthisandtestyourapplication!

25

Page 26: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

StrongEncapsulation

OracleConfidential– Internal/Restricted/HighlyRestricted 26

Page 27: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

EncapsulationofModules• Onlyexplicitlyexportedpackagesarevisible– Providesstrictencapsulationofimplementationdetails– Internal“API”isnolongeraccessible– Accessinganytypeinanon-exportedpackagewillresultinanerror• Andno,youcan’tsimplyusereflectiontocallsetAccessible• Thiscanbeoverriddenwith“--add-exports”commandlineswitchinextremeneed

• Withinexportedpackages,onlypublictypesareaccessible– Accessinganynon-publictypewillresultinanerror• Aswiththepreviouscase,youcan’tsimplyusereflectiontocallsetAccessible• Thiscanbeoverriddenwith“--add-exports-private ”commandlineswitchinextremeneed

27

Page 28: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

EncapsulationofModules• Strongencapsulationmeansthesupported-nessofanAPIisclear:– Eachmodulethatyouaccesslistsitspubliclyexportedpackages– Aclassormethodyoucanaccesswithoutbreakingencapsulation(thatis,withoutusing--add-exports or –add-exports-private)ispartoftheAPI

– Noriskof“hidden”dependenciesoninternalmethods/implementationdetails

• Non-modularappsthatonlyusepublicAPIwillrununmodified• Somemodificationsmaybeneededwhenmigratingapptomodules

28

Page 29: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

Encapsulation:ImpactonModularApplications• LaunchingaJavaFXApplication– TheJavaFXlauncherconstructsaninstanceofyourApplicationsubclass– ThismeansJavaFXmustbeabletoaccessthatclass– Youneedtoexportthecontainingpackagetojavafx.graphics (orpublicly)– Example:

module my.app {requires javafx.controls;

exports my.pkg to javafx.graphics;}

Page 30: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

Encapsulation:ImpactonModularApplications• Annotatingnon-publictypeswith@FXML– FXMLneedsabilitytoaccessyourprivatefieldsandmethods– Youneedto“exports private”yourpackagetojavafx.fxml– Example:

module my.app {requires javafx.controls;requires javafx.fxml;

exports private my.pkg to javafx.fxml;}

Page 31: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

ResourceEncapsulation:ImpactonModularApplications• Resourcesareencapsulatedsimilarlytoclasses• Class.getResource()willfindresourcesinmodulesifpackageisaccessible– Nomore“dippinginto”theinternalstoloadanothermodule’sresource

• ClassLoader.getResource()willnotfindresourcesinmodule– Amodularappcannotsimplyuse"/some/path/myresource.css"asstylesheetURL

Page 32: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

ResourceEncapsulation:ImpactonModularApplications• JavaFXhasseveralAPIsthattakeaURL(orurl String)– CSSStylesheets– FXMLLoader– Image&Media–WebEngine

• Anon-modularappcancontinuetouseClassLoader-relativeURLs• ModularapplicationsshoulduseClass.getResource()instead

Page 33: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

Encapsulationofimpl_“API”• JavaFXhasalwayshadpublicmethodsthatstartedwith‘impl_’,e.g.– Image.impl_getUrl() orContextMenu.impl_showRelativeToWindow()

• ThesewerehiddenfromAPIdocsandmarked@Deprecatedtoindicatethatapplicationsshouldnotusethem–Mostofthesewerejustimplementationdetails– Someweretherebecauseweweren’treadytocommittothemasfinalAPI

• Themodulesystemhidesnon-publicpackages,sowetooktheopportunitytocleanupourimpl_* APIsinJavaFX• Allimpl_* methodsaregone,butsomehavebecomepublicAPI

Page 34: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

Othercompatibilityissues:• Nodebuilderclasses– DeprecatedinJDK8(andnotpartofAPIdocs)andslatedforremoval– RemovedfromJDK9(asofbuild51)

• JMXsupport–Weusedtoshipastandalonejavafx-mx.jarfilewiththeJDK(notJRE)–WasunsupportedinJDK8– RemovedfromJDK9(asofbuild111)– ItisstillbuiltaspartofOpenJFX incasedevelopersneedit

Page 35: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

ImpactonJavaFXApplications:Summary• Allapplicationsneedtocheckandavoid:– UsinganyJavaFXcom.sun.*packageorimpl_method• Manyalreadyhaveapublicreplacement

– UsingsetAccessible toaccessnon-publictypes(eveninajavafx.*package)– AccesstoanyinternalJavaFXresources(e.g.,modena.css)– Nodebuilders

• Ifyouwanttomodularizeyourapplication,youalsoneedtoavoid:– UsingClassLoader.getResource (useClass.getResource instead)– Passing“classpath-relative”URLstringsforresourcesinyourmoduleintoCSS,etc.• Don’tdothis:scene.getStyleSheets().add("/path/to/my/resource/resource.css");

Page 36: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JEP253PrepareJavaFXUIControls&CSSAPIsforModularization

OracleConfidential– Internal/Restricted/HighlyRestricted 36

Page 37: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JDK8andEarlier::StateoftheNation::UIControls

JDK8shipswithapproximately64UIcontrols(orcriticalutilityclasses):

Accordion CheckMenuItem DateCell Labeled Pagination ScrollBar SplitPane TextField ToolBar

Alert ChoiceBox DatePicker ListCell PasswordField ScrollPane Tab TextInputControl Tooltip

Button ChoiceDialog Dialog ListView PopupControl Separator TableCell TextInputDialog TreeCell

ButtonBar ColorPicker DialogPane Menu ProgressBar SeparatorMenuItem TableColumn TitledPane TreeItem

Cell ComboBox Hyperlink MenuBar ProgressIndicator Slider TableView Toggle TreeTableCell

CheckBox ContextMenu IndexedCell MenuButton RadioButton Spinner TabPane ToggleButton TreeTableColumn

CheckBoxTreeItem CustomMenuItem Label MenuItem RadioMenuItem SplitMenuButton TextArea ToggleGroup TreeTableView

TreeView

Page 38: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JDK8andEarlier::StateoftheNation::UIControls• JavaFXnowhasafullcomplementofexpectedUIcontrols– “Widebutnotdeep”

• Weneedtoiterate:– fillgapsinfunctionality,– fixingbugs,– improvingsupportforthirdpartyUIcontrols

Page 39: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JDK8andEarlier::StateoftheNation::UIControls• SomereleasesaremotivatedbychangesbeyondUIcontrols,butrequiresignificantchangestocontrols:– JavaFX2.0:• MovingtoJava• Introductionof‘Region’

– JavaFX8.0:• MigratingtoLambdas

– JavaFX8u40:• Introductionofaccessibilitysupport

• JDK9:Modules

Page 40: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JDK8andEarlier::StateoftheNation::UIControls

TounderstandJEP253,weneedtounderstand:

HowareUIControlsbuilt?(Note:Iampresentingafullsessiononthisat5:30pmtoday)

Page 41: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JDK8andEarlier::StateoftheNation::UIControls• MostUIcontrolsaresplitintothreecomponents:

Control

Behavior

Skin

Page 42: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JDK8andEarlier::StateoftheNation::UIControls• MostUIcontrolsaresplitintothreecomponents:

Control

Behavior

Skin

PublicAPI(javafx.scene.control)

PrivateImplementation(com.sun.javafx.scene.control.*)

Page 43: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JDK8andEarlier::StateoftheNation::CSS

WealsoneedtoaskthesamequestionforCSSAPIs:

WhatCSSAPIsexist,andwherearetheyused?

Page 44: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

CssMetaDataStyleableStyleablePropertySimpleStyleable*Property

JDK8andEarlier::StateoftheNation::CSS

Supportforcustomstyleable propertiescominginfromCSS,

e.g.–fx-custom-property: true;

Page 45: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

CssMetaDataStyleableStyleablePropertySimpleStyleable*PropertyPseudoClass

JDK8andEarlier::StateoftheNation::CSS

Supportforcustompseudoclass states.

e.g..button:javaone {..

}

Page 46: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

CssMetaDataStyleableStyleablePropertySimpleStyleable*PropertyPseudoClassParsedValueStyleOrigin

JDK8andEarlier::StateoftheNation::CSS

javafx.css

Page 47: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JDK8andEarlier::StateoftheNation::CSS

*ConverterUsedtoconvertCSSvaluesintoJavavalues,e.g.BooleanConverter converts‘true’or‘false’stringsintoBooleanvalues.

Page 48: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JDK8andEarlier::StateoftheNation::CSS

*ConverterCssParser

ImplementationandAPIresponsibleforconvertingcss syntaxintoaJavaFXCSSdatamodel.

Page 49: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JDK8andEarlier::StateoftheNation::CSS

*ConverterCssParserCSS data model:

CalculatedValueCascadingStyleCombinatorCssErrorDeclarationRule*Selector*SizeStyleStyleCacheStyleClassStyleMapStylesheet

Theactualdatamodel– i.e.theoutputfromtheCssParser class.Alargenumberofclasses…

Page 50: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JDK8andEarlier::StateoftheNation::CSS

*ConverterCssParserCSS data model:

CalculatedValueCascadingStyleCombinatorCssErrorDeclarationRule*Selector*SizeStyleStyleCacheStyleClassStyleMapStylesheet

StyleManager

com.sun.javafx.css

CssMetaDataStyleableStyleablePropertySimpleStyleable*PropertyPseudoClassParsedValueStyleOrigin

javafx.css

Page 51: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

MotivationforJEP253• UIControlsandCSSAPIshavealwayshadpublicAPIand‘private’API–Manyprojectscan’tresisttheurgetousecom.sun.*API.– Alwaysfrownedupon,butneverprevented(andimpossibletopreventanyway).

• JDK9withJigsawmodularityisabiggamechanger:– UpuntilJDK9,developerscoulduseAPIincom.sun.*packages.– JDK9enforcesboundaries- com.sun.*becomesunavailable

• SomeJavaFXappsandlibrarieswillfailtocompile/executeunderJDK9.

Page 52: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

MotivationforJEP253

Control

Behavior

Skin

PublicAPI(javafx.scene.control)

PrivateImplementation(com.sun.javafx.scene.control.*)

Page 53: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

MotivationforJEP253

*ConverterCssParserCSS data model:

CalculatedValueCascadingStyleCombinatorCssErrorDeclarationRule*Selector*SizeStyleStyleCacheStyleClassStyleMapStylesheet

StyleManager

com.sun.javafx.css

CssMetaDataStyleableStyleablePropertySimpleStyleable*PropertyPseudoClassParsedValueStyleOrigin

javafx.css

Page 54: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

MotivationforJEP253• WhydopeopleneedtousetheseAPIs?

• Manyapplicationsneedfunctionalitywejusthaven’tgotaroundtomakingpublicyet!

• Manycustomcontrolsbasetheirskinsonexistingskins,e.g.– CustomTextFieldSkin extendsTextFieldSkin– TextFieldSkin nolongeravailableatcompiletime

Page 55: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

MotivationforJEP253• JDK9moduleshasforcedourhand:–WeneedtomakepublicmoreAPI–Wecan’tdoeverything–WeneedtoidentifythemostimportantprivateAPI

• Currentapproachissplitintotwoprojects:– JEP253:UIControlsandCSSAPIs– ‘Smaller’JavaFXAPIs(discussedlater)

Page 56: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JDK9::Whatarewedoing• UsefulJEP253URLs:– http://openjdk.java.net/jeps/253– JDK-8076423 - Umbrellaproject

• JEP253issplitintotwosubprojects:1. JDK-8077916:MakeUIcontrolskinsintopublicAPIs2. JDK-8077918:ReviewandmakepublicrelevantCSSAPIs

Page 57: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JDK9::Whatarewedoing::ProgressReport• JDK-8077916:MakeUIcontrolskinsintopublicAPIs:• AllrelevantUIcontrolskinshavebeenmovedtojavafx.scene.control.skin

• Eachfilehasbeencleanedup:– codereorderedtofollowstandardlayoutstyle

– JavaDocs writtenforallpublicAPI

• Mostimportantly:thesizeoftheAPIperclasshasbeenreducedtobareessentials–WecangrowtheAPIinfuturereleasesbasedoncommunityfeedback(butwecannevershrinkit!)

• Overall:Essentiallythissubprojectiscomplete.CodeisnowinpublicJDK9reposforreview.

Page 58: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JEP253::PublicSkins::Summary

Control

Behavior

Skin

PrivateImplementation(com.sun.javafx.scene.control.*)

PublicAPI(javafx.scene.control)

Page 59: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JEP253::PublicSkins::Summary

Control

Behavior

Skin

PublicAPI(javafx.scene.control) PrivateImplementation

(com.sun.javafx.scene.control.*)

Page 60: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JDK9::Whatarewedoing::ProgressReport• JDK-8077918:ReviewandmakepublicrelevantCSSAPIs• CoreCSSAPIshavebeenmadepublic,including– CSSdatamodel– Converters(forconvertingfromCSStextintoJava)– Parsers

• Overall:Essentiallythissubprojectiscomplete.CodeisnowinpublicJDK9reposforreview.

Page 61: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JEP253::Summary

*ConverterCssParserCSS data model:

CalculatedValueCascadingStyleCombinatorCssErrorDeclarationRule*Selector*SizeStyleStyleCacheStyleClassStyleMapStylesheet

StyleManager

com.sun.javafx.css

CssMetaDataStyleableStyleablePropertySimpleStyleable*PropertyPseudoClassParsedValueStyleOrigin

javafx.css

Page 62: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JEP253::Summary

CSS data model:CalculatedValueCascadingStyleCombinatorStyleCacheStyleMap

StyleManager

com.sun.javafx.css

CssMetaDataStyleableStyleablePropertySimpleStyleable*PropertyPseudoClassParsedValueStyleOriginCssParserCSS data model:

CssErrorDeclarationRule*Selector*SizeStyleStyleClassStylesheet

javafx.css

*Converter

javafx.css.converter

Page 63: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JDK9::Whatarewedoing::ProgressReport• Overall,JEP253is’finished’(barringinternaltesting):– AllcodehasbeenmergedintoJDK9mainrepoforoverayear

• It’scritical thatthecommunitytestandgivefeedbackonJDK9assoonaspossible!

Page 64: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JEP253::Summary• Freeside-effectofJEP253:–MoveclosertoprovidingafullAPIforthird-partyUIcontrols– Thishasbeenafeaturewe’vebeenwantingforaverylongtime–WenowhaveallcontrolsandskinsavailableaspublicAPI

– Nexttargetistomakebehaviors publicAPItoo• Willdiscusslaterinthispresentation…

Page 65: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

OtherJDK9Enhancements

65

Page 66: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

NewPublicAPIs

66

Page 67: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

UnderstandingwhichprivateAPIsareinuse• InJune2015,wereachedouttothecommunityforhelp[1].• WeneededtounderstandwhatprivateAPIsweremostcommonlybeingused.• JDeps isatoolthatreportsdependenciesincode.• Wewroteasmallappthatwouldanalyseoutputfrom~twodozenprojects.– Ifyou’reinterested,runthefollowingcommand:

jdeps -v <jarfile> > <textfile>e.g.: jdeps -v SceneBuilder.jar > SceneBuilder.txt

• Insummary:someopensourceappsandsomecustomerappsbreak!

[1]http://mail.openjdk.java.net/pipermail/openjfx-dev/2015-June/017340.html

Page 68: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

Overview• Resultsquiteclearlyindicatedmainareasforfurtheranalysis:– UIControlSkins– CSSAPIs– Toolkit/PlatformAPIs:• firingpulse,nestedeventloops,pulselistening,platformstartup

– Robot– PerformanceTracker

Page 69: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

Overview• Resultsalsoshowedareaswheredevelopersweredoingthewrongthing

• E.g.BadAPI ProperAPI

com.sun.javafx.collections.ObservableListWrapper javafx.collections.FXCollections

com.sun.javafx.css.StyleConverterImpl javafx.css.StyleConverter

com.sun.javafx.css.PseudoClassState javafx.css.PseudoClass

Page 70: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

FiringPulse• Sometimesanapplicationwantstobesureanotherpulsewillberun.

• NewAPIinPlatform:– public static void requestNextPulse();

• Ifnopulseisrunning,thiswillrunapulseatsomepointinthefuture,evenifnopulseisrequired.• Ifapulseisrunning,anotheronewillbescheduledonceitcompletes.

Page 71: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

NestedEventLoop• Sometimesanapplicationwantstoprocesseventswithoutreturningfromthecurrentflowofcontrol• JavaFXinternallyusesnestedeventloopsinsomecases:– CallingshowAndWait onStageorDialog– Fordisplayingprinterdialogs

• NewAPIinPlatform:– public static Object enterNestedEventLoop(Object key);– public static void exitNestedEventLoop(Object key, Object rval);– public static boolean isNestedLoopRunning();

Page 72: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

PulseListener• Someapplicationswantacallback duringthepulseforeachframe– UsingAnimationTimer providesasimilarcapability,butrunsbeforeCSSandlayout(andforcesacontinuouspulse)

• NewAPIinScene:– public final void addPreLayoutPulseListener(Runnable r);– public final void addPostLayoutPulseListener(Runnable r);

• Thisaddsalistener(Runnable)thatiscalledeveryframe– CalledafterCSSandeitherbefore(pre)orafter(post)layout– Calledbeforerendering• Changestoscenegrapharerenderedthisframe,butCSSisnotapplieduntilnextframe

Page 73: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

PlatformStartup• TheJavaFXruntimeisinitializedinoneofthefollowingways:– Forstandardapplicationsthatextendjavafx.application.Application:• Running‘java MainClass’whereMainClass isasub-classofApplication• CallingApplication.launch tolaunchtheApplicationsub-class

– ForSwingapplicationthatuseJFXPanel:• ThefirsttimeaninstanceofJFXPanel isconstructed

– ForSWTapplicationsthatuseFXCanvas:• ThefirsttimeaninstanceofFXCanvas isconstructed

• Applicationsthatdon’tfitoneofthesepatternsoftenresorttocallingPlatformImpl.startup whichisnolongeraccessible

Page 74: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

PlatformStartup• NewAPIonPlatform:– public static void startup(Runnable);

• StartstheJavaFXruntimeandthencallstherunmethodoftheRunnableontheJavaFXApplicationThread– ThestartupmethodreturnsbeforetheRunnableisrun

• MustnotbecallediftheJavaFXruntimehasalreadybeenstarted– CannotbeusedtorestarttheJavaFXruntimeafterithasterminated

Page 75: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

Summary• Resultsquiteclearlyindicatedmainareasforfurtheranalysis:– UIControlSkins(JEP253)– CSSAPIs (JEP253)

– Toolkit/PlatformAPIs• firingpulse(AddedasPlatform.requestNextPulse())• nestedeventloops(AddedtoPlatform)• pulselistening(AddedtoScene)• Platformstartup (AddedtoPlatform)

– Robot(Toomuchwork,primaryusecaseistesting)

– PerformanceTracker(Toomuchwork)

Page 76: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

Turningimpl_*methodsintopublicAPI• Allimpl_*methodsaregone...butasmallnumbertransitionedintofullpublicAPI:– FXMLLoader:LoadListener interface+set/getmethods– Image:getUrl()– KeyCode:getChar(),getCode()– GridPane:getRowCount(),getColumnCount(),getCellBounds(col,row)– Text,TextFlow:selection,caret,hittestAPIs–Window:getWindows()– FXCanvas:getFXCanvas()– TableColumnBase:reorderable property

Page 77: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

HighDPI

77

Page 78: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

HighDPI• JDK8u60hasthefollowingsupportforHigh-DPI:–Mac:forretinadisplay,integerscales(200%)–Windows:forHigh-DPIsettings>=150%– NoLinuxsupport– NoAPItoallowapplicationcontroloverHigh-DPIscaling• Renderingisalwaysdonewithanintegerscale• OnWindows,theblit tothescreenmightuseanon-integerscale

Page 79: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

HighDPI• InJDK9weadded:– High-DPIsupportforLinux– High-DPIthresholdchangedto125%onWindows– APItogetthescreenscale– APItoforceintegerrenderscale(falsebydefault)– APItoset/gettherenderscale– Supportfor“snaptopixel”evenwhenusingnon-integerrenderscale

Page 80: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

JEP283:EnableGTK3onLinux• FXwindow-toolkit(glass)usesGTK2inJDK8u60• Ubuntu16.04:GTK2nolongerpartoftypicalinstallation• SWT4.xusesGTK3bydefault– CannotloadGTK2andGTK3insameapplication– SWTisusuallyloadedbeforeFXisloaded

• FXglassandAWTtoolkitsupportbothGTK2(default)andGTK3– Auto-detectifGTK3isalreadyloadedandswitchtothat– Fail-overtoGTK3ifGTK2isnotpresentonsystem– Usejava–Djdk.gtk.version=3(or2)toforce

Page 81: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

OtherJDK9Enhancements• JEP257:UpdatetonewerVersionofGStreamer– RequiresnewerversionofGLIBsosomeolderLinuxdistroswillnolongerwork

• UpdatedversionofWebKit– AlreadyupdatedonceforJDK9– Planningtoupdateatleastonemoretime…maybetwice– Goal:pickupbugfixesandperformanceimprovementsinamoretimelyfashion

Page 82: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

OtherJDK9Enhancements• 102smallerenhancements,suchas:– Tooltip:Customizabletiming– ComboBox &Spinner:commitValue(),cancelEdit()– Spinner:addedpromptText property–Node:viewOrder property(user-specifiedrenderingorder)– Font:loadFonts()– Collections:viewIndexproperty– FXPermission:fine-grainedpermissions

• 756bugfixes!

Page 83: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

LookingbeyondJDK9WhatmighthappeninJDK9updatereleasesandJDK10

83

Page 84: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

FutureInvestigations• JDK9isnearlyfrozen!– FocusisshiftingtowardsJDK9updatereleasesandJDK10featureplanning

• Wearegatheringfeatureideasfromtheusualplaces(JBS,communityfeedback,internally,etc.)

• Disclaimer:Wehaven’tactuallystartedplanningyet,sowhatwe’rediscussingtodaymightchange!

Page 85: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

FutureInvestigations• Platformimprovements:– JavaFX‘Desktop’API(noAWT)

• Scenegraph improvements:– PublicfocustraversalAPI– Newlayouts(e.g.Flexbox)

• Graphicsimprovements– Supportformulti-resolutionimages– Imagewriters– Updatedgraphicsrenderers– Interopwithplatformgraphics?

• Controlsimprovements:–MakeUIControlbehaviorspublic– UIControlActionsAPI– Extendedaccessibility(e.g.DatePicker)– TableView improvements(cellspanning,row/columnfreeze,commitonfocusloss)

– Draggable /detachabletabsinTabPane

• WebView improvements:–WebGL support– Accessibility

Page 86: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

Whatdoyouwant?Wehaveanotepaduphereonthedesk.Attheendofthissession,takeamoment–letusknowwhatyouwanttoseeinfuturereleasesofJavaFX

86

Page 87: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

UsefulJavaOne Sessions&BOFs

87

Page 88: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

UsefulJavaOne Sessions

Title When Where

JavaFXLayouts Today@4:00pm Hilton—Imperial BallroomA

BuildingJavaFX UIControls Today@5:30pm Hilton—Imperial BallroomA

MeettheOracleJavaFXandJDKClientTeam Today@7:00pm Hilton—Imperial BallroomA

JavaFX ScenicView Today@8:00pm Hilton—Imperial BallroomA

Page 89: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

UsefulJavaOne Sessions

Title When Where

ProjectJigsaw: UnderTheHood Tuesday@4:00pm Hilton—ContinentalBallroom 4

ProjectJigsawHackSession Wednesday@8:30am Hilton—Continental Ballroom4

The”Unsafe”Zone Wednesday@10:00am Hilton—Continental Ballroom5

PitfallsofMigratingProjectstoJDK9 Thursday@1:00pm Hilton—Continental Ballroom1/2/3

Page 90: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM

Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|

Q&A

Page 91: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM
Page 92: JavaFX: New & Noteworthy - Rain Focus · PDF fileTitle: JavaFX 9 - New and Noteworthy Created Date: 9/26/2016 1:06:52 AM