Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.ClassCastException in the reversi app #8

Open
kindlychung opened this issue Sep 19, 2015 · 5 comments
Open

java.lang.ClassCastException in the reversi app #8

kindlychung opened this issue Sep 19, 2015 · 5 comments

Comments

@kindlychung
Copy link

This app produces lots of java.lang.ClassCastException.

package proscalafx.ch04.reversi.ui

import proscalafx.ch04.reversi.model.{Black, Owner, ReversiModel, White}

import scalafx.Includes._
import scalafx.application.JFXApp.PrimaryStage
import scalafx.application.{ConditionalFeature, JFXApp, Platform}
import scalafx.geometry.Pos
import scalafx.scene.control.Button
import scalafx.scene.effect.{DropShadow, InnerShadow}
import scalafx.scene.layout._
import scalafx.scene.paint.Color
import scalafx.scene.shape.Ellipse
import scalafx.scene.text.{Font, FontWeight, Text}
import scalafx.scene.transform.{Rotate, Scale, Translate}
import scalafx.scene.{PerspectiveCamera, Scene}


object Reversi extends JFXApp {

  val restart = new Button() {
    text = "Restart"
    onAction = handle {ReversiModel.restart()}
  }

  val game = new BorderPane() {
    top = createTitle()
    center = new StackPane() {
      children = List(
        createBackground(),
        createTiles()
      )
    }
    bottom = createScoreBoxes()
  }

  stage = new PrimaryStage() {
    scene = new Scene(600, 400) {
      root = new AnchorPane() {
        children = List(
          game,
          restart
        )
      }
    }
  }

  AnchorPane.setTopAnchor(game, 0d)
  AnchorPane.setBottomAnchor(game, 0d)
  AnchorPane.setLeftAnchor(game, 0d)
  AnchorPane.setRightAnchor(game, 0d)
  AnchorPane.setRightAnchor(restart, 10d)
  AnchorPane.setTopAnchor(restart, 10d)


  if (Platform.isSupported(ConditionalFeature.Scene3D)) {
    stage.scene().camera = new PerspectiveCamera() {
      fieldOfView = 60
    }.delegate
  }


  //---------------------------------------------------------------------------


  private def createTitle() = new TilePane {
    snapToPixel = false
    children = List(
      new StackPane {
        style = "-fx-background-color: black"
        children = new Text {
          text = "ScalaFX"
          font = Font.font(null, FontWeight.Bold, 18)
          fill = Color.White
          alignmentInParent = Pos.CenterRight
        }
      },
      new Text {
        text = "Reversi"
        font = Font.font(null, FontWeight.Bold, 18)
        alignmentInParent = Pos.CenterLeft
      })
    prefTileHeight = 40
    prefTileWidth <== parent.selectDouble("width") / 2
  }


  private def createBackground() = new Region {
    style = "-fx-background-color: radial-gradient(radius 100%, white, gray)"
  }


  private def createTiles(): GridPane = {
    val board = new GridPane
    for {
      i <- 0 until ReversiModel.BOARD_SIZE
      j <- 0 until ReversiModel.BOARD_SIZE
    } {
      val square = new ReversiSquare(i, j)
      val piece = new ReversiPiece()
      piece.owner <== ReversiModel.board(i)(j)
      board.add(new StackPane {
        children = List(square, piece)
      }, i, j)
    }

    if (Platform.isSupported(ConditionalFeature.Scene3D)) {
      val scale = new Scale(.45, .8, 1, 300, 60, 0)
      val translate = new Translate(75, -2, -150)
      val xRot = new Rotate {
        angle = -40
        pivotX = 300
        pivotY = 150
        pivotZ = 0
        axis = Rotate.XAxis
      }
      val yRot = new Rotate {
        angle = -5
        pivotX = 300
        pivotY = 150
        pivotZ = 0
        axis = Rotate.YAxis
      }
      val zRot = new Rotate {
        angle = -6
        pivotX = 300
        pivotY = 150
        pivotZ = 0
        axis = Rotate.ZAxis
      }

      board.transforms ++= List(scale, translate, xRot, yRot, zRot)
    }

    board
  }


