SlideShare a Scribd company logo
JFXtras
JavaFX Controls, Layouts, Services, and More


Stephen Chin          Dean Iverson
GXS                   Virginia Tech Transportation Institute
steve@widgetfx.org    deanriverson@gmail.com
tweet: @steveonjava   tweet: @deanriverson
Meet the Presenters…
              Steve                               Dean

                                     Family Man


 Family Man




                      Motorcyclist



                                                         Robotics
                                                          Coach


                                                                    2
Agenda
> JFXtras 0.7 Summary
> JavaFX 2.0 Recap

> The Future of JFXtras

> A Little Announcement…




                           3
JFXtras 0.7 Summary




     Layouts          Borders




     Shapes           Controls
                                 4
JFXtras Grid

        Row

         Row


               5
JFXtras Grid
Grid {
  effect: Reflection {}
  border: 20
  vgap: 12
  hgap: 12
  rows: bind [
    row([text, progressBar]),
    row([navigator, mediaGrid])
  ]
}
                                  6
JFXtras Borders




                  7
JFXtras Borders
Function:
override function create() {
  TitledBorder {
    id: "imageTitle"
    title: file.getName()
    content: FrameBorder {
      id: "imageFrame"
      node: ResizableImageView {
        preserveRatio: true
        smooth: true
        image: bind image
      }
    }
  }
}
                                   8
Border and Grid Example




                          9
MigLayout for JavaFX




                       10
Flexible Grid Layout


         Flow          Wrap




                              11
XMigLayout {
  constraints: "fill, wrap"
  columns: "[][]"
  rows: "[][]4mm[]push[]"
  content: [
    Label {
      text: "Email"
      layoutInfo: nodeConstraints( "ax right" )
    }
    TextBox {
      layoutInfo: nodeConstraints( "growx, pushx" )
    }
    Label {
      text: "Password"
      layoutInfo: nodeConstraints( "ax right" )
    }
    TextBox {
      layoutInfo: nodeConstraints( "growx, pushx" )
    }
    Button {
      text: "Login“, layoutInfo: nodeConstraints( "skip, right" )
    }
    Label {
      text: "This text is 'pushed' to the bottom“, layoutInfo: nodeConstraints( "span" )
}]}
                                                                                           12
Flexible Border Layout

Stage {
  title: "Mig Docking Test"
  scene: XScene {
      width: 400, height: 400
      fill: Color.LEMONCHIFFON
      content: XMigLayout {
           constraints: "fill"
           content: [
              migNode( createLabel( Color.KHAKI, "North" ), "north" ),
              migNode( createLabel( Color.GOLDENROD, "South" ), "south" ),
              migNode( createLabel( Color.GOLD, "East" ),   "east" ),
              migNode( createLabel( Color.DARKKHAKI, "West" ), "west" ),
            ]
      }
  }
}
                                                                             13
Inflexible Absolute Layout

function createLabel( color:Color, label:String ) {
   XMigLayout {
     constraints: "fill"
     content: [
        ResizableRectangle {
           fill: color
           layoutInfo: nodeConstraints( "pos 0 0 container.x2 container.y2" )
        }
        Text {
           content: label
           font: Font { size: 18 }
           layoutInfo: nodeConstraints( "center, grow" )
        }
     ]
   }
}
                                                                                14
JFXtras Shapes

    Almond     Intersection of two circles (Vesica Piscis)   centerX, centerY, width

    Arrow      Arrow shape x, y, width, height, depth, rise


    Asterisk   Asterisk with rounded corners                 centerX, centerY, width, radius, beams, roundness


    Astroid    Hypocloid with four cusps      centerX, centerY, radius

    Balloon    Rectangular shape with a tab x, y, width, height, arc, anglePosition, tabWidth,
                                            tabHeight, tabLocation, tabDisplacement


    Cross      Symmetrical cross shape        centerX, centerY, width, radius, roundness

    Donut      Regular polygon with a hole centerX, centerY, innerRadius, outerRadius, sides

    Lauburu    Four comma-shaped heads centerX, centerY, radius



                                                                                            Continued…
                                                                                                                 15
