All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.sciss.mellite.gui.SelectionModel.scala Maven / Gradle / Ivy

/*
 *  SelectionModel.scala
 *  (Mellite)
 *
 *  Copyright (c) 2012-2016 Hanns Holger Rutz. All rights reserved.
 *
 *  This software is published under the GNU General Public License v3+
 *
 *
 *  For further information, please contact Hanns Holger Rutz at
 *  [email protected]
 */

package de.sciss.mellite
package gui

import de.sciss.lucre.stm.Sys
import de.sciss.mellite.gui.impl.component.{SelectionModelImpl => Impl}
import de.sciss.model.Model

object SelectionModel {
  def apply[S <: Sys[S], Repr]: SelectionModel[S, Repr] = new Impl[S, Repr]

  type Listener[S <: Sys[S], Repr] = Model.Listener[Update[S, Repr]]
  final case class Update[S <: Sys[S], Repr](added: Set[Repr], removed: Set[Repr])
}
trait SelectionModel[S <: Sys[S], Repr]
  extends Model[SelectionModel.Update[S, Repr]] {

  def contains(view: Repr): Boolean
  def +=(view: Repr): Unit
  def -=(view: Repr): Unit
  def clear(): Unit
  def iterator: Iterator[Repr]
  def isEmpty: Boolean
  def nonEmpty: Boolean
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy