0% found this document useful (0 votes)
143 views

Programming With Javafx: Tecniche Di Programmazione - A.A. 2016/2017

This document provides an introduction to programming with JavaFX. It discusses the basic concepts and architecture of a JavaFX application including stages, scenes, nodes, and the scene graph. It also covers creating a minimal JavaFX application, adding nodes and content to the scene graph, and using FXML for building the user interface.

Uploaded by

Pawan Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
143 views

Programming With Javafx: Tecniche Di Programmazione - A.A. 2016/2017

This document provides an introduction to programming with JavaFX. It discusses the basic concepts and architecture of a JavaFX application including stages, scenes, nodes, and the scene graph. It also covers creating a minimal JavaFX application, adding nodes and content to the scene graph, and using FXML for building the user interface.

Uploaded by

Pawan Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 90

Programming with JavaFX

Tecniche di Programmazione – A.A. 2016/2017


Summary
1. About and History
2. Basic concepts
3. Minimal JavaFX Application
4. Application structure
5. The Scene Graph
6. Events

2 Tecniche di programmazione A.A. 2016/2017


About and History

Introduction to JavaFX
GUI in Java
} Graphic framework available in Java
} AWT (1996)
} Swing (1998)
} Extremely powerful, many extensions available
} Complex to master, requires low-level handling
} Hard to create visually pleasing applications
} Alternatives available
} Most notable: SWT (Eclipse)
} Still cumbersome to master

} On a different Universe, web-based user interfaces


became nicer and faster to create

4 Tecniche di programmazione A.A. 2016/2017


JavaFX 1.0 – forget it
} JavaFX 1 (2008)
} JavaFX 1 and JavaFX 2 are completely different
} Version 1 relied on a “scripting language” to describe
scenes, with ‘hooks’ to activate Java code
} JavaFX 1.x is now deprecated

5 Tecniche di programmazione A.A. 2016/2017


JavaFX 8 (and JavaFX 2.x)
} Redesigned from scratch
} The JavaFX 2.x/8.0 framework is entirely written in Java
} For visual layout, an XML file may also be used (called
FXML)
} Graphic appearance borrows from web-standard CSS
style sheets
} UI programming is based on easy to handle events and
bindings

} Oracle plans to deprecate Swing in favor of JavaFX 2


} Now called JavaFX 8 (after Java 8 – JDK 1.8)

6 Tecniche di programmazione A.A. 2016/2017


Getting and running JavaFX
} JavaFX is already included in Oracle JDK 7 and JDK8
} Not in JDK 6.x
} Not in OpenJDK (beware, Linux users!)
} JDK 8 includes significant JavaFX improvements.
} Recommended:
} JavaFX Scene Builder (latest version: 8.1)
} Eclipse: e(fx)clipse plugin, available in the Eclipse Marketplace

} Download links are in the course webpage

7 Tecniche di programmazione A.A. 2016/2017


Basic concepts

Introduction to JavaFX
Separation of concerns

9 Tecniche di programmazione A.A. 2016/2017


Empty JavaFX window
public class Main extends Application {

@Override
public void start(Stage stage) {
Group root = new Group(); // the root is Group or Pane
Scene scene = new Scene(root, 500, 500, Color.BLACK);
stage.setTitle("JavaFX Demo");
stage.setScene(scene);
stage.show();
}

public static void main(String[] args) {


launch(args);
}
}

10 Tecniche di programmazione A.A. 2016/2017


Key concepts in JavaFX
} Stage: where the application will be displayed (e.g., a
Windows’ window)
} Scene: one container of Nodes that compose one “page”
of your application
} Node: an element in the Scene, with a visual appearance
and an interactive behavior. Nodes may be hierarchically
nested

My best friend is the JavaFX JavaDoc API


http://docs.oracle.com/javase/8/javafx/api/
11 Tecniche di programmazione A.A. 2016/2017
Some ‘Leaf’ Nodes (Controls)

12 Tecniche di programmazione A.A. 2016/2017


Some ‘Parent’ Nodes (Container ‘Panes’)
} BorderPane (5-areas)
} Hbox, Vbox (linear sequence)
} StackPane (overlay all children)
} GridPane (row x columns)
} FlowPane (flowing boxes, wrap around)
} TilePane (flowpane with equally sized boxes)
} AnchorPane (magnetically attach nodes at corners or
sides)

13 Tecniche di programmazione A.A. 2016/2017


Some Nodes (Charts)

