-
Notifications
You must be signed in to change notification settings - Fork 2
/
JavafxGriffonPlugin.groovy
145 lines (128 loc) · 4.85 KB
/
JavafxGriffonPlugin.groovy
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
140
141
142
143
144
145
/*
* Copyright 2009-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @author Dean Iverson
*/
class JavafxGriffonPlugin {
String version = '0.10.2'
String griffonVersion = '1.4.0 > *'
Map dependsOn = [groovyfx: '0.9.1']
List pluginIncludes = []
String license = 'Apache Software License 2.0'
// Toolkit compatibility. No value means compatible with all
// Valid values are: swing, javafx, javafx, pivot, gtk
List toolkits = ['javafx']
// Platform compatibility. No value means compatible with all
// Valid values are:
// linux, linux64, windows, windows64, macosx, macosx64, solaris
List platforms = []
// URL to the plugin's documentation
String documentation = ''
// URL where source can be found
String source = 'https://github.com/deanriverson/griffon-javafx-plugin'
List authors = [
[
id: 'deanriverson',
name: 'Dean Iverson',
email: '[email protected]'
],
[
id: 'aalmiray',
name: 'Andres Almiray',
email: '[email protected]'
]
]
String title = 'Griffon JavaFX Plugin'
String description = '''
Allows writing Griffon JavaFX applications using GroovyFX for the views.
This plugin assumes the existence of [JavaFX][1] on the developer's computer.
The environment variable JAVAFX_HOME should point to the root directory of the
JavaFX SDK installation.
Usage
-----
Once installed, you can use any of the nodes provided by GroovyFX in your views.
GroovyFX documentation can be found [here][2] and JavaFX documentation can be
found [here][3]. In addition, you will be able to use the @FXBindable annotation
on your models.
### Property Editors
This plugin contributes the following property editors
| *Type* | *Format* |
| --------------------------- | -------------------------------------------------- |
| javafx.scene.paint.Color | #RGB ; #RGBA ; #RRGGBB; #RRGGBBAA ; Color constant |
| javafx.geometry.Dimension2D | width, height |
| javafx.scene.image.Image | path/to/image_file |
| javafx.geometry.Insets | top, left, bottom, right |
| javafx.geometry.Point2D | x, y |
| javafx.geometry.Rectangle2D | x, y , width, height |
Notes:
* Color supports all color constants defined by `javafx.scene.paint.Color`.
### Default Imports
This plugin enables additional imports to be used in Groovy based artifacts.
Here's the full list per type
* Controller
* javafx.collections
* javafx.application
* javafx.util
* Model
* javafx.collections
* javafx.beans
* javafx.beans.binding
* javafx.beans.property
* javafx.util.
* groovyx.javafx.beans.
* View
* javafx.collections
* javafx.concurrent
* javafx.event
* javafx.geometry
* javafx.scene
* javafx.scene.chart
* javafx.scene.control
* javafx.scene.control.cell
* javafx.scene.effect
* javafx.scene.image
* javafx.scene.input
* javafx.scene.layout
* javafx.scene.media
* javafx.scene.paint
* javafx.scene.shape
* javafx.scene.text
* javafx.scene.transform
* javafx.scene.web
* javafx.stage
* javafx.util
### Example
Your main application's view might look like this (in fact it will look very
similar if you create your application with the [JavaFX archetype][4]):
application(title: 'Cool App', sizeToScene: true, centerOnScreen: true) {
scene(fill: black, width: 400, height: 300) {
hbox(padding: 80) {
text(text: "Java", font: "80pt sanserif") {
fill linearGradient(endX: 0, stops: [[0, orange], [1, chocolate]])
}
text(text: "FX", font: "80pt sanserif") {
fill linearGradient(endX: 0, stops: [[0, cyan], [1, dodgerblue]])
effect dropShadow(color: dodgerblue, radius: 25, spread: 0.25)
}
}
}
}
[1]: http://www.oracle.com/technetwork/java/javafx/downloads/index.html
[2]: http://groovy.codehaus.org/GroovyFX
[3]: http://docs.oracle.com/javafx/2.0/api/index.html
[4]: http://artifacts.griffon-framework.org/archetype/javafx/description
'''
}