java.lang.Object
org.controlsfx.control.decoration.Decoration
Direct Known Subclasses:
GraphicDecoration, StyleClassDecoration

public abstract class Decoration extends Object
Decoration is an abstract class used by the ControlsFX Decorator class for adding and removing decorations on a node. ControlsFX ships with pre-built decorations, including GraphicDecoration and StyleClassDecoration.

To better understand how to use the ControlsFX decoration API in your application, refer to the code samples and explanations in Decorator.

See Also:
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Instantiates a default Decoration instance (obviously only callable by subclasses).
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract 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).
    Custom decoration properties
    abstract void
    removeDecoration(javafx.scene.Node targetNode)
    This method removes the decoration from the given target node.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Decoration

      protected Decoration()
      Instantiates a default Decoration instance (obviously only callable by subclasses).
  • Method Details

    • applyDecoration

      public abstract 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). 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.

      Parameters:
      targetNode - The node to decorate.
      Returns:
      The decoration, but null is a valid return value.
    • removeDecoration

      public abstract void removeDecoration(javafx.scene.Node targetNode)
      This method removes the decoration from the given target node.
      Parameters:
      targetNode - The node to undecorate.
    • getProperties

      public final Map<String,Object> getProperties()
      Custom decoration properties
      Returns:
      decoration properties