现在的位置: 首页 > 综合 > 正文

JavaFX Scene Builder 1.0 Developer Preview介绍

2012年08月04日 ⁄ 综合 ⁄ 共 4588字 ⁄ 字号 评论关闭

1.The JavaFX Scene Builder 1.0 Developer Preview is a design tool for the JavaFX platform It can assist you with quickly prototyping an application with interactive user interface that is linked to the application logic. You simply drag and drop graphical user interface (GUI) components onto a JavaFX scene and the FXML source code for your layout is automatically generated. JavaFX Scene Builder is available for the Windows and Mac OS X platforms.

简言之,就是可视化的开发JavaFx界面,该软件可以将配置好的界面自动转换成FXML文件

下载地址:http://www.oracle.com/technetwork/java/javafx/tools/index.html

 

2.介绍它的基本使用方法

JavaFX Scene Builder 1.0 Developer Preview Release Notes:http://docs.oracle.com/javafx/scenebuilder/1/release_notes_1-0/jsbpub-release_notes_1-0.htm

JavaFX Scene Builder User Guide:http://docs.oracle.com/javafx/scenebuilder/1/user_guide/jsbpub-user_guide.htm

Getting Started with JavaFX Scene Builder:http://docs.oracle.com/javafx/scenebuilder/1/get_started/jsbpub-get_started.htm

 

3.目前这个版本的JavaFX Scene Builder还存在很多已知的问题,例如:

(1)The main limitation is that JavaFX Scene Builder is unable to load FXML files that reference custom user classes.

主要的缺陷是不能加载引用了用户自定义的类的FXML文件

(2)The TableView UI control is supported in JavaFX Scene Builder Developer Preview release, but with the following limitations:

  • You can not add a Table Column component to a Table View control using JavaFX Scene Builder. The Library panel currently does not list the Table Column object.

  • It is currently not possible to reorganize or re-parent the table columns using JavaFX Scene Builder.

TableView控件可以使用,但是功能有限,不可以在JavaFX Scene Builder中添加一个列,目前还不支持重新组织表格的列

(3)There is no Internationalization support available with the JavaFX Scene Builder Developer Release. It is only localized in English, regardless of the locale of the user's operating system.

暂时不支持国际化!这个的确是,我试过了,会出现一定的中文乱码问题,解决办法就是使用ResourceBundle!在FXML文件中使用纯英文名称,然后定义该FXML文件对应的

properties文件,在文件中映射相应的键值对就行了,但是这样还是有点麻烦。

(4)A UI component becomes unselectable when the Disabled and Mouse Transparency flags are set.

Description: When you check the Disabled or Mouse Transparency flag of a UI component, that component becomes unselectable in the Content panel.

如果你为一个UI组件选择了Disabled或者Mouse Transparency标志时,这个组件在内容面板中就无法选中了。

(5)CSS related errors are not displayed when loading a FXML file.

Description: When you load an FXML file that contains invalid CSS files, any CSS related error messages are not displayed in the Message bar.

Workaround: In order to see the error message, you need to force a CSS update on the layout. For example, you can edit the CSS file and save it. If some errors are detected, then an error message will be displayed in the Message bar when JavaFX Scene Builder does a refresh of the CSS rules.

当加载一个FXML文件时,CSS相关的错误是不会显示的。解决办法是编辑一下CSS文件然后保存。

(6)Popup Control elements that are part of that UI component do not inherit from a parent container's style sheet nor from any inline styled declarations made to the parent container.

Description: If you assign a CSS file to the style sheets property of a parent container (e.g: root Anchor Pane), the rules in that CSS file are not applied to the Popup Control elements that are associated with the container's children elements. Inline styled declarations inherited from the parent container are also not applied to the Popup Control elements of the children objects. Popup Control objects are Context Menu and Tooltip.

Workaround: Directly work with the Style property of the Context Menu and Tooltip to set the CSS styling rules.

弹出式控件元素是一类不会继承其父组件样式的UI组件,它们也不会受到行内样式声明的影响,弹出式控件元素包括Context Menu和Tooltip

解决办法就是手动的直接去给弹出式控件设置style属性

(7)Exception messages thrown by the CSS parser contain invalid lines and column numbers.

Description: If some CSS related error messages are displayed in the Message bar (e.g. invalid syntax, invalid content), you will notice that the numbers appear meaningless. These numbers are supposed to refer to the line and column numbers to help locate the source of the errors. Do not use these line and column numbers because they are not valid.

当CSS解析器抛出错误时,显示在界面中的信息中的行和列是没有用的,它们是错误的。

(8)The -fx-font property is not inherited from the parent container.

Description: If you set the -fx-font property on a container element, such as an Anchor Pane, its contained children elements do not inherit from that styling property. If the font rule impacts the font size, note that the boundaries of the children elements are affected (children becomes bigger or smaller).

Workaround: Set the -fx-font directly on the target child element instead.

注意:-fx-font 属性不会从父容器中继承下来!

(9)Rendering of some parts of JavaFX Scene Builder UI may not be properly refreshed.

Description: On rare occasions, JavaFX Scene Builder may become unresponsive. For example, the focus on a particular panel is not being displayed even though the focus has been gained, or the selection of an element in the Content panel is not updated when the selection has changed.

Workaround: Resize the Inspector panel.

在某些情况下,JavaFX Scene Builder可能变得不能够响应(这个的确是,有时候做得好好的,突然右侧的面板没有反应了,一般是删除或修改了css style或者突然删除了某个组件的时候),解决办法就是重置panel的大小,貌似不行,我一般是关掉重启!

 

总之,JavaFX Scene Builder现在还是存在着不少的问题,我发现的一个很大的问题就是它的css style上,有时候给某个组件定义一个style没有问题,但是添加一个style class就会报错,程序中报错!即使是用scene加载了css文件还是如此!诡异啊。。。纠结啊。。。继续坚持吧!。。。

抱歉!评论已关闭.