getting started with widgetfx - oracle cloud · getting started with widgetfx open-source desktop...

39
Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci Sun Microsystems 1 Monday, 8 June 2009

Upload: others

Post on 16-Jul-2020

24 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Getting Started with WidgetFXOpen-Source Desktop Widget Platform with JavaFX™ Technology

Stephen ChinInovis, Inc.

Joshua MarinacciSun Microsystems

1Monday, 8 June 2009

Page 2: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

The JavaFX Desktop Widget Platform

WidgetFX

2Monday, 8 June 2009

Page 3: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Meet the Presenters…

Steve Josh

3

Motorc

Family

Family

World

3Monday, 8 June 2009

Page 4: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

WidgetFX Origins

4

4Monday, 8 June 2009

Page 5: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

5

Why another desktop widget framework?

> Open-Sourcel But widgets can be licensed commercially

> Cross-Platform Supportl Windows XP/Vista, Linux, and Mac OS X.

> One-Click Installationl Plus automatic updates of the dock and widgets.

> Robust Securityl Secure sandbox + signed widgets

5Monday, 8 June 2009

Page 6: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Built-in Widgets

> Clockl Skinnable via CSS

> Slide Showl Configurable Directory, Speed, & Filter

> Web Feedl Supports Atom and all RSS flavors

6Monday, 8 June 2009

Page 7: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Dock Features

> Drag to desktop> Resize widgets (option for fixed aspect ratio)> Per widget transparency> Widget settings saved on restart> Toggle dock always-on-top> Launch on start-up> Multi-monitor support> Dock and widgets can be styled via CSS

7Monday, 8 June 2009

Page 8: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Movie Widget Tutorial

8Monday, 8 June 2009

Page 9: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Widget PropertiesName Type Inherited From Description

width Number Resizable Initial width of the widget

height Number Resizable Initial height of the widget

aspectRatio Number Widget If set, defines a fixed aspect ratio for the widget width and heightskin Skin Control Renders the widget to the scene graph, can have CSS properties for styling

9Monday, 8 June 2009

Page 10: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Widget Definition

var widget: Widget;widget = Widget { width: 640 height: 352 aspectRatio: bind player.media.width / player.media.height skin: Skin { scene: Group { content: bind player } }}

10Monday, 8 June 2009

Page 11: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Load the Media

var source = "http://projavafx.com/movies/elephants-dream-640x352.flv";

var player = bind SimpleMoviePlayer { media: Media { source: source } width: bind widget.width height: bind widget.height}

11Monday, 8 June 2009

Page 12: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Run as Application

12Monday, 8 June 2009

Page 13: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Run in Widget Runner

13Monday, 8 June 2009

Page 14: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

How the Widget Runner Works

> Test widgets standalone> Identical behavior to production> Two ways to launch:

l Automatic Executionl Run your widget as a Web Start application

l Direct Executionl Create a launch url with the following structure:

http://widgetfx.org/dock/runner.jnlp?arg=<widgetUrl>

14Monday, 8 June 2009

Page 15: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Widget Configuration PropertiesClass Name Type Description

BooleanProperty Boolean This class allows you to persist sequences of Booleans

BooleanSequenceProperty Boolean[] This class allows you to persist sequences of Booleans

IntegerProperty Integer This class allows you to persist Integers

IntegerSequenceProperty Integer[] This class allows you to persist sequences of Integers

LongProperty Long This class allows you to persist Longs

LongSequenceProperty Long[] This class allows you to persist sequences of Longs

NumberProperty Number This class allows you to persist Numbers

NumberSequenceProperty Number[] This class allows you to persist sequences of Numbers

StringProperty String This class allows you to persist Strings

StringSequenceProperty String[] This class allows you to persist sequences of Strings

15Monday, 8 June 2009

Page 16: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Widget Configuration

