Navigation

RIABook.cn

国内外优秀RIA书籍推荐与交流平台

« Integrating Flash with XMLProgramming Flash Communication Server(download) »

JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications(Download)

Download JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications
下载 动态Java脚本开发丰富网络应用程序
RIAbook Rank:★★★★

简介 Book Description
这是SUN刚刚开源的一种开发RIA的技术工具,被称为Flex/AIR的有力竞争对手。Java社区的RIA成绩就看诸位客官的了。
JavaFX Script makes it easy for developers to quickly develop high-quality UI-intensive applications very quickly. As JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications demonstrates, developers can develop Rich Internet Applications and rich client-side user interfaces quickly and easily with this potential replacement for Ajax and perhaps even ActionScript and other scripting found in Flash. This firstPress book on JavaFX Scriptcovers the following topics:

* The fundamentals of the JavaFX suite of technologies and the foundations of JavaFX Script and available tools
* How to create a Wordsearch application
* How to augment and enhance the Wordsearch application after learning more advanced JavaFX Script features such as classes, objects, UI components, and constructs.

学到什么 What you’ll learn
* Understand the JavaFX family and JavaFX Script and its relationship to the Java/Java SE 6 platform.
* Set up a JavaFX Script development and execution environment culminating in a Hello JFX application.
* Create a Wordsearch application and explore important JavaFX Script concepts by doing so.
* Survey the JavaFX UI Components including the commonly used ones that go into further building and enhancement of the Wordsearch application frame and menu structure.
* Use more advanced JavaFX Script language constructs for extending the Wordsearch application.
* Build JavaFX classes and objects, build the data model for the WordSearch application, and run the data model with a tester program.
* Develop the view for the Wordsearch application using a data model such as bind as well as drawing on a canvas.
* Explore more JavaFX Script concepts and possible IDE tie-ins to NetBeans, Eclipse, etc.

适合读者 Who is this book for?
This book is for content developers and application developers with some programming experience who want to create rich internet applications.

作者 About the Author
James L. Weaver is the chief scientist at Learning Assistant Technologies, a company that specializes in developing learner-centric tools. He is also the president of JMentor, a Java mentoring, training, and consulting practice.

