DukeScript

57 %
43 %
Information about DukeScript
Technology

Published on March 11, 2014

Author: steveonjava

Source: slideshare.net

Description

DukeScript is a new way of writing JavaScript applications that lets you take advantage of a powerful binding model to connect to Java code running in a local JVM.

DUKESCRIPT Puts the Java in JavaScript

ProblemI

ProblemII

Chuck Norris can instantiate abstract classes can run Java on iPad and Android without Jailbreak! uses generics since Java 1.0 overrides final methods Chuck Norris on the set of "The Delta Force" (1986), Copyright Yoni S.Hamenahem

bck2brwsr vs HotSpot „World of Warcraft Commercial" Copyright ©Blizzard Entertainment

The Solution "The Way of the Dragon" Copyright © 20th Century Fox Home Entertainment / Bryanston Distributing / CBS/Fox / Cinema Classics

BCK2BRWSR

DESIGNER VS DEVELOPER

DESIGNER VS DEVELOPER index.html <html> <button id="hello"> Say Hello!</button> </html> ! App.java @Model(className="Person" , properties={ @Property(name = "selectedName", type=String.class), }) static class PersonModel{ ... }

DUKESCRIPT Puts the Java in JavaScript

alternatively use bck2brwsr

KNOCKOUT4J

@Model(className="Person", properties={ @Property(name = "firstName", type=String.class), @Property(name = "lastName", type=String.class) @Property(name = "addresses", type=Address.class, array = true) }) static class PersonModel { http://bits.netbeans.org/html4j/0.7.5/net/java/html/json/ package-summary.html

@Model(className="Address", properties={ @Property(name = "street", type=String.class), @Property(name = "town", type=String.class) }) static class AddressModel { } http://bits.netbeans.org/html4j/0.7.5/net/java/html/json/ package-summary.html

@ComputedProperty static String fullName(String firstName, String lastName) { return firstName + " " + lastName; } http://bits.netbeans.org/html4j/0.7.5/net/java/html/json/ package-summary.html

<span data-bind="text: fullName"> <div data-bind="foreach: addresses"> Lives in <span data-bind="text: town"/> </div> http://bits.netbeans.org/html4j/0.7.5/net/java/html/json/ package-summary.html

@ComputedProperty static String fullName(String firstName, String lastName) { return firstName + " " + lastName; } http://bits.netbeans.org/html4j/0.7.5/net/java/html/json/ package-summary.html

CANVAS 0.5.2 https://github.com/eppleton/canvas

! ≈! HTML5 CANVAS! CANVAS API

CANVAS API GraphicsContext2D gc = HTML5Graphics.getOrCreate("canvas"); gc.setLineWidth(30); gc.setFont("24px Helvetica"); gc.fillText("Hello World!", 175, 200); gc.setFillStyle(new Color("rgba(0, 0, 255, 0.5)“)); gc.strokeRect(75, 100, 200, 200); gc.fillRect(325, 100, 200, 200);

JAVAFX WITH CANVAS API IN BCK2BRWSR http://xelfi.cz/fishsim/

FXGAMES https://github.com/eppleton/FXGameEngine

DUKESCRIPT ! ! ! UNIVERSITY

Task 1 Create your own application in Java that renders through HTML.! Write your own model and display and animate it. mvn archetype:generate -DarchetypeGroupId=org.apidesign.html -DarchetypeArtifactId=knockout4j-archetype -DarchetypeVersion=0.7.5

Task 2 Create your own application using the Canvas API mvn archetype:generate -DarchetypeGroupId=org.apidesign.canvas -DarchetypeArtifactId=canvas-archetype -DarchetypeVersion=0.5.2

Task 3 Use JSON/REST to communicate with a server API Doc: http://bits.netbeans.org/html4j/0.7.5/net/java/html/json/OnReceive.html Demo: http://dew.apidesign.org/dew/#7138581 See also: http://bits.netbeans.org/html4j/0.7.5/net/java/html/json/doc-files/websockets.html

HOW CAN WE IMPROVE IT?

We want you for DukeScript http://bits.netbeans.org/html4j/0.7.5/ and https://github.com/eppleton/canvas Thank you! ! @monacotoni

Add a comment

Related presentations

Related pages

DukeScript

Applications with the nice and clean architecture that DukeScript enables are one thing, but what about cool interactive graphics or games? The Canvas API ...
Read more

Getting started with DukeScript

Getting started with DukeScript. Did we convince you to give it a try and do some demos? Then you've got two options, either use our ...
Read more

DukeScript - APIDesign

The DukeScript vision is to write once, display anywhere and to deliver on this promise, there are various ways to package and deploy a DukeScript application.
Read more

DukeScript: Wir sind das Java in JavaScript! - JAXenter

DukeScript erzeugt derzeit viel Aufmerksamkeit in der Java-Szene. Der Clou: DukeScript-Anwendungen werden in Java geschrieben und mittels HTML5 bzw.
Read more

DukeScript Framework for Dummies (Geertjan's Blog)

Blogs.Oracle.Com - Geertjan's Blog ... Awesome video. I start right away to code with one hand holding a beer with the other one!
Read more

DukeScript: A New Attempt to Run Java Everywhere

DukeScript is a technology meant to bring Java to every client, mobile or desktop, without the need of a plug-in. In spite of its misleading ...
Read more

Das Überall-Java: Write once run anywhere mit DukeScript

Java löst sein WORA (Write Once, Run Everywhere)-Versprechen schon lange nicht mehr ein. DukeScript will das ändern, indem es eine saubere Trennung von ...
Read more

Newest 'dukescript' Questions - Stack Overflow

Every time I generate a new dukescript project using knockoutjs sample code, this appears in some comment: browser.bootstrap