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

3
import javafx.scene.input.{KeyCode, KeyCodeCombination}
4
import scalafx.beans.property.{ReadOnlyObjectProperty, ReadOnlyObjectWrapper}
5
import scalafx.scene.control.{ToggleButton, Tooltip}
6
import scalafx.scene.image.ImageView
7

8
class EditMode(
9
    imagePath: String,
10
    val tooltipText: String,
UNCOV
11
    val shortCut: KeyCodeCombination = null
×
12
) {
13
  val toolboxButton: ToggleButton = {
14
    val t = new ToggleButton(null, new ImageView("icons/editmodes/" + imagePath + ".png"))
×
15
    t.tooltip = new Tooltip(s"$tooltipText\n(Shortcut: $shortCut)")
×
UNCOV
16
    t.onAction = _ => select()
×
17
    t
18
  }
19

UNCOV
20
  EditMode._modes :+= this
×
21

22
  def select(): Unit = {
×
23
    EditMode.deselectAll()
×
UNCOV
24
    toolboxButton.selected = true
×
25

UNCOV
26
    EditMode.currentMode = this
×
27
  }
28
}
29

30
object EditMode {
UNCOV
31
  private var _modes = Vector.empty[EditMode]
×
32

UNCOV
33
  def modes: Vector[EditMode] = _modes
×
34

UNCOV
35
  private val _currentMode = new ReadOnlyObjectWrapper[EditMode](null, null)
×
36

UNCOV
37
  private def currentMode_=(mode: EditMode): Unit = _currentMode.value = mode
×
38

UNCOV
39
  def currentMode: EditMode = _currentMode.value
×
40

41
  val Select = new EditMode("select", "Select", new KeyCodeCombination(KeyCode.S))
×
42
  val Draw = new EditMode("draw", "Draw", new KeyCodeCombination(KeyCode.P))
×
43
  val Fill = new EditMode("fill", "Fill", new KeyCodeCombination(KeyCode.F))
×
44
  val PickColor = new EditMode("pickColor", "Pick Color", new KeyCodeCombination(KeyCode.K))
×
UNCOV
45
  val Organize = new EditMode("organize", "Organize", new KeyCodeCombination(KeyCode.O))
×
46

UNCOV
47
  Draw.select()
×
48

UNCOV
49
  private def deselectAll(): Unit = EditMode.modes.foreach(_.toolboxButton.selected = false)
×
50
}
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