Oracle
  • Select Country/Region
  • Select Country/Region
  • Communities
  • I am a...
  • I want to...
  • Welcome
  • Account
  • Sign Out
  • Sign In/Register for Account
  • Help
  • Products and Services

  • Solutions

  • Downloads

  • Store

  • Support

  • Training

  • Partners

  • About

  • Oracle Technology Network

Oracle Technology Network Java JavaFX Documentation
  • Java SE
  • Java EE
  • Java ME
  • Java SE Support
  • Java SE Advanced & Suite
  • Java Embedded
  • JavaFX
  • Java DB
  • Web Tier
  • Java Card
  • Java TV
  • New to Java
  • Community
  • Java Magazine
  • Java Advanced
  • Overview
  • Downloads
  • Documentation
  • Tools
  • Community
  • Samples

FXD Specification

expand all

Profile: desktop, common

  • animation

    • KeyFrame
    • KeyValue
    • Timeline
  • animation.transition

    • AnimationPath
    • FadeTransition
    • ParallelTransition
    • PathTransition
    • PauseTransition
    • RotateTransition
    • ScaleTransition
    • SequentialTransition
    • TranslateTransition
  • fxd

    • FXDNode
  • geometry

    • BoundingBox
    • Dimension2D
    • Insets
    • Point2D
    • Point3D
    • Rectangle2D
  • scene

    • Cursor
    • Group
    • ImageCursor
    • ParallelCamera
    • PerspectiveCamera
    • Scene
  • scene.chart

    • AreaChart
    • BarChart
    • BarChart3D
    • BubbleChart
    • LineChart
    • PieChart
    • PieChart3D
    • ScatterChart
  • scene.chart.data

    • Data
    • Series
  • scene.chart.part

    • CategoryAxis
    • Legend
    • NumberAxis
  • scene.control

    • Behavior
    • Button
    • CheckBox
    • ChoiceBox
    • Hyperlink
    • IndexedCell
    • Keystroke
    • Label
    • ListCell
    • ListView
    • PasswordBox
    • ProgressBar
    • ProgressIndicator
    • RadioButton
    • ScrollBar
    • ScrollView
    • Separator
    • Slider
    • TextBox
    • ToggleButton
    • ToggleGroup
    • Tooltip
  • scene.effect

    • Blend
    • Bloom
    • BoxBlur
    • ColorAdjust
    • DisplacementMap
    • DropShadow
    • FloatMap
    • Flood
    • GaussianBlur
    • Glow
    • Identity
    • InnerShadow
    • InvertMask
    • Lighting
    • MotionBlur
    • PerspectiveTransform
    • Reflection
    • SepiaTone
    • Shadow
  • scene.effect.light

    • DistantLight
    • PointLight
    • SpotLight
  • scene.image

    • Image
    • ImageView
  • scene.layout

    • ClipView
    • Container
    • Flow
    • HBox
    • LayoutInfo
    • Panel
    • Stack
    • Tile
    • VBox
  • scene.media

    • AudioTrack
    • Media
    • MediaError
    • MediaPlayer
    • MediaTimer
    • MediaView
    • SubtitleTrack
    • VideoTrack
  • scene.paint

    • Color
    • LinearGradient
    • RadialGradient
    • Stop
  • scene.shape

    • Arc
    • ArcTo
    • Circle
    • ClosePath
    • CubicCurve
    • CubicCurveTo
    • DelegateShape
    • Ellipse
    • HLineTo
    • Line
    • LineTo
    • MoveTo
    • Path
    • Polygon
    • Polyline
    • QuadCurve
    • QuadCurveTo
    • Rectangle
    • SVGPath
    • ShapeIntersect
    • ShapeSubtract
    • VLineTo
  • scene.text

    • Font
    • Text
  • scene.transform

    • Affine
    • Rotate
    • Scale
    • Shear
    • Translate
  • Copyright 2008-2010
    Oracle Corporation
    Use is subject to license terms.

