Skip to content

Commit

Permalink
Refactor: Moved most ui files to ui module
Browse files Browse the repository at this point in the history
  • Loading branch information
Martomate committed Jun 7, 2024
1 parent 3c8a1e6 commit bbde434
Show file tree
Hide file tree
Showing 24 changed files with 7 additions and 15 deletions.
15 changes: 4 additions & 11 deletions app/src/main/scala/tripaint/view/gui/MainStage.scala
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
package tripaint.view.gui

import tripaint.Color
import tripaint.{Color, TriPaintModel}
import tripaint.ScalaFxExt.{*, given}
import tripaint.TriPaintModel
import tripaint.effects.{BlurEffect, MotionBlurEffect, RandomNoiseEffect}
import tripaint.grid.GridCell
import tripaint.image.{ImagePool, ImageStorage}
import tripaint.image.format.{RecursiveStorageFormat, SimpleStorageFormat}
import tripaint.view.{
EditMode,
FileOpenSettings,
FileSaveSettings,
TriPaintView,
TriPaintViewListener
}
import tripaint.view.*
import tripaint.view.image.ImageGridPane

import scalafx.application.JFXApp3.PrimaryStage
Expand Down Expand Up @@ -175,7 +168,7 @@ class MainStage(controls: TriPaintViewListener, model: TriPaintModel)
val selectedImagesCoords = model.imageGrid.selectedImages.map(_.coords)
val loColorPicker = new ColorPicker(FXColor.Black)
val hiColorPicker = new ColorPicker(FXColor.White)
import DialogUtils._
import DialogUtils.*

val (previewPane, updatePreview) = DialogUtils.makeImagePreviewList(images, model.imagePool)

Expand Down Expand Up @@ -250,7 +243,7 @@ class MainStage(controls: TriPaintViewListener, model: TriPaintModel)
RecursiveStorageFormat -> "Recursive format"
),
0,
model.fileSystem
model.fileSystem.readImage
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ package tripaint.view.gui
import tripaint.Color
import tripaint.coords.{GridCoords, StorageCoords}
import tripaint.grid.{GridCell, ImageGrid}
import tripaint.image.ImageStorage
import tripaint.image.{ImageStorage, RegularImage}
import tripaint.image.format.StorageFormat
import tripaint.infrastructure.FileSystem
import tripaint.view.FileOpenSettings
import tripaint.view.gui.DialogUtils.{getValueFromCustomDialog, makeGridPane}
import tripaint.view.image.TriImageForPreview
Expand All @@ -26,7 +25,7 @@ object AskForFileOpenSettingsDialog {
imagePreview: (File, Int, Int, Int),
formats: Seq[(StorageFormat, String)],
initiallySelectedFormat: Int,
fileSystem: FileSystem
readImage: File => Option[RegularImage]
): Option[FileOpenSettings] = {
val (previewFile, imageSize, xCount, yCount) = imagePreview
val (previewWidth, previewHeight) = (xCount * imageSize, yCount * imageSize)
Expand Down Expand Up @@ -77,7 +76,7 @@ object AskForFileOpenSettingsDialog {
p
}

val underlyingImage = fileSystem.readImage(previewFile).get
val underlyingImage = readImage(previewFile).get

val wholeImage = new ImageView(SwingFXUtils.toFXImage(underlyingImage.toBufferedImage, null))

Expand Down

0 comments on commit bbde434

Please sign in to comment.