JFXtras Shapes (continued)
   MultiRoundRectangle       Rectangle with configurable corners     x, y, width, height, topLeftWidth/Height,
                                                                      topRightWidth/Height, bottomLeftWidth/Height,
                                                                      bottomRightWidth/Height
   Rays        Multiple rays extend from center         centerX, centerY, rays, radius, extent, rounded

   RegularPolygon            Polygon with equal sides   centerX, centerY, sides, radius


   ReuleauxTriangle          Curved triangle shape      centerX, centerY, radius

   RoundPin    Cone with rounded top      centerX, centerY, height, radius

   Star2       Multipoint star            centerX, centerY, innerRadius, outerRadius, count


   ETriangle   Equilateral triangle          x, y, width
   ITriangle   Isosceles triangle            x, y, width, height
   RTriangle   Right triangle x, y, width, height, anglePosition




                                                                                                            16
JFXtras Shapes




                 17
Sphere Challenge
                                                                          Andres Almiray’s Weblog




             http://www.jroller.com/aalmiray/entry/griffon_gfxbuilder_fxbuilder_side_by


“The following snapshot shows a couple of
spheres drawn with GfxBuilder and
FxBuilder, can you guess which one is
which?
…
This is by no means a post to bash JavaFX
rather to point out some of its deficiencies”
                            -- Andres Almiray
                    (taken completely out of context)


                                                                                               18
Sphere Challenge – JavaFX Response
>   Composition:
     RadialGradient for the Sphere

     Three additional RadialGradients for
      the light sources
     A blurred shadow underneath

>   Features:
     All Bound/Relative Coordinates

     Configurable –

           Base, Ambient, Specular, Shine Colors
           Shadow Size and Height
       Uses New JFXtras ColorUtil Library
       JavaFX Caching for High Performance
                                                    19
JFXtras Spheres Demo




                       20
JFXtras Controls
>   Simple Controls
       XHyperlink
       XEtchedButton
       XPane
>   Complex Controls
       XPicker
       XCalendarPicker
       XShelfView
       XTableView


                          21
Hyperlinks and Etched Buttons
XHyperlink {
  text: "Oracle's Homepage",
  url: "http://oracle.com/"
}

var hposSeq = [ HPos.LEFT, HPos.CENTER, HPos.RIGHT ];
HBox {
  spacing: -1
  content: for (i in [0..2]) {
     XEtchedButton {
       graphic: ImageView { image: images[i] }
       buttonGroupHPos: hposSeq[i]
     }
  }
}
                                                        22
XPane




        23
XPane

 XPane {
  title: "Default Titled XPane”
  contentNode: Label { text: "Default XPane with a Label" }
  layoutInfo: LayoutInfo { width: 200, height: 200 }
}




                                                              24
XPicker
>   Multiple Picker Types
       Side Scroll
       Drop Down
       Thumb Wheel
       Side/Thumb Nudge
>   Supports All Events
       Mouse Clicks
       Mouse Wheel
       Keyboard


                            25
XCalendarPicker
>   Configurable Locale
>   Multiple Selection Modes
       Single
       Multiple
       Range
>   Completely Skinnable




                               26
XShelfView
>   High Performance
>   Features:
       Scrollbar
       Image Title
       Reflection Effect
       Aspect Ratio
       Infinite Repeat
>   Integrates With JFXtras Data Providers
>   Automatically Updates on Model Changes

                                             27
XTableView
>   Insanely Scalable
       Up to 16 million rows
>   Extreme Performance
       Pools rendered nodes
       Caches images
       Optimized scene graph
>   Features:
       Drag-and-Drop Column Reordering
       Dynamic Updating from Model
       Automatically Populates Column Headers
                                                 28
BandMatesFX - JSONHandler in 3 Steps
              public class FreebaseResult {
                public var code: String;
    1           public var result: Result;
                public var status: String;
   POJO         public var transactionId: String;
              }

              var albumHandler:JSONHandler = JSONHandler {

    2           rootClass: "javafxpert.FreebaseResult“
                onDone: function(obj, isSequence): Void {
JSONHandler      freebaseResult = obj as FreebaseResult;
              }}

              req = HttpRequest {

    3           location: queryUrl
                onInput: function(is: java.io.InputStream) {
HttpRequest       albumHandler.parse(is);
              }}
                                                               29
http://jfxtras.org/   30
JavaFX 2.0 Recap
>   The Good
       JavaFX is here to stay
       Controls will be open source
       Calling JavaFX code from different language is
        pretty cool!
>   The Bad
       We have to wait a bit… (next summer)
       Mobile is no longer on the radar
>   The Ugly
       JavaFX Script was a pretty nice language…
                                                         31
The Future of JFXtras
>   Mission:
       Provide Quality JavaFX Add-ons
>   Going Forward:
       Migrate Non-Overlapping Functionality
       Support Java APIs For All Components
       Continue to Fill the Gaps
