Index

imagesA

AreaChart, 328329

Audio equalization

AudioPlayer 4, 377, 378

audioSpectrumInterval property, 371, 375

audioSpectrumListener property, 371

audioSpectrumNumBands property, 371, 374, 375

audioSpectrumThreshold property, 371

BAND_COUNT constant, 371

bucket calculation, 374

createBucketCounts method, 374

createEQBands method, 371

createEQInterface method, 369

equalizer and button styling, 379

equalizer bands creation, 369, 371

EqualizerBand.MAX_GAIN constants, 371

EqualizerBand.MIN_GAIN constants, 371

EqualizerView Class, 368369

equalizerview constructor, 376377

equalizerview mediaplayer listener, 376

frequency spectrum display, 372

GridPane, 371, 372

normArray, 374

setNextHandler Method, 377

setValue method, 372

Slider value property, 371

SpectrumBar controls, 372

spectrumDataUpdate method, 375

SpectrumListener class, 373, 374

imagesB

BarChart, 326328

Bindings utility class

equals() method, 113

overloaded add() methods, 110

relational operators, 113

selection operators, 113

triangleareaexample.java, 111112

BorderPane Class

bound function, 155

create score boxes function, 154

createBackground(), 155

createScoreBoxes() function, 154

properties, 153

reversi root stage declaration, 153154

title creation code, 154155

title, background, and scores, 155

BubbleChart, 329333

imagesC

Cascading style sheets, 51

changeOfScene.css, 61

id property, 60

nodes styling, 60

onTheScene.css file, 6061

onTheScene.css radio button, 60

Colorful Circles application, 431

imagesE

Event Dispatcher Thread (EDT), 255

imagesF

Fluent Interface API

Boolean property and binding, 114115

doubleproperty and doublebinding, 118119

floatproperty and floatbinding, 117118

Heron's formula, 122125

if/then/else expressions, 121122

integerproperty and integerbinding, 116

longproperty and binding, 116117

objectproperty and objectbinding, 119

stringproperty and stringbinding, 119

triangle area, 120121

FXML

Cat Adoption Form application, 472

controlling applications, 473, 474

Dog Adoption Form, 468

FXMLLoader, 469

GroovyFX code, 471

Java source code, 468469

JavaFX application, 468

layout constraints, 471

ObservableList inline, 471

Pet Adoption application, 469470

properties, 471

scene graph, 468469

imagesG

GStreamer, 335

imagesH

Hello Earthrise

clipping graphical areas, 16

code for, 811

command-line, 7, 8

graphical nodes, 1315

image displaying, 13

NetBeans, 1721

scene class, 1213

stage class, 1112

text animation, 1617

text drawing, 1516

user interface, 11

imagesI

InSwingExample.java, 287289

IntelliJ Community Edition, 441

imagesJ

JavaFX

AnchorPane

alignment and stretching properties, 165

child Node constraints, 165

game and restart nodes, 166

list of children, 165

restart() method, 166

sizing behavior, 165

stand-off, 165

top-right corner,restart button, 167

API chart structure, 307, 308

custom square region

functions, 157

padding property, 157

preferredWidth/Height properties, 158

properties, 156

read-only properties, 157

single reversi square, 159

wrapper script, 159

dynamic layout techniques

bind layouts variable, 142

BorderPane Class (see BorderPane Class)

CenterUsingStack extends Application, 144

createScore method implementation, 150152

DropShadow and InnerShadow, 152

first falf player score, 149

getScore and getTurnsRemaining, 149

getTurnsRemainingMethod, 149

HBox, VBox, and FlowPane, 150

horizontally sized window,ouput, 152

implement player score backend, 149

location and size binding, 142

overlay and align nodes, 144

per-layout or per-node basis, 145

player color, 148

prefWidth and prefHeight, 143

scene centering text, 142

score, 148

setAlignment functions, 144

SimpleIntegerProperty, 149

StackPane class, 143145

StackPanes and TilePanes (see StackPanes and TilePanes)

text node, 143

textOrigin property, 143

tileWidth and tileHeight, 150

turns remaining, 148

vertically sized window,output, 152

GridPane layout

ALWAYS, 163

hgrow and vgrow, 163

like-named static method, 162

nested StackPane, 164

NEVER, 163

on node properties, 162

Reversi application, 163164

SOMETIMES, 163

tiles method implementation, 164

Hello Earthrise, 7

clipping graphical areas, 16

code for, 811

command-line, 7, 8

graphical nodes, 1315

image displaying, 13

NetBeans, 1721

