diff options
author | michelou <michelou@epfl.ch> | 2009-04-21 13:56:06 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2009-04-21 13:56:06 +0000 |
commit | 19c09dd68756c538306f7282af89f9f9f579bc32 (patch) | |
tree | fb0572d3b8ccddc07085e90ea9803203de1c4fc6 /src/swing | |
parent | cd2843fa2689d8f4ecef3a25384b2ed62fe7b92e (diff) | |
download | scala-19c09dd68756c538306f7282af89f9f9f579bc32.tar.gz scala-19c09dd68756c538306f7282af89f9f9f579bc32.tar.bz2 scala-19c09dd68756c538306f7282af89f9f9f579bc32.zip |
removed deprecation warnings
Diffstat (limited to 'src/swing')
-rwxr-xr-x | src/swing/scala/swing/test/ButtonApp.scala | 4 | ||||
-rw-r--r-- | src/swing/scala/swing/test/LinePainting.scala | 12 |
2 files changed, 10 insertions, 6 deletions
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] |