Skip to content

Commit 2466a21

Browse files
committed
Merge branch 'master' into release
2 parents fc346e1 + 2ee56d1 commit 2466a21

File tree

14 files changed

+472
-228
lines changed

14 files changed

+472
-228
lines changed

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = 3.7.3
1+
version = 3.8.0
22

33
runner.dialect = scala3
44
fileOverride {

ReadMe.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -154,17 +154,14 @@ A complete example in Scala 3. Shows a pane with 2 directory selection fields an
154154
button is pressed values
155155
of the directory fields are printed
156156

157-
[//]: # (@formatter:off)
158-
```scala
157+
```scala 3
158+
import org.scalafx.extras.generic_pane.GenericPane
159159
import scalafx.application.JFXApp3
160160
import scalafx.application.JFXApp3.PrimaryStage
161161
import scalafx.geometry.Insets
162162
import scalafx.scene.Scene
163163
import scalafx.scene.control.Button
164164
import scalafx.scene.layout.VBox
165-
import scalafx.scene.paint.*
166-
import scalafx.scene.paint.Color.*
167-
import scalafx.scene.text.Text
168165

169166
object GenericPaneDemo extends JFXApp3:
170167

@@ -189,7 +186,6 @@ object GenericPaneDemo extends JFXApp3:
189186
println(s"Output dir: ${gp.nextString()}")
190187
)
191188
```
192-
[//]: # (@formatter:off)
193189

194190
![GenericPane Demo](notes/assets/GenericPane.png)
195191

@@ -292,12 +288,9 @@ new BusyWorker("Simple Task", parentWindow).doTask { () =>
292288
Here is a little more elaborated example. It updates a progress message and progress indicator.
293289

294290
```scala
295-
val buttonPane: Pane =
296-
...
297-
val progressLabel: Label =
298-
...
299-
val progressBar: ProgressBar =
300-
...
291+
val buttonPane: Pane = ???
292+
val progressLabel: Label = ???
293+
val progressBar: ProgressBar = ???
301294

302295
val busyWorker = new BusyWorker("BusyWorker Demo", buttonPane) {
303296
progressLabel.text <== progressMessage

build.sbt

Lines changed: 49 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,35 @@
1-
import java.net.URL
1+
import xerial.sbt.Sonatype._
2+
23
import scala.xml.transform.{RewriteRule, RuleTransformer}
34
import scala.xml.{Node => XmlNode, NodeSeq => XmlNodeSeq, _}
45

5-
// @formatter:off
6-
76
//
87
// Environment variables used by the build:
98
// GRAPHVIZ_DOT_PATH - Full path to Graphviz dot utility. If not defined Scaladocs will be build without diagrams.
109
// JAR_BUILT_BY - Name to be added to Jar metadata field "Built-By" (defaults to System.getProperty("user.name")
1110
//
1211

13-
val projectVersion = "0.8.0"
12+
val projectVersion = "0.8.0.1-SNAPSHOT"
1413
val versionTagDir = if (projectVersion.endsWith("SNAPSHOT")) "master" else "v." + projectVersion
15-
val _scalaVersions = Seq("3.2.2", "2.13.10", "2.12.17")
14+
val _scalaVersions = Seq("3.3.3", "2.13.13", "2.12.19")
1615
val _scalaVersion = _scalaVersions.head
1716

18-
ThisBuild / version := projectVersion
19-
ThisBuild / crossScalaVersions := _scalaVersions
20-
ThisBuild / scalaVersion := _scalaVersion
21-
ThisBuild / organization := "org.scalafx"
17+
ThisBuild / version := projectVersion
18+
ThisBuild / crossScalaVersions := _scalaVersions
19+
ThisBuild / scalaVersion := _scalaVersion
20+
ThisBuild / organization := "org.scalafx"
2221

23-
publishArtifact := false
24-
publish / skip := true
22+
publishArtifact := false
23+
publish / skip := true
24+
25+
lazy val libEnumeratum = "com.beachape" %% "enumeratum" % "1.7.3"
26+
lazy val libLogbackClassic = "ch.qos.logback" % "logback-classic" % "1.5.3"
27+
lazy val libParadise = "org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full
28+
lazy val libScalaLogging = "com.typesafe.scala-logging" %% "scala-logging" % "3.9.5"
29+
lazy val libScalaFX = "org.scalafx" %% "scalafx" % "22.0.0-R33"
30+
lazy val libScalaFXML = "org.scalafx" %% "scalafxml-core-sfx8" % "0.5"
31+
lazy val libScalaTest = "org.scalatest" %% "scalatest" % "3.2.18"
32+
lazy val libScalaReflect = "org.scala-lang" % "scala-reflect"
2533

2634
def isScala2(scalaVersion: String): Boolean = {
2735
CrossVersion.partialVersion(scalaVersion) match {
@@ -63,7 +71,7 @@ lazy val scalaFXExtras = (project in file("scalafx-extras")).settings(
6371
baseDirectory.value.toString,
6472
"-doc-root-content",
6573
baseDirectory.value + "/src/main/scala/root-doc.creole"
66-
),
74+
)
6775
)
6876

6977
// ScalaFX Extras Demos project
@@ -77,8 +85,8 @@ lazy val scalaFXExtrasDemos = (project in file("scalafx-extras-demos")).settings
7785
),
7886
publishArtifact := false,
7987
libraryDependencies ++= Seq(
80-
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.5",
81-
"ch.qos.logback" % "logback-classic" % "1.4.7" % Runtime
88+
libScalaLogging,
89+
libLogbackClassic % Runtime
8290
)
8391
).dependsOn(scalaFXExtras % "compile;test->test")
8492

