• 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/AskForXYDialog.scala
1
package tripaint.view.gui
2

3
import tripaint.view.gui.DialogUtils.{getValueFromCustomDialog, makeGridPane}
4

5
import scalafx.scene.control.{ButtonType, Label}
6

7
import scala.util.Try
8

9
object AskForXYDialog {
10
  def askForXY(title: String, headerText: String): Option[(Int, Int)] = {
×
11
    val xCoordTF = RestrictedTextField.intTF
×
12
    xCoordTF.promptText = "0"
×
13
    val yCoordTF = RestrictedTextField.intTF
×
UNCOV
14
    yCoordTF.promptText = "0"
×
15

16
    val coordsFromTF = () => {
17
      val xt = xCoordTF.text()
×
UNCOV
18
      val yt = yCoordTF.text()
×
19

20
      for {
×
21
        xOffset <- Try(if xt != "" then xt.toInt else 0)
×
UNCOV
22
        yOffset <- Try(if yt != "" then yt.toInt else 0)
×
23
      } yield (xOffset, yOffset)
24
    }
25

UNCOV
26
    getValueFromCustomDialog[(Int, Int)](
×
27
      title = title,
28
      headerText = headerText,
29
      content = Seq(
×
30
        makeGridPane(
×
31
          Seq(
×
32
            Seq(new Label("X coordinate:"), xCoordTF),
×
UNCOV
33
            Seq(new Label("Y coordinate:"), yCoordTF)
×
34
          )
35
        )
36
      ),
37
      resultConverter = {
38
        case ButtonType.OK => coordsFromTF().getOrElse(null)
×
UNCOV
39
        case _             => null
×
40
      },
UNCOV
41
      buttons = Seq(ButtonType.OK, ButtonType.Cancel)
×
42
    )
43
  }
44
}
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