>   Reality:
       Migration Will Be Challenging
       Release Dates Will Trail Oracle
           (until they are fully open source)

                                                 32
How about JavaFX on… Java
public class HelloStage implements Runnable {
    public void run() {
      Stage stage = new Stage();
      stage.setTitle("Hello Stage");
      stage.setWidth(600);
      stage.setHeight(450);
        Scene scene = new Scene();
        scene.setFill(Color.LIGHTGREEN);
        stage.setScene(scene);
        stage.setVisible(true);
    }
    public static void main(String[] args) {
      FX.start(new HelloStage());
    }
}
How about JavaFX on… Clojure
(defn javafxapp []
  (doto (Stage. "JavaFX Stage")
    (.setWidth 600)
    (.setHeight 450)
    (.setScene (doto (Scene.)
      (.setFill Color/LIGHTGREEN)
      (.setContent (list (doto (Rectangle.)
        (.setX 25)
        (.setY 40)
        (.setWidth 100)
        (.setHeight 50)
        (.setFill Color/RED))))))
    (.setVisible true)))
(javafxapp)

                                              34
How about JavaFX on… Groovy
FxBuilder.build {
    stage = stage(
        title: "Hello Rectangle (Groovy FxBuilder 2)",
        width: 600,
        height: 450,
        scene: scene(fill: Color.LIGHTSKYBLUE) {
            rectangle(
                x: 25, y: 40,
                width: 100, height: 50,
                fill: Color.RED
            )
        }
    )
    stage.visible = true;
}
How about JavaFX on… Scala
object HelloJavaFX extends JavaFXApplication {
  def stage = new Stage {
    title = "Hello Stage"
    width = 600
    height = 450
    scene = new Scene {
      fill = Color.LIGHTGREEN
      content = List(new Rectangle {
         x = 25
         y = 40
         width = 100
         height = 50
         fill = Color.RED
      })
    }
  }
}
                                                 36
How about JavaFX on… Visage
Stage {
  title: "Hello Stage"
  width: 600
  height: 450
  scene: Scene {
    fill: Color.LIGHTGREEN
    content: Rectangle {
      x: 25
      y: 40
      width: 100
      height: 50
      fill: Color.RED
    }
  }
}

                              37
Announcing Project Visage
>   “Visage is a domain specific language (DSL)
    designed for the express purpose of writing
    user interfaces.”

>   Visage project goals:
       Compile to JavaFX Java APIs
       Evolve the Language (Annotations, Maps, etc.)
       Support Other Toolkits

>   Come join the team!
>   For more info: http://visage-lang.org/
                                                        38
Stephen Chin          Dean Iverson
steve@widgetfx.org    deanriverson@gmail.com
tweet: @steveonjava   tweet: @deanriverson




                                               39

More Related Content

Similar to JFXtras - JavaFX Controls, Layout, Services, and More

Javafx Overview 90minutes
Javafx Overview 90minutesJavafx Overview 90minutes
Javafx Overview 90minutes
SiliconExpert Technologies
 
Javafx Overview 90minutes
Javafx Overview 90minutesJavafx Overview 90minutes
Javafx Overview 90minutes
SiliconExpert Technologies
 
Javafx Overview 90minutes
Javafx Overview 90minutesJavafx Overview 90minutes
Javafx Overview 90minutes
SiliconExpert Technologies
 
Building Data Rich Interfaces with JavaFX
Building Data Rich Interfaces with JavaFXBuilding Data Rich Interfaces with JavaFX
Building Data Rich Interfaces with JavaFX
Stephen Chin
 
Extjsslides 091216224157-phpapp02
Extjsslides 091216224157-phpapp02Extjsslides 091216224157-phpapp02
Extjsslides 091216224157-phpapp02
Charles Ferentchak
 
W-JAX 09 - Lift
W-JAX 09 - LiftW-JAX 09 - Lift
W-JAX 09 - Lift
Heiko Seeberger
 
C# v8 new features - raimundas banevicius
C# v8 new features - raimundas baneviciusC# v8 new features - raimundas banevicius
C# v8 new features - raimundas banevicius
Raimundas Banevičius
 