  private def createScoreBoxes() = new TilePane() {
    snapToPixel = false
    prefColumns = 2
    children = List(
      createScore(Black),
      createScore(White)
    )
    prefTileWidth <== parent.selectDouble("width") / 2
  }


  private def createScore(owner: Owner): StackPane = {

    val innerShadow = new InnerShadow() {
      color = Color.DodgerBlue
      choke = 0.5
    }
    val noInnerShadow = null.asInstanceOf[javafx.scene.effect.InnerShadow]

    val backgroundRegion = new Region() {
      style = "-fx-background-color: " + owner.opposite.colorStyle
      effect <== when(ReversiModel.turn === owner) choose innerShadow otherwise noInnerShadow
    }

    val dropShadow = new DropShadow() {
      color = Color.DodgerBlue
      spread = 0.2
    }
    val noDropShadow = null.asInstanceOf[javafx.scene.effect.DropShadow]

    val piece = new Ellipse() {
      radiusX = 32
      radiusY = 20
      fill = owner.color
      effect <== when(ReversiModel.turn === owner) choose dropShadow otherwise noDropShadow
    }

    val score = new Text() {
      font = Font.font(null, FontWeight.Bold, 100)
      fill = owner.color
      text <== ReversiModel.score(owner).asString()
    }

    val remaining = new Text() {
      font = Font.font(null, FontWeight.Bold, 12)
      fill = owner.color
      text <== ReversiModel.turnsRemaining(owner).asString() + " turns remaining"
    }

    new StackPane() {
      children = List(
        backgroundRegion,
        new FlowPane() {
          hgap = 20
          vgap = 10
          alignment = Pos.Center
          children = List(
            score,
            new VBox() {
              alignment = Pos.Center
              spacing = 10
              children = List(
                piece,
                remaining
              )
            }
          )
        }
      )
    }
  }
}
@kindlychung
Copy link
Author

OS X 10.10, Java 1.8_51, Scala 2.11.7

@kindlychung
Copy link
Author

Actually, as soon as I make the first move, I get the following:

/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/bin/java -Didea.launcher.port=7549 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 14 CE.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/lib/tools.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Users/kaiyin/personal_config_bin_files/workspace/ProScalaFX-master/target/scala-2.11/classes:/Users/kaiyin/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.7.jar:/Users/kaiyin/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.6.jar:/Users/kaiyin/.ivy2/cache/org.scalafx/scalafx_2.11/jars/scalafx_2.11-8.0.40-R8.jar:/Applications/IntelliJ IDEA 14 CE.app/Contents/lib/idea_rt.jar" com.intellij.rt.execution.application.AppMain proscalafx.ch04.reversi.ui.Reversi
Picked up _JAVA_OPTIONS: -Xms256m -Xmx5g
sept. 19, 2015 2:28:03 PM com.sun.javafx.binding.SelectBinding$SelectBindingHelper getObservableValue
WARNING: Exception while evaluating select-binding [width]
sept. 19, 2015 2:28:03 PM com.sun.javafx.binding.SelectBinding$SelectBindingHelper getObservableValue
WARNING: Exception while evaluating select-binding [width]
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
ERROR: unexpected fbo is bound! Expected 1, but found 2
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
ERROR: unexpected fbo is bound! Expected 1, but found 2
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)
java.lang.ClassCastException: com.sun.javafx.geom.BoxBounds cannot be cast to com.sun.javafx.geom.RectBounds
    at com.sun.javafx.sg.prism.NGNode.applyTransform(NGNode.java:2479)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1221)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.sg.prism.NGNode.accumulateGroupDirtyRegion(NGNode.java:1203)
    at com.sun.javafx.sg.prism.NGNode.accumulateDirtyRegions(NGNode.java:1036)
    at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:243)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.lang.Thread.run(Thread.java:745)


@jpsacha
Copy link
Member

jpsacha commented Sep 19, 2015

