Permalink
Browse files

Merge pull request #4 from jsacha/master

Pull Solictation - 13/01
  • Loading branch information...
2 parents fb7b048 + 349a663 commit a177212d252de1df606589e4334d7c54569a293c @rafonso rafonso committed Jan 15, 2013
Showing with 232 additions and 267 deletions.
  1. +2 −1 .gitignore
  2. +48 −0 build.sbt
  3. BIN lib/scalafx-1.0-SNAPSHOT.jar
  4. BIN lib/scalafx_2.10-1.0-SNAPSHOT.jar
  5. BIN lib/scalafx_2.9.2-1.0-SNAPSHOT.jar
  6. +2 −4 src/proscalafx/ch01/audioconfig/AudioConfigMain.scala
  7. +2 −3 src/proscalafx/ch01/audioconfig/AudioConfigModel.scala
  8. +2 −6 src/proscalafx/ch01/helloearthrise/HelloEarthRiseMain.scala
  9. +9 −17 src/proscalafx/ch01/helloearthrise/HelloScrollPaneMain.scala
  10. +1 −1 src/proscalafx/ch02/metronomepathtransition/MetronomePathTransitionMain.scala
  11. +11 −17 src/proscalafx/ch02/onthescene/OnTheSceneMain.scala
  12. +6 −15 src/proscalafx/ch02/stagecoach/StageCoachMain.scala
  13. +7 −17 src/proscalafx/ch02/zenpong/ZenPongMain.scala
  14. +2 −4 src/proscalafx/ch04/reversi/examples/AlignUsingStackAndTile.scala
  15. +2 −4 src/proscalafx/ch04/reversi/examples/BorderLayoutExample.scala
  16. +2 −4 src/proscalafx/ch04/reversi/examples/CenterUsingBind.scala
  17. +1 −3 src/proscalafx/ch04/reversi/examples/CenterUsingStack.scala
  18. +2 −3 src/proscalafx/ch04/reversi/examples/PlayerScoreExample.scala
  19. +1 −3 src/proscalafx/ch04/reversi/reversipieces/ReversiPieceTest.scala
  20. +5 −7 src/proscalafx/ch04/reversi/ui/Reversi.scala
  21. +1 −2 src/proscalafx/ch04/reversi/ui/ReversiSquare.scala
  22. +6 −8 src/proscalafx/ch05/ui/StarterAppMain.scala
  23. +1 −1 src/proscalafx/ch06/JavaFXSceneInSwingExample.scala
  24. +3 −4 src/proscalafx/ch06/ResponsiveUIExample.scala
  25. +5 −6 src/proscalafx/ch06/ServiceExample.scala
  26. +2 −3 src/proscalafx/ch06/UnresponsiveUIExample.scala
  27. +5 −6 src/proscalafx/ch06/WorkerAndTaskExample.scala
  28. +10 −12 src/proscalafx/ch08/AudioPlayer2/AudioPlayer2.scala
  29. +2 −3 src/proscalafx/ch08/AudioPlayer3/AudioPlayer3.scala
  30. +5 −7 src/proscalafx/ch08/AudioPlayer3/MetadataView.scala
  31. +10 −12 src/proscalafx/ch08/AudioPlayer3/PlayerControlsView.scala
  32. +2 −3 src/proscalafx/ch08/AudioPlayer4/AudioPlayer4.scala
  33. +10 −12 src/proscalafx/ch08/AudioPlayer4/EqualizerView.scala
  34. +5 −7 src/proscalafx/ch08/AudioPlayer4/MetadataView.scala
  35. +13 −14 src/proscalafx/ch08/AudioPlayer4/PlayerControlsView.scala
  36. +2 −2 src/proscalafx/ch08/AudioPlayer4/SpectrumBar.scala
  37. +8 −10 src/proscalafx/ch08/CodeMonkeyToDo/CodeMonkeyToDo.scala
  38. +1 −2 src/proscalafx/ch08/VideoPlayer2/VideoPlayer2.scala
  39. +2 −4 src/proscalafx/ch08/VideoPlayer3/VideoPlayer3.scala
  40. +10 −12 src/proscalafx/ch08/VideoPlayer4/EqualizerView.scala
  41. +18 −20 src/proscalafx/ch08/VideoPlayer4/PlayerControlsView.scala
  42. +2 −2 src/proscalafx/ch08/VideoPlayer4/SpectrumBar.scala
  43. +2 −3 src/proscalafx/ch08/VideoPlayer4/VideoPlayer4.scala
  44. +2 −3 test/src/misc/ChangeFillExample.scala
