JavaFX 的 Scala 绑定 ScalaFX

码农软件 · 软件分类 · GUI开发框架 · 2019-08-08 16:12:30

软件介绍

ScalaFX是JavaFX 2.0的Scala绑定(UI DSL),主要特性如下:

1)对程序员友好的层次结构式的对象创建语法。

stage = new Stage {
  title.value = "Hello Stage"
  width = 600
  height = 450
  scene = new Scene {
    fill = Color.LIGHTGREEN
    content = new Rectangle {
      x = 25
      y = 40
      width = 100
      height = 100
      fill <== when (hover) then Color.GREEN otherwise Color.RED
    }
  }
}

2)易于理解的属性绑定(Binding)语法。

height <== rect1.height + rect2.height
width <== max(rect1.width, rect2.width, rect3.width)
color <== when (hover) then Color.GREEN otherwise Color.RED
text <== when (rect.hover || circle.hover && !disabled) then textField.text + " is enabled" otherwise "disabled"
rect.hover onInvalidate {
  needsRepaint = true
}
3)精心设计的动画语法。
Seq(
  at(0 s) {circle.centerX -> random * 800},
  at(0 s) {circle.centerY -> random * 600},
  at(40 s) {circle.centerX -> random * 800},
  at(40 s) {circle.centerY -> random * 600}
)
4)类型安全的API。

5)无缝的JavaFX/ScalaFX互操作。

本文地址:https://codercto.com/soft/d/11925.html

AI·未来

AI·未来

李开复 / 浙江人民出版社 / 2018-9-1 / 62

迎来“深度学习”这项重大技术突破后,人工智能已经从发明的年代步入了实干的年代。 现在已是未来,我们所处的时代,已经与过去完全不同。面对已经来临的、机遇与挑战并存的人工智能时代,我们必须了解人工智能,跟上人工智能发展的脚步,这样才能不被时代淘汰。 全球目前人工智能发展的情况是怎样的? 全球的人工智能巨头企业有哪几家,现在它们有什么贡献?未来它们又将如何改变世界? 人工智能已经......一起来看看 《AI·未来》 这本书的介绍吧!

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

html转js在线工具
html转js在线工具

html转js在线工具