14 Tecniche di programmazione A.A. 2016/2017


And more coming…

http://jfxtras.org/

15 Tecniche di programmazione A.A. 2016/2017


And more coming…
http://fxexperience.com/controlsfx/

16 Tecniche di programmazione A.A. 2016/2017


How to add scene content
} In Java code
} By creating and adding new Node subclasses
} Standard way, in Java (boring and error-prone)
} By using node Builder classes
} Programming pattern, later on…
} In FXML
} By writing XML directly
} By using the Scene Builder
} And loading the FXML into the application

17 Tecniche di programmazione A.A. 2016/2017


Adding some shape
public class Main extends Application {

@Override
public void start(Stage stage) {
Group root = new Group();

Rectangle rect = new Rectangle(25,25,250,250);


r.setFill(Color.BLUE);
root.getChildren().add(rect);

Scene scene = new Scene(root, 500, 500, Color.BLACK);

stage.setTitle("JavaFX Demo");
stage.setScene(scene);
stage.show();
}

}
18 Tecniche di programmazione A.A. 2016/2017
JavaFX Scene Builder 8.1

http://gluonhq.com/open-source/scene-builder/

19 Tecniche di programmazione A.A. 2016/2017


FXML fragment
. . .

<HBox id="HBox" alignment="CENTER" spacing="15.0"


AnchorPane.rightAnchor="23.0" AnchorPane.topAnchor="22.0">
<children>
<Button id="button1" fx:id="newIssue" onAction="#newIssueFired"
text="New" />
<Button id="button2" fx:id="saveIssue" onAction="#saveIssueFired"
text="Save" />
<Button id="button3" fx:id="deleteIssue" onAction="#deleteIssueFired"
text="Delete" />
</children>
</HBox>
<ImageView id="IssueTrackingLite" layoutX="14.0" layoutY="20.0">
<image>
<Image url="@IssueTrackingLite.png" preserveRatio="true" smooth="true" />
</image>
</ImageView>

. . .

20 Tecniche di programmazione A.A. 2016/2017


Building a scene from FXML

public void start(Stage stage) throws Exception {


Parent root = FXMLLoader.load(
getClass().getResource("circle.fxml"));

stage.setTitle("Circle Demo");
stage.setScene(new Scene(root, 500, 150));
stage.show();
}

21 Tecniche di programmazione A.A. 2016/2017


Application structure

Introduction to JavaFX
Empty JavaFX window
public class Main extends Application {

@Override
public void start(Stage stage) {
Group root = new Group(); // the root is Group or Pane
Scene scene = new Scene(root, 500, 500, Color.BLACK);
stage.setTitle("JavaFX Demo");
stage.setScene(scene);
stage.show();
}

public static void main(String[] args) {


launch(args);
}
}

23 Tecniche di programmazione A.A. 2016/2017


General class diagram
.launch()
creates
Application Stage

.setScene
extends .start()
creates
Scene
MyApp Root node
children (at constructor)

creates
Node
adds

Parent (leaf) Node (root) Node


children

24 Tecniche di programmazione A.A. 2016/2017


Typical Class Diagram

25 Tecniche di programmazione A.A. 2016/2017


General rules
} A JavaFX application extends
javafx.application.Application
} The main() method should call Application.launch()
} The start() method is the main entry point for all JavaFX
applications
} Called with a Stage connected to the Operating System’s
window
} The content of the scene is represented as a hierarchical
scene graph of nodes
} Stage is the top-level JavaFX container
} Scene is the container for all content

26 Tecniche di programmazione A.A. 2016/2017


Minimal example
public class HelloWorld extends Application {
public static void main(String[] args) {
launch(args);
}

@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("Hello World!");

StackPane root = new StackPane();

Button btn = new Button();


btn.setText("Say 'Hello World'");

root.getChildren().add(btn);

primaryStage.setScene(new Scene(root, 300, 250));


primaryStage.show();
}
}

27 Tecniche di programmazione A.A. 2016/2017


Stage vs. Scene

javafx.stage.Stage javafx.scene.Scene

} The JavaFX Stage class is the } The container for all content
top level JavaFX container. in a scene graph
} The primary Stage is } The application must specify
constructed by the platform. the root Node for the scene
} Additional Stage objects may graph
be constructed by the } Root may be Group (clips),
application. Region, Control (resizes)
} A stage can optionally have } If no initial size is specified, it
an owner Window. will automatically compute it

