Skip to content

Commit cc8dae2

Browse files
authored
Merge pull request #75 from Sciss/2.0.x
addresses table sorting issues
2 parents 5eae857 + 721895f commit cc8dae2

File tree

6 files changed

+239
-61
lines changed

6 files changed

+239
-61
lines changed

build.sbt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ scalaModuleSettings
44

55
name := "scala-swing"
66

7-
version := "2.0.3-SNAPSHOT"
7+
version := "2.0.4-SNAPSHOT"
88

99
scalacOptions ++= Seq("-deprecation", "-feature")
1010

1111
// Map[JvmMajorVersion, List[(ScalaVersion, UseForPublishing)]]
1212
scalaVersionsByJvm in ThisBuild := Map(
13-
8 -> List("2.11.12", "2.12.4", "2.13.0-M3").map(_ -> true)
13+
8 -> List("2.11.12", "2.12.6", "2.13.0-M3").map(_ -> true)
1414
)
1515

1616
OsgiKeys.exportPackage := Seq(s"scala.swing.*;version=${version.value}")
@@ -28,15 +28,15 @@ lazy val swing = project.in(file("."))
2828
}
2929
)
3030

31-
lazy val examples = project.in( file("examples") )
31+
lazy val examples = project.in(file("examples"))
3232
.dependsOn(swing)
3333
.settings(
3434
scalaVersion := (scalaVersion in swing).value,
3535
fork in run := true,
3636
fork := true
3737
)
3838

39-
lazy val uitest = project.in( file("uitest") )
39+
lazy val uitest = project.in(file("uitest"))
4040
.dependsOn(swing)
4141
.settings(
4242
scalaVersion := (scalaVersion in swing).value,

src/main/scala/scala/swing/Font.scala

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/* __ *\
2+
** ________ ___ / / ___ Scala API **
3+
** / __/ __// _ | / / / _ | (c) 2007-2013, LAMP/EPFL **
4+
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
5+
** /____/\___/_/ |_/____/_/ | | **
6+
** |/ **
7+
\* */
8+
9+
package scala.swing
10+
11+
import java.awt.{Font => JFont}
12+
13+
object Font {
14+
def apply(name: String, style: Style.Value, size: Int): Font =
15+
new JFont(name, style.id, size)
16+
17+
/** A String constant for the canonical family name of the
18+
* logical font "Dialog". It is useful in Font construction
19+
* to provide compile-time verification of the name.
20+
*/
21+
val Dialog: String = JFont.DIALOG
22+
23+
/** A String constant for the canonical family name of the
24+
* logical font "DialogInput". It is useful in Font construction
25+
* to provide compile-time verification of the name.
26+
*/
27+
val DialogInput: String = JFont.DIALOG_INPUT
28+
29+
/** A String constant for the canonical family name of the
30+
* logical font "SansSerif". It is useful in Font construction
31+
* to provide compile-time verification of the name.
32+
*/
33+
val SansSerif: String = JFont.SANS_SERIF
34+
35+
/** A String constant for the canonical family name of the
36+
* logical font "Serif". It is useful in Font construction
37+
* to provide compile-time verification of the name.
38+
*/
39+
val Serif: String = JFont.SERIF
40+
41+
/** A String constant for the canonical family name of the
42+
* logical font "Monospaced". It is useful in Font construction
43+
* to provide compile-time verification of the name.
44+
*/
45+
val Monospaced: String = JFont.MONOSPACED
46+
47+
// Constants to be used for styles. Can be combined to mix styles.
48+
49+
object Style extends Enumeration {
50+
val Plain : Style.Value = Value(JFont.PLAIN)
51+
val Bold : Style.Value = Value(JFont.BOLD)
52+
val Italic : Style.Value = Value(JFont.ITALIC)
53+
val BoldItalic: Style.Value = Value(JFont.BOLD | JFont.ITALIC)
54+
}
55+
56+
// for convenience, have these values also directly in the `Font` name space
57+
val Plain : Style.Value = Style.Plain
58+
val Bold : Style.Value = Style.Bold
59+
val Italic : Style.Value = Style.Italic
60+
val BoldItalic: Style.Value = Style.BoldItalic
61+
}

0 commit comments

Comments
 (0)