it.unibo.tuprolog.ui.gui.TuPrologIDEModel.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ide Show documentation
Show all versions of ide Show documentation
Customisable, JavaFX-based GUI for logic solvers
package it.unibo.tuprolog.ui.gui
import it.unibo.tuprolog.core.Struct
import it.unibo.tuprolog.core.exception.TuPrologException
import it.unibo.tuprolog.solve.MutableSolver
import it.unibo.tuprolog.solve.Solution
import it.unibo.tuprolog.solve.SolveOptions
import it.unibo.tuprolog.solve.exception.Warning
import org.reactfx.EventStream
import java.io.File
import java.util.concurrent.ExecutorService
import java.util.concurrent.ForkJoinPool
@Suppress("TooManyFunctions")
interface TuPrologIDEModel {
companion object {
fun of(executor: ExecutorService = ForkJoinPool.commonPool()): TuPrologIDEModel = TuPrologIDEModelImpl(executor)
}
enum class State {
IDLE,
COMPUTING,
SOLUTION,
}
var solveOptions: SolveOptions
val state: State
val executor: ExecutorService
fun customizeSolver(customizer: (MutableSolver) -> MutableSolver)
fun newFile(): File
fun loadFile(file: File)
fun saveFile(file: File)
val currentFile: File?
fun selectFile(file: File)
fun closeFile(file: File)
fun getFile(file: File): String
fun setFile(
file: File,
theory: String,
)
fun renameFile(
file: File,
newFile: File,
)
fun setCurrentFile(theory: String)
fun setStdin(content: String)
// fun getTheory(file: File): Theory
//
// fun setTheory(file: File, theory: Theory)
fun quit()
fun solve()
fun solveAll()
fun next()
fun nextAll()
fun stop()
fun reset()
var query: String
// var goal: Struct
val onReset: EventStream>
val onQuit: EventStream
val onSolveOptionsChanged: EventStream
val onFileSelected: EventStream
val onFileCreated: EventStream
val onFileLoaded: EventStream>
val onFileClosed: EventStream
val onQueryChanged: EventStream
val onNewSolver: EventStream>
val onNewStaticKb: EventStream>
val onNewQuery: EventStream>
val onResolutionStarted: EventStream>
val onNewSolution: EventStream>
val onResolutionOver: EventStream>
val onQueryOver: EventStream>
val onStdoutPrinted: EventStream
val onStderrPrinted: EventStream
val onWarning: EventStream
val onError: EventStream
}