public class GraphicDecoration extends Decoration
Decoration designed to show a graphic (be it
an image loaded via an ImageView or an arbitrarily complex
scenegraph in its own right) on top of a given node. GraphicDecoration is
applied as part of the ControlsFX Decorator API - refer to the
Decorator javadoc for more details.Decoration,
Decorator| Constructor and Description |
|---|
GraphicDecoration(javafx.scene.Node decorationNode)
Constructs a new GraphicDecoration with the given decoration node to be
applied to any node that has this decoration applied to it.
|
GraphicDecoration(javafx.scene.Node decorationNode,
javafx.geometry.Pos position)
Constructs a new GraphicDecoration with the given decoration node to be
applied to any node that has this decoration applied to it, in the location
provided by the
position argument. |
GraphicDecoration(javafx.scene.Node decorationNode,
javafx.geometry.Pos position,
double xOffset,
double yOffset)
Constructs a new GraphicDecoration with the given decoration node to be
applied to any node that has this decoration applied to it, in the location
provided by the
position argument, with the given xOffset and
yOffset values used to adjust the position. |
| Modifier and Type | Method and Description |
|---|---|
javafx.scene.Node |
applyDecoration(javafx.scene.Node targetNode)
This method decorates the given
target node with the relevant decorations, returning any 'decoration node'
that needs to be added to the scenegraph (although this can be null).
|
void |
removeDecoration(javafx.scene.Node targetNode)
This method removes the decoration from the given target node.
|
getPropertiespublic GraphicDecoration(javafx.scene.Node decorationNode)
decorationNode - The decoration node to apply to any node that has this
decoration applied to itpublic GraphicDecoration(javafx.scene.Node decorationNode,
javafx.geometry.Pos position)
position argument.decorationNode - The decoration node to apply to any node that has this
decoration applied to itposition - The location to position the decoration node relative to the
node that is being decorated.public GraphicDecoration(javafx.scene.Node decorationNode,
javafx.geometry.Pos position,
double xOffset,
double yOffset)
position argument, with the given xOffset and
yOffset values used to adjust the position.decorationNode - The decoration node to apply to any node that has this
decoration applied to itposition - The location to position the decoration node relative to the
node that is being decorated.xOffset - The amount of movement to apply to the decoration node in the
x direction (i.e. left and right).yOffset - The amount of movement to apply to the decoration node in the
y direction (i.e. up and down).public javafx.scene.Node applyDecoration(javafx.scene.Node targetNode)
When the boolean parameter is false, this method removes the decoration from the given target node, always returning null.
applyDecoration in class DecorationtargetNode - The node to decorate.public void removeDecoration(javafx.scene.Node targetNode)
removeDecoration in class DecorationtargetNode - The node to undecorate.