Class Separator

All Implemented Interfaces:
LayoutMeasurable, LayoutMeasurableMixin, HasBackgroundProperty, HasBlendModeProperty, HasBorderProperty, HasClipProperty, HasEffectProperty, HasHeightProperty, HasLayoutXProperty, HasLayoutYProperty, HasManagedProperty, HasMaxHeightProperty, HasMaxWidthProperty, HasMinHeightProperty, HasMinWidthProperty, HasMouseTransparentProperty, HasOnMouseClickedProperty, HasOpacityProperty, HasPaddingProperty, HasParentProperty, HasPrefHeightProperty, HasPrefWidthProperty, HasSnapToPixelProperty, HasVisibleProperty, HasWidthProperty, Styleable, EventTarget, Skinnable, INode, PreferenceResizableNode

public class Separator extends Control
A horizontal or vertical separator line. The visual appearance of this separator can be controlled via CSS. A horizontal separator occupies the full horizontal space allocated to it (less padding), and a vertical separator occupies the full vertical space allocated to it (less padding). The halignment and valignment properties determine how the separator is positioned in the other dimension, for example, how a horizontal separator is positioned vertically within its allocated space.

The separator is horizontal (i.e. isVertical() == false) by default.

The style-class for this control is "separator".

The separator provides two pseudo-classes "horizontal" and "vertical" which are mutually exclusive. The "horizontal" pseudo-class applies if the separator is horizontal, and the "vertical" pseudo-class applies if the separator is vertical.

Separator sets focusTraversable to false.

Since:
JavaFX 2.0
  • Property Details

  • Constructor Details

    • Separator

      public Separator()
      Creates a new horizontal separator with halignment and valignment set to their respective CENTER values.
    • Separator

      public Separator(Orientation orientation)
      Creates a new separator with halignment and valignment set to their respective CENTER values. The direction of the separator is specified by the vertical property.
      Parameters:
      orientation - Specifies whether the Separator instance is initially vertical or horizontal.
  • Method Details

    • setOrientation

      public final void setOrientation(Orientation value)
      Sets the value of the orientation property.
      Property description:
      The orientation of the Separator can either be horizontal or vertical.
      Parameters:
      value - the value for the orientation property
      See Also:
    • getOrientation

      public final Orientation getOrientation()
      Gets the value of the orientation property.
      Property description:
      The orientation of the Separator can either be horizontal or vertical.
      Returns:
      the value of the orientation property
      See Also:
    • orientationProperty

      public final ObjectProperty<Orientation> orientationProperty()
      The orientation of the Separator can either be horizontal or vertical.
      Returns:
      the orientation property
      See Also:
    • setHalignment

      public final void setHalignment(HPos value)
      Sets the value of the halignment property.
      Property description:
      For vertical separators, specifies the horizontal position of the separator line within the separator control's space. Ignored for horizontal separators.
      Parameters:
      value - the value for the halignment property
      See Also:
    • getHalignment

      public final HPos getHalignment()
      Gets the value of the halignment property.
      Property description:
      For vertical separators, specifies the horizontal position of the separator line within the separator control's space. Ignored for horizontal separators.
      Returns:
      the value of the halignment property
      See Also:
    • halignmentProperty

      public final ObjectProperty<HPos> halignmentProperty()
      For vertical separators, specifies the horizontal position of the separator line within the separator control's space. Ignored for horizontal separators.
      Returns:
      the halignment property
      See Also:
    • setValignment

      public final void setValignment(VPos value)
      Sets the value of the valignment property.
      Property description:
      For horizontal separators, specifies the vertical alignment of the separator line within the separator control's space. Ignored for vertical separators.
      Parameters:
      value - the value for the valignment property
      See Also:
    • getValignment

      public final VPos getValignment()
      Gets the value of the valignment property.
      Property description:
      For horizontal separators, specifies the vertical alignment of the separator line within the separator control's space. Ignored for vertical separators.
      Returns:
      the value of the valignment property
      See Also:
    • valignmentProperty

      public final ObjectProperty<VPos> valignmentProperty()
      For horizontal separators, specifies the vertical alignment of the separator line within the separator control's space. Ignored for vertical separators.
      Returns:
      the valignment property
      See Also:
    • createDefaultSkin

      protected Skin<?> createDefaultSkin()
      Create a new instance of the default skin for this control. This is called to create a skin for the control if no skin is provided via CSS -fx-skin or set explicitly in a sub-class with setSkin(...).
      Overrides:
      createDefaultSkin in class Control
      Returns:
      new instance of default skin for this control. If null then the control will have no skin unless one is provided by css.