- java.lang.Object
-
- org.controlsfx.control.decoration.Decoration
-
- org.controlsfx.control.decoration.GraphicDecoration
-
public class GraphicDecoration extends Decoration
GraphicDecoration is aDecoration
designed to show a graphic (be it an image loaded via anImageView
or an arbitrarily complex scenegraph in its own right) on top of a given node. GraphicDecoration is applied as part of the ControlsFXDecorator
API - refer to theDecorator
javadoc for more details.- See Also:
Decoration
,Decorator
-
-
Constructor Summary
Constructors Constructor Description GraphicDecoration(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(Node decorationNode, 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 theposition
argument.GraphicDecoration(Node decorationNode, 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 theposition
argument, with the given xOffset and yOffset values used to adjust the position.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Node
applyDecoration(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(Node targetNode)
This method removes the decoration from the given target node.-
Methods inherited from class org.controlsfx.control.decoration.Decoration
getProperties
-
-
-
-
Constructor Detail
-
GraphicDecoration
public GraphicDecoration(Node decorationNode)
Constructs a new GraphicDecoration with the given decoration node to be applied to any node that has this decoration applied to it. By default the decoration node will be applied in the top-left corner of the node.- Parameters:
decorationNode
- The decoration node to apply to any node that has this decoration applied to it
-
GraphicDecoration
public GraphicDecoration(Node decorationNode, 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 theposition
argument.- Parameters:
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.
-
GraphicDecoration
public GraphicDecoration(Node decorationNode, 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 theposition
argument, with the given xOffset and yOffset values used to adjust the position.- Parameters:
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).
-
-
Method Detail
-
applyDecoration
public Node applyDecoration(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). When the returned Node is null, this indicates that the decoration will be handled internally by the decoration (which is preferred, as the default implementation is not ideal in most circumstances).When the boolean parameter is false, this method removes the decoration from the given target node, always returning null.
- Specified by:
applyDecoration
in classDecoration
- Parameters:
targetNode
- The node to decorate.- Returns:
- The decoration, but null is a valid return value.
-
removeDecoration
public void removeDecoration(Node targetNode)
This method removes the decoration from the given target node.- Specified by:
removeDecoration
in classDecoration
- Parameters:
targetNode
- The node to undecorate.
-
-