📅  最后修改于: 2020-10-14 01:02:04             🧑  作者: Mango
下图显示了JavaFX平台的完整体系结构。有各种相互连接的内置组件。但是,JavaFX包含一组丰富的API,足以开发可在许多平台上一致运行的丰富Internet应用程序。
JavaFX体系结构的顶层包含一个JavaFX公共API,该API提供了负责执行功能齐全的JavaFX应用程序的所有必需类。此API的所有软件包的列表如下。
Package Name | Description |
---|---|
javafx.animation | Provides the set of classes that are responsible for transitions based animations |
javafx.application | Provides application life-cycle methods |
javafx.collections | Provides classes that can handle collections and related utilities |
javafx.concurrent | Provides classes that are responsible for multitasking |
javafx.embed.swing | Provides the set of classes that can be used inside the swing code |
javafx.embed.swt | Provides the set of classes that can be used inside the swt code |
javafx.event | Provides the classes that deal with events and their handling |
javafx.fxml | Contains the set of classes that are responsible of loading hierarchy from mark-up |
javafx.geometry | Provides the 2D classes that contains the methods to operate 2D geometry on the object. |
javafx.scene | Provides the classes to deal with scene graph API |
javafx.scene.canvas | Provides the set of classes that deal with canvas. |
javafx.scene.control | Contains the classes for all JavaFX components. |
javafx.scene.effect | Contains the set of classes that apply the graphic effects to scene graph nodes |
javafx.scene.image | Provides the set of classes for loading and displaying images |
javafx.scene.input | Provides the set of classes for the mouse and keyboard events |
javafx.scene.layout | Provides the set of classes to support user interface layout |
javafx.scene.media | Provides the set of classes to integrate audio and video into JavaFX application |
javafx.scene.paint | Provides the set of classes for colours and gradients to fill shapes and backgrounds when rendering scene graph. |
javafx.scene.shape | Provides the set of 2D classes that performs the operations on objects related to 2D geometry. |
javafx.scene.text | Provides the set of classes for fonts and rendering text nodes. |
javafx.scene.transform | Provides the set of classes that are used to perform rotating, scaling, shearing operations on objects. |
javafx.scene.web | Provides means for loading and displaying web content. |
javafx.stage | Provides the top level container classes for JavaFX content. |
javafx.util | Provides utilities classes |
javafx.util.converter | This package is for standard string converters for JavaFX |
这是构建JavaFX应用程序的起点。它是节点的分层树,代表用户界面的所有可视元素。它还具有处理事件的能力。通常,场景图可以定义为节点的集合。
每个节点都有其单独的ID,样式和数量。场景图的每个节点只能有一个父级,零个或多个子级。
场景图上的所有实现实际上都应用于其节点。它们是javafx.scene包中存在的各种类,用于在节点上创建,修改和应用某些转换。稍后我们将详细讨论场景图。
JavaFX图形引擎为场景图提供图形支持。它基本上支持2D和3D图形。当系统上存在的图形硬件无法支持硬件加速渲染时,它将提供软件渲染。
JavaFX中的两个图形加速管道是:
棱镜可以看作是高性能硬件加速的图形管线。它具有同时渲染2D和3D图形的功能。 Prism实现了在不同平台上渲染图形的不同方法。
量子工具套件用于将棱镜和玻璃开窗工具套件绑定在一起,并使它们可用于堆栈中的以上层。
它位于最低级别的JavaFX图形堆栈上。基本上可以将其视为依赖于平台的层,该层充当JavaFX平台与本机操作系统之间的接口。
它负责提供操作系统服务,例如管理窗口,计时器,事件队列和表面。
我们还可以将HTML内容嵌入JavaFX场景图。为此,JavaFX使用称为Web视图的组件。 Web视图使用Web Kit,它是一个内部开放源代码浏览器,可以呈现HTM5,DOM,CSS,SVG和JavaScript。
使用Web视图,我们可以从JavaFX应用程序呈现HTML内容,还可以将一些CSS样式应用于用户界面。
通过使用媒体引擎,JavaFX应用程序可以支持音频和视频媒体文件的播放。 JavaFX媒体引擎依赖于称为G Streamer的开源引擎。软件包javafx.scene.media包含所有可以为JavaFX应用程序提供媒体功能的类和接口。