scene class, 1213

stage class, 1112

text animation, 1617

text drawing, 1516

user interface, 11

Java enterprise modules, 393394

Java SE 6 Update 10, 2

layout techniques

binding, 167

bind vs. layouts, 168

complexity, 167

performance, 167

More Cowbell program (see More Cowbell program)

Oracle's official JavaFX web site, 45

PieChart

abstract Chart class, 312

clockwise configuration, 315

CSS to style, 315

fx-pie-label-visible property, 316

getChartData() method, 311

layout instructions, 314

modified chart,output, 313

modified version, 312

rendering,TIOBE index, 310, 311

start() method, 314

stylesheet, 314

TIOBE index screenshot, 309

resizable reversi piece

constructor code, 160

public ReversiPiece() method, 160

reversi square, 162

side-by-side playing pieces, 160

SimpleObjectProperty, 160

styling, 160

WHITE or BLACK, 159

wrapper application, 161

Reversi to life

addEventHandler method, 177

application, 140

black's first turn, 175

board position, 138, 139

canFlip method, 173

cells loop to go through, 173

custom binding, 173

enumeration class, 141

EventHandler inner class, 177

FadeTransition, 176177

game enhancements, 180181

game rules, 172

highlight animation,active cell, 178

initBoard() method, 141

Java singleton pattern, 140

legalMove function, 173175

next move by white, 139

opposite() method, 141

owner enumeration, 141

region class function, 176

ReversiModel class, 140

ReversiSquare create() method, 175

static model variable, 174

taking turns, 178180

tiles() method, 174

turn-based game, 138

two-dimensional array, 141

3D scene graph

classes and methods, 169

3D look and feel, 169

orthographic projection, 170

perspective transform layout, 172

PerspectiveCamera to transform, 171

slick-looking perspective, 171

source co-ordinates mapping, 170

3D translation or rotation, 170

Tiles() Method, 171

scene.media package., 344

screenshot, 3

script language, 3

SDK, 6

SDK API, 56

surveying, 3132

tools, 7

user interface control (see StarterApp program)

XYChart

alternativeColumnVisible properties, 324

alternativeRowFillVisible properties, 324

AreaChart, 328329

BarChart, 326328

behavior,xAxis, 321

BubbleChart, 329333

CategoryAxis, 322324

getChartData method, 321

LineChart, 325326

NumberAxis, 322

properties, 316

rows and column,fill values, 325

ScatterChart, 317320

title and named symbols, 322

xAxis constructor, 320

JavaFX 2.0, 4

media classes, 344

properties and bindings

bindings utility class (see Bindings utility class)

Fluent interface API (see Fluent interface API)

intProperty, 9497

JavaFX Beans (see JavaFX Beans)

key interfaces and concepts (see Key interfaces and concepts)

script language, 94

SimpleIntegerProperty class, 94

JavaFX Beans

eagerly instantiated properties strategy, 126130

getter and setter methods, 125

lazily instantiated properties strategy, 130132

selection bindings, 132135

JavaFX concurrency framework

Service<V> Abstract Class

createTask() method, 278, 284

executor, 278

restart() method, 278

ServiceExample.java, 278284

starting up, ServiceExample, 284

task cancelled, 286

task progress, ServiceExample, 285

task succeeded, 285

task threw exception, 286

Worker.State.CANCELLED state, 278

Worker.State.RUNNING state, 284

Worker.State.SCHEDULED state, 278

thread identification, 255257

unresponsive UIs

AtomicBoolean, 274, 277

call() method, 275

cancel() methods, 269

CANCELLED state, 269

exception property, 267

FutureTask<V> class, 268

InterruptedException, 276

java.util.concurrent.ExecutorService, 265

java.util.concurrent.FutureTasks, 265

long-running event handler, 261

message property, 267

Model nested class, 274

Platform.runLater() method, 266

program, 264

progress property, 267

protected methods, 268

public static boolean isFxApplicationThread(), 266

public static boolean isSupported(ConditionalFeature), 266

public static void exit(), 266

ResponsiveUIExample.java, 265

RunnableFuture<V> class, 268

running property, 267

RUNNING state, 269

RuntimeException, 276

shouldThrow field, 274

state property, 267

starting up,WorkerAndTask, 274

task cancelled,WorkerAndTaskExample program, 277

task progress,WorkerAndTaskExample program, 275

task suceeded,WorkerAndTaskExample program, 276

task threw exception, 277

Task<V> abstract class, 268

Thread.sleep(Long.MAX_VALUE), 265

title property, 267

totalWork property, 267

