You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.1 KiB

  1. package nova.monadic_sfx.implicits
  2. import com.jfoenix.{controls => jfoenixc}
  3. import javafx.{scene => jfxs}
  4. import scalafx.Includes._
  5. import scalafx.beans.property.ObjectProperty
  6. import scalafx.scene.Node
  7. import scalafx.scene.control.Button
  8. import jfxs.{paint => jfxsp}
  9. object JFXButton {
  10. implicit def sfxButton2jfx(v: JFXButton): jfoenixc.JFXButton =
  11. if (v != null) v.delegate else null
  12. }
  13. class JFXButton(
  14. override val delegate: jfoenixc.JFXButton = new jfoenixc.JFXButton
  15. ) extends Button(delegate) {
  16. /**
  17. * Creates a button with the specified text as its label.
  18. */
  19. def this(text: String) = this(new jfoenixc.JFXButton(text))
  20. /**
  21. * Creates a button with the specified text and icon for its label.
  22. */
  23. def this(text: String, graphic: Node) =
  24. this(new jfoenixc.JFXButton(text, graphic))
  25. def ripplerFill: ObjectProperty[jfxsp.Paint] =
  26. jfxObjectProperty2sfx(delegate.ripplerFillProperty)
  27. def ripplerFill_=(b: jfxsp.Paint): Unit = {
  28. ripplerFill() = b
  29. }
  30. def obsAction =
  31. new ActionObservableBuilder(this.observableAction())
  32. }