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

垃圾回收的算法与实现

垃圾回收的算法与实现

中村成洋、相川光 / 丁灵 / 人民邮电出版社 / 2016-7-1 / 99.00元

★ Ruby之父Matz作推荐语:上古传承的魔法,彻底揭开垃圾回收的秘密! ★ 日本天才程序员兼Lisp黑客竹内郁雄审校 本书前半介绍基本GC算法,包括标记-清除GC、引用计数、复制算法的GC、串行GC的算法、并发GC的算法等。后半介绍V8、Rubinius、Dalvik、CPython等几种具体GC的实现。本书适合各领域程序员阅读。一起来看看 《垃圾回收的算法与实现》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具