Upload
truongkien
View
215
Download
0
Embed Size (px)
Citation preview
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
IntroductionToJavaFXScenicView
JonathanGilesConsultingMemberofTechnicalStaffJavaClientGroupSeptember,2016
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
SafeHarborStatementThefollowingisintendedtooutlineourgeneralproductdirection.Itisintendedforinformationpurposesonly,andmaynotbeincorporatedintoanycontract.Itisnotacommitmenttodeliveranymaterial,code,orfunctionality,andshouldnotberelieduponinmakingpurchasingdecisions.Thedevelopment,release,andtimingofanyfeaturesorfunctionalitydescribedforOracle’sproductsremainsatthesolediscretionofOracle.
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.| 5
Warning:Thisisalmost lastyearsBOF.Ifyouattendedlastyear,youmaynotwantto
stickaround…
Note:I’vecondensedtheBOFthisyear.Weshouldbeoutofherein20minutes…
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.| 6
ScenicViewinaNutshell
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
• ScenicViewisafreeJavaFX scenegraph analyser.
• IdevelopScenicView,–whentimepermits(orwhenaconferenceiscomingup!)– itisnot myjob(butitisveryusefulinmydayjob)!
• DownloadandfindoutmoreaboutScenicViewhere:http://www.scenic-view.org
7
ScenicViewinaNutshell
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
• WhatisScenicView?–OriginallybuiltbyAmyFowlerfordiagnosingruntimeissueswithUIlayout
– Itwasreallysimpletouse:justaddScenicView.show(scene) inyourcode
• ItookAmy’scodeandpolishedtheUIconsiderablybeforethefirstpublicreleaseofScenicViewonMay6,2012• Itlookedalittlelikethis:
8
ScenicView
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.| 9
Treeshowingscenegraphstructureofrunning
application
Themostimportant
propertiesfortheselectednode
Applicationoverview
ScenicViewPre-1.0.0
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.| 10
Whoknowsthedifferencebetween‘layoutbounds’and‘boundsinparent’?
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
ScenicView ScenicViewcanalsodrawoverlaysintheapplication
itisobserving.
ThegreendashedrectangleshowsthelayoutBounds,andtheyellowfilledrectangleshowstheboundsInParent.
Thiscanbeveryusefulfordebugging.
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
• TheresponsetothepublicreleaseofScenicViewwasextremelypositive.• Mostfeedbackwasoftheform:“Iloveit,butitneedstodoX”• Xincluded:– Liveediting– Filtering– SelectingnodesbyclickingintheUI– Eventtracing
12
ScenicView
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
• AnderRuizcontactedmeafterthefirstrelease,andhadanumberofideas.• Evenbetter,hewaskeentohelpprogramthem!• TogetherwemadeavailableScenicView1.0.0onJune4,2012• ThefirstversionedreleaseofScenicView• Itlookedalittlelikethis:
13
ScenicView1.0.0
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.| 14
Abilitytofilterthetreeareaby
typinginanIDorclassname.
Abilitytofilterthedetailsareabytypingina
propertyname
ScenicView1.0.0
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
• ThemajorcomplaintAnderandIheardfromusers:– PeopledidnotwanttohavetomodifytheircodebyaddingScenicView.show(scene).
• Thisprovedaninteresting(andcomplex)problemtoresolve!• Weneededawaytoconnecttoapplicationsatruntimewithoutanymodificationoftheircode.
• Wesettledontwosolutions
15
TheProblemwithScenicView1.0.0
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
• TheJavaagentAPIallowsforanexternallibrarytobecalledwhenanapplicationstarts.• Simplyaddthefollowingwhenstartingyourapplication:
-javaagent:ScenicView.jar• ScenicViewwillstartwhenyourapplicationstarts• Itwillautomaticallydiscoverallstagesinyourapplication
• Bestapproach:inyourIDEhavetwo‘run’profiles,onewithScenicViewenabledandtheotherwithout
16
Solution1:JavaAgents
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
• JavaprovidestheAttachAPItodiscoverrunningJavaapplications• Weusethistoinstallasmallsocketserverintoyourapplicationatruntime,throughwhichScenicViewcancommunicate
• ThismeansthatScenicViewcandiscoverallrunningJavaFX applicationsandyoudon’tneedtodoanything!• Tousethissolution,simplystartScenicViewdirectlyandit’llstartinthismode
17
Solution2:JavaAttachAPI
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
• ScenicView1.1.0wasreleasedonAugust14th,2012aftermuchtestinganduserfeedback• Thisreleaserequiredamassiveamountofreworkingandfoundationbuilding.
• WewereincrediblyrelievedtogetthisworkingonWindows,MacOSandLinux!• However,thingsareneverperfect,andScenicView1.1.1wasreleasedonAugust16th,2012• Thisimprovedourabilitytodebugpeoplesissues.
18
ScenicView1.1.0
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
• Still,weknewtherewasmoretodo,sowecarriedonandreleasedScenicView1.2.0onSeptember25th,2012.• Thisreleaseincluded:– Eventtracingsupport– JavaDoc browsingsupport– Streamlinedmenus(contextmenus)– Bugfixes!
19
ScenicView1.2.0
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.| 20
Tabbedareafornew
functionality
ScenicView1.2.0
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.| 21
EventtracingisenabledfromtheEventsmenu
EventsarerecordedonlyfromselectednodedownEventscanbesearchedusing
booleanstatementsClicktheinfobuttonforthe
entirestacktrace
Tableshowsallmatchingevents
ScenicView1.2.0:EventTracing
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.| 22
BrowsershowsJavaDoc forcurrently
selectednode
ScenicView1.2.0:JavaDoc Browser
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
• ScenicView1.3.0wasreleasedonNovember12,2012• Whatwasnew?–Massiveperformancegains– Animationtracer– ImprovedCSSsupport– Versionupdatechecking–Macnativemenubar integration– Bugfixesandmiscellaneousimprovements
23
ScenicView1.3.0
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
• ScenicView1.3.0wasthelastreleasewithsupportforJavaFX2.x.• UnfortunatelyatthisstageAnderhadtodropoutduetoworkcommitments
24
BeyondScenicView1.3.0
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
• Releasedandopensourced atJavaOne 2014
• GPLlicensed• Coderepositoryisopenhere:https://bitbucket.org/scenicview/scenic-view
25
ScenicView8.0.0
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
• ReleasedSeptember2nd,2015• Primarilyconsistsoftwoverycoolcommunitycontributions:– ThreeDOM– CSSFX
26
ScenicView8.6.0
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
3D‘explosion’viewofuserinterface
27
ThreeDOM
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
• Abilitytoedit/saveCSSfilesandhavethembedynamicallyreloadedatruntimewithoutneedingtorestartapplication.
28
CSSFX
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
• ReleasedAugust30th,2016• AtpresentthisissimplyabranchofthemainbranchwithminimalsetofpatchestoworkinJDK9
29
ScenicView9.0.0
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
ScenicViewDemo
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
GettingStarted- InSixSimpleSteps!
Thefollowingsoftwareisrequired:–Mercurial– Gradle– JDK8
You’llneedaBitbucket account– Accountsarefreefromhttp://bitbucket.org
1
2
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
GettingStarted- InSixSimpleSteps!
Forktherepo.Goheretocreateyourownfork– https://bitbucket.org/scenicview/scenic-view/fork
Cloneyourfork:– hgclonehttps://<username>@bitbucket.org/<username>/<forkname>– e.g.• hgclonehttps://[email protected]/jonathangiles/scenic-view
3
4
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
GettingStarted- InSixSimpleSteps!
Buildyourclone.Fromclonerootdirectory,run:– gradle cleanassemble
Runyourclone:– gradle run
5
6
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
• Whatelseistherelefttodo?• ShouldIpackmybagsandstopdevelopingScenicViewnow?• Isthereafeatureyou’dlovetohave?– Tellme!– [email protected]
• Someideas:– Pulseloggersupport(pulseduration,timesincelastpulse,etc)– Lessbugs,faster,betterUI,etc
34
TheFutureofScenicView
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
• Evenbetter– pleasejoininandhelpmetodevelopit!• Forktheprojectonbitbucket anddopullrequests
35
TheFutureofScenicView
Copyright©2016, Oracleand/oritsaffiliates.Allrightsreserved.|
ThanksforAttending!
It’sDiscussionTime!Howtocontactme:[email protected]@JonathanGiles