APIdia Launch Partner
Top Description Fields Constructors Methods
javafx.scene.layout

public final Enum HeaderDragType

extends Enum<HeaderDragType>
Class Inheritance
Imports
javafx.scene.Node, javafx.stage.StageStyle

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

Since
27
See Also
HeaderBar#setDragType(Node, HeaderDragType)

Field Summary

Modifier and TypeField and Description
public static final HeaderDragType
DRAGGABLE

The node is a draggable part of the HeaderBar.

public static final HeaderDragType
DRAGGABLE_SUBTREE

The node and its descendants are a draggable part of the HeaderBar.

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.

public static final HeaderDragType
TRANSPARENT

The node is transparent in regard to draggable-area hit testing.

public static final HeaderDragType
TRANSPARENT_SUBTREE

The node and its descendants are transparent in regard to draggable-area hit testing.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static HeaderDragType
public static HeaderDragType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DRAGGABLEback to summary
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_SUBTREEback to summary
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.

NONEback to summary
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.

TRANSPARENTback to summary
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_SUBTREEback to summary
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.

Constructor Detail

HeaderDragTypeback to summary
private HeaderDragType()

Method Detail

valueOfback to summary
public static HeaderDragType valueOf(String name)
valuesback to summary
public static HeaderDragType[] values()