目录 Table of Contents
CHAPTER 1
Introduction to JavaFX. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
The JavaFX Family . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
JavaFX Mobile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
JavaFX Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
JavaFX Script's Relationship to Java . . . . . . . . . . . . . . . . . . . . . . . 2
Features and Advantages of JavaFX Script. . . . . . . . . . . . . . . . . . . 2
Current Status of JavaFX Script . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Getting the Most from This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
CHAPTER 2
Quick Start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . 5
Choosing a JavaFX Development Environment . . . . . . . . . . . . . . . . . . . . 5
Obtaining JavaFXPad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Obtaining an IDE Plug-In . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
The Eclipse Plug-In . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
The NetBeans Plug-In . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Your First JavaFX Application: HelloJFX . . . . . . . . . . . . . . . . . . . . . . . . . 7
Understanding the HelloJFX Application . . . . . . . . . . . . . . . . . . . . . 9
Comments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
The package Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
import Statements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Declarative Code That Defines the User Interface . . . . . . . . . . . . . 11
Using the Frame Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Creating String Literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Using the Canvas GUI Widget . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Drawing Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Defining Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Running and Examining the HelloJFXBind Application. . . . . . . . . . . . . . 15
Structure of a Minimal JavaFX Class . . . . . . . . . . . . . . . . . . . . . . 17
The class Declaration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
attribute Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Making an Instance of the Class . . . . . . . . . . . . . . . . . . . . . . . . . 18
Declaring and Assigning Variables . . . . . . . . . . . . . . . . . . . . . . . . 18
Understanding Binding. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Assigning Color Constants to the Text Object . . . . . . . . . . . . . . . . 20
Assigning an Array of Values to an Attribute . . . . . . . . . . . . . . . . . 21
Moving the HelloJFXModel Class into Its Own File . . . . . . . . . . . . . . . . 22
Special Instructions for Running This Example with JavaFXPad . . 24
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
CHAPTER 3
Creating User Interfaces in JavaFX. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Overview of the Word Search Builder Application . . . . . . . . . . . . . . . . . 29
Invoking the Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
A Tour of the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
The Word Search Builder Application Architecture . . . . . . . . . . . . 36
The Declarative Code and Classes in the
wordsearch_jfx.ui Package . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
The Classes in the wordsearch_jfx.model Package . . . . . . . . . . . 38
Creating the Frame and Menu Structure. . . . . . . . . . . . . . . . . . . . . . . . 39
The Exoskeleton of the Word Search Builder UI. . . . . . . . . . . . . . . . . . . 39
Creating Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Creating a MenuBar Widget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Creating Menu Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Creating MenuItem Widgets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Creating CheckBoxMenuItem Widgets . . . . . . . . . . . . . . . . . . . . . 49
Visually Separating Menu Items . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Table of Menu-Related Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Invoking Java Methods from JavaFX . . . . . . . . . . . . . . . . . . . . . . 51
Instantiating the Model, Handler, and View Classes . . . . . . . . . . . 53
Using Borders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Understanding JavaFX Layout Widgets. . . . . . . . . . . . . . . . . . . . . 62
Using the GridPanel Layout Widget. . . . . . . . . . . . . . . . . . . . . . . . 62
Using the Box Layout Widget . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Using the BorderPanel Layout Widget. . . . . . . . . . . . . . . . . . . . . . 65
The Layout Widget Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Creating a ToolBar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Using Button Widgets on a Toolbar . . . . . . . . . . . . . . . . . . . . . . . . 71
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
CHAPTER 4
Creating JavaFX Classes and Objects . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Testing the Word Search Builder Model . . . . . . . . . . . . . . . . . . . . . . . . 81
Understanding the Structure of a JavaFX Class . . . . . . . . . . . . . . 87
Understanding Attribute Initializers. . . . . . . . . . . . . . . . . . . . . . . . 87
Introducing Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Defining the Body of an Operation . . . . . . . . . . . . . . . . . . . . . . . . 88
Producing Console Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Creating String Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Invoking an Operation Located in the Same Class . . . . . . . . . . . . 90
The for Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Examining the Model Behind the Word Search Grid . . . . . . . . . . . . . . . 94
Understanding JavaFX Data Types . . . . . . . . . . . . . . . . . . . . . . . 107
Considerations When Declaring an Attribute. . . . . . . . . . . . . . . . 108
Considerations When Declaring a var . . . . . . . . . . . . . . . . . . . . . 110
Defining and Using Named Instances (Constants). . . . . . . . . . . . 111
Creating Operations and Functions . . . . . . . . . . . . . . . . . . . . . . 112
Defining the Parameters and Return Type of an Operation . . . . . 112
Understanding the Effects of the new Operator . . . . . . . . . . . . . 114
Creating JavaFX Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Understanding JavaFX Triggers . . . . . . . . . . . . . . . . . . . . . . . . . 116
Using JavaFX Statements and Operators . . . . . . . . . . . . . . . . . . 117
The if/else Statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
The while Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
The break Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Using JavaFX Sequences. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Sequence Literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Accessing a Specific Element of a Sequence . . . . . . . . . . . . . . . 131
Iterating Over an Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Inserting Sequence Elements. . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Querying Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Deleting Sequence Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Zeroing Out a Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
The JavaFX Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
The JavaFX Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
The Model Behind Each Word Search Grid Cell . . . . . . . . . . . . . . . . . . 139
The Model Behind the Word List Boxes. . . . . . . . . . . . . . . . . . . . . . . . 141
Naming Rules and Conventions for JavaFX Identifiers . . . . . . . . 143
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
CHAPTER 5
More UI Fun Including 2D Drawing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Understanding JavaFX 2D Graphic . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Drawing and Painting Shapes . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Transforming Graphics Objects . . . . . . . . . . . . . . . . . . . . . . . . . 150
Using the Group Node to Group Shapes Together . . . . . . . . . . . . 150
Canvas Mouse Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Using the var Pseudo-Attribute . . . . . . . . . . . . . . . . . . . . . . . . . 157
Creating Custom Graphical Components . . . . . . . . . . . . . . . . . . 158
Extending CompositeNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Working with Images on the Canvas . . . . . . . . . . . . . . . . . . . . . 163
Controlling the Opacity of a Node. . . . . . . . . . . . . . . . . . . . . . . . 164
Animating a Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Using a Custom Component in a Program . . . . . . . . . . . . . . . . . 165
Examining the WordGridView
Custom Graphical Component . . . . . . . . . . . . . . . . . . . . . . . . 166
Using the PopupMenu Widget . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Creating Custom Widgets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Supplying a composeWidget() Operation . . . . . . . . . . . . . . . . . . 181
Creating and Using the ListBox Widget. . . . . . . . . . . . . . . . . . . . 181
Creating Dialog Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Using the JavaFX MessageDialog Class . . . . . . . . . . . . . . . . . . . 192
Using the Java Swing JOptionPane Class. . . . . . . . . . . . . . . . . . 192
Using the JavaFX Dialog Class . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Experiencing the GroupPanel Layout . . . . . . . . . . . . . . . . . . . . . 198
Using the RadioButton Widget . . . . . . . . . . . . . . . . . . . . . . . . . . 198
More JavaFX UI Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200

下载 Download
rapidshare: download 如何从Rapidshare上下载?
BT Torrent: download


收藏到网摘:

  • Articles related:

Post comment:

◎welcome to give out your point。

Powered By Z-Blog .Templete from Google

Copyright riabook.cn . Some Rights Reserved. 辽ICP备07502442号

Search

     
feedsky
抓虾
pageflakes
Rojo
狗狗
google reader
bloglines
my yahoo
newsgator
netvibes
鲜果

Previous

Favorites

Control panel