28 Tecniche di programmazione A.A. 2016/2017


Nodes
} The Scene is populated with a tree of Nodes
} Layout components
} UI Controls
} Charts
} Shapes
} Nodes have Properties
} Visual (size, position, z-order, color, ...)
} Contents (text, value, data sets, ...)
} Programming (event handlers, controller)
} Nodes generate Events
} UI events
} Nodes can be styled with CSS

29 Tecniche di programmazione A.A. 2016/2017


Events
} FX Event (javafx.event.Event):
} Event Source => a Node
} Event Target
} Event Type
} Usually generated after some user action
} ActionEvent, TreeModificationEvent, InputEvent, ListView.E
ditEvent, MediaErrorEvent, TableColumn.CellEditEvent,Tre
eItem.TreeModificationEvent, TreeView.EditEvent, WebEve
nt,WindowEvent,WorkerStateEvent
} You can define event handlers in your application

30 Tecniche di programmazione A.A. 2016/2017


Properties
} Extension of the Java Beans convention
} May be used also outside JavaFX
} Encapsulate properties of an object
} Different types (string, number, object, collection, ...)
} Set/Get
} Observe changes
} Supports lazy evaluation
} Each Node has a
large set of Properties

31 Tecniche di programmazione A.A. 2016/2017


Bindings
} Automatically connect («bind») one Property to another
Property
} Whenever the source property changes, the bound one is
automatically updated
} Multiple bindings are supported
} Lazy evaluation is supported
} Bindings may also involve computations (arithmetic operators,
if-then-else, string concatenation, ...) that are automatically
evaluated
} May be used to automate UI
} May be used to connect the Model with the View

32 Tecniche di programmazione A.A. 2016/2017


The Scene graph

Introduction to JavaFX
Nodes
} Root node: top level container
} Intermediate nodes:
} Containers
} Layout managers
} UI Composite controls
} Leaf (terminal) nodes:
} Shapes
} UI Controls
} Organized as a Hierarchical tree

34 Tecniche di programmazione A.A. 2016/2017


ChoiceBox
ColorPicker
ComboBoxBase Button
ComboBox

Nodes family
CheckBox
ButtonBase
MenuButton
Cell
Labeled ToggleButton
Label
ListView
Control TitledPane

Group
MenuBar
Focus on
Slider Panes
TabPane and
TextInputControl
TextArea
Controls
TextField
Parent
ToolBar
AnchorPane
TreeView
BorderPane
Axis
FlowPane
Region Chart
GridPane
WebView Pane

javafx.scene.Node HBox JavaDoc


Arc
StackPane is your
friend
Circle
TilePane
Line
Shape VBox
Polygon
Canvas
Rectangle
Imageview
35 Text Tecniche di programmazione A.A. 2016/2017
Exploring Controls and Examples
} JavaFX Ensemble demo
application
} Download from Oracle
site: JavaFX Demos and
Samples Downloads
} Run Ensemble.jnlp

36 Tecniche di programmazione A.A. 2016/2017


UI Form Controls
} Controls may be
combined to construct
«Forms»
} Control Nodes have a
value property
} May be linked to application
code
} Control Nodes generate
UI Events
} Button: ActionEvent
} Text: ActionEvent,
KeyTyped, KeyPressed,
MouseClicked, ...

37 Tecniche di programmazione A.A. 2016/2017


38 Tecniche di programmazione A.A. 2016/2017
Layout Class Hierarchy
} Group:
} Doesn’t perform any positioning of children.
} To statically assemble a collection of nodes in fixed positions
} To apply an effect or transform to that collection.
} Region:
} base class for all general purpose layout panes
} resizable and stylable via CSS
} Supports dynamic layout by sizing and positioning children
} Control:
} the base class for all skinnable controls
} resizable and subclasses are all stylable via CSS
} Controls delegate layout to their skins (which are Regions)
} Each layout Control subclass provides API for adding content in the
appropriate place within its skin
} you do not add children to a control directly.

39 Tecniche di programmazione A.A. 2016/2017


40 Tecniche di programmazione A.A. 2016/2017
41 Tecniche di programmazione A.A. 2016/2017
42 Tecniche di programmazione A.A. 2016/2017
43 Tecniche di programmazione A.A. 2016/2017
44 Tecniche di programmazione A.A. 2016/2017
45 Tecniche di programmazione A.A. 2016/2017
46 Tecniche di programmazione A.A. 2016/2017
47 Tecniche di programmazione A.A. 2016/2017
Creating the Scene Graph
} The Java way
} Create Control Nodes
} Set properties to new nodes
} Add new nodes to parent node
} With Constructors and/or with Builders
} The FXML way
} Create a FXML file
} Define Nodes and Properties in FXML
} Load the FXML
} (Optionally, add new nodes/properties the Java way)