View
@@ -49,7 +49,8 @@ local.properties
*.vspscc
.builds
*.dotCover
-## TODO: If you have NuGet Package Restore enabled, uncomment this
+
+## If you have NuGet Package Restore enabled, uncomment this
#packages/
# Visual C++ cache files
ipch/
View
@@ -0,0 +1,48 @@
+// Project name
+name := "ScalaFXPro"
+
+// Current version
+version := "1.0.0-SNAPSHOT"
+
+// Version of scala to use
+scalaVersion := "2.9.2"
+
+// Set the main Scala source directory to be <base>/src
+scalaSource in Compile <<= baseDirectory(_ / "src")
+
+resourceDirectory <<= baseDirectory(_ / "src")
+
+// Set the Scala test directory to be <base>/test/src
+scalaSource in Test <<= baseDirectory(_ / "test/src")
+
+// append -deprecation to the options passed to the Scala compiler
+scalacOptions += "-deprecation"
+
+// ScalaFX is assumed to be in local repo (build locally)
+resolvers += "Local Maven Repository" at "file:///"+Path.userHome.absolutePath+"/.m2/repository"
+
+libraryDependencies += "org.scalafx" % "scalafx" % "1.0-SNAPSHOT"
+
+// Test dependencies
+libraryDependencies += "junit" % "junit" % "4.+" % "test"
+
+libraryDependencies += "org.scalatest" %% "scalatest" % "1.7.+" % "test"
+
+// Add JavaFX 2 to the unmanaged classpath
+// For Java 7 update 06+ the JFXRT JAR is part of the Java Runtime Environment
+unmanagedJars in Compile += Attributed.blank(file(System.getenv("JAVA_HOME") + "/jre/lib/jfxrt.jar"))
+
+
+// Fork a new JVM for 'run' and 'test:run'
+fork := false
+
+// Fork a new JVM for 'test:run', but not 'run'
+fork in Test := false
+
+// Only use a single thread for building
+parallelExecution := false
+
+// Execute tests in the current project serially
+parallelExecution in Test := false
+
+
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,9 +1,8 @@
package proscalafx.ch01.audioconfig
-import javafx.geometry.VPos
-import javafx.scene.text.FontWeight
import scalafx.Includes._
import scalafx.application.JFXApp
+import scalafx.geometry.VPos
import scalafx.scene.Scene
import scalafx.scene.control.CheckBox
import scalafx.scene.control.ChoiceBox
@@ -13,8 +12,7 @@ import scalafx.scene.paint.LinearGradient
import scalafx.scene.paint.Stop
import scalafx.scene.shape.Line
import scalafx.scene.shape.Rectangle
-import scalafx.scene.text.Font
-import scalafx.scene.text.Text
+import scalafx.scene.text.{FontWeight, Font, Text}
import scalafx.stage.Stage
object AudioConfigMain extends JFXApp {
@@ -1,7 +1,6 @@
package proscalafx.ch01.audioconfig
-import scalafx.beans.property.BooleanProperty
-import scalafx.beans.property.IntegerProperty
+import scalafx.beans.property.{BooleanProperty, IntegerProperty}
import scalafx.collections.ObservableBuffer
import scalafx.scene.control.SingleSelectionModel
@@ -26,7 +25,7 @@ class AudioConfigModel {
/**
* Indicates whether audio is muted
*/
- val muting: BooleanProperty = false
+ val muting = BooleanProperty(false)
/**
* List of some musical genres
@@ -3,22 +3,18 @@
*/
package proscalafx.ch01.helloearthrise
-import javafx.geometry.VPos
-import javafx.scene.text.FontWeight
-import javafx.scene.text.TextAlignment
import scalafx.animation.Interpolator
import scalafx.animation.Timeline
import scalafx.animation.TranslateTransition
import scalafx.application.JFXApp
+import scalafx.geometry.VPos
import scalafx.scene.Group
import scalafx.scene.Scene
import scalafx.scene.image.Image
-import scalafx.scene.image.Image.sfxImage2jfx
import scalafx.scene.image.ImageView
import scalafx.scene.paint.Color
import scalafx.scene.shape.Rectangle
-import scalafx.scene.text.Font
-import scalafx.scene.text.Text
+import scalafx.scene.text.{FontWeight, TextAlignment, Font, Text}
import scalafx.stage.Stage
import scalafx.util.Duration
import scalafx.util.UtilIncludes.jfxDuration2sfx
@@ -1,25 +1,17 @@
package proscalafx.ch01.helloearthrise
-import javafx.geometry.VPos
-import javafx.scene.control.ScrollPane.ScrollBarPolicy
-import javafx.scene.text.FontWeight
-import javafx.scene.text.TextAlignment
-import scalafx.animation.Interpolator
-import scalafx.animation.Timeline
-import scalafx.animation.TranslateTransition
+import scalafx.Includes._
+import scalafx.animation.{Interpolator, Timeline, TranslateTransition}
import scalafx.application.JFXApp
-import scalafx.scene.Group
-import scalafx.scene.Scene
+import scalafx.geometry.VPos
import scalafx.scene.control.ScrollPane
-import scalafx.scene.image.Image
-import scalafx.scene.image.Image.sfxImage2jfx
-import scalafx.scene.image.ImageView
+import scalafx.scene.control.ScrollPane.ScrollBarPolicy
+import scalafx.scene.image.{Image, ImageView}
import scalafx.scene.paint.Color
-import scalafx.scene.text.Font
-import scalafx.scene.text.Text
+import scalafx.scene.text.{FontWeight, TextAlignment, Font, Text}
+import scalafx.scene.{Group, Scene}
import scalafx.stage.Stage
import scalafx.util.Duration
-import scalafx.util.UtilIncludes.jfxDuration2sfx
object HelloScrollPaneMain extends JFXApp {
@@ -64,7 +56,8 @@ you on the good Earth." """.replace("\n", "")
pannable = true
content = textRef
style = "-fx-background-color: transparent;"
- })
+ }
+ )
}
}
}
@@ -76,5 +69,4 @@ you on the good Earth." """.replace("\n", "")
toY = -820
interpolator = Interpolator.LINEAR
}.play
-
}
@@ -4,7 +4,6 @@
package proscalafx.ch02.metronomepathtransition
import javafx.animation.Animation.Status
-import javafx.animation.PathTransition.OrientationType
import scalafx.Includes._
import scalafx.animation.Interpolator
import scalafx.animation.PathTransition
@@ -20,6 +19,7 @@ import scalafx.scene.shape.MoveTo
import scalafx.scene.shape.Path
import scalafx.stage.Stage
import scalafx.util.Duration
+import scalafx.animation.PathTransition.OrientationType
/**
*
@@ -3,23 +3,19 @@
*/
package proscalafx.ch02.onthescene
-import javafx.{scene => jfxs}
import javafx.scene.{text => jfxst}
-import javafx.{geometry => jfxg}
+import javafx.{scene => jfxs}
import scalafx.Includes._
import scalafx.application.JFXApp
-import scalafx.beans.property.DoubleProperty
-import scalafx.beans.property.StringProperty
+import scalafx.beans.property.{DoubleProperty, StringProperty}
import scalafx.collections.ObservableBuffer
import scalafx.event.ActionEvent
-import scalafx.geometry.Insets
+import scalafx.geometry.{VPos, Orientation, HPos, Insets}
import scalafx.scene.Scene
import scalafx.scene.control._
-import scalafx.scene.layout.FlowPane
-import scalafx.scene.layout.HBox
+import scalafx.scene.layout.{FlowPane, HBox}
import scalafx.scene.paint.Color
-import scalafx.scene.text.Font
-import scalafx.scene.text.Text
+import scalafx.scene.text.{FontWeight, Font, Text}
import scalafx.stage.Stage
@@ -53,7 +49,7 @@ object OnTheSceneMain extends JFXApp {
min = 0
max = 255
value = 255
- orientation = jfxg.Orientation.VERTICAL
+ orientation = Orientation.VERTICAL
}
val choiceRef = new ChoiceBox[jfxs.Cursor] {
@@ -96,10 +92,10 @@ object OnTheSceneMain extends JFXApp {
layoutX = 20
layoutY = 40
padding = Insets(0, 20, 40, 0)
- orientation = jfxg.Orientation.VERTICAL
+ orientation = Orientation.VERTICAL
vgap = 10
hgap = 20
- columnHalignment = jfxg.HPos.LEFT
+ columnHalignment = HPos.LEFT
content = List(
new HBox {
spacing = 10
@@ -172,15 +168,13 @@ object OnTheSceneMain extends JFXApp {
val addedTextRef = new Text {
layoutX = 0
layoutY = -30
- textOrigin = jfxg.VPos.TOP
+ textOrigin = VPos.TOP
fill = Color.BLUE
- font = Font.font("Sans Serif", jfxst.FontWeight.BOLD, 16)
+ font = Font.font("Sans Serif", FontWeight.BOLD, 16)
managed = false
text <== new StringProperty("Scene fill: ") + sceneRef.fill
}
// Add to the Text node to the FlowPane.
- // TODO: Use ScalaFX notation.
- sceneRef.content.add(addedTextRef)
-
+ sceneRef.content += addedTextRef
}
@@ -3,28 +3,19 @@
*/
package proscalafx.ch02.stagecoach
-import javafx.geometry.VPos
-import javafx.stage.StageStyle
import scalafx.Includes._
import scalafx.application.JFXApp
import scalafx.beans.property.ReadOnlyDoubleProperty.sfxReadOnlyDoubleProperty2jfx
import scalafx.beans.property.StringProperty
-import scalafx.geometry.Rectangle2D
-import scalafx.scene.Group
-import scalafx.scene.Scene
-import scalafx.scene.control.Button
-import scalafx.scene.control.CheckBox
-import scalafx.scene.control.Label
-import scalafx.scene.control.TextField
+import scalafx.geometry.{VPos, Rectangle2D}
+import scalafx.scene.control.{Button, CheckBox, Label, TextField}
import scalafx.scene.input.MouseEvent
-import scalafx.scene.layout.HBox
-import scalafx.scene.layout.VBox
+import scalafx.scene.layout.{HBox, VBox}
import scalafx.scene.paint.Color
-import scalafx.scene.paint.Color.sfxColor2jfx
import scalafx.scene.shape.Rectangle
import scalafx.scene.text.Text
-import scalafx.stage.Screen
-import scalafx.stage.Stage
+import scalafx.scene.{Group, Scene}
+import scalafx.stage.{StageStyle, Screen, Stage}
/**
@@ -33,7 +24,7 @@ import scalafx.stage.Stage
*/
object StageCoachMain extends JFXApp {
- val titleProperty: StringProperty = ""
+ val titleProperty = StringProperty("")
val stageStyle = parameters.unnamed match {
case Seq("transparent") => StageStyle.TRANSPARENT
@@ -1,26 +1,16 @@
package proscalafx.ch02.zenpong
import javafx.animation.Animation.Status
-import javafx.scene.input.KeyCode
import scalafx.Includes._
-import scalafx.animation.KeyFrame
-import scalafx.animation.Timeline
+import scalafx.animation.{KeyFrame, Timeline}
import scalafx.application.JFXApp
-import scalafx.beans.property.BooleanProperty
-import scalafx.beans.property.DoubleProperty
+import scalafx.beans.property.{BooleanProperty, DoubleProperty}
import scalafx.event.ActionEvent
-import scalafx.scene.Cursor
-import scalafx.scene.Group
-import scalafx.scene.Scene
import scalafx.scene.control.Button
-import scalafx.scene.input.KeyEvent
-import scalafx.scene.input.MouseEvent
-import scalafx.scene.paint.Color
-import scalafx.scene.paint.CycleMethod
-import scalafx.scene.paint.LinearGradient
-import scalafx.scene.paint.Stop
-import scalafx.scene.shape.Circle
-import scalafx.scene.shape.Rectangle
+import scalafx.scene.input.{KeyCode, KeyEvent, MouseEvent}
+import scalafx.scene.paint.{Color, CycleMethod, LinearGradient, Stop}
+import scalafx.scene.shape.{Circle, Rectangle}
+import scalafx.scene.{Cursor, Group, Scene}
import scalafx.stage.Stage
object ZenPongMain extends JFXApp {
@@ -140,7 +130,7 @@ object ZenPongMain extends JFXApp {
/**
* Controls whether the startButton is visible
*/
- val startVisible: BooleanProperty = true
+ val startVisible = BooleanProperty(true)
/**
* The animation of the ball
@@ -1,15 +1,13 @@
package proscalafx.ch04.reversi.examples
-import javafx.geometry.Pos
-import javafx.scene.text.FontWeight
import scalafx.Includes._
import scalafx.application.JFXApp
+import scalafx.geometry.Pos
import scalafx.scene.Scene
import scalafx.scene.layout.StackPane
import scalafx.scene.layout.TilePane
import scalafx.scene.paint.Color
-import scalafx.scene.text.Font
-import scalafx.scene.text.Text
+import scalafx.scene.text.{FontWeight, Font, Text}
import scalafx.stage.Stage
object AlignUsingStackAndTile extends JFXApp {
@@ -1,13 +1,12 @@
package proscalafx.ch04.reversi.examples
-import javafx.geometry.Pos
-import javafx.scene.text.FontWeight
import proscalafx.ch04.reversi.model.BLACK
import proscalafx.ch04.reversi.model.Owner
import proscalafx.ch04.reversi.model.ReversiModel
import proscalafx.ch04.reversi.model.WHITE
import scalafx.Includes._
import scalafx.application.JFXApp
+import scalafx.geometry.Pos
import scalafx.scene.Node
import scalafx.scene.Scene
import scalafx.scene.effect.DropShadow
@@ -20,8 +19,7 @@ import scalafx.scene.layout.TilePane
import scalafx.scene.layout.VBox
import scalafx.scene.paint.Color
import scalafx.scene.shape.Ellipse
-import scalafx.scene.text.Font
-import scalafx.scene.text.Text
+import scalafx.scene.text.{FontWeight, Font, Text}
import scalafx.stage.Stage
Oops, something went wrong.

0 comments on commit a177212

Please sign in to comment.