Skip to content

Commit c52d48b

Browse files
authored
Merge pull request #83 from xuwei-k/procedure-syntax
fix procedure syntax
2 parents 81173bf + 00127b1 commit c52d48b

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

examples/src/main/scala/scala/swing/examples/CelsiusConverter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ object CelsiusConverter extends SimpleSwingApplication {
3131
border = Swing.EmptyBorder(5, 5, 5, 5)
3232
listenTo(convertButton, tempCelsius)
3333

34-
def convert() {
34+
def convert(): Unit = {
3535
val c = Integer.parseInt(tempCelsius.text)
3636
val f = c * 9 / 5 + 32
3737
text = "<html><font color = red>" + f + "</font> Fahrenheit</html>"

examples/src/main/scala/scala/swing/examples/ComboBoxes.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ object ComboBoxes extends SimpleSwingApplication {
5656

5757
listenTo(dateBox.selection)
5858

59-
def reformat() {
59+
def reformat(): Unit = {
6060
try {
6161
val today = new Date
6262
val formatter = new SimpleDateFormat(dateBox.selection.item)
@@ -86,7 +86,7 @@ object ComboBoxes extends SimpleSwingApplication {
8686

8787
val iconBox = new ComboBox(icons) {
8888
renderer = new ListView.AbstractRenderer[Icon, Label](new Label) {
89-
def configure(list: ListView[_], isSelected: Boolean, focused: Boolean, icon: Icon, index: Int) {
89+
def configure(list: ListView[_], isSelected: Boolean, focused: Boolean, icon: Icon, index: Int): Unit = {
9090
component.icon = icon
9191
component.xAlignment = Alignment.Center
9292
if (isSelected) {

examples/src/main/scala/scala/swing/examples/LinePainting.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ object LinePainting extends SimpleSwingApplication {
4141
/* records the dragging */
4242
var path = new geom.GeneralPath
4343

44-
def lineTo(p: Point) {
44+
def lineTo(p: Point): Unit = {
4545
path.lineTo(p.x, p.y); repaint()
4646
}
4747

48-
def moveTo(p: Point) {
48+
def moveTo(p: Point): Unit = {
4949
path.moveTo(p.x, p.y); repaint()
5050
}
5151

examples/src/main/scala/scala/swing/examples/TableSelection.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ object TableSelection extends SimpleSwingApplication {
5454
}
5555
contents += new ScrollPane(output)
5656

57-
def outputSelection() {
57+
def outputSelection(): Unit = {
5858
output.append("Lead: " + table.selection.rows.leadIndex + "," +
5959
table.selection.columns.leadIndex + ". ")
6060
output.append("Rows:")

examples/src/main/scala/scala/swing/examples/tutorials/components/IntegerEditor.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class IntegerEditor(min: Int, max: Int) extends DefaultCellEditor(new JFormatted
8080

8181
ftf.getActionMap.put("check", new AbstractAction() {
8282

83-
def actionPerformed(e: ActionEvent) {
83+
def actionPerformed(e: ActionEvent): Unit = {
8484
if (!ftf.isEditValid) {
8585
if (userSaysRevert()) {
8686
ftf.postActionEvent()

examples/src/main/scala/scala/swing/examples/tutorials/layout/DiagonalLayout.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ class DiagonalLayout(private var vgap: Int) extends LayoutManager {
5555
}
5656

5757
/* Required by LayoutManager. */
58-
def addLayoutComponent(name: String, comp: Component) {
58+
def addLayoutComponent(name: String, comp: Component): Unit = {
5959
}
6060

61-
def removeLayoutComponent(comp: Component) {
61+
def removeLayoutComponent(comp: Component): Unit = {
6262
}
6363

64-
private def setSizes(parent: Container) {
64+
private def setSizes(parent: Container): Unit = {
6565
val nComps = parent.getComponentCount
6666
var d: Dimension = null
6767
//Reset preferred/minimum width and height.
@@ -117,7 +117,7 @@ class DiagonalLayout(private var vgap: Int) extends LayoutManager {
117117
* minimumLayoutSize will be called -- in the case
118118
* of applets, at least, they probably won't be.
119119
*/
120-
def layoutContainer(parent: Container) {
120+
def layoutContainer(parent: Container): Unit = {
121121
val insets = parent.getInsets
122122
val maxWidth = parent.getWidth - (insets.left + insets.right)
123123
val maxHeight = parent.getHeight - (insets.top + insets.bottom)

0 commit comments

Comments
 (0)