summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2009-04-21 13:56:06 +0000
committermichelou <michelou@epfl.ch>2009-04-21 13:56:06 +0000
commit19c09dd68756c538306f7282af89f9f9f579bc32 (patch)
treefb0572d3b8ccddc07085e90ea9803203de1c4fc6 /src
parentcd2843fa2689d8f4ecef3a25384b2ed62fe7b92e (diff)
downloadscala-19c09dd68756c538306f7282af89f9f9f579bc32.tar.gz
scala-19c09dd68756c538306f7282af89f9f9f579bc32.tar.bz2
scala-19c09dd68756c538306f7282af89f9f9f579bc32.zip
removed deprecation warnings
Diffstat (limited to 'src')
-rw-r--r--src/library/scala/collection/immutable/Stack.scala5
-rwxr-xr-xsrc/swing/scala/swing/test/ButtonApp.scala4
-rw-r--r--src/swing/scala/swing/test/LinePainting.scala12
3 files changed, 13 insertions, 8 deletions
diff --git a/src/library/scala/collection/immutable/Stack.scala b/src/library/scala/collection/immutable/Stack.scala
index b8398614ea..4b507daafe 100644
--- a/src/library/scala/collection/immutable/Stack.scala
+++ b/src/library/scala/collection/immutable/Stack.scala
@@ -64,7 +64,8 @@ class Stack[+A] extends Seq[A] {
* @param elems the element sequence.
* @return the stack with the new elements on top.
*/
- def push[B >: A](elem1: B, elem2: B, elems: B*): Stack[B] = this.push(elem1).push(elem2) ++ elems
+ def push[B >: A](elem1: B, elem2: B, elems: B*): Stack[B] =
+ this.push(elem1).push(elem2) ++ elems
/** Push all elements provided by the given iterable object onto
* the stack. The last element returned by the iterable object
@@ -97,7 +98,7 @@ class Stack[+A] extends Seq[A] {
* @deprecated
*/
def ++[B >: A](elems: Iterator[B]): Stack[B] =
- elems.foldLeft(this: Stack[B]){ (stack, elem) => stack + elem }
+ elems.foldLeft(this: Stack[B]){ (stack, elem) => stack push elem }
/** Push all elements provided by the given iterable object onto
* the stack. The last element returned by the iterable object
diff --git a/src/swing/scala/swing/test/ButtonApp.scala b/src/swing/scala/swing/test/ButtonApp.scala
index 9d8fcb04e3..855b094d77 100755
--- a/src/swing/scala/swing/test/ButtonApp.scala
+++ b/src/swing/scala/swing/test/ButtonApp.scala
@@ -1,5 +1,7 @@
package scala.swing.test
+import java.awt.Dimension
+
import swing._
import swing.event._
@@ -16,6 +18,6 @@ object ButtonApp extends SimpleGUIApplication {
}
}
}
- size = (300, 80)
+ size = new Dimension(300, 80)
}
}
diff --git a/src/swing/scala/swing/test/LinePainting.scala b/src/swing/scala/swing/test/LinePainting.scala
index f21b8f6522..aba0540746 100644
--- a/src/swing/scala/swing/test/LinePainting.scala
+++ b/src/swing/scala/swing/test/LinePainting.scala
@@ -1,8 +1,10 @@
package scala.swing.test
+
+import java.awt.{Color, Dimension, Graphics, Graphics2D, Point, geom}
+
import scala.swing.Swing._
import scala.swing.{MainFrame, Panel, SimpleGUIApplication}
import scala.swing.event.{MousePressed, MouseDragged, MouseReleased}
-import java.awt.{Color, Dimension, Graphics, Graphics2D, Point, geom}
/**
* Dragging the mouse draws a simple graph
@@ -14,7 +16,7 @@ object LinePainting extends SimpleGUIApplication {
title = "SimpleDraw"
contents = new Panel {
background = Color.white
- preferredSize = (200,200)
+ preferredSize = new Dimension(200, 200)
listenTo(Mouse.clicks, Mouse.moves)
@@ -27,10 +29,10 @@ object LinePainting extends SimpleGUIApplication {
/* records the dragging */
val path = new geom.GeneralPath
- def lineTo(p:Point) { path.lineTo(p.x, p.y); repaint() }
- def moveTo(p:Point) { path.moveTo(p.x, p.y); repaint() }
+ def lineTo(p: Point) { path.lineTo(p.x, p.y); repaint() }
+ def moveTo(p: Point) { path.moveTo(p.x, p.y); repaint() }
- override def paintComponent(g:Graphics) = {
+ override def paintComponent(g: Graphics) = {
super.paintComponent(g)
/* we need Graphics2D */
val g2 = g.asInstanceOf[Graphics2D]