• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Martomate / TriPaint / 9275511596

28 May 2024 07:51PM UTC coverage: 29.682% (+1.8%) from 27.877%
9275511596

push

github

Martomate
Updated to Scala 3.4 and MUnit 1.0

2 of 11 new or added lines in 9 files covered. (18.18%)

430 existing lines in 38 files now uncovered.

401 of 1351 relevant lines covered (29.68%)

0.3 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/scala/tripaint/view/gui/ImageTabs.scala
1
package tripaint.view.gui
2

3
import tripaint.model.ImageGrid
4
import tripaint.model.image.{GridCell, ImagePool}
5
import tripaint.view.image.TriImageForPreview
6

7
import scalafx.scene.layout.{StackPane, TilePane}
8

9
import scala.collection.mutable
10

11
class ImageTabs(imagePool: ImagePool, requestImageRemoval: GridCell => Unit) extends TilePane {
×
UNCOV
12
  maxWidth = TriImageForPreview.previewSize
×
13

UNCOV
14
  private val imageTabMap: mutable.Map[GridCell, StackPane] = mutable.Map.empty
×
15

UNCOV
16
  def onImageGridEvent(event: ImageGrid.Event): Unit = {
×
17
    event match {
18
      case ImageGrid.Event.ImageAdded(image) =>
19
        val tab = ImageTabPane(image, requestImageRemoval, imagePool)
×
20
        children.add(tab.delegate)
×
21
        imageTabMap(image) = tab
×
22
      case ImageGrid.Event.ImageRemoved(image) =>
×
23
        imageTabMap.remove(image) match {
×
24
          case Some(pane) => children.remove(pane.delegate)
×
UNCOV
25
          case None       =>
×
26
        }
UNCOV
27
      case _ =>
×
28
    }
29
  }
30
}
31

32
object ImageTabs {
UNCOV
33
  def fromImagePool(
×
34
      imageGrid: ImageGrid,
35
      imagePool: ImagePool,
36
      requestImageRemoval: GridCell => Unit
37
  ): TilePane = {
38
    val tilePane = new ImageTabs(imagePool, requestImageRemoval)
×
NEW
39
    imageGrid.trackChanges(tilePane.onImageGridEvent(_))
×
40
    tilePane
41
  }
42
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc