diff options
author | Ingo Maier <ingo.maier@epfl.ch> | 2009-06-02 09:20:22 +0000 |
---|---|---|
committer | Ingo Maier <ingo.maier@epfl.ch> | 2009-06-02 09:20:22 +0000 |
commit | 954377bb52ec230c557bb460c1143d0ce7a6d862 (patch) | |
tree | cb95e69470789a105204febbc9c0be776feef8e3 | |
parent | 045e04db5a2b58822e51cc59cd60562ebb43d33c (diff) | |
download | scala-954377bb52ec230c557bb460c1143d0ce7a6d862.tar.gz scala-954377bb52ec230c557bb460c1143d0ce7a6d862.tar.bz2 scala-954377bb52ec230c557bb460c1143d0ce7a6d862.zip |
Removed deprecation warnings.
-rw-r--r-- | src/swing/scala/swing/Component.scala | 3 | ||||
-rw-r--r-- | src/swing/scala/swing/Publisher.scala | 9 | ||||
-rw-r--r-- | src/swing/scala/swing/Table.scala | 2 | ||||
-rw-r--r-- | src/swing/scala/swing/UIElement.scala | 7 | ||||
-rw-r--r-- | src/swing/scala/swing/test/LabelTest.scala | 7 |
5 files changed, 17 insertions, 11 deletions
diff --git a/src/swing/scala/swing/Component.scala b/src/swing/scala/swing/Component.scala index 4c5c4d2e18..b6d8688127 100644 --- a/src/swing/scala/swing/Component.scala +++ b/src/swing/scala/swing/Component.scala @@ -121,6 +121,9 @@ abstract class Component extends UIElement with Publisher { } }) + /** + * @deprecated Use mouse instead. + */ @deprecated lazy val Mouse = mouse /** diff --git a/src/swing/scala/swing/Publisher.scala b/src/swing/scala/swing/Publisher.scala index 338fa838c7..5524e7ea29 100644 --- a/src/swing/scala/swing/Publisher.scala +++ b/src/swing/scala/swing/Publisher.scala @@ -1,6 +1,7 @@ package scala.swing -import scala.collection.mutable._ +import scala.collection._ +import scala.collection.mutable.{Buffer, HashSet, Set} import event.Event /** @@ -58,7 +59,7 @@ private[swing] trait LazyPublisher extends Publisher { import scala.ref._ -private[swing] trait SingleRefCollection[+A <: AnyRef] extends Collection[A] { self => +private[swing] trait SingleRefCollection[+A <: AnyRef] extends Iterable[A] { self => trait Ref[+A <: AnyRef] extends Reference[A] { override def hashCode() = { @@ -78,7 +79,7 @@ private[swing] trait SingleRefCollection[+A <: AnyRef] extends Collection[A] { s protected[this] def Ref(a: A): Ref[A] protected[this] val referenceQueue = new ReferenceQueue[A] - protected val underlying: Collection[Reference[A]] + protected val underlying: Iterable[Reference[A]] def purgeReferences() { var ref = referenceQueue.poll @@ -129,7 +130,7 @@ abstract class RefBuffer[A <: AnyRef] extends Buffer[A] with SingleRefCollection def remove(n: Int) = { val el = apply(n); remove(el); el } def insertAll(n: Int, iter: Iterable[A]) { purgeReferences() - underlying.insertAll(n, iter.projection.map(Ref(_))) + underlying.insertAll(n, iter.view.map(Ref(_))) } def update(n: Int, el: A) { purgeReferences(); underlying(n) = Ref(el) } def readOnly : Seq[A] = new Seq[A] { diff --git a/src/swing/scala/swing/Table.scala b/src/swing/scala/swing/Table.scala index 2a40a635ab..b6d8ecd115 100644 --- a/src/swing/scala/swing/Table.scala +++ b/src/swing/scala/swing/Table.scala @@ -184,7 +184,7 @@ class Table extends Component with Scrollable with Publisher { } def cells: Set[(Int, Int)] = - new SelectionSet[(Int, Int)]((for(r <- selection.rows; c <- selection.columns) yield (r,c)).toSeq) { outer => + new SelectionSet[(Int, Int)]((for(r <- selection.rows; c <- selection.columns) yield (r,c)).toSequence) { outer => def -=(n: (Int, Int)) = { peer.removeRowSelectionInterval(n._1,n._1) peer.removeColumnSelectionInterval(n._2,n._2) diff --git a/src/swing/scala/swing/UIElement.scala b/src/swing/scala/swing/UIElement.scala index 8148526d9e..385c5f5923 100644 --- a/src/swing/scala/swing/UIElement.scala +++ b/src/swing/scala/swing/UIElement.scala @@ -64,6 +64,10 @@ trait UIElement extends Proxy { def maximumSize_=(x: Dimension) = peer.setMaximumSize(x) def preferredSize = peer.getPreferredSize def preferredSize_=(x: Dimension) = peer.setPreferredSize(x) + + /** + * @deprecated Use implicit conversion from Swing object instead. + */ @deprecated def preferredSize_=(xy: (Int, Int)) { peer.setPreferredSize(new Dimension(xy._1, xy._2)) } def font: Font = peer.getFont @@ -74,6 +78,9 @@ trait UIElement extends Proxy { def bounds = peer.getBounds def size = peer.getSize def size_=(dim: Dimension) = peer.setSize(dim) + /** + * @deprecated Use implicit conversion from Swing object instead. + */ @deprecated def size_=(xy: (Int, Int)) { peer.setSize(new Dimension(xy._1, xy._2)) } def locale = peer.getLocale def toolkit = peer.getToolkit diff --git a/src/swing/scala/swing/test/LabelTest.scala b/src/swing/scala/swing/test/LabelTest.scala index ac2b0c6ee0..f4702aa6d0 100644 --- a/src/swing/scala/swing/test/LabelTest.scala +++ b/src/swing/scala/swing/test/LabelTest.scala @@ -8,12 +8,7 @@ object LabelTest extends SimpleGUIApplication{ contents = new Label { text = "Hello" import java.awt.event._ - /*peer.addMouseListener (new MouseAdapter{ - override def mousePressed(e : MouseEvent ) { - println("Mouse pressed") - } - })*/ - listenTo(Mouse.clicks) + listenTo(mouse.clicks) reactions += { case MousePressed(_,_,_,_,_) => println("Mouse pressed2") |