de.sciss.lucre.swing.graph.impl.PathFieldValueExpandedImpl.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lucreswing_2.13.0-M5 Show documentation
Show all versions of lucreswing_2.13.0-M5 Show documentation
Swing support for Lucre, and common views
The newest version!
/*
* PathFieldValueExpandedImpl.scala
* (LucreSwing)
*
* Copyright (c) 2014-2019 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Lesser General Public License v2.1+
*
*
* For further information, please contact Hanns Holger Rutz at
* [email protected]
*/
package de.sciss.lucre.swing.graph.impl
import de.sciss.desktop.{PathField => Peer}
import de.sciss.file.File
import de.sciss.lucre.event.ITargets
import de.sciss.lucre.stm
import de.sciss.lucre.stm.Sys
import scala.swing.event.ValueChanged
final class PathFieldValueExpandedImpl[S <: Sys[S]](peer: => Peer, value0: File)
(implicit targets: ITargets[S], cursor: stm.Cursor[S])
extends ComponentPropertyExpandedImpl[S, File](value0) {
protected def valueOnEDT: File = peer.value
protected def startListening(): Unit = {
val c = peer
c.listenTo(c)
c.reactions += {
case ValueChanged(_) => commit()
}
}
protected def stopListening(): Unit = {
val c = peer
c.deafTo(c)
}
}