UnresponsiveUIExample.java, 261266

updateProgress() call method, 269

value property, 267

workDone property, 267

Worker.State, 268

WorkerAndTaskExample.java, 269274

JavaFX Groovy

advantages, 440

API enhancements

animation, 448449

layouts, 451452

tables, 449450

binary zip release, 442

binding, 446448

built-in data structure syntax, 440

closures, 440

dynamic typing, 440

getter/setter access, 440

Groovy Class creation dialog, 444

Hello GroovyFX code, 444

IntelliJ, 441

jar references, 443

jfxrt.jar, 444

landing page, 440

module configuration screen, 443

named constructor parameters, 440

operator overloading, 440

properties, 445446

source files, 440

JavaFX languages and markupvanishing circles application, 431433

builder version, 434435

code, 432

functionality, 433

Groovy, 435436 (see also JavaFX Groovy)

Scala, 436438 (see also Scala)

swing, 432

Visage, 438439 (see also Visage)

FXML (see FXML)

JAXB.unmarshal method, 410

JsonFactory.createJsonParser method, 405

imagesK

Key interfaces and concepts, 9497

binding, 103105

observable interface, 100101

property, 102103

readonlyproperty, 101

type-specific specializations, 105109

writableValue interface, 101

imagesL

LineChart, 325326

imagesM

Media classes

audio clips

BasicAudioClip application, 339

constructor, 337

getResource method, 337

media.css style sheet, 338

MediaPlayer, 344, 345

MediaView, 344

play method, 337

playback parameter control, 339340

scene construction, 340343

source code, 337

stop method, 337

URI string, 336

wrap-up, 343

audio playing

AbstractView Base Class, 353

acceptTransferModes method, 355

audio equalization (see Audio equalization)

AudioPlayer3 application class, 355356

code, 345

createControlPanel method, 363

createPlayPauseButton method, 364

currentTime property, 356

currentTime value, 364365

DragEvent handlers, 354

error handling, 346

formatDuration method, 366

initSceneDragAndDrop method, 354355

jar file, 345

JavaFX FileChooser, 350

MediaPlayer wrap-up, 379

metadata, 347350

panel creation, 363364

play, pause, and stop, 356

playback controls creation, 359362

player controls, 357359

PlayerControlsView Class, 353

position slider changes, 366

repetition, 368

seekAndUpdatePosition helper method, 364

seeking, 366

SongModel, 350352

updatePositionSlider method, 365

volume control, 367

GStreamer, 335

media formats, 335

video playing

audioplayer conversion, 388390

functional movie player, 380

http URL, 380

markers, 383385

MediaView, 380383

mediaviews slide apart, 388

robot movie, 381

split and join transitions, 387

StackPane, 380

viewport, 385387

Metronome1 example program

behavior, 6566

Metronome1Main.java, 6668

MetronomeTransitionMain.fx, 7476

screenshot, 64, 65, 73

timeline-based, 72

More Cowbell program

Audio Configuration Program

behavior of, 22

building and running, 2122

change listeners, 2930

model class, 2829

source code files, 2326

AudioConfigModel, 26

colors and gradients, 27

graphical node, 26

slider node, 27

imagesO

Observable collections

observableList

addListener() calls, 236

boolean wasAdded(), 243

boolean wasRemoved(), 243

FXCollections.observableArrayList(), 236

getAddedSize() method, 237

getAddedSublist() method, 237

getFrom() method, 237

getPermutation(int i) method, 237

getRemoved() method, 237

getRemovedSize() method, 237

java.util.List interface, 232

JavaFX observable map, 243

K getKey(), 243

key interfaces, 232

ListChangeEventExample.java, 238240

MapChangeEventExample.java, 244247

MapChangeListener interface, 243

MapChangeListener.Change class, 243

next() and reset() methods, 237

ObservableListExample.java, 233

ObservableMap<K, V> getMap(), 244

onChange() callback method, 236

register and unregister ListChangeListeners, 232

remove() method, 234

removeAll() call, 242

setAll() method, 240

sort() utility method, 240

UML diagram, 232

V getValueAdded(), 244

V getValueRemoved(), 244

wasAdded(), 237

wasPermutted(), 237

wasRemoved(), 237

wasReplaced(), 237

factory and utility methods, 248254

OnTheScene program

behavior, 5152

OnTheSceneMain.fx, 5257

screenshots, 50

imagesS

Scala, 436438

animation, 464

closures, 463

JavaFX properties, 459461

layout constraints, 463464

ScalaFX

API binding, 461462

