diff options
-rw-r--r-- | src/library/scala/collection/immutable/Stack.scala | 5 | ||||
-rwxr-xr-x | src/swing/scala/swing/test/ButtonApp.scala | 4 | ||||
-rw-r--r-- | src/swing/scala/swing/test/LinePainting.scala | 12 |
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] |