Skip to content

Commit

Permalink
#112: adds scrolling for BlockViewPane
Browse files Browse the repository at this point in the history
  • Loading branch information
rladstaetter committed Oct 30, 2022
1 parent 36ec719 commit 6760887
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ class BlockViewPane[Elem <: BlockView.E]

setContent(vbox)

def scrollToEnd(): Unit = {
def scrollToEnd(): Unit = setVvalue(getVmax)

}

}
9 changes: 5 additions & 4 deletions app/src/test/scala/app/logorrr/LogProducer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ case class SimpleWriter(path: Path) extends Runnable {

override def run(): Unit = {
var linenumber = 1
Files.write(path, util.Arrays.asList("started, waiting 30 secs ..."), StandardOpenOption.CREATE, StandardOpenOption.APPEND)
Thread.sleep(30000)
while (running) {
Thread.sleep(100)
Thread.sleep(50)
val now = LocalDateTime.now();
val str = s"${dtf.format(now)} $linenumber testlog "
linenumber += 1
Expand All @@ -29,14 +31,13 @@ object LogProducer {

def main(args: Array[String]): Unit = {
if (args.nonEmpty) {

val path = Paths.get(args(0))
Files.deleteIfExists(path)
val writer = SimpleWriter(path)
new Thread(writer).start()

val keyboard = new Scanner(System.in)
new Thread(writer).start()
System.out.println(s"producing log entries in ${path.toAbsolutePath.toString}, press enter to stop")
val keyboard = new Scanner(System.in)
keyboard.nextLine()
writer.stop()
} else {
Expand Down

0 comments on commit 6760887

Please sign in to comment.