This looks like an issue introduced by JavaFX 8. The examples were created when JavaFX 2 was around and worked fine at that time. Then you try the original Pro JavaFX 2, it has the same problems.

Would you want to file the bug with JavaFX team.

Pro JavaFX 8 uses modified code. That will need to be ported to ProScalaFX.

@kindlychung
Copy link
Author

Here is the Pro JavaFX 8 version of the same app:

package projavafx.reversi.ui;

import javafx.application.Application;
import javafx.beans.binding.Bindings;
import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.effect.DropShadow;
import javafx.scene.effect.InnerShadow;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Region;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.TilePane;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.shape.Ellipse;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import projavafx.reversi.model.Owner;
import projavafx.reversi.model.ReversiModel;

/**
 * @author Stephen Chin <[email protected]>
 */
public class Reversi extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        TilePane title = createTitle();
        TilePane scoreBoxes = createScoreBoxes();

        BorderPane game = new BorderPane();
        game.setTop(title);
        game.setCenter(new StackPane(createBackground(), tiles()));
        game.setBottom(scoreBoxes);
        Node restart = restart();
        AnchorPane root = new AnchorPane(game, restart);
        Scene scene = new Scene(root, 600, 400);
        primaryStage.setScene(scene);
        AnchorPane.setTopAnchor(game, 0d);
        AnchorPane.setBottomAnchor(game, 0d);
        AnchorPane.setLeftAnchor(game, 0d);
        AnchorPane.setRightAnchor(game, 0d);
        AnchorPane.setRightAnchor(restart, 10d);
        AnchorPane.setTopAnchor(restart, 10d);

        title.prefTileWidthProperty().bind(Bindings.selectDouble(title.parentProperty(), "width").divide(2));
        scoreBoxes.prefTileWidthProperty().bind(Bindings.selectDouble(scoreBoxes.parentProperty(), "width").divide(2));
        primaryStage.show();
    }

    private Node restart() {
        Button button = new Button("Restart");
        button.setOnAction(e -> model.restart());
        return button;
    }

    private TilePane createTitle() {
        StackPane left = new StackPane();
        left.setStyle("-fx-background-color: black");
        Text text = new Text("JavaFX");
        text.setFont(Font.font(null, FontWeight.BOLD, 18));
        text.setFill(Color.WHITE);
        StackPane.setAlignment(text, Pos.CENTER_RIGHT);
        left.getChildren().add(text);
        Text right = new Text("Reversi");
        right.setFont(Font.font(null, FontWeight.BOLD, 18));
        TilePane tiles = new TilePane();
        tiles.setSnapToPixel(false);
        TilePane.setAlignment(right, Pos.CENTER_LEFT);
        tiles.getChildren().addAll(left, right);
        tiles.setPrefTileHeight(40);
        return tiles;
    }

    private Node createBackground() {
        Region region = new Region();
        region.setStyle("-fx-background-color: radial-gradient(radius 100%, white, gray)");
        return region;
    }

    private final ReversiModel model = ReversiModel.getInstance();

    private Node tiles() {
        GridPane board = new GridPane();
        for (int i = 0; i < ReversiModel.BOARD_SIZE; i++) {
            for (int j = 0; j < ReversiModel.BOARD_SIZE; j++) {
                ReversiSquare square = new ReversiSquare(i, j);
                ReversiPiece piece = new ReversiPiece();
                piece.ownerProperty().bind(model.board[i][j]);
                board.add(new StackPane(square, piece), i, j);
            }
        }
        return board;
    }

    private TilePane createScoreBoxes() {
        TilePane tiles = new TilePane(createScore(Owner.BLACK), createScore(Owner.WHITE));
        tiles.setSnapToPixel(false);
        tiles.setPrefColumns(2);
        return tiles;
    }

    private Node createScore(Owner owner) {
        Region background = new Region();
        background.setStyle("-fx-background-color: " + owner.opposite().getColorStyle());
        Ellipse piece = new Ellipse(32, 20);
        piece.setFill(owner.getColor());
        Text score = new Text();
        score.setFont(Font.font(null, FontWeight.BOLD, 100));
        score.setFill(owner.getColor());
        Text remaining = new Text();
        remaining.setFont(Font.font(null, FontWeight.BOLD, 12));
        remaining.setFill(owner.getColor());

        VBox vbox = new VBox(10.0, piece, remaining);
        vbox.setAlignment(Pos.CENTER);
        FlowPane flowPane = new FlowPane(score, vbox);
        flowPane.setHgap(20);
        flowPane.setVgap(10);
        flowPane.setAlignment(Pos.CENTER);
        StackPane stack = new StackPane(background, flowPane);

        InnerShadow innerShadow = new InnerShadow();
        innerShadow.setColor(Color.DODGERBLUE);
        innerShadow.setChoke(0.5);
        background.effectProperty().bind(Bindings.when(model.turn.isEqualTo(owner))
          .then(innerShadow)
          .otherwise((InnerShadow) null));
        DropShadow dropShadow = new DropShadow();
        dropShadow.setColor(Color.DODGERBLUE);
        dropShadow.setSpread(0.2);
        piece.setEffect(dropShadow);
        piece.effectProperty().bind(Bindings.when(model.turn.isEqualTo(owner))
          .then(dropShadow)
          .otherwise((DropShadow) null));
        score.textProperty().bind(model.getScore(owner).asString());
        remaining.textProperty().bind(model.getTurnsRemaining(owner).asString().concat(" turns remaining"));
        return stack;
    }
}