ShapeSubtract

Inherits from: Shape > Node > Interpolatable

Overview

A Shape that is the result of the union of all shapes in sequence a with all shapes in a subtracted from it. This class implements the Constructive Area Geometry (CAG) Add and Subtract operations. If sequence @{code b} is empty, then the resulting shape is simply the union of all the shapes in sequence a.

This implementation of Constructive Area Geometry uses the geometric shape of the provided shapes for the Constructive Area Geometry operation. The primitive shape is not affected by many of the node attributes such as fill, stroke, etc.

Example:



Profile: desktop

Variable Summary

nametype Default Value description
a Shape []

A sequence of shapes that defines shape "A". The union of all these shapes is computed and shape "B" is subtracted from that union.

b Shape []

A sequence of shapes that defines shape "B". The union of all these shapes is computed and is subtracted from shape "A". If this sequence is empty then no subtraction is done.

Inherited Variables

Shape

nametype Default Value description
strokeWidth Number 1.0

Defines a square pen line width. A value of 0.0 specifies a hairline stroke. A value of less than 0.0 will be treated as 0.0.

strokeLineJoin StrokeLineJoin StrokeLineJoin.MITER

Defines the decoration applied where path segments meet. The value must have one of the following values: StrokeLineJoin.BEVEL, StrokeLineJoin.MITER, and StrokeLineJoin.ROUND.

strokeLineCap StrokeLineCap StrokeLineCap.SQUARE

The end cap style of this Shape as one of the following values that define possible end cap styles: StrokeLineCap.BUTT, StrokeLineCap.ROUND, and StrokeLineCap.SQUARE.

strokeMiterLimit Number 10.0

Defines the limit for the StrokeLineJoin.MITER line join style. A value of less than 1.0 will be treated as 1.0.

strokeDashOffset Number 0

Defines a distance specified in user coordinates that represents an offset into the dashing pattern. In other words, the dash phase defines the point in the dashing pattern that will correspond to the beginning of the stroke.

strokeDashArray Number []

Defines the array representing the lengths of the dash segments. Alternate entries in the array represent the user space lengths of the opaque and transparent segments of the dashes. As the pen moves along the outline of the Shape to be stroked, the user space distance that the pen travels is accumulated. The distance value is used to index into the dash array. The pen is opaque when its current cumulative distance maps to an even element of the dash array and transparent otherwise. An empty strokeDashArray indicates a solid line with no spaces.

fill Paint

Defines parameters to fill the interior of an Shape using the settings of the Paint context. The default value is Color.BLACK for all shapes except Line, Polyline, and Path. The default value is null for those shapes.

stroke Paint

Defines parameters of a stroke that is drawn around the outline of a Shape using the settings of the specified Paint. The default value is null for all shapes except Line, Polyline, and Path. The default value is Color.BLACK for those shapes.

smooth Boolean true

Defines whether antialiasing hints are used or not for this Shape. If the value equals true the rendering hints are applied.

Node

nametype Default Value description
id String

The id of this Node. This simple string identifier is useful for finding a specific Node within the scene graph. While the id of a Node should be unique within the scene graph, this uniqueness is not enforced. This is much like the "id" attribute of an HTML element.

styleClass String

A String identifier which can be used to logically group Nodes, specifically for an external style engine. This variable is exactly analogous to the styleClass attribute on an HTML element.

style String

A string representation of the CSS style associated with this specific Node. This is exactly analogous to the "style" attribute on an HTML element, but uses the syntax defined in JavaFX CSS.

visible Boolean true

Specifies whether this Node and any subnodes should be rendered as part of the scene graph. A node may be visible and yet not be shown in the rendered scene if, for instance, it is off the screen or obscured by another Node. Invisible nodes never receive mouse events or keyboard focus, and never maintain keyboard focus when they become invisible.

cursor Cursor null

