Skip to content

Commit 345b4c8

Browse files
committed
Add javafxdoc and links inside the articles
1 parent f8103c4 commit 345b4c8

File tree

8 files changed

+172
-94
lines changed

8 files changed

+172
-94
lines changed

app/data/javafxdoc.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"current_release": "19",
3+
4+
"javafx-documentation": "https://openjfx.io/javadoc/@@CURRENT_RELEASE@@/javafx.graphics/",
5+
"javafxdoc_root": "https://openjfx.io/javadoc/@@CURRENT_RELEASE@@/javafx.graphics/",
6+
7+
"Application": "javafx/application/Application.html",
8+
9+
"Scene": "javafx/scene/Scene.html",
10+
11+
"Stage": "javafx/stage/Stage.html",
12+
13+
"Group": "javafx/scene/Group.html",
14+
15+
"AnchorPane": "javafx/scene/layout/AnchorPane.html",
16+
"BorderPane": "javafx/scene/layout/BorderPane.html",
17+
18+
"FlowPane": "javafx/scene/layout/FlowPane.html",
19+
"GridPane": "javafx/scene/layout/GridPane.html",
20+
"HBox": "javafx/scene/layout/HBox.html",
21+
"StackPane": "javafx/scene/layout/StackPane.html",
22+
"VBox": "javafx/scene/layout/VBox.html",
23+
24+
"ImageView": "javafx/scene/image/ImageView.html",
25+
26+
"Color": "javafx/scene/paint/Color.html",
27+
"LinearGradient": "javafx/scene/paint/LinearGradient.html",
28+
29+
"Ellipse": "javafx/scene/shape/Ellipse.html",
30+
"Line": "javafx/scene/shape/Line.html",
31+
"Path": "javafx/scene/shape/Path.html",
32+
"Rectangle": "javafx/scene/shape/Rectangle.html",
33+
"Shape": "javafx/scene/shape/Shape.html",
34+
"Text": "javafx/scene/shape/Text.html",
35+
36+
37+
"Button": "javafx/scene/control/Button.html",
38+
"ButtonBar": "javafx/scene/control/ButtonBar.html",
39+
"ListView": "javafx/scene/control/ListView.html",
40+
"SplitPane": "javafx/scene/control/SplitPane.html",
41+
"TextField": "javafx/scene/control/TextField.html",
42+
"TextArea": "javafx/scene/control/TextArea.html",
43+
44+
"Animation.Status": "javafx/animation/Animation.Status.html",
45+
"RotateTransition": "javafx/animation/RotateTransition.html",
46+
"ParallelTransition": "javafx/animation/ParallelTransition.html",
47+
"PauseTransition": "javafx/animation/PauseTransition.html",
48+
"SequentialTransition": "javafx/animation/SequentialTransition.html",
49+
"Transition": "javafx/animation/Transition.html",
50+
51+
"When": "javafx/beans/binding/When.html",
52+
53+
"FXMLLoader": "javafx/fxml/FXMLLoader.html",
54+
"Initializable": "javafx/fxml/Initializable.html",
55+
56+
"ObservableList": "javafx/collections/ObservableList.html",
57+
"SortedList": "javafx/collections/transformation/SortedList.html",
58+
}

app/pages/learn/01_tutorial/07_rich_client_apps/01_javafx/01_app_structure.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@ byline: 'and is from <a href="https://link.springer.com/book/10.1007/978-1-4842-
2828
A JavaFX application is controlled by the JavaFX platform, a runtime system that builds your application object and constructs the `JavaFX Application Thread`. To build a JavaFX application, you must extend the `JavaFX Application` class.
2929
The JavaFX runtime system controls the Application lifecycle and invokes the Application `start()` method.
3030

31-
JavaFX uses a theater metaphor: the top-level container is the `Stage` and is constructed by the platform for you. In desktop applications, the `Stage` is the window. Its appearance depends on the host system and varies among Mac OS X, Windows, and Linux platforms.
31+
JavaFX uses a theater metaphor: the top-level container is the [`Stage`](javafxdoc:Stage) and is constructed by the platform for you. In desktop applications, the [`Stage`](javafxdoc:Stage) is the window. Its appearance depends on the host system and varies among Mac OS X, Windows, and Linux platforms.
3232
Normally, the window is decorated with controls that resize, minimize, and quit your application. It’s also possible to construct undecorated windows. You can specialize the Application class for other environments, too. For example, with the `Gluon Mobile Application` framework, your program extends Mobile Application, an application class specifically written for mobile devices.
3333
<a id="single-threaded">&nbsp;</a>
3434
## JavaFX Is Single-Threaded
3535

