Package swingtree

Class UIForSeparator<S extends JSeparator>


public final class UIForSeparator<S extends JSeparator> extends UIForAnySwing<UIForSeparator<S>,S>
A SwingTree builder node designed for configuring JSeparator instances.

Please take a look at the living swing-tree documentation where you can browse a large collection of examples demonstrating how to use the API of this class.

  • Method Details

    • _state

      protected swingtree.BuilderState<S> _state()
      Description copied from class: UIForAnything
      Returns the state of the builder, which is a container for the wrapped component as well as it's type and current EventProcessor.
      Specified by:
      _state in class UIForAnything<UIForSeparator<S extends JSeparator>,S extends JSeparator,JComponent>
      Returns:
      The state of the builder.
    • _newBuilderWithState

      protected UIForSeparator<S> _newBuilderWithState(swingtree.BuilderState<S> newState)
      Description copied from class: UIForAnything
      An internal wither method which creates a new builder instance with the provided BuilderState stored inside it.
      Specified by:
      _newBuilderWithState in class UIForAnything<UIForSeparator<S extends JSeparator>,S extends JSeparator,JComponent>
      Parameters:
      newState - The new state which should be stored inside the new builder instance.
      Returns:
      A new builder instance with the provided state stored inside it.
    • withOrientation

      public final UIForSeparator<S> withOrientation(UI.Align align)
      Sets the orientation of the separator which can be either SwingConstants.HORIZONTAL or SwingConstants.VERTICAL. This method is a convenience method for JSeparator.setOrientation(int) which receives the UI.Align enum instead of an integer.
      Parameters:
      align - The orientation of the separator.
      Returns:
      This very instance, which enables builder-style method chaining.
      Throws:
      IllegalArgumentException - if align is null.
    • withOrientation

      public final UIForSeparator<S> withOrientation(sprouts.Val<UI.Align> align)
      Binds the supplied alignment property to the orientation of the separator, so that whenever the property changes, the orientation of the separator will be updated accordingly.
      Parameters:
      align - The alignment property used to dynamically update the alignment of the separator.
      Returns:
      This very instance, which enables builder-style method chaining.
      Throws:
      IllegalArgumentException - if align is null.
    • withLength

      public final UIForSeparator<S> withLength(int separatorLength)
      Sets the length of the separation line either horizontally or vertically depending on the orientation of the separator. This method is an alignment aware convenience method for JComponent.setPreferredSize(Dimension).
      Parameters:
      separatorLength - The length of the separation line.
      Returns:
      This very builder to allow for method chaining.
    • withLength

      public UIForSeparator<S> withLength(sprouts.Val<Integer> separatorLength)
      Binds the provided integer property to the length of the separation line., which means that whenever the property changes, the length of the separation line will be updated accordingly.
      Parameters:
      separatorLength - The property dynamically determining the length of the separation line.
      Returns:
      This very builder to allow for method chaining.