Skip to content

Commit

Permalink
#150: cleanup in app.logorrr.util - wipes out unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
rladstaetter committed Nov 2, 2023
1 parent 697f059 commit 4d68438
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 141 deletions.
3 changes: 0 additions & 3 deletions app/src/main/scala/app/logorrr/util/CpResource.scala

This file was deleted.

9 changes: 0 additions & 9 deletions app/src/main/scala/app/logorrr/util/Encoding.scala

This file was deleted.

2 changes: 2 additions & 0 deletions app/src/main/scala/app/logorrr/util/ImageCp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import javafx.scene.image.{Image, ImageView}
import java.util.Properties


abstract class CpResource(value: String)

case class PropsCp(classPathResource : String) extends CpResource(classPathResource) {

def asProperties(clazz: Class[_]): Properties = {
Expand Down
9 changes: 0 additions & 9 deletions app/src/main/scala/app/logorrr/util/JfxEventHandler.scala

This file was deleted.

1 change: 0 additions & 1 deletion app/src/main/scala/app/logorrr/util/JfxUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import javafx.stage.{Stage, WindowEvent}

object JfxUtils extends CanLog {


def execOnUiThread(f: => Unit): Unit = {
if (!Platform.isFxApplicationThread) {
Platform.runLater(() => f)
Expand Down
11 changes: 0 additions & 11 deletions app/src/main/scala/app/logorrr/util/LogFileUtil.scala

This file was deleted.

25 changes: 0 additions & 25 deletions app/src/main/scala/app/logorrr/util/LogUtil.scala

This file was deleted.

12 changes: 0 additions & 12 deletions app/src/main/scala/app/logorrr/util/LogoRRRFileChooser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,4 @@ import javafx.stage.{FileChooser, Window}

import java.nio.file.Path

class LogoRRRFileChooser(title: String) {

def showAndWait(window: Window): Option[Path] = {
val fc = new FileChooser
fc.setTitle(title)
LogoRRRGlobals.getSomeLastUsedDirectory.foreach(d => fc.setInitialDirectory(d.toFile))
val somePath = Option(fc.showOpenDialog(window)).map(_.toPath)
LogoRRRGlobals.setSomeLastUsedDirectory(somePath.map(_.getParent))
LogoRRRGlobals.persist()
somePath
}

}
15 changes: 0 additions & 15 deletions app/src/main/scala/app/logorrr/util/StringUtil.scala

This file was deleted.

43 changes: 0 additions & 43 deletions app/src/main/scala/app/logorrr/util/Throttler.scala

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import javafx.beans.property.{SimpleDoubleProperty, SimpleIntegerProperty}
import javafx.beans.{InvalidationListener, Observable}
import javafx.collections.{FXCollections, ObservableList}
import javafx.scene.control.ListView
import javafx.scene.layout.BorderPane

import scala.util.{Failure, Success, Try}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,8 @@ class LogFileTab(val pathAsString: String

val repaintChunkListViewListener = JfxUtils.onNew[Number](n => {
if (n.doubleValue() > 0.1) {
logTrace("divider")
repaint()
}
/*
throttler.process(n).onComplete {
case Success(_) => LogoRRRGlobals.setDividerPosition(pathAsString, n.doubleValue())
case Failure(_: CancellationException) => logTrace(s"Computation for $n was cancelled.")
case Failure(e) => logException(s"Error processing $n: $e", e)
}
*/
})

def init(): Unit = {
Expand Down
18 changes: 16 additions & 2 deletions app/src/main/scala/app/logorrr/views/menubar/FileMenu.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
package app.logorrr.views.menubar

import app.logorrr.util.{CanLog, LogoRRRFileChooser, OsUtil}
import app.logorrr.conf.LogoRRRGlobals
import app.logorrr.util.{CanLog, OsUtil}
import javafx.scene.control.{Menu, MenuItem}
import javafx.stage.Window
import javafx.stage.{FileChooser, Window}

import java.nio.file.Path

class LogoRRRFileChooser(title: String) {

def showAndWait(window: Window): Option[Path] = {
val fc = new FileChooser
fc.setTitle(title)
LogoRRRGlobals.getSomeLastUsedDirectory.foreach(d => fc.setInitialDirectory(d.toFile))
val somePath = Option(fc.showOpenDialog(window)).map(_.toPath)
LogoRRRGlobals.setSomeLastUsedDirectory(somePath.map(_.getParent))
LogoRRRGlobals.persist()
somePath
}

}
object FileMenu {

class OpenMenuItem(getWindow: () => Window
Expand Down
5 changes: 4 additions & 1 deletion core/src/main/scala/app/logorrr/io/Fs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ package app.logorrr.io
import app.logorrr.util.CanLog

import java.nio.charset.Charset
import java.nio.file.{Files, Path}
import java.nio.file.{Files, Path, Paths}

/**
* File related operations
*/
object Fs extends CanLog {

/** compute file name from a LogFilePath */
def logFileName(pathAsString: String): String = Paths.get(pathAsString).getFileName.toString

def createDirectories(path: Path): Unit = {
if (Files.exists(path)) {
logTrace(s"Using directory ${path.toAbsolutePath.toString}")
Expand Down

0 comments on commit 4d68438

Please sign in to comment.