Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Groovy
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<h3>SceneGraphBuilder</h3> <p>The SceneGraphBuilder is the main helper class for doing Groovy Markup for JavaFX 2.0. </p> <p>The following sections describe some of the generalized behavior supported in the SceneGraphBuilder on all nodes and attributes defined in the MarkUP.</p> <h3>Fonts</h3> <p>All font attributes may of course be set with a JavaFX Font object (<a href="http://download.oracle.com/javafx/2.0/api/javafx/scene/text/Font.html">javafx.scene.text.Font</a>). In addition, fonts may be defined using the JavaFX CSS styles for "-fx-font" or "-fx-font-size". If a font size string is presented, then the default Font will be used with that size. (see <a href="http://download.oracle.com/javafx/2.0/api/javafx/scene/javafx.scene/doc-files/cssref.html">CSS Reference Guide.</a>)</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> text( font: "32pt", text: "This is Text") button( font: "16pt Courier" text: "Push Here") </pre></td></tr></table> <h3>Paints/Colors</h3> <p>All color and paint attributes may be set with one of the JavaFX Paint or Color objects (<a href="http://download.oracle.com/javafx/2.0/api/javafx/scene/paint/LinearGradient.html">javafx.scene.paint.LinearGradient</a>, <a href="http://download.oracle.com/javafx/2.0/api/javafx/scene/paint/RadialGradient.html">javafx.scene.paint.RadialGradient</a> and <a href="http://download.oracle.com/javafx/2.0/api/javafx/scene/paint/Paint.html">javafx.scene.paint.Color</a>). In addition, colors may be set using the pseudo color variables, such as <em>red</em>, <em>green</em>, <em>blue, etc.</em> Colors may also be defined as a web string such as "#333", "cyan", etc. Colors may also be defined using the JavaFX CSS styles for colors, linear, and radial gradients. (see <a href="http://download.oracle.com/javafx/2.0/api/javafx/scene/javafx.scene/doc-files/cssref.html">JavaFX CSS Reference Guide</a>) Also see <a class="confluence-link" href="/display/GROOVY/SceneGraphBuilder+-+paint" data-linked-resource-id="213319918" data-linked-resource-type="page" data-linked-resource-default-alias="SceneGraphBuilder - paint" data-base-url="http://docs.codehaus.org">SceneGraphBuilder - paint</a> for more details.</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> scene(fill: hsb(128, 0.5, 0.5, 0.5)) circle(centerX: 50, centerY: 50, radius: 25, fill: rgb(0, 0, 255)) rectangle(x: 100, y: 50, width: 50, height: 50, fill: red) rectangle(x: 100, y: 50, width: 50, height: 50, fill: "#333") rectangle(x: 100, y: 50, width: 50, height: 50, fill: "linear (0%,0%) to (0%,100%) stops (0%,gray) (100%,black)") </pre></td></tr></table> <h3>Enumerated Values</h3> <p>All Java Enumerations may be set using their string equivalents. For example, if an attribute field is of type javafx.geometry.Pos, then the value may be set with one of the string values, "center", "bottom_left", etc.</p> <p>There are some special cases where Object instances are used rather than enumerations. For example the javafx.scene.Cursor class contains numerous singleton instances for the various cursors that may be set on the scene. Also, there are special pseudo variables for the Orientation enumeration, <em>horizontal</em> and <em>vertical</em>.</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> scene(cursor: "OPEN_HAND") // javafx.scene.Cursor static member. sg.stage(style: "transparent") // javafx.stage.StageStyle enumeration scrollBar(min: 0, max: 100, value: 50, orientation: horizontal) // javafx.geometry.Orientation enumeration </pre></td></tr></table> <h3><span style="color: rgb(0,51,102);"><strong>Geometry</strong></span></h3> <p>The Geometry objects in the javafx.geometry package, Point2D, Point3D, Dimension2D, Rectangle2D, and BoundingBox, may be set using numbered lists. For the 2D classes, 2 numbers must be provided, and for the 3D classes, 3 numbers must be provided. BoundingBox may be either 2D, requiring 4 values, or 3D, requiring 6 values. A Rectangle2D may also take and empty list or the "EMPTY" string as shown in the previous section on Insets.</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> rotate(angle: 90, axis: [1,1,0]) imageView(viewport: [0,0, 400, 400]) </pre></td></tr></table> <h4><span style="color: rgb(0,51,102);"><strong>Insets</strong></span></h4> <p><span style="color: rgb(0,0,0);">The javafx.geometry.Insets class may be instantiated by using the javafx class, or by using a Groovy number list. If a number list is used, it may contain, one, two, or four numbers. If one number is presented then all sides of the Insets will be set to that value. If two numbers are presented then the first number will be used to set the top and bottom side of the Inset, and the second number will be used to set the left and right side of the Inset. If four numbers are present in the list, the numbers will be assigned to the the top, right, bottom and left in order. An empty list or the String "empty" will map to the Insets.EMPTY object.</span></p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> stackPane(style: "-fx-background-color: burlywood", padding: 20) stackPane(style: "-fx-background-color: burlywood", padding: [10]) stackPane(style: "-fx-background-color: burlywood", padding: [50, 25]) stackPane(style: "-fx-background-color: burlywood", padding: [0, 50, 0, 0]) stackPane(style: "-fx-background-color: burlywood", padding: []) stackPane(style: "-fx-background-color: burlywood", padding: "EMPTY") </pre></td></tr></table> <h3>ToggleGroups</h3> <p>ToggleGroups are identified with an unique string across the SceneGraphBuilder context. To tie a toggle type button to a specific ToggleGroup, use the special attribute toggleGroup on the Toggle type button. Buttons with the same ToggleGroup names will be assigned the same ToggleGroup instance.</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> scene(fill: hsb(128, 0.5, 0.5, 0.5), root: group()) { toggleButton ( layoutX: 25, layoutY: 300, font: "16pt Courier", text: "One", selected: true, toggleGroup: "Group1" ) toggleButton ( layoutX: 125, layoutY: 300, font: "16pt Courier", text: "Two", selected: true, toggleGroup: "Group1" ) } </pre></td></tr></table>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced