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.

43 lines
1.1 KiB

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