36-
You must always construct and modify the `Stage` and its scene objects on the `JavaFX Application Thread`. Note that JavaFX (like `Swing`) is a single-threaded UI model. For the JavaFX developer, this is mostly a straightforward restriction.
36+
You must always construct and modify the [`Stage`](javafxdoc:Stage) and its scene objects on the `JavaFX Application Thread`. Note that JavaFX (like `Swing`) is a single-threaded UI model. For the JavaFX developer, this is mostly a straightforward restriction.
3737
As you create UI elements, respond to event handlers, manage dynamic content with animation, or make changes in the scene graph, work continues to execute on the JavaFX Application Thread.
3838

3939
To keep the UI responsive, however, you should assign long-running work to background tasks in separate threads. In this case, work that modifies the UI must be separate from work being executed on a background thread.
4040
Fortunately, JavaFX has a well-developed concurrency API that helps developers assign long-running tasks to one or more separate threads. This keeps the UI thread responsive to user events.
4141
<a id="hierarchical-node-structure">&nbsp;</a>
4242
## Hierarchical Node Structure
4343

44-
Continuing with the theater metaphor, the `Stage` holds a scene. The scene consists of JavaFX elements such as the root, which is the top scene element and contains what is called the scene graph.
44+
Continuing with the theater metaphor, the [`Stage`](javafxdoc:Stage) holds a scene. The scene consists of JavaFX elements such as the root, which is the top scene element and contains what is called the scene graph.
4545

4646
The scene graph is a strictly hierarchical structure of elements that visualize your application. These elements are called Nodes. A Node has exactly one parent (except the root node) and may contain other Nodes. Or, a Node can be a leaf node with no children. Nodes must be added to the scene graph in order to participate in the rendering of that scene.
4747
Furthermore, a Node may be added only once to a scene, unless it is first removed and then added somewhere else.
@@ -54,10 +54,10 @@ as shown in the figure below. Coordinate values on the x-axis increase to the ri
5454
JavaFX also supports 3D graphics and represents the third dimension with z-axis values, providing depth.
5555
JavaFX has an absolute coordinate system, in addition to local coordinate systems that are relative to the parent. In each case, the coordinate system’s origin is the upper-left corner of the parent.
5656
In general, layout controls hide the complexities of component placement within the scene and manage the placement of its children for you. Component placement is based on the specific layout control and how you configure it.
57-
It’s also possible to nest layout controls. For example, you can place multiple VBox controls in an `HBox` or put an `AnchorPane` into one pane of a `SplitPane` control. Other parent nodes are more complex visual nodes, such as `TextField`, `TextArea`, and `Button`.
58-
These nodes have managed subparts. For example, `Button` includes a labeled text part and optional graphic. This graphic can be any node type but is typically an image or icon.
57+
It’s also possible to nest layout controls. For example, you can place multiple VBox controls in an [`HBox`](javafxdoc:HBox) or put an [`AnchorPane`](javafxdoc:AnchorPane) into one pane of a [`SplitPane`](javafxdoc:SplitPane) control. Other parent nodes are more complex visual nodes, such as [`TextField`](javafxdoc:TextField), [`TextArea`](javafxdoc:TextArea), and [`Button`](javafxdoc:Button).
58+
These nodes have managed subparts. For example, [`Button`](javafxdoc:Button) includes a labeled text part and optional graphic. This graphic can be any node type but is typically an image or icon.
5959

60-
Recall that leaf nodes have no child nodes. Examples include `Shape` (such as `Rectangle`, `Ellipse`, `Line`, `Path`, and `Text`) and `ImageView`, a node for rendering an image.
60+
Recall that leaf nodes have no child nodes. Examples include [`Shape`](javafxdoc:Shape) (such as [`Rectangle`](javafxdoc:Rectangle), [`Ellipse`](javafxdoc:Ellipse), [`Line`](javafxdoc:Line), [`Path`](javafxdoc:Path), and [`Text`](javafxdoc:Text)) and [`ImageView`](javafxdoc:ImageView), a node for rendering an image.
6161

6262
Just a word of warning: you should be using a plain text editor to create and save this file. Using a word processor will not work.
6363
<a id="shape">&nbsp;</a>
@@ -68,7 +68,7 @@ When you resize the window, the visible elements will remain centered in the res
6868

6969
[![MyShapes application](/assets/images/javafx/myshapes-application.png)](/assets/images/javafx/myshapes-application.png)
7070

71-
The source code for this application is in the `MyShapes` program. Class `MyShapes` is the main class and extends `Application`. The JavaFX runtime system instantiates `MyShapes` as well as the primary Stage, which it passes to the overridden `start()` method. The runtime system invokes the `start()` method for you.
71+
The source code for this application is in the `MyShapes` program. Class `MyShapes` is the main class and extends [`Application`](javafxdoc:Application). The JavaFX runtime system instantiates `MyShapes` as well as the primary Stage, which it passes to the overridden `start()` method. The runtime system invokes the `start()` method for you.
7272