48 Tecniche di programmazione A.A. 2016/2017


Example: one text input field
TextField text = new TextField("Text"); Constructors
text.setMaxSize(140, 20);
root.getChildren().add(text);

TextField text = TextFieldBuilder().create()


.maxHeight(20).maxWidth(140)
.text("Text")
.build() ;
Builders
root.getChildren().add(text);

49 Tecniche di programmazione A.A. 2016/2017


public class HelloDevoxx extends Application {
public static void main(String[] args)
{
launch(args);
}

@Override
public void start(Stage primaryStage)
{
primaryStage.setTitle("Hello Devoxx");
Group root = new Group();
Scene scene = new Scene(root, 400, 250,
Color.ALICEBLUE);
Text text = new Text();
text.setX(105);
text.setY(120);
text.setFont(new Font(30));
text.setText("Hello Devoxx");
root.getChildren().add(text);
primaryStage.setScene(scene);
primaryStage.show();
}
}
50 Tecniche di programmazione A.A. 2016/2017
public void start(Stage primaryStage)
{
primaryStage.setTitle("Hello Devoxx");
primaryStage.setScene(SceneBuilder.create()
.width(400).height(250).fill(Color.ALICEBLUE)
.root(GroupBuilder.create().children(
TextBuilder.create()
.x(105).y(120)
.text("Hello Devoxx")
.font(new Font(30)).build()
).build()
).build());

primaryStage.show();
}

51 Tecniche di programmazione A.A. 2016/2017


The FXML way...
} XML-based format
} Nested tree of XML Elements, corresponding to Nodes
} XML Attributes corresponding to (initial) properties of
nodes

} JavaFX Scene Builder is a GUI for creating FXML files

} The FXMLLoader class reads a FXML file and creates all


the Nodes

52 Tecniche di programmazione A.A. 2016/2017


Example

53 Tecniche di programmazione A.A. 2016/2017


JavaFX Scene Builder

54 Tecniche di programmazione A.A. 2016/2017


FXMLLoader

@Override
public void start(Stage stage) throws Exception {
Parent root = FXMLLoader.load(
getClass().getResource("fxml_example.fxml"));

stage.setTitle("FXML Welcome");
stage.setScene(new Scene(root, 300, 275));
stage.show();
}

55 Tecniche di programmazione A.A. 2016/2017


Linking FXML and Java
} FXML element may have an associated attribute fx:id
} Nodes may be later retrieved by
} public Node lookup(java.lang.String selector)
} Finds a node with a specified ID in the current sub-tree
} Example:
} scene.lookup("#myId");
} Node references can also be «injected» using the
@FXML annotation (see later)

56 Tecniche di programmazione A.A. 2016/2017


Events

Introduction to JavaFX
Interacting with Nodes
} In JavaFX applications, events are notifications that
something has happened.
} An event represents an occurrence of something of interest to
the application
} As a user clicks a button, presses a key, moves a mouse, or
performs other actions, events are dispatched.
} Registered event filters and event handlers within the
application
} receive the event and
} provide a response.

58 Tecniche di programmazione A.A. 2016/2017


What is an event?

59 Tecniche di programmazione A.A. 2016/2017


Event propagation
} Events are generated on the source node
} Events propagated in the scene graph hierarchy («dispatch
chain»), in two phases
} Dispatching: downwards, from root to source node
} Processes Event Filters registered in the nodes
} Bubbling: upwards, from source node to root
} Processes Event Handlers registered in the nodes
} If you want an application to be notified
when an event occurs, register a filter
or a handler for the event
} Handlers may “consume” the event

60 Tecniche di programmazione A.A. 2016/2017


Event Handlers
} Implements the EventHandler interface
} Executed during the event bubbling phase.
} If does not consume the event, it is propagated to the
parent.
} A node can register more than one handler.
} Handlers for a specific event type are executed before
handlers for generic event types.
} For example, a handler for the KeyEvent.KEY_TYPED event is
called before the handler for the InputEvent.ANY event.
} To consume an event, call the consume() method

61 Tecniche di programmazione A.A. 2016/2017