And it doesn't throw any exception.

If I comment out the 3D effect parts of the Scala version

package proscalafx.ch04.reversi.ui

import proscalafx.ch04.reversi.model.{Black, Owner, ReversiModel, White}

import scalafx.Includes._
import scalafx.application.JFXApp.PrimaryStage
import scalafx.application.{ConditionalFeature, JFXApp, Platform}
import scalafx.geometry.Pos
import scalafx.scene.control.Button
import scalafx.scene.effect.{DropShadow, InnerShadow}
import scalafx.scene.layout._
import scalafx.scene.paint.Color
import scalafx.scene.shape.Ellipse
import scalafx.scene.text.{Font, FontWeight, Text}
import scalafx.scene.transform.{Rotate, Scale, Translate}
import scalafx.scene.{PerspectiveCamera, Scene}


object Reversi extends JFXApp {

  val restart = new Button() {
    text = "Restart"
    onAction = handle {ReversiModel.restart()}
  }

  val game = new BorderPane() {
    top = createTitle()
    center = new StackPane() {
      children = List(
        createTiles()
      )
    }
    bottom = createScoreBoxes()
  }

  stage = new PrimaryStage() {
    scene = new Scene(600, 400) {
      root = new AnchorPane() {
        children = List(
          game,
          restart
        )
      }
    }
  }

  AnchorPane.setTopAnchor(game, 0d)
  AnchorPane.setBottomAnchor(game, 0d)
  AnchorPane.setLeftAnchor(game, 0d)
  AnchorPane.setRightAnchor(game, 0d)
  AnchorPane.setRightAnchor(restart, 10d)
  AnchorPane.setTopAnchor(restart, 10d)


//  if (Platform.isSupported(ConditionalFeature.Scene3D)) {
//    stage.scene().camera = new PerspectiveCamera() {
//      fieldOfView = 60
//    }.delegate
//  }


  //---------------------------------------------------------------------------


  private def createTitle() = new TilePane {
    snapToPixel = false
    children = List(
      new StackPane {
        style = "-fx-background-color: black"
        children = new Text {
          text = "ScalaFX"
          font = Font.font(null, FontWeight.Bold, 18)
          fill = Color.White
          alignmentInParent = Pos.CenterRight
        }
      },
      new Text {
        text = "Reversi"
        font = Font.font(null, FontWeight.Bold, 18)
        alignmentInParent = Pos.CenterLeft
      })
    prefTileHeight = 40
    prefTileWidth <== parent.selectDouble("width") / 2
  }


  private def createBackground() = new Region {
    style = "-fx-background-color: radial-gradient(radius 100%, white, gray)"
  }


  private def createTiles(): GridPane = {
    val board = new GridPane
    for {
      i <- 0 until ReversiModel.BOARD_SIZE
      j <- 0 until ReversiModel.BOARD_SIZE
    } {
      val square = new ReversiSquare(i, j)
      val piece = new ReversiPiece()
      piece.owner <== ReversiModel.board(i)(j)
      board.add(new StackPane {
        children = List(square, piece)
      }, i, j)
    }

//    if (Platform.isSupported(ConditionalFeature.Scene3D)) {
//      val scale = new Scale(.45, .8, 1, 300, 60, 0)
//      val translate = new Translate(75, -2, -150)
//      val xRot = new Rotate {
//        angle = -40
//        pivotX = 300
//        pivotY = 150
//        pivotZ = 0
//        axis = Rotate.XAxis
//      }
//      val yRot = new Rotate {
//        angle = -5
//        pivotX = 300
//        pivotY = 150
//        pivotZ = 0
//        axis = Rotate.YAxis
//      }
//      val zRot = new Rotate {
//        angle = -6
//        pivotX = 300
//        pivotY = 150
//        pivotZ = 0
//        axis = Rotate.ZAxis
//      }
//      board.transforms ++= List(scale, translate, xRot, yRot, zRot)
//    }

    board
  }


  private def createScoreBoxes() = new TilePane() {
    snapToPixel = false
    prefColumns = 2
    children = List(
      createScore(Black),
      createScore(White)
    )
    prefTileWidth <== parent.selectDouble("width") / 2
  }


  private def createScore(owner: Owner): StackPane = {

    val innerShadow = new InnerShadow() {
      color = Color.DodgerBlue
      choke = 0.5
    }
    val noInnerShadow = null.asInstanceOf[javafx.scene.effect.InnerShadow]

    val backgroundRegion = new Region() {
      style = "-fx-background-color: " + owner.opposite.colorStyle
      effect <== when(ReversiModel.turn === owner) choose innerShadow otherwise noInnerShadow
    }

    val dropShadow = new DropShadow() {
      color = Color.DodgerBlue
      spread = 0.2
    }
    val noDropShadow = null.asInstanceOf[javafx.scene.effect.DropShadow]

    val piece = new Ellipse() {
      radiusX = 32
      radiusY = 20
      fill = owner.color
      effect <== when(ReversiModel.turn === owner) choose dropShadow otherwise noDropShadow
    }

    val score = new Text() {
      font = Font.font(null, FontWeight.Bold, 100)
      fill = owner.color
      text <== ReversiModel.score(owner).asString()
    }

    val remaining = new Text() {
      font = Font.font(null, FontWeight.Bold, 12)
      fill = owner.color
      text <== ReversiModel.turnsRemaining(owner).asString() + " turns remaining"
    }

    new StackPane() {
      children = List(
        backgroundRegion,
        new FlowPane() {
          hgap = 20
          vgap = 10
          alignment = Pos.Center
          children = List(
            score,
            new VBox() {
              alignment = Pos.Center
              spacing = 10
              children = List(
                piece,
                remaining
              )
            }
          )
        }
      )
    }
  }
}

Then these exceptions went away, but I still get a warning:

sept. 20, 2015 11:32:53 AM com.sun.javafx.binding.SelectBinding$SelectBindingHelper getObservableValue
WARNING: Exception while evaluating select-binding [width]
sept. 20, 2015 11:32:53 AM com.sun.javafx.binding.SelectBinding$SelectBindingHelper getObservableValue
WARNING: Exception while evaluating select-binding [width]

@jpsacha
Copy link
Member

jpsacha commented Oct 13, 2018

The issue is with the 3D code (the one you commented out). This is an JavaFX issue. That code was removed from the newer editions of the book.

I am clear where the last two warnings, about 'width', are coming from. Need a deeper look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants