• Save
JavaFX Mix
Upcoming SlideShare
Loading in...5
×
 

JavaFX Mix

on

  • 2,286 views

JUG Genova presentation on JavaFX technology

JUG Genova presentation on JavaFX technology

Statistics

Views

Total Views
2,286
Views on SlideShare
2,012
Embed Views
274

Actions

Likes
1
Downloads
0
Comments
0

5 Embeds 274

http://juggenova.net 240
http://juggenova.wordpress.com 30
http://www.slideshare.net 2
https://s3.amazonaws.com 1
http://web.archive.org 1

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

JavaFX Mix JavaFX Mix Presentation Transcript

  • Mixing Java and JavaFx Giampaolo Melis JUG Genova
  • Goal
    • An MVC where Java is the controller and JavaFx the view.
  • Agenda
    • JSR 223 Scripting for the Java Platform
    • The JavaFx Script language
    • Design and Programming Tools
    • Using Fx in a Java Application
    • Makeover of JhaarSearch Application
    • Resources
    • Q&A
  • JSR 223 Scripting for the Java Platform
    • Framework for embedding scripts into Java source code.
    ClassLoader loader = Thread.currentThread().getContextClassLoader(); ScriptEngineManager manager = new ScriptEngineManager(loader); ScriptEngine engine = manager.getEngineByExtension( "fx" ); String script = "println("Hello World!");"; engine.eval(script);
  • The JavaFx Script language
    • Primary component of the JavaFx platform for creating RIA.
    • Statically typed declarative scripting language, based on Java syntax.
    • Started as F3, has been changed from interpreted to compiled (fx compiler) version.
  • The JavaFx Script language
    • Built in automatic binding.
    • Built in animation and effects.
    • Graphics primitives can be composed using CustomNode.
    import javafx.ui.*; import javafx.ui.canvas.*; Group { content: [Text { content: 'Hello JavaFX' transform: scale(4.0,4.0) }] } Hello JavaFX
  • Design and Programming Tools
    • Many tools helping developers and designers
      • JavaFx Pad
      • JavaFx Tutorial
      • Netbeans Plugin
      • SVG Converter
      • Project Nile
    Demo ...
  • Using Fx in a Java Application
    • The proxy method...
    public class FXDesktopControllerInvocationHandler implements InvocationHandler { Value delegate; public FXDesktopControllerInvocationHandler(Value delegate) { this.delegate = delegate; } public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { String mname = method.getName(); if (mname.equals(&quot;toString&quot;)) return delegate.toString(); Type t = delegate.getType().getOperation(mname); Value v = t.instantiate(); v.setAttribute(&quot;this&quot;, delegate); Iterator<Attribute> i = v.getAttributes(); int c = 0; if (i.hasNext()) i.next(); while (i.hasNext()) { Attribute attribute = i.next(); if (args.length > c) v.setAttribute(attribute.getName(), args[c++]); } v.call(); return null; } }
  • Makeover of JhaarSearch Application Demo ...
  • Resources
    • Chris Oliver's Weblog
      • http://blogs.sun.com/chrisoliver/
    • OpenJFX Project
      • https://openjfx.dev.java.net/
    • PlanetJFX Wiki
      • http://jfx.wikia.com/wiki/Planet_JFX_Wiki
    • JavaFX Main site
      • http://javafx.com/
  • Q&A Any Questions? [email_address]