Package swingtree

Class UIForSeparator<S extends JSeparator>

Type Parameters:
S - The type of JSeparator that this UIForSeparator is configuring.

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.Axis axis)
      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.Axis enum instead of an integer.
      Parameters:
      axis - The axis the separator line runs along.
      Returns:
      This very instance, which enables builder-style method chaining.
      Throws:
      IllegalArgumentException - if axis is null.
    • withOrientation

      public final UIForSeparator<S> withOrientation(sprouts.Val<UI.Axis> axis)
      Binds the supplied axis property to the orientation of the separator, so that whenever the property changes, the orientation of the separator will be updated accordingly.
      Parameters:
      axis - A property holding the axis the separator line runs along.
      Returns:
      This very instance, which enables builder-style method chaining.
      Throws:
      IllegalArgumentException - if axis is null.
    • withLength

      public final UIForSeparator<S> withLength(int separatorLength)
      Sets how long the separation line is, which is its width on a horizontal separator and its height on a vertical one. This is a convenience method for JComponent.setPreferredSize(Dimension) which reads the axis of the separator and sets the matching 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.