Defines the mouse cursor for this Node and subnodes. If null, then the cursor of the first parent node with a non-null cursor will be used. If no Node in the scene graph defines a cursor, then the cursor of the Scene will be used.

opacity Number 1.0

Specifies how opaque (that is, solid) the Node appears. A Node with 0% opacity is fully translucent. That is, while it is still #visible and rendered, you generally won't be able to see it. The exception to this rule is when the Z Node is combined with a blending mode and blend effect in which case a translucent Node may still have an impact in rendering. An opacity of 50% will render the node as being 50% transparent.

A #visible node with any opacity setting still receives mouse events and can receive keyboard focus. For example, if you want to have a large invisible rectangle overlay all Nodes in the scene graph in order to intercept mouse events but not be visible to the user, you could create a large Rectangle that had an opacity of 0%.

Opacity is specified as a value between 0 and 1. Values less than 0 or greater than 1 are clipped to 0 and 1 respectively.

On some platforms ImageView might not support opacity variable.

clip Node null

Specifies a Node to use to define the the clipping shape for this Node. This clipping Node is not a child of this Node in the scene graph sense. Rather, it is used to define the clip for this Node.

For example, you can use an javafx.scene.image.ImageView Node as a mask to represent the Clip. Or you could use one of the geometric shape Nodes such as javafx.scene.shape.Rectangle or javafx.scene.shape.Circle. Or you could use a javafx.scene.text.Text node to represent the Clip.

See the class documentation for Node for scene graph structure restrictions on setting the clip. If these restrictions are violated by a change to the clip variable, the change is ignored and the previous value of the clip variable is restored.

Note: this is a conditional feature. See javafx.runtime.ConditionalFeature#SHAPE_CLIP ConditionalFeature.SHAPE_CLIP for more information.

cache Boolean false

A performance hint to the system to indicate that this Node should be cached as a bitmap. Rendering a bitmap representation of a node will be faster than rendering primitives in many cases, especially in the case of primitives with effects applied (such as a blur). However, it also increases memory usage. This hint indicates whether that trade-off (increased memory usage for increased performance) is worthwhile. Also note that on some platforms such as GPU accelerated platforms there is little benefit to caching Nodes as bitmaps when blurs and other effects are used since they are very fast to render on the GPU. The cacheHint variable provides additional options for enabling more aggressive bitmap caching.

cacheHint CacheHint CacheHint.DEFAULT

Additional hint for controlling bitmap caching.

Under certain circumstances, such as animating nodes that are very expensive to render, it is desirable to be able to perform transformations on the node without having to regenerate the cached bitmap. An option in such cases is to perform the transforms on the cached bitmap itself.

This technique can provide a dramatic improvement to animation performance, though may also result in a reduction in visual quality. The cacheHint variable provides a hint to the system about how and when that trade-off (visual quality for animation performance) is acceptable.

It is possible to enable the cacheHint only at times when your node is animating. In this way, expensive nodes can appear on screen with full visual quality, yet still animate smoothly.

Example:

                   
expensiveNode.cache = true;
 expensiveNode.cacheHint = CacheHint.QUALITY;
 ...
 // Do an animation
 expensiveNode.cacheHint = CacheHint.SPEED;
 Timeline {
     keyFrames: [
         KeyFrame {
             time: 2s
             values: [
                 expensiveNode.scaleX => 2.0,
                 expensiveNode.scaleY => 2.0,
                 expensiveNode.rotate=> 360,
                 expensiveNode.cacheHint => CacheHint.QUALITY
             ]
        }
     ]
 }.play();

                
Note that cacheHint is only a hint to the system. Depending on the details of the node or the transform, this hint may be ignored.

If Node.cache is false, cacheHint is ignored.

effect Effect null

Specifies an effect to apply to this Node.

Note: this is a conditional feature. See javafx.runtime.ConditionalFeature#EFFECT ConditionalFeature.EFFECT for more information.

disable Boolean false

Sets the individual disabled state of this Node. Setting disable to true will cause this Node and any subnodes to become disabled. This variable should be used only to set the disabled state of a Node. For querying the disabled state of a Node, the #disabled variable should instead be used, since it is possible that a Node was disabled as a result of an ancestor being disabled even if the individual disable state on this Node is false.

pickOnBounds Boolean false

Defines how the picking computation is done for this node when triggered by a MouseEvent or a contains function call. If pickOnBounds is true, then picking is computed by intersecting with the bounds of this node, else picking is computed by intersecting with the geometric shape of this node.

managed Boolean true

Defines whether or not this node's layout will be managed by it's parent. Each parent class follows a strategy for laying out managed children during the scene's layout pass:

  • Group: sets the size of any Resizable children to their preferred size; does not alter the size of non-Resizable children; does not position children.
  • Container: sets the size of any Resizable content according to its layout rules and each node's layoutInfo; does not alter the size of non-Resizable content; will position nodes (setting layoutX/layoutY according to its layout rules.
  • CustomNode: by default it behaves like Group, however its layout behavior may be overridden by a subclass.
Parents will ignore unmanaged children for the purposes of layout and it is the application's responsibility to set the size and position of an unmanaged node. By default all nodes are managed.

If a Parent node is unmanaged, then it will act as a root for layout, which means that layout requests beneath it will cause only the branch rooted by this node to be relayed out.

layoutX Number 0

Defines the X coordinate of the translation that is added to the transformed coordinates of this Node for the purpose of layout. Containers or Groups performing layout will set this variable relative to layoutBounds.minX in order to position the node at the desired layout location.

For example, if child should have a final location of finalX:

                   
     child.layoutX = finalX - child.layoutBounds.minX;
 
                


layoutY Number 0

Defines the Y coordinate of the translation that is added to the transformed coordinates of this Node for the purpose of layout. Containers or Groups performing layout will set this variable relative to layoutBounds.minY in order to position the node at the desired layout location.

For example, if child should have a final location of finalY:

                   
     child.layoutY = finalY - child.layoutBounds.minY;
 
                


layoutInfo LayoutInfoBase

Hook for node-specific layout information used by layout containers. If the node is not a child of a container which supports layout info, this variable will be ignored.

Note that layoutInfo object literals may be shared across nodes, which means altering the vars in layoutInfo will affect all such nodes.

transforms Transform []

Defines the sequence of javafx.scene.transform.Transform objects to be applied to this Node. This sequence of transforms is applied before #translateX, #translateY, #scaleX, and #scaleY, #rotate transforms.

By default, #layoutBounds is defined as the local bounds with all the transforms in this sequence applied.

translateX Number 0

Defines the X coordinate of the translation that is added to the transformed coordinates of this Node. This value will be added to any translation defined by the transforms sequence and layoutX.

This variable can be used to alter the location of a Node without disturbing its layout bounds, which makes it useful for animating a node's location.

translateY Number 0

Defines the Y coordinate of the translation that is added to the transformed coordinates of this Node. This value will be added to any translation defined by the transforms sequence and layoutY.

This variable can be used to alter the location of a Node without disturbing its layout bounds, which makes it useful for animating a node's location.

translateZ Number 0

Defines the Z coordinate of the translation that is added to the transformed coordinates of this Node. This value will be added to any translation defined by the transforms sequence and layoutZ.

This variable can be used to alter the location of a Node without disturbing its layout bounds, which makes it useful for animating a node's location.

Note: this is a conditional feature. See javafx.runtime.ConditionalFeature#SCENE3D ConditionalFeature.SCENE3D for more information.

scaleX Number 1.0

Defines the factor by which coordinates are scaled about the center of the object along the X axis of this Node. This is used to stretch or animate the node either manually or by using an animation.

This scale factor is not included in #layoutBounds by default, which makes it ideal for scaling the entire node after all effects and transforms have been taken into account.

The pivot point about which the scale occurs is the center of the untransformed #layoutBounds.

scaleY Number 1.0

