HeaderDragType (JavaFX 27)
Description: declaration: module: javafx.graphics, package: javafx.scene.layout, enum: HeaderDragType

# Enum Class HeaderDragType

java.lang.Object
java.lang.Enum<HeaderDragType>
javafx.scene.layout.HeaderDragType

All Implemented Interfaces:
  `Serializable, Comparable<HeaderDragType>, Constable`

public enum HeaderDragType extends Enum<HeaderDragType>
Specifies how a `Node` participates in `HeaderBar` draggable-area hit testing.

In stages with the `StageStyle.EXTENDED` style, the window can be moved (and on some platforms, resized near the top edge) by interacting with a draggable area. `HeaderBar` provides such an area in the scene graph, and uses `HeaderDragType` flags on nodes to decide which parts of the scene graph count as draggable, block an underlying draggable area, or are ignored during draggable area hit testing.

## Recommended usage

- Mark non-interactive "blank" areas as `DRAGGABLE` / `DRAGGABLE_SUBTREE`.
- Do not mark interactive controls (buttons, menu bars, text inputs) as draggable; use `NONE` on controls if you need them to explicitly opt out or stop inheritance.
- Mark overlays that may cover the header area as `TRANSPARENT` / `TRANSPARENT_SUBTREE` so they do not obstruct existing draggable areas.

Since:
  27
See Also:
  - `HeaderBar.setDragType(Node, HeaderDragType)`

- ## Nested Class Summary

  ### Nested classes/interfaces declared in class Enum

  `Enum.EnumDesc<E>`

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `DRAGGABLE`
  The node is a draggable part of the `HeaderBar`.
  `DRAGGABLE_SUBTREE`
  The node and its descendants are a draggable part of the `HeaderBar`.
  `NONE`
  The node and its descendants are not a draggable part of the `HeaderBar`, and not transparent in regard to draggable-area hit testing.
  `TRANSPARENT`
  The node is transparent in regard to draggable-area hit testing.
  `TRANSPARENT_SUBTREE`
  The node and its descendants are transparent in regard to draggable-area hit testing.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static HeaderDragType`
  `valueOf(String name)`
  Returns the enum constant of this class with the specified name.
  `static HeaderDragType[]`
  `values()`
  Returns an array containing the constants of this enum class, in the order they are declared.

  ### Methods declared in class Enum

  `clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

  ### Methods declared in class Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Enum Constant Details

  - ### NONE

    public static final HeaderDragType NONE
    The node and its descendants are not a draggable part of the `HeaderBar`, and not transparent in regard to draggable-area hit testing. Explicitly opting out of draggability can be useful for controls that are flush with the top edge (for example a `MenuBar`), where some platforms may otherwise prioritize a window resize border over control interaction.

    If the node inherits `DRAGGABLE_SUBTREE` or `TRANSPARENT_SUBTREE` from its parent, the inheritance stops and descendants of the node will not inherit either drag type.

  - ### DRAGGABLE

    public static final HeaderDragType DRAGGABLE
    The node is a draggable part of the `HeaderBar`.

    This drag type is only relevant for nodes that are descendants of the header bar. When set on a node, the node participates in draggable-area hit testing. If the node extends beyond the header bar, the effective draggable area is extended accordingly.

    An interactive node (for example, a `Control`) should not be draggable. This can cause problems as both the header bar and the interactive node may react to mouse events in incompatible ways.

    This drag type does not apply to descendants of the node on which it is set. However, it does not stop an inherited `DRAGGABLE_SUBTREE` drag type from being inherited by descendants of the node.

  - ### DRAGGABLE_SUBTREE

    public static final HeaderDragType DRAGGABLE_SUBTREE
    The node and its descendants are a draggable part of the `HeaderBar`.

    This drag type is only relevant for nodes that are descendants of the header bar. When set on a node, the node and its descendants participate in draggable-area hit testing. If the node or its descendants extend beyond the header bar, the effective draggable area is extended accordingly.

    An interactive node (for example, a `Control`) should not be draggable. This can cause problems as both the header bar and the interactive node may react to mouse events in incompatible ways.

    This drag type is inherited by descendants of the node until a descendant specifies `NONE`.

  - ### TRANSPARENT

    public static final HeaderDragType TRANSPARENT
    The node is transparent in regard to draggable-area hit testing.

    In contrast to `DRAGGABLE`, which positively identifies a node as a draggable part of the `HeaderBar`, this option excludes a node from draggable-area hit testing: the header bar behaves as if the node was not present and continues hit testing unimpeded. The next eligible node behind the transparent node is then considered for determining whether the location is part of a draggable header area.

    This drag type can be used not only on descendants of the header bar, but also on other nodes that may overlap it (for example, a sibling shown on top of the header bar). In that case, the overlapping node behaves as if it were draggable, but only where it overlaps a draggable area of the header bar; it does not create any additional draggable area.

    An interactive node (for example, a `Control`) should not be transparent in regard to draggable area hit testing. This can cause problems as both the header bar and the interactive node may react to mouse events in incompatible ways.

    This drag type does not apply to descendants of the node on which it is set. However, it does not stop an inherited `TRANSPARENT_SUBTREE` drag type from being inherited by descendants of the node.

  - ### TRANSPARENT_SUBTREE

    public static final HeaderDragType TRANSPARENT_SUBTREE
    The node and its descendants are transparent in regard to draggable-area hit testing.

    In contrast to `DRAGGABLE_SUBTREE`, which positively identifies a node and its descendants as a draggable part of the `HeaderBar`, this option excludes a node and its descendants from draggable-area hit testing: the header bar behaves as if the node and its descendants were not present and continues hit testing unimpeded. The next eligible node behind the transparent node is then considered for determining whether the location is part of a draggable header area.

    This drag type can be used not only on descendants of the header bar, but also on other nodes that may overlap it (for example, a sibling shown on top of the header bar). In that case, the overlapping node and its descendants behave as if they were draggable, but only where they overlap a draggable area of the header bar; they do not create any additional draggable area.

    An interactive node (for example, a `Control`) should not be transparent in regard to draggable area hit testing. This can cause problems as both the header bar and the interactive node may react to mouse events in incompatible ways.

    This drag type is inherited by descendants of the node until a descendant specifies `NONE`.

- ## Method Details

  - ### values

    public static HeaderDragType[] values()
    Returns an array containing the constants of this enum class, in the order they are declared.
    Returns:
      an array containing the constants of this enum class, in the order they are declared

  - ### valueOf

    public static HeaderDragType valueOf(String name)
    Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
    Parameters:
      `name` - the name of the enum constant to be returned.
    Returns:
      the enum constant with the specified name
    Throws:
      `IllegalArgumentException` - if this enum class has no constant with the specified name
      `NullPointerException` - if the argument is null