code, 453

core functionality, 457

default project settings, 455

Hello ScalaFX application, 457

IDE installation, 454

implicits, 457

installation, 455

library, 453

proxies and implicit conversions, 458459

Scala project creation, 455

semicolons, 457

stub class, 456

TypeSafe, 453

SongModel, 351352

StackPanes and TilePanes

align nodes, 147148

layout methods, 146

node alignment example, 148

pos enumeration, 147

snapToPixels property, 148

versatile class, 146

visual effect, 145

StageCoach example program

behavior, 3841

screenshot, 37, 38

StageCoachMain.java, 4145

StarterApp program

accordion creation, 208

Accordion/TitledPane tab, 185, 186

createMenus() method, 195197

createTabs() method, 195

createToolBar() method, 195, 197200

file menu, 184

graphic and an accelerator key, 197

graphic() method, 197

graphical buttons, 200201

HTMLEditor, 190, 191

items() method, 206

keyCombination() method, 197

onAction() event handler, 197

onSelectionChanged() method, 204

popup, 191

screenshot, 184

ScrollPane/Miscellaneous, 187190

separator, 202

source code, 192193

SplitPane/TreeView/ListView, 186

StarterAppMain.java file, 194195

tableView, 185

columns definition, 206207

creation, 205206

row selection, 207

tabpane creation, 203204

titledpane definition, 208

toggle buttons, 201

toggle groups, 201202

toolbar, 185

treeitem

changelistener, 211

checkbox, 218

choicebox, 219220

contextmenu, 221

definition, 211

HTMLEditor, 226227

hyperlink, 219

listview creation and assigning, 212

menubutton, 220221

passwordfield, 223

Popup, 227228

progressbar, 225226

progressindicator, 224225

radiobutton, 218219

scrollpane definition, 213218

slider, 224

splitmenubutton, 222

splitpane creation, 212

textarea, 223224

textfield, 222223

webview, 228229

treeview, 209211

webview tab, 192

Swing and SWT applications

ActionListeners, 291

display.asyncExec(), 295

EventQueue.invokeLater(), 287

FXCanvas code, 299

FXPanelBuilder class, 287

JavaFX hybrid program, 291

JavaFX rectangle, 294, 299

javafx.embed.swt package, 295

JavaFXSceneInSwingExample.java, 291294

javax.swing.JComponent, 287

JFXPanel class, 287

Label widget, 299

NoJavaFXSceneInSWTExample.java, 295298

org.eclipse.swt.widgets.Canvas, 295

paint()and getPreferredSize()methods, 289

Platform.runLater(), 287, 295

ResponsiveUIExample program, 287

swing code, 290291

SWT JavaFX hybrid program, 300303

SWT Shell, JavaFX rectangle, 303

imagesT

Timeline, 64

controlling and monitoring, 7071

key frames insertion, 6970

pause() method, 71

properties, 69

resume button, 71

Start() method, 71

stop button, 71

Transition classes

controlling and monitoring, 77

MetronomePathTransition Example, 77

behavior, 78

MetronomePathTransitionMain.java, 7879

pathtransition class, 7980

properties, 76

imagesU

User interface creation

node-centric UIs, 3536

stage setting, 36

animating nodes, 6364

bounds, 47

checkForCollision() method, 8889

close() method, 50

CSS (see Cascading style sheets)

cursor setting, 57

desktop, 48

drag and drop handlers, 62

drawing rounded rectangles, 47

ellipse drawing, 80

event handling, 62

focused property, 49

full-screen mode, 47

handle() method, 91

intersects() method, 89

javafx.scene.paint, 5758

key event handlers, 62

KeyEvent Class, 62

layout containers, 4849

lookup() method, 59

Metronome1 example program (see Metronome1 example program)

mouse event handlers, 62

mouseevent class, 6263

nodes, 58

OnTheScene program (see OnTheScene program)

program arguments, 46

resizable method, 46

scene, 50

scene class property, 59

scene's content sequence, 59

stage class understanding, 3637

StageCoach example program (see StageCoach example program)

style setting, 46

text node, 5859

timeline class (see Timeline)

transition classes, 7172 (see also Transition classes)

VBox layout class, 49

ZenPong program (see ZenPong program)

Z-Order, 49

imagesV

Visage, 438439

advantages, 465

anonymous functions, 546548

bidirectional bindings and lazy bindings, 533535

bind expression

bind keyword, 530

block, 532

compiler, 530

dependent variables, 531

for expressions, 531

function invocation expression, 532

if expressions, 531

object literal expressions, 533