Defines the factor by which coordinates are scaled about the center of the object along the Y axis of this Node. This is used to stretch or animate the node either manually or by using an animation.

This scale factor is not included in #layoutBounds by default, which makes it ideal for scaling the entire node after all effects and transforms have been taken into account.

The pivot point about which the scale occurs is the center of the untransformed #layoutBounds.

scaleZ Number 1.0

Defines the factor by which coordinates are scaled about the center of the object along the Z axis of this Node. This is used to stretch or animate the node either manually or by using an animation.

This scale factor is not included in #layoutBounds by default, which makes it ideal for scaling the entire node after all effects and transforms have been taken into account.

The pivot point about which the scale occurs is the center of the rectangular bounds formed by taking #boundsInLocal and applying all the transforms in the #transforms[] sequence.

Note: this is a conditional feature. See javafx.runtime.ConditionalFeature#SCENE3D ConditionalFeature.SCENE3D for more information.

rotate Number 0.0

Defines the angle of rotation about the Node's center, measured in degrees. This is used to rotate the Node.

This rotation factor is not included in #layoutBounds by default, which makes it ideal for rotating the entire node after all effects and transforms have been taken into account.

The pivot point about which the rotation occurs is the center of the untransformed #layoutBounds.

Note that because the pivot point is computed as the center of this Node's layout bounds, any change to the layout bounds will cause the pivot point to change, which can move the object. For a leaf node, any change to the geometry will cause the layout bounds to change. For a group node, any change to any of its children, including a change in a child's geometry, clip, effect, position, orientation, or scale, will cause the group's layout bounds to change. If this movement of the pivot point is not desired, applications should instead use the Node's #transforms[] sequence, and add a javafx.scene.transform.Rotate transform, which has a user-specifiable pivot point.

rotationAxis Point3D Rotate.Z_AXIS

Defines the axis of rotation of this Node.

Note: this is a conditional feature. See javafx.runtime.ConditionalFeature#SCENE3D ConditionalFeature.SCENE3D for more information.

blocksMouse Boolean false

If true, consumes mouse events in this Node and does not send them to other nodes further up the scene graph. If a Node wants to block mouse events from going to nodes which are visually obscured by this Node, then set blocksMouse to true.

focusTraversable Boolean false

Specifies whether this Node should be a part of focus traversal cycle. When this property is true focus can be moved to this Node and from this Node using regular focus traversal keys. On a desktop such keys are usually TAB for moving focus forward and SHIFT+TAB for moving focus backward. When a Scene is created, the system gives focus to a Node whose focusTraversable variable is true and that is eligible to receive the focus, unless the focus had been set explicitly via a call to requestFocus().

    E-mail this page    Printer View Printer View
 
    Oracle Cloud
  • Learn About Oracle Cloud
  • Get a Free Trial
  • Learn About PaaS
  • Learn About SaaS
  • Learn About IaaS
    Java
  • Learn About Java
  • Download Java for Consumers
  • Download Java for Developers
  • Java Resources for Developers
  • Java Cloud Service
  • Java Magazine
    Customer and Events
  • Explore and Read Customer Stories
  • All Oracle Events
  • Oracle OpenWorld
  • JavaOne
    Communities
  • Blogs
  • Discussion Forums
  • Wikis
  • Oracle ACEs
  • User Groups
  • Social Media Channels
    Services and Store
  • Log In to My Oracle Support
  • Training and Certification
  • Become a Partner
  • Find a Partner Solution
  • Purchase from the Oracle Store
  • Contact and Chat
    Global Contacts
    Oracle Support
    Phone: 800-633-0738
 

Hardware and Software, Engineered to Work Together

  • Subscribe
  • Careers
  • Contact Us
  • Site Maps
  • Legal Notices
  • Terms of Use
  • Privacy
  •  
  • Facebook
  • LinkedIn
  • Twitter
  • Google+
  • YouTube
  • Oracle RSS Feed