@@ -99,14 +107,15 @@ lazy val scalaFXExtrasSettings = Seq(
99107
"-encoding",
100108
"utf8",
101109
"-feature",
102-
"-release", "8"
110+
"-release",
111+
"8"
103112
) ++
104113
(
105114
if (isScala2(scalaVersion.value))
106115
Seq(
107116
"-explaintypes",
108117
"-Xcheckinit",
109-
"-Xsource:3",
118+
"-Xsource:3"
110119
// "-Xlint",
111120
// "-Xcheckinit",
112121
// "-Xlint:missing-interpolator",
@@ -123,10 +132,11 @@ lazy val scalaFXExtrasSettings = Seq(
123132
Compile / doc / scalacOptions ++= Opts.doc.version(projectVersion),
124133
Compile / doc / scalacOptions ++= Seq("-doc-footer", s"ScalaFX Extras API v.$projectVersion"),
125134
Compile / doc / scalacOptions ++= (
126-
if(isScala2(scalaVersion.value))
135+
if (isScala2(scalaVersion.value))
127136
Seq(
128137
s"-doc-external-doc:${scalaInstance.value.libraryJars.head}#https://www.scala-lang.org/api/${scalaVersion.value}/",
129-
"-doc-source-url", "https://github.com/SscalaFX-Extras/scalafx-extras/blob/" + versionTagDir + "/scalafx/€{FILE_PATH}.scala"
138+
"-doc-source-url",
139+
"https://github.com/SscalaFX-Extras/scalafx-extras/blob/" + versionTagDir + "/scalafx/€{FILE_PATH}.scala"
130140
) ++ (
131141
Option(System.getenv("GRAPHVIZ_DOT_PATH")) match {
132142
case Some(path) => Seq("-diagrams", "-diagrams-dot-path", path)
@@ -141,40 +151,39 @@ lazy val scalaFXExtrasSettings = Seq(
141151
// If using Scala 2.12 or lower, enable macro processing through compiler plugin
142152
libraryDependencies ++= (
143153
if (isScala2_12(scalaVersion.value))
144-
Seq(compilerPlugin(
145-
"org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full
146-
))
154+
Seq(compilerPlugin(libParadise))
147155
else
148156
Seq.empty[sbt.ModuleID]
149157
),
150158
libraryDependencies ++= Seq(
151-
"org.scalafx" %% "scalafx" % "20.0.0-R31",
152-
"org.scalatest" %% "scalatest" % "3.2.15" % "test"
159+
libScalaFX,
160+
libScalaTest % "test"
153161
),
154162
libraryDependencies ++= (
155163
if (isScala2(scalaVersion.value))
156164
Seq(
157-
"com.beachape" %% "enumeratum" % "1.7.2",
158-
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
159-
"org.scalafx" %% "scalafxml-core-sfx8" % "0.5"
165+
libEnumeratum,
166+
libScalaReflect % scalaVersion.value,
167+
libScalaFXML
160168
)
161169
else
162170
Seq.empty[sbt.ModuleID]
163171
),
164172
// Use `pomPostProcess` to remove dependencies marked as "provided" from publishing in POM
165173
// This is to avoid dependency on wrong OS version JavaFX libraries
166174
// See also [https://stackoverflow.com/questions/27835740/sbt-exclude-certain-dependency-only-during-publish]
167-
pomPostProcess := { node: XmlNode =>
168-
new RuleTransformer(new RewriteRule {
169-
override def transform(node: XmlNode): XmlNodeSeq = node match {
170-
case e: Elem if e.label == "dependency" && e.child.exists(c => c.label == "scope" && c.text == "provided") =>
171-
val organization = e.child.filter(_.label == "groupId").flatMap(_.text).mkString
172-
val artifact = e.child.filter(_.label == "artifactId").flatMap(_.text).mkString
173-
val version = e.child.filter(_.label == "version").flatMap(_.text).mkString
174-
Comment(s"provided dependency $organization#$artifact;$version has been omitted")
175-
case _ => node
176-
}
177-
}).transform(node).head
175+
pomPostProcess := {
176+
node: XmlNode =>
177+
new RuleTransformer(new RewriteRule {
178+
override def transform(node: XmlNode): XmlNodeSeq = node match {
179+
case e: Elem if e.label == "dependency" && e.child.exists(c => c.label == "scope" && c.text == "provided") =>
180+
val organization = e.child.filter(_.label == "groupId").flatMap(_.text).mkString
181+
val artifact = e.child.filter(_.label == "artifactId").flatMap(_.text).mkString
182+
val version = e.child.filter(_.label == "version").flatMap(_.text).mkString
183+
Comment(s"provided dependency $organization#$artifact;$version has been omitted")
184+
case _ => node
185+
}
186+
}).transform(node).head
178187
},
179188
autoAPIMappings := true,
180189
manifestSetting,
@@ -204,14 +213,12 @@ lazy val manifestSetting = packageOptions += {
204213
)
205214
}
206215

207-
import xerial.sbt.Sonatype.*
208-
209216
// Metadata needed by Maven Central
210217
// See also http://maven.apache.org/pom.html#Developers
211218
lazy val mavenCentralSettings = Seq(
212-
homepage := Some(new URL("https://www.scalafx.org/")),
213-
startYear := Some(2016),
214-
licenses := Seq(("BSD", new URL("https://github.com/scalafx/scalafx-extras/blob/master/LICENSE.txt"))),
219+
homepage := Some(new URI("https://www.scalafx.org/").toURL),
220+
startYear := Some(2016),
221+
licenses := Seq(("BSD", new URI("https://github.com/scalafx/scalafx-extras/blob/master/LICENSE.txt").toURL)),
215222
sonatypeProfileName := "org.scalafx",
216223
sonatypeProjectHosting := Some(GitHubHosting("org.scalafx", "scalafx-extras", "[email protected]")),
217224
publishMavenStyle := true,

notes/0.9.0.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## ScalaFX-Extras Release v.0.9.0
2+
3+
This release of [ScalaFX-Extras] is mostly a bug fix release. Some small tweak to `BusyWorker` was required to resolve
4+
the issue with double error dialogs.
5+
6+
### New features
7+
8+
* Add helper method for finding parent windows for nodes [[#29]]
9+
10+
### Bug fixes
11+
12+
* FileSelectionField - editing text field is difficult - cursor jumps to the end after each keystroke [[#27]]
13+
* Error handling implemented in `SimpleTask` is disabled in `BusyWorker#_doTask` [[#28]]
14+
15+
### Breaking Changes
16+
17+
* `org.scalafx.extras.BusyWorker.SimpleTask` API changed to respect overrides
18+
of `onSucceeded`, `onCancelled`, `onFailed` that were ignored. Issue [[#28]].
19+
20+
To post questions, please use [Project Discussions][Discussions] or [ScalaFX Users Group][scalafx-users]
21+
22+
[ScalaFX-Extras]: https://github.com/scalafx/scalafx-extras
23+
24+
[Discussions]: https://github.com/scalafx/scalafx-extras/discussions
25+
26+
[scalafx-users]: https://groups.google.com/forum/#!forum/scalafx-users
27+
28+
29+
[#27]: https://github.com/scalafx/scalafx-extras/issues/27
30+
31+
[#28]: https://github.com/scalafx/scalafx-extras/issues/28
32+
33+
[#29]: https://github.com/scalafx/scalafx-extras/issues/29
34+

project/build.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011-2023, ScalaFX Project
2+
# Copyright (c) 2011-2024, ScalaFX Project
33
# All rights reserved.
44
#
55
# Redistribution and use in source and binary forms, with or without
@@ -24,5 +24,5 @@
2424
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2525
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2626
#
27-
sbt.version=1.8.2
27+
sbt.version=1.9.9
2828

project/sbt-sonatype.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// [https://github.com/xerial/sbt-sonatype]
2-
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.18")
2+
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.10.0")
33
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")

scalafx-extras-demos/src/main/scala/org/scalafx/extras/BusyWorkerDemo.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011-2021, ScalaFX Project
2+
* Copyright (c) 2011-2024, ScalaFX Project
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -139,7 +139,7 @@ object BusyWorkerDemo extends JFXApp3 {
139139
).map(_.delegate)
140140
}
141141

142-
lazy val busyWorker: BusyWorker = new BusyWorker("BusyWorker Demo", buttonPane) {
142+
lazy val busyWorker: BusyWorker = new BusyWorker(title = "BusyWorker Demo", disabledNode = buttonPane) {
143143
progressLabel.text <== progressMessage
144144
progressBar.progress <== progressValue
145145
}

0 commit comments

Comments
 (0)