bound functions, 549550

characteristics, 477

class definitions

init blocks, 563564

instance functions, 560562

instance variables, 557560

member variables, 560

PiggyBank Class, 555556

this expression, 562563

class hierarchies

abstract instance function, 569, 571

inheritance, 566

instance function override, 568

instance variable override, 567

instanceof operator, 572573

mix-in classes, 565

mix-in inheritance, 571572

super keyword, 568569

superclass, 565

code organization feature

import directive, 579581

modules, 575576

packages, 577, 579

protected modifiers, 581582

provision, 576577

public-init and public-read modifiers, 582583

scripts, 574575

data types, 478

expressions

assignment operator, 515

block expression, 513

compound assignment operators, 516

for expression, 519

if expression, 520522

precedence and groupings, 514

relational operators, 516518

separator, 514

types, 512

variable and constant declarations, 514515

while expression, 518519

function definitions

dequeue() function, 542

enqueue() function, 542

Fibonacci series, 536

function parameters, 543

instance functions, 536

integer value, 536

local variables, 543

parameter types, 539

return expression, 539541

return types, 537538

script functions, 536

script variables, 542

handling exceptions, 553555

call stack, 551

throw expression, 551552

Hello Visage application, 466

internationalization, 592594

Java libraries

classes and interface extending, 597599

classes instantiating, 594

enums access, 597

Java collections, 599600

Java methods calling, 595

keywords quoting, 596

native array type, 599

nested classes access, 596

object fields access, 595

static fields access, 595

object literals

classes and objects, 523

constant and variable declarations, 525

declarative syntax, 529

default instance variables, 524

instance variable and functions, 525526

instance variables initializer, 523

Java object creation, 529

null safe handling, 528529

objects manipulation, 526528

Visagedoc, 523

overloaded functions, 543546

package contents, 466

primitive types

angle type, 496497

boolean type, 480481

byte, short, and long types, 485486

character type, 484485

characteristics, 480

color type, 497499

double types, 488

duration type, 491493

float and number types, 486488

integer type, 481484

length type, 493496

string type, 488491

reflection

instance and script variables, 605607

metaprogramming, 600

mirror examination, 602603

mirror-based reflection, 600601

mirrorOf() methods, 601

output, 603604

programming, 604605

VisageLocal, 601

sequence

comprehension, 509510

delete expression, 507

element accessing, 504

element insertion, 506

explicit sequence expressions, 501

insert expressions, 507

manipulation, 508509

range expressions, 501503

reverse operator, 506

size accessing, 503

slice accessing, 504505

subset accessing, 505506

types, 500501

utility functions, 511512

string format specifications, 589592

triggers

debugging, 588589

old and new values access, 584586

sequence modification information access, 586588

variable modification, 583

variable

declarations, 478

names, 479

types, 479

var keyword, 478

visagec compiler, 467

wrapper, 467

imagesW, X, Y, Z

Web service access

frontend and backend platforms, 391392

JavaFX and Java enterprise modules, 393394

REST

"firstName" string, 421

asynchronous processing, 413417

boilerplate code, 420

CellFactories, 419

DataFX, 425426

DOM approach, 409

firstNameProperty() method, 421

getObservableList() method, 398, 410

hard-coded tweets, 400

HTTP protocol, 395

human-readable text format, 400

import statements, 409

JavaBean properties, 412

JavaFX properties, 420422

JAXB annotations, 411412

Jersey-Client, 427429

JSON library, 403

Json response, 401

JsonFactory.createJsonParser method, 405

key-value map, 407

ListView, 397398

ListView.setCellFactory() method, 399

manual XMLParsing, 412

parseTweet method, 406

POJO Tweet class, 421

PropertyValueFactory, 420

RestFX, 423425

RSS response, 401

searchterm, 400

setCellValueFactory method, 419

simple data binding, 407

SimpleStringProperty, 419

start method, 417418

TableColumn constructor, 418

timeStamp field, 412

TweetApplication retrieving JSON data, 405

tweet class, 396397, 399

tweets rendering, 397

Twitter REST API, 403

TwitterResponse class, 412413

uniform resource identifiers, 395

unmarshalling, 410

XML parsing and JAXB, 410

XmlAccessType.PROPERTY, 422

XML-based operations, 408

XML-based response, 408

zero-arg constructor, 397

SOAP, 395

ZenPong program, 63

behavior, 8182

initial state, 80

keyboard input focus, 9091

keyFrame action event handler, 88

nodes dragging, 8990

ZenPongMain.java, 8287

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.21.47