Registering Event Handlers
} setOnEvent-type(
EventHandler<? super event-class> value )
} Event-Type
} The type of event that the handler processes (e.g. setOnKeyTyped,
setOnMouseClicked, ...)
} Event-class
} The class that defines the event type (e.g., KeyEvent , MouseEvent, ...)
} Value
} The event handler for event-class (or for one of its super classes)
} Must implement: public void handle(ActionEvent event)
} May be a regular class or an anonymous inline class

62 Tecniche di programmazione A.A. 2016/2017


Example
class ButtonActionHandler implements Event Handler
javafx.event.EventHandler<ActionEvent> {

public ButtonActionHandler (/*params*/) {


// constructor - if needed
}

@Override
public void handle(ActionEvent event) {
Button b = (Button)event.getSource() ;
//...do something
String buttonText = b.getText() ;
// ...
} Registration
}
Button btn = new Button() ;

btn.setOnAction(new ButtonActionHandler()) ;
63 Tecniche di programmazione A.A. 2016/2017
Example (inline definition)

Registration &
Anonymous event handler
btn.setOnAction(new EventHandler<ActionEvent>() {

public void handle(ActionEvent event) {


System.out.println("Hello World");
}

});

64 Tecniche di programmazione A.A. 2016/2017


Model-View-Controller

JavaFX programming
Application complexity and MVC
} Interactive, graphical applications exhibit complex
interaction patterns
} Flow of control is in the hand of the user
} Actions are mainly asynchronous

} How to organize the program?


} Where to store data?
} How to decouple application logic from interface details?
} How to keep in sync the inner data with the visibile
interface?

66 Tecniche di programmazione A.A. 2016/2017


Design Patterns

67 Tecniche di programmazione A.A. 2016/2017


Design Patterns
} How to build systems with good OO design qualities
} Reusable, extensible, maintainable
} Patterns: Proven solutions to recurrent problems
} Design problems
} Programming problems
} Adopt and combine the OO constructs
} Interface, inheritance, abstract classes, information hiding,
polymorphism, objects, statics, …
} Help dealing with changes in software
} Some part of a system is free to vary, independently from the
rest

68 Tecniche di programmazione A.A. 2016/2017


Media Player example

69 Tecniche di programmazione A.A. 2016/2017


MVC pattern defined

70 Tecniche di programmazione A.A. 2016/2017


Normal life-cycle of interaction

71 Tecniche di programmazione A.A. 2016/2017


Mapping concepts to JavaFX
} View: presenting the UI
} FXML
} The Nodes in the Scene Graph
} Controller: reacting to user actions
} Set of event handlers
} Model: handling the data
} Class(es) including data
} Persistent data in Data Bases

72 Tecniche di programmazione A.A. 2016/2017


Design Exercise
} Imagine an application managing a list of items (e.g.,
names)
} Different items in the user interface should manage the
same set of data, with different criteria and actions

} Where do you declare the data class?


} Which class should have access to which?
} Who creates what objects?

73 Tecniche di programmazione A.A. 2016/2017


A possible
solution

74 Tecniche di programmazione A.A. 2016/2017


The Controller in FXML

JavaFX programming
The Controller in FXML
} Several attributes in FXML help in the definition of the
Controller behavior associated to a scene
} Identification of the Controller class
} Injection of Node identifiers (references)
} Registration of event handlers
} Additionally, the JavaFX Scene Builder may generate a
«controller skeleton» for inclusion in the project

76 Tecniche di programmazione A.A. 2016/2017


Defining the Controller class
} The Root element of the scene
graph may specify a fx:
controller attribute
} <BorderPane
id="BorderPane"
xmlns:fx="http://javafx.com
/fxml"
fx:controller="it.polito.te
cnprogr.RuzzleController">

77 Tecniche di programmazione A.A. 2016/2017


fx:controller attribute
} Associate a "controller" class with an FXML document
} Automatically create the instance when FXML is loaded
} Should include event handler methods
} May include an initialize() method
} public void initialize();
} called once when the contents of its associated document have
been completely loaded
} any necessary post-processing on the content

78 Tecniche di programmazione A.A. 2016/2017


Accessing the controller instance
} The Application often needs to communicate with the
controller object
} E.g., to call setModel()
} FXMLLoader provides this information

URL location = getClass().getResource("example.fxml");

FXMLLoader fxmlLoader = new FXMLLoader(location);

Pane root = (Pane)fxmlLoader.load();

MyController controller =
(MyController)fxmlLoader.getController();

79 Tecniche di programmazione A.A. 2016/2017


Injection of Node references
} The controller code may directly access various Nodes in
the associated scene graph
} The attribute @FXML associates a Node variable with
the corresponding node, with the same fx:id value as the
variable name
} No more error-prone «lookup» calls...
} Local variables in the controller instance
} Try:View | Show Sample Controller Skeleton on the
Scene Builder!
@FXML // fx:id="theTitle"
private Label theTitle;

80 Tecniche di programmazione A.A. 2016/2017


Registration of Event Handlers
} In FXML, you may set a event handler
through attributes
} onAction, onKeyTyped, onMouseClicked, ...
hundreds more ...
} The value should be the #name of a
method in the controller class
} With the right signature for the event
type

<Button fx:id="cercaBtn" @FXML


onAction="#doCercaParola" void doCercaParola (
text="Cerca" /> ActionEvent event ) {

81 Tecniche di programmazione A.A. 2016/2017


Properties and bindings

JavaFX programming
JavaFX Properties
} Modern revisitation of the JavaBeans framework (back
from Java 1.1)
} Easy to connect different variable values
} Some may be internal variables
} Some may be visual elements
} Supports automatic «binding» to efficiently propagate
changes
} Simplifies programming

83 Tecniche di programmazione A.A. 2016/2017


«Old» JavaBeans conventions
} http://www.oracle.com/technetwork/java/javase/document
ation/spec-136004.html

84 Tecniche di programmazione A.A. 2016/2017


Resources

Introduction to JavaFX
Resources
} Official
} http://www.oracle.com/us/technologies/java/fx/overview/index.
html
} http://www.oracle.com/technetwork/java/javafx/overview/index
.html
} Documents
} http://docs.oracle.com/javafx/
} http://docs.oracle.com/javafx/2/api/index.html
} Blogs
} http://fxexperience.com/
} http://www.learnjavafx.typepad.com/weblog/
} http://community.java.net/community/javafx

86 Tecniche di programmazione A.A. 2016/2017


Resources
} API
} http://docs.oracle.com/javafx/2/api/index.html
} Slides/Tips
} http://www.slideshare.net/steveonjava/java-fx-20-a-developers-guide
} http://refcardz.dzone.com/refcardz/getting-started-javafx
} Tutorials/Articles
} http://docs.oracle.com/javafx/2/events/jfxpub-events.htm
} http://amyfowlersblog.wordpress.com/2011/06/02/javafx2-0-layout-a-
class-tour/
} Examples (Downloads)
} JavaFX Demos and Samples, at
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-
downloads-1880260.html

87 Tecniche di programmazione A.A. 2016/2017


Resources
} FXML Controller
} http://docs.oracle.com/javafx/2/api/javafx/fxml/doc-
files/introduction_to_fxml.html#controllers
} Charts
} Using JavaFX Charts tutorial:
http://docs.oracle.com/javafx/2/charts/jfxpub-charts.htm
} Books
} Head First Design Patterns, chapter 12

88 Tecniche di programmazione A.A. 2016/2017


Resources
} Properties and Bindings
} http://docs.oracle.com/javafx/2/binding/jfxpub-binding.htm
} http://thierrywasyl.wordpress.com/2012/07/29/properties-and-
bindings-in-javafx/

89 Tecniche di programmazione A.A. 2016/2017


Licenza d’uso
} Queste diapositive sono distribuite con licenza Creative Commons
“Attribuzione - Non commerciale - Condividi allo stesso modo (CC
BY-NC-SA)”
} Sei libero:
} di riprodurre, distribuire, comunicare al pubblico, esporre in pubblico,
rappresentare, eseguire e recitare quest'opera
} di modificare quest'opera
} Alle seguenti condizioni:
} Attribuzione — Devi attribuire la paternità dell'opera agli autori
originali e in modo tale da non suggerire che essi avallino te o il modo in
cui tu usi l'opera.
} Non commerciale — Non puoi usare quest'opera per fini
commerciali.
} Condividi allo stesso modo — Se alteri o trasformi quest'opera, o se
la usi per crearne un'altra, puoi distribuire l'opera risultante solo con una
licenza identica o equivalente a questa.
} http://creativecommons.org/licenses/by-nc-sa/3.0/
90 Tecniche di programmazione A.A. 2016/2017

You might also like