Go To Homepage



Book Details
Pro JavaFX™ Platform: Script, Desktop and Mobile RIA with Java™ Technology book cover
  • By Weiqi Gao James Weaver Stephen Chin Dean Iverson
  • ISBN13: 978-1-4302-1875-3
  • ISBN10: 1-4302-1875-4
  • 568 pp.
  • Published Jul 2009
  • Print Book Price: $49.99
  • eBook Price: $34.99



Errata Submission

If you think that you've found an error in Pro JavaFX™ Platform: Script, Desktop and Mobile RIA with Java™ Technology, please let us know about it. You will find any confirmed erratum below, so you can check if your concern has already been addressed.

Submit Errata
Pro JavaFX™ Platform: Script, Desktop and Mobile RIA with Java™ Technology (978-1-4302-1875-3)

Errata

Issue Author's Response
Ch 7. p. 32

if (perspectiveScale) {
cell.effect = PerspectiveTransform {
...
should be:
node.effect = PerspectiveTransform {

similarly:

cell.impl_layoutX = centerPoint.x - transformedWidth / 2 - cell.layoutBounds.minX;
cell.impl_layoutY = centerPoint.y - ransformedHeight / 2 - cell.layoutBounds.minY;

should read:

node.impl_layoutX = centerPoint.x - transformedWidth / 2 - cell.layoutBounds.minX;
node.impl_layoutY = centerPoint.y - ransformedHeight / 2 - cell.layoutBounds.minY;

I'd also suggest:
var resizable = node as Resizable;
instead of:
var resizable = cell as Resizable;
even though the original compiles
Code has changed significantly with JavaFX 1.2 layout changes... no longer applies.
Ch 7. p. 27:

Text on the bottom page seems to be missing, in particular the code:

public class PerspectiveTransformer {
public var upperLeft: Point2D;
public var upperRight: Point2D;
public var lowerLeft: Point2D;
public var lowerRight: Point2D;
Pagination has changed, no longer seems to be a problem.
Ch. 7. p. 43

name mismatch: highlightTimeline vs. highlightTransition

seems that highlightTimeline should be highlightTransition in onMouseClicked() on bottom of the page
Code has changed to use an on replace trigger instead.
Ch 7, p. 18-26
The code doesn't produce the picture in Figure 7-11, primarily because GridLayout doesn't resize the nodes.

Suggestion:
...
for (node in content) {
var cell = node as Cell;
node.impl_layoutX = cell.x * cellWidth;
node.impl_layoutY = cell.y * cellHeight;
var resizable = node as Resizable;
resizable.width = cellWidth;
resizable.height = cellHeight;
}

Note also that assignments to node.impl_layoutX and node.impl_layoutY are simplified in above version - the justification in the book is contrived, and shifts the board so that board doesn't cover the "screen". (It's also logically strange - why should the layout take care how the node wants to use the available space - other code in the book leaves that to the nodes themselves, e.g. when text needs to be aligned.) The above code places the board correctly and resizes the squares and pieces, but doesn't put the pieces into the center of their squares. Do do that ReversiPiece needs to position itself into the center, i.e. be changed to:

init {
skin = Skin {
scene: Ellipse {
translateX: bind width / 2
translateY: bind height / 2
...

Now Figure 7-11 is correct, and the test program on p. 19 can be simplified:

ReversiPiece {
owner: Owner.WHITE
scale: 0.7
// translateX: bind scene.width / 2 //not needed
// translateY: bind scene.height / 2 //not needed
...

(There are other ways to arrive at Figure 7-11, but the above seems to me to be the simplest one...)
Example changed for JavaFX 1.2, now handles layout differently.
Chapter 7, p. 18

in public class ReversiPiece
...
init {
Skin {...

needs to be:

init {
skin = Skin {
...

otherwise the pieces won't show
Example changed. It no longer makes sense being a Control due to JavaFX 1.2 changes.
(sorry to be picky:)
Chapter 7, page 12

...
highlighted in bold in Listing 7-8. Listing 7
Listing 7-8. Changes required to the title creation code to turn it into a bound function.
...

Delete "Listing 7" at the end of the line.
Italicize "Listing 7-8." at the beginning of the line.
Fixed.
Chapter 7. p. 3:

mismatch in constant name: Owner.EMPTY vs. Owner.EMPTY

Listing 7-1.
public var cells = for (i in [1..BOARD_SIZE]) Owner.EMPTY; //should be probably NONE, as NONE is used several times, e.g.:

public enum Owner {
NONE, // used also a few lines later and in
...
Good catch! Fixed.
Chapter 7, page 17
Book reads "Your class should Control" at the bottom just above code block. I believe it should be "Your class should extend Control"
Fixed in the draft. Thanks for the feedback!