7373
```java
7474
package org.modernclient;
@@ -110,24 +110,24 @@ Note the import statements that reference packages in `javafx.application`, `jav
110110

111111
---
112112

113-
This program creates several nodes and adds them to a `StackPane` layout container. The program also creates the scene, configures the stage, and shows the stage. Let’s look at these steps in detail.
113+
This program creates several nodes and adds them to a [`StackPane`](javafxdoc:StackPane) layout container. The program also creates the scene, configures the stage, and shows the stage. Let’s look at these steps in detail.
114114

115-
First, we create an `Ellipse` shape, providing a width and height in pixels. Since `Ellipse` extends `Shape`, we can also configure any `Shape` property. This includes fill, which lets you specify an interior paint value.
115+
First, we create an [`Ellipse`](javafxdoc:Ellipse) shape, providing a width and height in pixels. Since [`Ellipse`](javafxdoc:Ellipse) extends [`Shape`](javafxdoc:Shape), we can also configure any [`Shape`](javafxdoc:Shape) property. This includes fill, which lets you specify an interior paint value.
116116
<a id="color">&nbsp;</a>
117117
## Color
118118

119-
A `Shape`’s fill property can be a JavaFX color, a linear gradient, a radial gradient, or an image. Let’s briefly discuss color. You can specify colors in JavaFX several ways.
120-
Here, we set the `Ellipse` fill property to `Color.LIGHTBLUE`.
119+
A [`Shape`](javafxdoc:Shape)’s fill property can be a JavaFX color, a linear gradient, a radial gradient, or an image. Let’s briefly discuss color. You can specify colors in JavaFX several ways.
120+
Here, we set the [`Ellipse`](javafxdoc:Ellipse) fill property to `Color.LIGHTBLUE`.
121121

122122
```java
123123
// Create an Ellipse and set fill color
124124
Ellipse ellipse = new Ellipse(110, 70);
125125
ellipse.setFill(Color.LIGHTBLUE);
126126
```
127127

128-
There are currently 147 predefined colors in the JavaFX Color class, named alphabetically from `ALICEBLUE` to `YELLOWGREEN`. However, you can also specify `Color` using web RGB values with either hexadecimal notation or decimal numbers.
128+
There are currently 147 predefined colors in the JavaFX Color class, named alphabetically from `ALICEBLUE` to `YELLOWGREEN`. However, you can also specify [`Color`](javafxdoc:Color) using web RGB values with either hexadecimal notation or decimal numbers.
129129
You can optionally provide an alpha value for transparency. Fully opaque is 1 and fully transparent is 0. A transparency of .5, for example, shows the color but lets the background color show through as well.
130-
Here are a few examples that set a shape’s fill with `Color`:
130+
Here are a few examples that set a shape’s fill with [`Color`](javafxdoc:Color):
131131

132132
```java
133133
ellipse.setFill(Color.LIGHTBLUE); // Light blue, fully opaque
@@ -143,7 +143,7 @@ Notably, you can interpolate a color’s values, and that is how JavaFX construc
143143
<a id="text">&nbsp;</a>
144144
## Text
145145

146-
We next create a Text object. Text is also a `Shape` with additional properties, such as font, text alignment, text, and wrapping width. The constructor provides the text and the `setFont()` method sets its font.
146+
We next create a Text object. Text is also a [`Shape`](javafxdoc:Shape) with additional properties, such as font, text alignment, text, and wrapping width. The constructor provides the text and the `setFont()` method sets its font.
147147

148148
```java
149149
// Create a Text shape with font and size
@@ -156,12 +156,12 @@ text.setFont(new Font("Arial Bold", 24));
156156
Note that we created the ellipse and text nodes, but they are not yet in our scene graph. Before we add them to the scene, we must put these nodes in some kind of layout container. Layout controls are extremely important in managing your scene graph.
157157
These controls not only arrange components for you but also respond to events such as resizing, the addition or removal of elements, and any changes to the sizes of one or more nodes in the scene graph.
158158

159-
To show you just how important layout controls are, let’s replace the `StackPane` from the original example with a `Group` and specify the placement manually.
160-
`Group` is a parent node that manages its children but does not provide any layout capability. Here we create a group and add the ellipse and text elements with the constructor. We then specify group as the scene’s root node:
159+
To show you just how important layout controls are, let’s replace the [`StackPane`](javafxdoc:StackPane) from the original example with a [`Group`](javafxdoc:Group) and specify the placement manually.
160+
[`Group`](javafxdoc:Group) is a parent node that manages its children but does not provide any layout capability. Here we create a group and add the ellipse and text elements with the constructor. We then specify group as the scene’s root node:
161161

162162
```java
163163
Group group = new Group(ellipse, text);
164-
. . .
164+
...
165165
Scene scene = new Scene(group, 350, 230, Color.LIGHTYELLOW);
166166
```
167167

0 commit comments

Comments
 (0)