-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
139 lines (117 loc) · 5.48 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>GroovyFX Project</title>
<link rel="stylesheet" href="resources/css/main.css">
<link rel="stylesheet" href="http://yandex.st/highlightjs/6.1/styles/default.min.css">
<script src="http://yandex.st/highlightjs/6.1/highlight.min.js"></script>
</head>
<body>
<a href="https://github.com/groovyfx-project/groovyfx">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="resources/img/fork_me.png"
alt="Fork me on GitHub"/>
</a>
<div id="container">
<header>
<a id="logo" href="https://github.com/groovyfx-project/groovyfx">
<img src="resources/img/GroovyFX_logo.png" width="120"/>
</a>
<h1>
<a href="https://github.com/groovyfx-project/groovyfx">Groovy<span id="fx">FX</span></a>
</h1>
<div class="description">
The easiest way to write JavaFX 8 applications in Groovy.
</div>
</header>
<nav>
<div id="community" class="nav-div">
<h3>Community</h3>
<!--<p><a href="http://groovy.codehaus.org/GroovyFX">User Guide</a></p>-->
<p><a href="docs/index.html">User Guide</a></p>
<p><a href="https://github.com/groovyfx-project/groovyfx/issues">Issue Tracker</a></p>
<p><a href="https://github.com/groovyfx-project/groovyfx/wiki/Mailing-Lists">Mailing Lists</a></p>
<p><a href="https://dl.bintray.com/groovyfx/maven/org/groovyfx/groovyfx/8.0.0/groovyfx-8.0.0.jar">Download</a></p>
</div>
<div id="developers" class="nav-div">
<h3>Developers</h3>
<p><a href="https://github.com/groovyfx-project/groovyfx/wiki">Developer Guide</a></p>
<p><a href="https://github.com/groovyfx-project/groovyfx">Source Repository</a></p>
</div>
</nav>
<section>
<p>
GroovyFX provides a Groovy binding for JavaFX 8.
<p>
<p>
GroovyFX is an API that makes working with JavaFX in Groovy much simpler and more natural. GroovyFX is
focused on exploiting the power of the Groovy Builder pattern to make JavaFX development easier and more
concise than what is possible in Java. GroovyFX also leverages Groovy's powerful DSL features and AST
transformations to eliminate boilerplate, making GroovyFX code easier to write and, just as importantly,
easier to read.
</p>
<p>
GroovyFX provides the SceneGraphBuilder object, which supports all of the JavaFX controls, shapes,
gradients, effects, and animation; as well as other elements of the JavaFX API such as enumerations and
colors. Additionally, Groovy closures can be used as event handlers, leading to clean and concise code.
</p>
<h2>Hello, World</h2>
<p>
A simple and complete "Hello, World" program is shown below. The general pattern for a GroovyFX application
is to define the JavaFX components within a Groovy closure that is passed to the static <code>start</code>
method of the GroovyFX class. Inside this closure, we simply start declaring our JavaFX scene graph nodes.
</p>
<p>
Each JavaFX class has a corresponding GroovyFX node. For example, the JavaFX
<code>Stage</code> class becomes the <code>stage</code> node. All GroovyFX node
names are exactly the same as their JavaFX counterparts with the start of their class names converted to
lowercase letters.
</p>
<pre><code style="background: #D8E8F0">
import static groovyx.javafx.GroovyFX.start
start {
stage(title: 'GroovyFX Hello World', visible: true) {
scene(fill: BLACK, width: 500, height: 250) {
hbox(padding: 60) {
text(text: 'Groovy', font: '80pt sanserif') {
fill linearGradient(endX: 0, stops: [PALEGREEN, SEAGREEN])
}
text(text: 'FX', font: '80pt sanserif') {
fill linearGradient(endX: 0, stops: [CYAN, DODGERBLUE])
effect dropShadow(color: DODGERBLUE, radius: 25, spread: 0.25)
}
}
}
}
}
</code></pre>
<p>
The result of running this program is shown in the image below. See the
<a href="docs/index.html#_getting_started">Getting Started</a> section of the user guide for
more information.
</p>
<img class="screenshot" src="resources/img/hello_world.png" alt="GroovyFX Hello World"/>
<h2>License</h2>
<p>
GroovyFX is licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0.html">
Apache License, Version 2.0.</a>
</p>
<h2>Download</h2>
<p>
You can download this project in either
<a href="https://github.com/groovyfx-project/groovyfx/zipball/master">zip</a> or
<a href="https://github.com/groovyfx-project/groovyfx/tarball/master">tar formats.</a>
</p>
<p>
You can also clone the project with <a href="http://git-scm.com">Git</a> by running:
<pre class="screen">$ git clone git://github.com/groovyfx-project/groovyfx</pre>
</p>
</section>
<footer>
get the source code on GitHub :
<a href="https://github.com/groovyfx-project/groovyfx">groovyfx-project/groovyfx</a>
</footer>
</div>
<script>hljs.initHighlightingOnLoad();</script>
</body>
</html>