Data-Oriented Programming with Clojure and Jackdaw (Charles Reese, Funding Ci...
Data-Oriented Programming with Clojure and Jackdaw (Charles Reese, Funding Ci...Data-Oriented Programming with Clojure and Jackdaw (Charles Reese, Funding Ci...
Data-Oriented Programming with Clojure and Jackdaw (Charles Reese, Funding Ci...
confluent
 
Clojure And Swing
Clojure And SwingClojure And Swing
Clojure And Swing
Skills Matter
 
Graph computation
Graph computationGraph computation
Graph computation
Sigmoid
 
Large-scale graph processing with Apache Flink @GraphDevroom FOSDEM'15
Large-scale graph processing with Apache Flink @GraphDevroom FOSDEM'15Large-scale graph processing with Apache Flink @GraphDevroom FOSDEM'15
Large-scale graph processing with Apache Flink @GraphDevroom FOSDEM'15
Vasia Kalavri
 
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
Sencha
 
Groovy's Builder
Groovy's BuilderGroovy's Builder
Groovy's Builder
Yasuharu Nakano
 
SVGo: a Go Library for SVG generation
SVGo: a Go Library for SVG generationSVGo: a Go Library for SVG generation
SVGo: a Go Library for SVG generation
Anthony Starks
 
Java Fx Overview Tech Tour
Java Fx Overview Tech TourJava Fx Overview Tech Tour
Java Fx Overview Tech Tour
Carol McDonald
 
Introduction into JavaFX
Introduction into JavaFXIntroduction into JavaFX
Introduction into JavaFX
Eugene Bogaart
 
Scala clojure techday_2011
Scala clojure techday_2011Scala clojure techday_2011
Scala clojure techday_2011
Thadeu Russo
 
React JS and Redux
React JS and ReduxReact JS and Redux
React JS and Redux
Glib Kechyn
 
SVGo workshop
SVGo workshopSVGo workshop
SVGo workshop
Anthony Starks
 
JCD 2012 JavaFX 2
JCD 2012 JavaFX 2JCD 2012 JavaFX 2
JCD 2012 JavaFX 2
益裕 張
 

Similar to JFXtras - JavaFX Controls, Layout, Services, and More (20)

Javafx Overview 90minutes
Javafx Overview 90minutesJavafx Overview 90minutes
Javafx Overview 90minutes
 
Javafx Overview 90minutes
Javafx Overview 90minutesJavafx Overview 90minutes
Javafx Overview 90minutes
 
Javafx Overview 90minutes
Javafx Overview 90minutesJavafx Overview 90minutes
Javafx Overview 90minutes
 
Building Data Rich Interfaces with JavaFX
Building Data Rich Interfaces with JavaFXBuilding Data Rich Interfaces with JavaFX
Building Data Rich Interfaces with JavaFX
 
Extjsslides 091216224157-phpapp02
Extjsslides 091216224157-phpapp02Extjsslides 091216224157-phpapp02
Extjsslides 091216224157-phpapp02
 
W-JAX 09 - Lift
W-JAX 09 - LiftW-JAX 09 - Lift
W-JAX 09 - Lift
 
C# v8 new features - raimundas banevicius
C# v8 new features - raimundas baneviciusC# v8 new features - raimundas banevicius
C# v8 new features - raimundas banevicius
 
Data-Oriented Programming with Clojure and Jackdaw (Charles Reese, Funding Ci...
Data-Oriented Programming with Clojure and Jackdaw (Charles Reese, Funding Ci...Data-Oriented Programming with Clojure and Jackdaw (Charles Reese, Funding Ci...
Data-Oriented Programming with Clojure and Jackdaw (Charles Reese, Funding Ci...
 
Clojure And Swing
Clojure And SwingClojure And Swing
Clojure And Swing
 
Graph computation
Graph computationGraph computation
Graph computation
 
Large-scale graph processing with Apache Flink @GraphDevroom FOSDEM'15
Large-scale graph processing with Apache Flink @GraphDevroom FOSDEM'15Large-scale graph processing with Apache Flink @GraphDevroom FOSDEM'15
Large-scale graph processing with Apache Flink @GraphDevroom FOSDEM'15
 
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
 
Groovy's Builder
Groovy's BuilderGroovy's Builder
Groovy's Builder
 
SVGo: a Go Library for SVG generation
SVGo: a Go Library for SVG generationSVGo: a Go Library for SVG generation
SVGo: a Go Library for SVG generation
 
Java Fx Overview Tech Tour
Java Fx Overview Tech TourJava Fx Overview Tech Tour
Java Fx Overview Tech Tour
 
Introduction into JavaFX
Introduction into JavaFXIntroduction into JavaFX
Introduction into JavaFX
 
Scala clojure techday_2011
Scala clojure techday_2011Scala clojure techday_2011
Scala clojure techday_2011
 
React JS and Redux
React JS and ReduxReact JS and Redux
React JS and Redux
 
SVGo workshop
SVGo workshopSVGo workshop
SVGo workshop
 
JCD 2012 JavaFX 2
JCD 2012 JavaFX 2JCD 2012 JavaFX 2
JCD 2012 JavaFX 2
 

More from Stephen Chin

DevOps Tools for Java Developers v2
DevOps Tools for Java Developers v2DevOps Tools for Java Developers v2
DevOps Tools for Java Developers v2
Stephen Chin
 
10 Ways Everyone Can Support the Java Community
10 Ways Everyone Can Support the Java Community10 Ways Everyone Can Support the Java Community
10 Ways Everyone Can Support the Java Community
Stephen Chin
 
Java Clients and JavaFX: The Definitive Guide
Java Clients and JavaFX: The Definitive GuideJava Clients and JavaFX: The Definitive Guide
Java Clients and JavaFX: The Definitive Guide
Stephen Chin
 
DevOps Tools for Java Developers
DevOps Tools for Java DevelopersDevOps Tools for Java Developers
DevOps Tools for Java Developers
Stephen Chin
 
Java Clients and JavaFX - Presented to LJC
Java Clients and JavaFX - Presented to LJCJava Clients and JavaFX - Presented to LJC
Java Clients and JavaFX - Presented to LJC
Stephen Chin
 
RetroPi Handheld Raspberry Pi Gaming Console
RetroPi Handheld Raspberry Pi Gaming ConsoleRetroPi Handheld Raspberry Pi Gaming Console
RetroPi Handheld Raspberry Pi Gaming Console
Stephen Chin
 
JavaFX on Mobile (by Johan Vos)
JavaFX on Mobile (by Johan Vos)JavaFX on Mobile (by Johan Vos)
JavaFX on Mobile (by Johan Vos)
Stephen Chin
 
Confessions of a Former Agile Methodologist (JFrog Edition)
Confessions of a Former Agile Methodologist (JFrog Edition)Confessions of a Former Agile Methodologist (JFrog Edition)
Confessions of a Former Agile Methodologist (JFrog Edition)
Stephen Chin
 
Devoxx4Kids Lego Workshop
Devoxx4Kids Lego WorkshopDevoxx4Kids Lego Workshop
Devoxx4Kids Lego Workshop
Stephen Chin
 
Raspberry Pi with Java (JJUG)
Raspberry Pi with Java (JJUG)Raspberry Pi with Java (JJUG)
Raspberry Pi with Java (JJUG)
Stephen Chin
 
Confessions of a Former Agile Methodologist
Confessions of a Former Agile MethodologistConfessions of a Former Agile Methodologist
Confessions of a Former Agile Methodologist
Stephen Chin
 
Internet of Things Magic Show
Internet of Things Magic ShowInternet of Things Magic Show
Internet of Things Magic Show
Stephen Chin
 
Zombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the UndeadZombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the Undead
Stephen Chin
 
JCrete Embedded Java Workshop
JCrete Embedded Java WorkshopJCrete Embedded Java Workshop
JCrete Embedded Java Workshop
Stephen Chin
 
Oracle IoT Kids Workshop
Oracle IoT Kids WorkshopOracle IoT Kids Workshop
Oracle IoT Kids Workshop
Stephen Chin
 
OpenJFX on Android and Devices
OpenJFX on Android and DevicesOpenJFX on Android and Devices
OpenJFX on Android and Devices
Stephen Chin
 
Java on Raspberry Pi Lab
Java on Raspberry Pi LabJava on Raspberry Pi Lab
Java on Raspberry Pi Lab
Stephen Chin
 
Java 8 for Tablets, Pis, and Legos
Java 8 for Tablets, Pis, and LegosJava 8 for Tablets, Pis, and Legos
Java 8 for Tablets, Pis, and Legos
Stephen Chin
 
DukeScript
DukeScriptDukeScript
DukeScript
Stephen Chin
 
Devoxx4Kids NAO Workshop
Devoxx4Kids NAO WorkshopDevoxx4Kids NAO Workshop
Devoxx4Kids NAO Workshop
Stephen Chin
 

More from Stephen Chin (20)

DevOps Tools for Java Developers v2
DevOps Tools for Java Developers v2DevOps Tools for Java Developers v2
DevOps Tools for Java Developers v2
 
10 Ways Everyone Can Support the Java Community
10 Ways Everyone Can Support the Java Community10 Ways Everyone Can Support the Java Community
10 Ways Everyone Can Support the Java Community
 
Java Clients and JavaFX: The Definitive Guide
Java Clients and JavaFX: The Definitive GuideJava Clients and JavaFX: The Definitive Guide
Java Clients and JavaFX: The Definitive Guide
 
DevOps Tools for Java Developers
DevOps Tools for Java DevelopersDevOps Tools for Java Developers
DevOps Tools for Java Developers
 
Java Clients and JavaFX - Presented to LJC
Java Clients and JavaFX - Presented to LJCJava Clients and JavaFX - Presented to LJC
Java Clients and JavaFX - Presented to LJC
 
RetroPi Handheld Raspberry Pi Gaming Console
RetroPi Handheld Raspberry Pi Gaming ConsoleRetroPi Handheld Raspberry Pi Gaming Console
RetroPi Handheld Raspberry Pi Gaming Console
 
JavaFX on Mobile (by Johan Vos)
JavaFX on Mobile (by Johan Vos)JavaFX on Mobile (by Johan Vos)
JavaFX on Mobile (by Johan Vos)
 
Confessions of a Former Agile Methodologist (JFrog Edition)
Confessions of a Former Agile Methodologist (JFrog Edition)Confessions of a Former Agile Methodologist (JFrog Edition)
Confessions of a Former Agile Methodologist (JFrog Edition)
 
Devoxx4Kids Lego Workshop
Devoxx4Kids Lego WorkshopDevoxx4Kids Lego Workshop
Devoxx4Kids Lego Workshop
 
Raspberry Pi with Java (JJUG)
Raspberry Pi with Java (JJUG)Raspberry Pi with Java (JJUG)
Raspberry Pi with Java (JJUG)
 
Confessions of a Former Agile Methodologist
Confessions of a Former Agile MethodologistConfessions of a Former Agile Methodologist
Confessions of a Former Agile Methodologist
 
Internet of Things Magic Show
Internet of Things Magic ShowInternet of Things Magic Show
Internet of Things Magic Show
 
Zombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the UndeadZombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the Undead
 
JCrete Embedded Java Workshop
JCrete Embedded Java WorkshopJCrete Embedded Java Workshop
JCrete Embedded Java Workshop
 
Oracle IoT Kids Workshop
Oracle IoT Kids WorkshopOracle IoT Kids Workshop
Oracle IoT Kids Workshop
 
OpenJFX on Android and Devices
OpenJFX on Android and DevicesOpenJFX on Android and Devices
OpenJFX on Android and Devices
 
Java on Raspberry Pi Lab
Java on Raspberry Pi LabJava on Raspberry Pi Lab
Java on Raspberry Pi Lab
 
Java 8 for Tablets, Pis, and Legos
Java 8 for Tablets, Pis, and LegosJava 8 for Tablets, Pis, and Legos
Java 8 for Tablets, Pis, and Legos
 
DukeScript
DukeScriptDukeScript
DukeScript
 
Devoxx4Kids NAO Workshop
Devoxx4Kids NAO WorkshopDevoxx4Kids NAO Workshop
Devoxx4Kids NAO Workshop
 

Recently uploaded

HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
Federico Razzoli
 

Recently uploaded (20)

HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
 

JFXtras - JavaFX Controls, Layout, Services, and More

  • 1. JFXtras JavaFX Controls, Layouts, Services, and More Stephen Chin Dean Iverson GXS Virginia Tech Transportation Institute steve@widgetfx.org deanriverson@gmail.com tweet: @steveonjava tweet: @deanriverson
  • 2. Meet the Presenters… Steve Dean Family Man Family Man Motorcyclist Robotics Coach 2
  • 3. Agenda > JFXtras 0.7 Summary > JavaFX 2.0 Recap > The Future of JFXtras > A Little Announcement… 3
  • 4. JFXtras 0.7 Summary Layouts Borders Shapes Controls 4
  • 5. JFXtras Grid Row Row 5
  • 6. JFXtras Grid Grid { effect: Reflection {} border: 20 vgap: 12 hgap: 12 rows: bind [ row([text, progressBar]), row([navigator, mediaGrid]) ] } 6
  • 8. JFXtras Borders Function: override function create() { TitledBorder { id: "imageTitle" title: file.getName() content: FrameBorder { id: "imageFrame" node: ResizableImageView { preserveRatio: true smooth: true image: bind image } } } } 8
  • 9. Border and Grid Example 9
  • 11. Flexible Grid Layout Flow Wrap 11
  • 12. XMigLayout { constraints: "fill, wrap" columns: "[][]" rows: "[][]4mm[]push[]" content: [ Label { text: "Email" layoutInfo: nodeConstraints( "ax right" ) } TextBox { layoutInfo: nodeConstraints( "growx, pushx" ) } Label { text: "Password" layoutInfo: nodeConstraints( "ax right" ) } TextBox { layoutInfo: nodeConstraints( "growx, pushx" ) } Button { text: "Login“, layoutInfo: nodeConstraints( "skip, right" ) } Label { text: "This text is 'pushed' to the bottom“, layoutInfo: nodeConstraints( "span" ) }]} 12
  • 13. Flexible Border Layout Stage { title: "Mig Docking Test" scene: XScene { width: 400, height: 400 fill: Color.LEMONCHIFFON content: XMigLayout { constraints: "fill" content: [ migNode( createLabel( Color.KHAKI, "North" ), "north" ), migNode( createLabel( Color.GOLDENROD, "South" ), "south" ), migNode( createLabel( Color.GOLD, "East" ), "east" ), migNode( createLabel( Color.DARKKHAKI, "West" ), "west" ), ] } } } 13
  • 14. Inflexible Absolute Layout function createLabel( color:Color, label:String ) { XMigLayout { constraints: "fill" content: [ ResizableRectangle { fill: color layoutInfo: nodeConstraints( "pos 0 0 container.x2 container.y2" ) } Text { content: label font: Font { size: 18 } layoutInfo: nodeConstraints( "center, grow" ) } ] } } 14
  • 15. JFXtras Shapes Almond Intersection of two circles (Vesica Piscis) centerX, centerY, width Arrow Arrow shape x, y, width, height, depth, rise Asterisk Asterisk with rounded corners centerX, centerY, width, radius, beams, roundness Astroid Hypocloid with four cusps centerX, centerY, radius Balloon Rectangular shape with a tab x, y, width, height, arc, anglePosition, tabWidth, tabHeight, tabLocation, tabDisplacement Cross Symmetrical cross shape centerX, centerY, width, radius, roundness Donut Regular polygon with a hole centerX, centerY, innerRadius, outerRadius, sides Lauburu Four comma-shaped heads centerX, centerY, radius Continued… 15
  • 16. JFXtras Shapes (continued) MultiRoundRectangle Rectangle with configurable corners x, y, width, height, topLeftWidth/Height, topRightWidth/Height, bottomLeftWidth/Height, bottomRightWidth/Height Rays Multiple rays extend from center centerX, centerY, rays, radius, extent, rounded RegularPolygon Polygon with equal sides centerX, centerY, sides, radius ReuleauxTriangle Curved triangle shape centerX, centerY, radius RoundPin Cone with rounded top centerX, centerY, height, radius Star2 Multipoint star centerX, centerY, innerRadius, outerRadius, count ETriangle Equilateral triangle x, y, width ITriangle Isosceles triangle x, y, width, height RTriangle Right triangle x, y, width, height, anglePosition 16
  • 18. Sphere Challenge Andres Almiray’s Weblog http://www.jroller.com/aalmiray/entry/griffon_gfxbuilder_fxbuilder_side_by “The following snapshot shows a couple of spheres drawn with GfxBuilder and FxBuilder, can you guess which one is which? … This is by no means a post to bash JavaFX rather to point out some of its deficiencies” -- Andres Almiray (taken completely out of context) 18
  • 19. Sphere Challenge – JavaFX Response > Composition:  RadialGradient for the Sphere  Three additional RadialGradients for the light sources  A blurred shadow underneath > Features:  All Bound/Relative Coordinates  Configurable –  Base, Ambient, Specular, Shine Colors  Shadow Size and Height  Uses New JFXtras ColorUtil Library  JavaFX Caching for High Performance 19
  • 21. JFXtras Controls > Simple Controls  XHyperlink  XEtchedButton  XPane > Complex Controls  XPicker  XCalendarPicker  XShelfView  XTableView 21
  • 22. Hyperlinks and Etched Buttons XHyperlink { text: "Oracle's Homepage", url: "http://oracle.com/" } var hposSeq = [ HPos.LEFT, HPos.CENTER, HPos.RIGHT ]; HBox { spacing: -1 content: for (i in [0..2]) { XEtchedButton { graphic: ImageView { image: images[i] } buttonGroupHPos: hposSeq[i] } } } 22
  • 23. XPane 23
  • 24. XPane XPane { title: "Default Titled XPane” contentNode: Label { text: "Default XPane with a Label" } layoutInfo: LayoutInfo { width: 200, height: 200 } } 24
  • 25. XPicker > Multiple Picker Types  Side Scroll  Drop Down  Thumb Wheel  Side/Thumb Nudge > Supports All Events  Mouse Clicks  Mouse Wheel  Keyboard 25
  • 26. XCalendarPicker > Configurable Locale > Multiple Selection Modes  Single  Multiple  Range > Completely Skinnable 26
  • 27. XShelfView > High Performance > Features:  Scrollbar  Image Title  Reflection Effect  Aspect Ratio  Infinite Repeat > Integrates With JFXtras Data Providers > Automatically Updates on Model Changes 27
  • 28. XTableView > Insanely Scalable  Up to 16 million rows > Extreme Performance  Pools rendered nodes  Caches images  Optimized scene graph > Features:  Drag-and-Drop Column Reordering  Dynamic Updating from Model  Automatically Populates Column Headers 28
  • 29. BandMatesFX - JSONHandler in 3 Steps public class FreebaseResult { public var code: String; 1 public var result: Result; public var status: String; POJO public var transactionId: String; } var albumHandler:JSONHandler = JSONHandler { 2 rootClass: "javafxpert.FreebaseResult“ onDone: function(obj, isSequence): Void { JSONHandler freebaseResult = obj as FreebaseResult; }} req = HttpRequest { 3 location: queryUrl onInput: function(is: java.io.InputStream) { HttpRequest albumHandler.parse(is); }} 29
  • 31. JavaFX 2.0 Recap > The Good  JavaFX is here to stay  Controls will be open source  Calling JavaFX code from different language is pretty cool! > The Bad  We have to wait a bit… (next summer)  Mobile is no longer on the radar > The Ugly  JavaFX Script was a pretty nice language… 31
  • 32. The Future of JFXtras > Mission:  Provide Quality JavaFX Add-ons > Going Forward:  Migrate Non-Overlapping Functionality  Support Java APIs For All Components  Continue to Fill the Gaps > Reality:  Migration Will Be Challenging  Release Dates Will Trail Oracle  (until they are fully open source) 32
  • 33. How about JavaFX on… Java public class HelloStage implements Runnable { public void run() { Stage stage = new Stage(); stage.setTitle("Hello Stage"); stage.setWidth(600); stage.setHeight(450); Scene scene = new Scene(); scene.setFill(Color.LIGHTGREEN); stage.setScene(scene); stage.setVisible(true); } public static void main(String[] args) { FX.start(new HelloStage()); } }
  • 34. How about JavaFX on… Clojure (defn javafxapp [] (doto (Stage. "JavaFX Stage") (.setWidth 600) (.setHeight 450) (.setScene (doto (Scene.) (.setFill Color/LIGHTGREEN) (.setContent (list (doto (Rectangle.) (.setX 25) (.setY 40) (.setWidth 100) (.setHeight 50) (.setFill Color/RED)))))) (.setVisible true))) (javafxapp) 34
  • 35. How about JavaFX on… Groovy FxBuilder.build { stage = stage( title: "Hello Rectangle (Groovy FxBuilder 2)", width: 600, height: 450, scene: scene(fill: Color.LIGHTSKYBLUE) { rectangle( x: 25, y: 40, width: 100, height: 50, fill: Color.RED ) } ) stage.visible = true; }
  • 36. How about JavaFX on… Scala object HelloJavaFX extends JavaFXApplication { def stage = new Stage { title = "Hello Stage" width = 600 height = 450 scene = new Scene { fill = Color.LIGHTGREEN content = List(new Rectangle { x = 25 y = 40 width = 100 height = 50 fill = Color.RED }) } } } 36
  • 37. How about JavaFX on… Visage Stage { title: "Hello Stage" width: 600 height: 450 scene: Scene { fill: Color.LIGHTGREEN content: Rectangle { x: 25 y: 40 width: 100 height: 50 fill: Color.RED } } } 37
  • 38. Announcing Project Visage > “Visage is a domain specific language (DSL) designed for the express purpose of writing user interfaces.” > Visage project goals:  Compile to JavaFX Java APIs  Evolve the Language (Annotations, Maps, etc.)  Support Other Toolkits > Come join the team! > For more info: http://visage-lang.org/ 38
  • 39. Stephen Chin Dean Iverson steve@widgetfx.org deanriverson@gmail.com tweet: @steveonjava tweet: @deanriverson 39