widget = Widget { ... configuration: Configuration { properties: [ StringProperty { name: "source" value: bind source with inverse } ] scene: Scene {} // defined in the next code fragment }}

16Monday, 8 June 2009

Page 17: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Widget Config Dialog

scene: Scene { content: Grid { rows: row([ Text { content: "Source URL:“ }, TextBox { columns: 30, value: bind source with inverse } ]) }}

17Monday, 8 June 2009

Page 18: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Add an On-Replace Trigger (fixme)

var player = bind SimpleMoviePlayer { media: Media { source: source } width: bind widget.width height: bind widget.height} on replace =oldPlayer { oldPlayer.player.stop();}

18Monday, 8 June 2009

Page 19: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Widget Configuration (demo)

19Monday, 8 June 2009

Page 21: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

The Pac-Man Challenge!

> “I Wish... Henry Zhang would make a WidgetFX widget from his JavaFX Pac-Man game”

-- Jim Weaver

21

javafxpert.com

21Monday, 8 June 2009

Page 23: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

23

So What is With the Bunny?

23Monday, 8 June 2009

Page 24: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Meet Nabaztag

> Wifi-Enabled Rabbit> 4 Multi-Colored LEDs> Rotating Ears> Text to Speech Conversion> Audio Sensor for Command Input> REST API for Interactions

24

24Monday, 8 June 2009

Page 25: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Nabaztag Widget

> Widget Functionality:l Send Messages Using Text-to-Speechl Move the Earsl Send a Choreographyl Play an Audio Stream

25

25Monday, 8 June 2009

Page 26: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Nabaztag API

> REST call for sending messages:l http://api.nabaztag.com/vl/FR/api.jsp?

sn=0013D3862711&token=1242371191&tts=Hello+JavaOne

> REST call for repositioning ears:l http://api.nabaztag.com/vl/FR/api.jsp?

sn=0013D3862711&token=1242371191&posleft=4&posright=5

26

26Monday, 8 June 2009

Page 27: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Nabaztag Code & Demo

27

27Monday, 8 June 2009

Page 28: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

What Else You Can Do With a Rabbit?

> E-mail notification> Continuous build status> Ambient Twitter chat> Play podcasts

(Java Posse anyone?)> Scare away unwanted guests> Tell your wife you are busy working on the

WidgetFX 1.2 release and are going to be late… again

28

28Monday, 8 June 2009

Page 29: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

WidgetFX Future Roadmap

> WidgetFX 1.2 Releasel JavaFX 1.2 Supportl Improved Performancel Release on or before 6/15

> Mobile WidgetFXl Deploy widgets to a phone right from the desktopl Mobile widget dockl Planned for second half of 2009

29

29Monday, 8 June 2009

Page 30: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Widget Development Contest

> Sign up at http://widgetfx.org/

30

30Monday, 8 June 2009

Page 31: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Contest Details> How to Enter:

1. Download the WidgetFX 1.2 SDK2. Develop a desktop widget that runs in WidgetFX3. Submit your widget to the Widget Library

> Prizes:1. 12 free e-books, one a month for a year2. 3 free e-books3. 1 free e-book

31

31Monday, 8 June 2009

Page 32: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Top 5 reasons to fill out the survey…

32

32Monday, 8 June 2009

Page 33: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Top 5 reasons to fill out the survey…

32

5. You need a reason to test out that shiny new pen from the Pavilion

32Monday, 8 June 2009

Page 34: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Top 5 reasons to fill out the survey…

32

5. You need a reason to test out that shiny new pen from the Pavilion

4. It is a great way to stretch your muscles after typing on your laptop the whole session

32Monday, 8 June 2009

Page 35: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Top 5 reasons to fill out the survey…

32

5. You need a reason to test out that shiny new pen from the Pavilion

4. It is a great way to stretch your muscles after typing on your laptop the whole session

3. You couldn’t say no to the usher at the door either…

32Monday, 8 June 2009

Page 36: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Top 5 reasons to fill out the survey…

32

5. You need a reason to test out that shiny new pen from the Pavilion

4. It is a great way to stretch your muscles after typing on your laptop the whole session

3. You couldn’t say no to the usher at the door either…

2. You thought the presentation was awesome! (feel free to step up and take a second survey)

32Monday, 8 June 2009

Page 37: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Top 5 reasons to fill out the survey…

32

5. You need a reason to test out that shiny new pen from the Pavilion

4. It is a great way to stretch your muscles after typing on your laptop the whole session

3. You couldn’t say no to the usher at the door either…

2. You thought the presentation was awesome! (feel free to step up and take a second survey)

1. Help keep Josh employed at Sun!

32Monday, 8 June 2009

Page 38: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

Top 5 reasons to fill out the survey…

32

5. You need a reason to test out that shiny new pen from the Pavilion

4. It is a great way to stretch your muscles after typing on your laptop the whole session

3. You couldn’t say no to the usher at the door either…

2. You thought the presentation was awesome! (feel free to step up and take a second survey)

1. Help keep Josh employed at Sun!

32Monday, 8 June 2009

Page 39: Getting Started with WidgetFX - Oracle Cloud · Getting Started with WidgetFX Open-Source Desktop Widget Platform with JavaFX™ Technology Stephen Chin Inovis, Inc. Joshua Marinacci

33

Stephen Chinhttp://steveonjava.com/Tweet: steveonjava

Joshua Marinaccihttp://weblogs.java.net/blog/joshy/Tweet: joshmarinacci

33Monday, 8 June 2009