Fixed remove/clear/update issues in BufferWrapper and layout map.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@19374 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
parent
f4b937c0b8
commit
44b5142d4d
|
@ -18,9 +18,9 @@ import scala.collection.IndexedSeq
|
|||
* Default partial implementation for buffer adapters.
|
||||
*/
|
||||
protected[swing] abstract class BufferWrapper[A] extends Buffer[A] { outer =>
|
||||
def clear() { for (i <- 0 until length) remove(i) }
|
||||
def clear() { for (i <- 0 until length) remove(0) }
|
||||
def update(n: Int, a: A) {
|
||||
remove(0)
|
||||
remove(n)
|
||||
insertAt(n, a)
|
||||
}
|
||||
def insertAll(n: Int, elems: scala.collection.Traversable[A]) {
|
||||
|
|
|
@ -67,8 +67,8 @@ trait LayoutContainer extends Container.Wrapper {
|
|||
def get(c: Component) = Swing.toOption(constraintsFor(c))
|
||||
override def size = peer.getComponentCount
|
||||
def iterator: Iterator[(Component, Constraints)] =
|
||||
Iterator.range(0,size).map { c =>
|
||||
val comp = UIElement.cachedWrapper[Component](peer.getComponent(c).asInstanceOf[JComponent])
|
||||
peer.getComponents.iterator.map { c =>
|
||||
val comp = UIElement.cachedWrapper[Component](c.asInstanceOf[JComponent])
|
||||
(comp, constraintsFor(comp))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue