Skip to content

Commit e1a067e

Browse files
committed
Merge branch 'master' into stable
2 parents 25dbcdb + 942e972 commit e1a067e

File tree

3 files changed

+81
-15
lines changed

3 files changed

+81
-15
lines changed

build.sbt

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@ import scala.xml.{Node => XmlNode, NodeSeq => XmlNodeSeq, _}
1111
// JAR_BUILT_BY - Name to be added to Jar metadata field "Built-By" (defaults to System.getProperty("user.name")
1212
//
1313

14-
val projectVersion = "0.3.1"
15-
val versionTagDir = if (projectVersion.endsWith("SNAPSHOT")) "master" else "v" + projectVersion
14+
val projectVersion = "0.3.2.1-SNAPSHOT"
15+
val versionTagDir = if (projectVersion.endsWith("SNAPSHOT")) "master" else "v." + projectVersion
1616
val _scalaVersions = Seq("2.13.0", "2.12.9")
17-
val _scalaVersion = _scalaVersions.head
17+
val _scalaVersion = _scalaVersions.head
1818

19-
crossScalaVersions := _scalaVersions
20-
scalaVersion := _scalaVersion
19+
version := projectVersion
20+
crossScalaVersions := _scalaVersions
21+
scalaVersion := _scalaVersion
22+
publishArtifact := false
23+
skip in publish := true
24+
sonatypeProfileName := "org.scalafx"
2125

2226
lazy val OSName = System.getProperty("os.name") match {
2327
case n if n.startsWith("Linux") => "linux"
@@ -28,7 +32,7 @@ lazy val OSName = System.getProperty("os.name") match {
2832

2933
lazy val JavaFXModuleNames = Seq("base", "controls", "fxml", "graphics", "media", "swing", "web")
3034
lazy val JavaFXModuleLibs: Seq[ModuleID] =
31-
JavaFXModuleNames.map(m => "org.openjfx" % s"javafx-$m" % "12.0.2" classifier OSName)
35+
JavaFXModuleNames.map(m => "org.openjfx" % s"javafx-$m" % "12.0.2" % "provided" classifier OSName)
3236

3337
def isScala2_13plus(scalaVersion: String): Boolean = {
3438
CrossVersion.partialVersion(scalaVersion) match {
@@ -46,10 +50,12 @@ lazy val scalaFXExtras = (project in file("scalafx-extras")).settings(
4650
"-sourcepath", baseDirectory.value.toString,
4751
"-doc-root-content", baseDirectory.value + "/src/main/scala/root-doc.creole",
4852
"-doc-source-url", "https://github.com/SscalaFX-Extras/scalafx-extras/blob/" + versionTagDir + "/scalafx/€{FILE_PATH}.scala"
49-
) ++ (Option(System.getenv("GRAPHVIZ_DOT_PATH")) match {
50-
case Some(path) => Seq("-diagrams", "-diagrams-dot-path", path)
51-
case None => Seq.empty[String]
52-
})
53+
),
54+
scalacOptions in(Compile, doc) ++= (
55+
Option(System.getenv("GRAPHVIZ_DOT_PATH")) match {
56+
case Some(path) => Seq("-diagrams", "-diagrams-dot-path", path)
57+
case None => Seq.empty[String]
58+
})
5359
)
5460

5561
// ScalaFX Extras Demos project
@@ -81,7 +87,6 @@ lazy val scalaFXExtrasSettings = Seq(
8187
crossScalaVersions := _scalaVersions,
8288
scalaVersion := _scalaVersion,
8389
scalacOptions ++= Seq("-unchecked", "-deprecation", "-Xcheckinit", "-encoding", "utf8", "-feature"),
84-
scalacOptions in(Compile, doc) ++= (if (_scalaVersion.startsWith("2.11")) Seq("-Xexperimental") else Seq.empty[String]),
8590
scalacOptions in(Compile, doc) ++= Opts.doc.title("ScalaFX Extras API"),
8691
scalacOptions in(Compile, doc) ++= Opts.doc.version(projectVersion),
8792
scalacOptions in(Compile, doc) += s"-doc-external-doc:${scalaInstance.value.libraryJar}#http://www.scala-lang.org/api/${scalaVersion.value}/",

notes/0.3.2.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
### ScalaFX-Extras Release v.0.3.2
2+
3+
Enhancements:
4+
5+
* [Issue #5][5] Do not include JavaFX as transitive dependency
6+
* [Issue #6][6] SimpleTask - add more flexibility in handling tasks states
7+
8+
9+
To post questions please use [ScalaFX Users Group][scalafx-users] of [StackOverflow ScalaFX][scalafx-overflow]
10+
11+
[scalafx-users]: https://groups.google.com/forum/#!forum/scalafx-users
12+
[scalafx-overflow]: https://stackoverflow.com/questions/tagged/scalafx
13+
14+
[5]: https://github.com/scalafx/scalafx-extras/issues/5
15+
[6]: https://github.com/scalafx/scalafx-extras/issues/6
16+

scalafx-extras/src/main/scala/org/scalafx/extras/BusyWorker.scala

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,47 @@ object BusyWorker {
4646
implicit def apply(nodes: Seq[Node]): Seq[jfxs.Node] = nodes.map(_.delegate)
4747

4848
/**
49-
* A simple wrapper for a task that mas a status message property and a progress property.
49+
* A simple wrapper for a task that has a status message property and a progress property.
5050
* Intended for use with [[org.scalafx.extras.BusyWorker#doTask(java.lang.String, org.scalafx.extras.BusyWorker.SimpleTask) BusyWorker#doTask]] method
5151
*
5252
* @tparam R returned value type.
5353
*/
5454
trait SimpleTask[R] {
5555

56+
57+
/**
58+
* Method called whenever the state of the Task has transitioned to the SCHEDULED state.
59+
* This method is invoked on the FX Application Thread after any listeners of the state property and after the
60+
* Task has been fully transitioned to the new state.
61+
*/
62+
def onScheduled(): Unit = {}
63+
64+
/**
65+
* Method called whenever the state of the Task has transitioned to the RUNNING state.
66+
* This method is invoked on the FX Application Thread after any listeners of the state property and after the
67+
* Task has been fully transitioned to the new state.
68+
*/
69+
def onRunning(): Unit = {}
70+
71+
/**
72+
* called whenever the state of the Task has transitioned to the SUCCEEDED state. This method is invoked on the FX Application Thread after any listeners of the state property and after the Task has been fully transitioned to the new state.
73+
*/
74+
def onSucceeded(): Unit = {}
75+
76+
/**
77+
* Method called whenever the state of the Task has transitioned to the CANCELLED state.
78+
* This method is invoked on the FX Application Thread after any listeners of the state property and after the
79+
* Task has been fully transitioned to the new state.
80+
*/
81+
def onCancelled(): Unit = {}
82+
83+
/**
84+
* Method called whenever the state of the Task has transitioned to the FAILED state.
85+
* This method is invoked on the FX Application Thread after any listeners of the state property and after the
86+
* Task has been fully transitioned to the new state.
87+
*/
88+
def onFailed(): Unit = {}
89+
5690
/**
5791
* Message that can be updated while task is executed.
5892
*/
@@ -199,6 +233,7 @@ class BusyWorker private(val title: String,
199233
this(title, _parentWindow = None, _disabledNodes = disabledNodes)
200234

201235
def disabledNodes: Seq[jfxs.Node] = _disabledNodes
236+
202237
def disabledNodes_=(implicit v: Seq[jfxs.Node]): Unit = _disabledNodes = v
203238

204239
override def parentWindow: Option[Window] = _parentWindow match {
@@ -218,6 +253,7 @@ class BusyWorker private(val title: String,
218253
def parentWindow_=(v: Option[Window]): Unit = {
219254
_parentWindow = v
220255
}
256+
221257
def parentWindow_=(v: Window): Unit = {
222258
_parentWindow = Option(v)
223259
}
@@ -345,12 +381,21 @@ class BusyWorker private(val title: String,
345381
*/
346382
def doTask[R](name: String)(task: SimpleTask[R]): Future[R] = {
347383
val jfxTask = new javafx.concurrent.Task[R] {
348-
override def call(): R = {
349-
task.call()
350-
}
384+
override def call(): R = task.call()
385+
386+
override def scheduled(): Unit = task.onScheduled()
387+
388+
override def running(): Unit = task.onRunning()
389+
390+
override def succeeded(): Unit = task.onSucceeded()
391+
392+
override def cancelled(): Unit = task.onCancelled()
393+
394+
override def failed(): Unit = task.onFailed()
351395

352396
task.message.onChange((_, _, newValue) => updateMessage(newValue))
353397
task.progress.onChange((_, _, newValue) => updateProgress(newValue.doubleValue(), 1.0))
398+
354399
}
355400
_doTask(jfxTask, task.onFinish, name)
356401
}

0 commit comments

Comments
 (0)