Top Description Inners Fields Constructors Methods
org.controlsfx.control

public Class PopOver

extends PopupControl
Class Inheritance
Imports
impl.org.controlsfx.skin.PopOverSkin, javafx.animation.FadeTransition, javafx.beans.InvalidationListener, .WeakInvalidationListener, javafx.beans.property.*, javafx.beans.value.ChangeListener, .WeakChangeListener, javafx.event.EventHandler, .WeakEventHandler, javafx.geometry.Bounds, .Insets, javafx.scene.Node, javafx.scene.control.Label, .PopupControl, .Skin, javafx.scene.layout.StackPane, javafx.stage.Window, .WindowEvent, javafx.util.Duration

The PopOver control provides detailed information about an owning node in a popup window. The popup window has a very lightweight appearance (no default window decorations) and an arrow pointing at the owner. Due to the nature of popup windows the PopOver will move around with the parent window when the user drags it.
Screenshot of PopOver

The PopOver can be detached from the owning node by dragging it away from the owner. It stops displaying an arrow and starts displaying a title and a close icon.

Screenshot of a detached PopOver

The following image shows a popover with an accordion content node. PopOver controls are automatically resizing themselves when the content node changes its size.

Screenshot of PopOver containing an Accordion

For styling apply stylesheets to the root pane of the PopOver.

Example:

PopOver popOver = new PopOver();
popOver.getRoot().getStylesheets().add(...);

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
PopOver.ArrowLocation

All possible arrow locations.

Field Summary

Modifier and TypeField and Description
private final SimpleBooleanProperty
private final DoubleProperty
private final ObjectProperty<PopOver.ArrowLocation>
private final DoubleProperty
private final BooleanProperty
private final WeakEventHandler<WindowEvent>
private final EventHandler<WindowEvent>
private final ObjectProperty<Node>
private final DoubleProperty
private static final Duration
private static final String
private final BooleanProperty
private final BooleanProperty
private final ObjectProperty<Duration>
private final ObjectProperty<Duration>
private final BooleanProperty
private final InvalidationListener
private Duration
private Window
private final StackPane
private double
private double
private final StringProperty
private final WeakInvalidationListener
private final WeakChangeListener<Number>
private final WeakChangeListener<Number>
private final ChangeListener<Number>
private final ChangeListener<Number>
Inherited from javafx.scene.control.PopupControl:
bridgeUSE_COMPUTED_SIZEUSE_PREF_SIZE

Constructor Summary

AccessConstructor and Description
public
PopOver()

Creates a pop over with a label as the content node.

public
PopOver(Node
The content shown by the pop over
content
)

Creates a pop over with the given node as the content node.

Method Summary

Modifier and TypeMethod and Description
private void
public final BooleanProperty

Returns:

the "animated" property
animatedProperty
()

Stores the "animated" flag.

public final DoubleProperty

Returns:

the arrow indent property
arrowIndentProperty
()

Controls the distance between the arrow and the corners of the pop over.

public final ObjectProperty<PopOver.ArrowLocation>

Returns:

the arrow location property
arrowLocationProperty
()

Stores the preferred arrow location.

public final DoubleProperty

Returns:

the arrow size property
arrowSizeProperty
()

Controls the size of the arrow.

public final BooleanProperty
closeButtonEnabledProperty()

Determines whether the header's close button should be available.

private double
private double
public final ObjectProperty<Node>

Returns:

the content node property
contentNodeProperty
()

Returns the content shown by the pop over.

public final DoubleProperty

Returns:

the corner radius property (default is 6)
cornerRadiusProperty
()

Returns the corner radius property for the pop over.

protected Skin<?>
createDefaultSkin()

Overrides javafx.scene.control.PopupControl.createDefaultSkin.

Create a new instance of the default skin for this control.

public final void
detach()

Detaches the pop over from the owning node.

public final BooleanProperty
detachableProperty()

Determines if the pop over is detachable at all.

public final BooleanProperty

Returns:

the detached property
detachedProperty
()

Determines whether the pop over is detached from the owning node or not.

public final ObjectProperty<Duration>

Returns:

the fade-in duration property
fadeInDurationProperty
()

Stores the fade-in duration.

public final ObjectProperty<Duration>

Returns:

the fade-out duration property
fadeOutDurationProperty
()

Stores the fade-out duration.

public final double

Returns:

the arrow indent value
getArrowIndent
()

Returns the value of the arrow indent property.

public final PopOver.ArrowLocation

Returns:

the preferred arrow location
getArrowLocation
()

Returns the value of the arrow location property.

public final double

Returns:

the arrow size property value
getArrowSize
()

Returns the value of the arrow size property.

public final Node

Returns:

the content node
getContentNode
()

Returns the value of the content property

public final double

Returns:

the corner radius
getCornerRadius
()

Returns the value of the corner radius property.

public final Duration

Returns:

the fade-in duration
getFadeInDuration
()

Returns the value of the fade-in duration property.

public final Duration

Returns:

the fade-out duration
getFadeOutDuration
()

Returns the value of the fade-out duration property.

public final StackPane

Returns:

the root pane
getRoot
()

The root pane stores the content node of the popover.

public final String

Returns:

the detached title
getTitle
()

Returns the value of the title property.

public final BooleanProperty
headerAlwaysVisibleProperty()

Determines whether the PopOver header should remain visible, even while attached.

public final void
hide()

Overrides javafx.stage.PopupWindow.hide.

Hides the pop over by quickly changing its opacity to 0.

public final void
hide(Duration
the duration of the fade transition that is being used to change the opacity of the pop over
fadeOutDuration
)

Hides the pop over by quickly changing its opacity to 0.

public final boolean

Returns:

true if the PopOver will be shown and hidden with a short fade animation
isAnimated
()

Returns the value of the "animated" property.

public final boolean

Returns:

true if the header's close button is enabled
isCloseButtonEnabled
()

Returns the value of the closeButtonEnabled property.

public final boolean

Returns:

true if the user is allowed to detach / tear off the pop over
isDetachable
()

Returns the value of the detachable property.

public final boolean

Returns:

true if the pop over is currently detached.
isDetached
()

Returns the value of the detached property.

public final boolean

Returns:

true if the header is visible even while attached
isHeaderAlwaysVisible
()

Returns the value of the detachable property.

private void
public final void
setAnimated(boolean
if true the PopOver will be shown and hidden with a short fade animation
animated
)

Sets the value of the "animated" property.

public final void
setArrowIndent(double
the arrow indent value
size
)

Sets the value of the arrow indent property.

public final void
setArrowLocation(PopOver.ArrowLocation
the requested location
location
)

Sets the value of the arrow location property.

public final void
setArrowSize(double
the new value of the arrow size property
size
)

Sets the value of the arrow size property.

public final void
setCloseButtonEnabled(boolean
if false, the pop over will not be closeable by the header's close button
enabled
)

Sets the value of the closeButtonEnabled property.

public final void
setContentNode(Node
the new content node value
content
)

Sets the value of the content property.

public final void
setCornerRadius(double
the corner radius
radius
)

Sets the value of the corner radius property.

public final void
setDetachable(boolean
if true then the user can detach / tear off the pop over
detachable
)

Sets the value of the detachable property.

public final void
setDetached(boolean
if true the pop over will change its apperance to "detached" mode
detached
)

Sets the value of the detached property.

public final void
setFadeInDuration(Duration
the requested fade-in duration
duration
)

Sets the value of the fade-in duration property.

public final void
setFadeOutDuration(Duration
the requested fade-out duration
duration
)

Sets the value of the fade-out duration property.

public final void
setHeaderAlwaysVisible(boolean
if true, then the header is visible even while attached
visible
)

Sets the value of the headerAlwaysVisible property.

public final void
setTitle(String
the title to use when detached
title
)

Sets the value of the title property.

public final void
show(Node
the owner of the pop over
owner
)

Shows the pop over in a position relative to the edges of the given owner node.

public final void
show(Node
the owner of the pop over
owner
,
double
if negative specifies the distance to the owner node or when positive specifies the number of pixels that the arrow will overlap with the owner node (positive values are recommended)
offset
)

Shows the pop over in a position relative to the edges of the given owner node.

public final void
show(Node
the owning node
owner
,
double
the x coordinate for the pop over arrow tip
x
,
double
the y coordinate for the pop over arrow tip
y
,
Duration
the time it takes for the pop over to be fully visible. This duration takes precedence over the fade-in property without setting.
fadeInDuration
)

Makes the pop over visible at the give location and associates it with the given owner node.

private void
showFadeInAnimation(Duration fadeInDuration)

public final StringProperty

Returns:

the title property
titleProperty
()

Stores the title to display in the PopOver's header.

Inherited from javafx.scene.control.PopupControl:
getClassCssMetaDatagetCssMetaDatagetIdgetMaxHeightgetMaxWidthgetMinHeightgetMinWidthgetPrefHeightgetPrefWidthgetPseudoClassStatesgetSkingetStylegetStyleableNodegetStyleableParentgetStyleClassgetTypeSelectoridPropertymaxHeightmaxHeightPropertymaxWidthmaxWidthPropertyminHeightminHeightPropertyminWidthminWidthPropertyprefHeightprefHeightPropertyprefWidthprefWidthPropertypseudoClassStateChangedsetIdsetMaxHeightsetMaxSizesetMaxWidthsetMinHeightsetMinSizesetMinWidthsetPrefHeightsetPrefSizesetPrefWidthsetSkinsetStyleskinPropertystyleProperty

Field Detail

animatedback to summary
private final SimpleBooleanProperty animated
arrowIndentback to summary
private final DoubleProperty arrowIndent
arrowLocationback to summary
private final ObjectProperty<PopOver.ArrowLocation> arrowLocation
arrowSizeback to summary
private final DoubleProperty arrowSize
closeButtonEnabledback to summary
private final BooleanProperty closeButtonEnabled
closePopOverOnOwnerWindowCloseback to summary
private final WeakEventHandler<WindowEvent> closePopOverOnOwnerWindowClose
closePopOverOnOwnerWindowCloseLambdaback to summary
private final EventHandler<WindowEvent> closePopOverOnOwnerWindowCloseLambda
contentNodeback to summary
private final ObjectProperty<Node> contentNode
cornerRadiusback to summary
private final DoubleProperty cornerRadius
DEFAULT_FADE_DURATIONback to summary
private static final Duration DEFAULT_FADE_DURATION
DEFAULT_STYLE_CLASSback to summary
private static final String DEFAULT_STYLE_CLASS
detachableback to summary
private final BooleanProperty detachable
detachedback to summary
private final BooleanProperty detached
fadeInDurationback to summary
private final ObjectProperty<Duration> fadeInDuration
fadeOutDurationback to summary
private final ObjectProperty<Duration> fadeOutDuration
headerAlwaysVisibleback to summary
private final BooleanProperty headerAlwaysVisible
hideListenerback to summary
private final InvalidationListener hideListener
oneTimeFadeInDurationback to summary
private Duration oneTimeFadeInDuration
ownerWindowback to summary
private Window ownerWindow

Hides javafx.stage.PopupWindow.ownerWindow.

rootback to summary
private final StackPane root
targetXback to summary
private double targetX
targetYback to summary
private double targetY
titleback to summary
private final StringProperty title
weakHideListenerback to summary
private final WeakInvalidationListener weakHideListener
weakXListenerback to summary
private final WeakChangeListener<Number> weakXListener
weakYListenerback to summary
private final WeakChangeListener<Number> weakYListener
xListenerback to summary
private final ChangeListener<Number> xListener
yListenerback to summary
private final ChangeListener<Number> yListener

Constructor Detail

PopOverback to summary
public PopOver()

Creates a pop over with a label as the content node.

PopOverback to summary
public PopOver(Node content)

Creates a pop over with the given node as the content node.

Parameters
content:Node

The content shown by the pop over

Method Detail

adjustWindowLocationback to summary
private void adjustWindowLocation()
animatedPropertyback to summary
public final BooleanProperty animatedProperty()

Stores the "animated" flag. If true then the PopOver will be shown / hidden with a short fade in / out animation.

Returns:BooleanProperty

the "animated" property

arrowIndentPropertyback to summary
public final DoubleProperty arrowIndentProperty()

Controls the distance between the arrow and the corners of the pop over. The default value is 12.

Returns:DoubleProperty

the arrow indent property

arrowLocationPropertyback to summary
public final ObjectProperty<PopOver.ArrowLocation> arrowLocationProperty()

Stores the preferred arrow location. This might not be the actual location of the arrow if auto fix is enabled.

Returns:ObjectProperty<PopOver.ArrowLocation>

the arrow location property

See Also
setAutoFix(boolean)
arrowSizePropertyback to summary
public final DoubleProperty arrowSizeProperty()

Controls the size of the arrow. Default value is 12.

Returns:DoubleProperty

the arrow size property

closeButtonEnabledPropertyback to summary
public final BooleanProperty closeButtonEnabledProperty()

Determines whether the header's close button should be available.

computeXOffsetback to summary
private double computeXOffset()
computeYOffsetback to summary
private double computeYOffset()
contentNodePropertyback to summary
public final ObjectProperty<Node> contentNodeProperty()

Returns the content shown by the pop over.

Returns:ObjectProperty<Node>

the content node property

cornerRadiusPropertyback to summary
public final DoubleProperty cornerRadiusProperty()

Returns the corner radius property for the pop over.

Returns:DoubleProperty

the corner radius property (default is 6)

createDefaultSkinback to summary
protected Skin<?> createDefaultSkin()

Overrides javafx.scene.control.PopupControl.createDefaultSkin.

Doc from javafx.scene.control.PopupControl.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(...).

Annotations
@Override
detachback to summary
public final void detach()

Detaches the pop over from the owning node. The pop over will no longer display an arrow pointing at the owner node.

detachablePropertyback to summary
public final BooleanProperty detachableProperty()

Determines if the pop over is detachable at all.

detachedPropertyback to summary
public final BooleanProperty detachedProperty()

Determines whether the pop over is detached from the owning node or not. A detached pop over no longer shows an arrow pointing at the owner and features its own title bar.

Returns:BooleanProperty

the detached property

fadeInDurationPropertyback to summary
public final ObjectProperty<Duration> fadeInDurationProperty()

Stores the fade-in duration. This should be set before calling PopOver.show(..).

Returns:ObjectProperty<Duration>

the fade-in duration property

fadeOutDurationPropertyback to summary
public final ObjectProperty<Duration> fadeOutDurationProperty()

Stores the fade-out duration.

Returns:ObjectProperty<Duration>

the fade-out duration property

getArrowIndentback to summary
public final double getArrowIndent()

Returns the value of the arrow indent property.

Returns:double

the arrow indent value

See Also
arrowIndentProperty()
getArrowLocationback to summary
public final PopOver.ArrowLocation getArrowLocation()

Returns the value of the arrow location property.

Returns:PopOver.ArrowLocation

the preferred arrow location

See Also
arrowLocationProperty()
getArrowSizeback to summary
public final double getArrowSize()

Returns the value of the arrow size property.

Returns:double

the arrow size property value

See Also
arrowSizeProperty()
getContentNodeback to summary
public final Node getContentNode()

Returns the value of the content property

Returns:Node

the content node

See Also
contentNodeProperty()
getCornerRadiusback to summary
public final double getCornerRadius()

Returns the value of the corner radius property.

Returns:double

the corner radius

See Also
cornerRadiusProperty()
getFadeInDurationback to summary
public final Duration getFadeInDuration()

Returns the value of the fade-in duration property.

Returns:Duration

the fade-in duration

See Also
fadeInDurationProperty()
getFadeOutDurationback to summary
public final Duration getFadeOutDuration()

Returns the value of the fade-out duration property.

Returns:Duration

the fade-out duration

See Also
fadeOutDurationProperty()
getRootback to summary
public final StackPane getRoot()

The root pane stores the content node of the popover. It is accessible via this method in order to support proper styling.

Example:

PopOver popOver = new PopOver();
popOver.getRoot().getStylesheets().add(...);
Returns:StackPane

the root pane

getTitleback to summary
public final String getTitle()

Returns the value of the title property.

Returns:String

the detached title

See Also
titleProperty()
headerAlwaysVisiblePropertyback to summary
public final BooleanProperty headerAlwaysVisibleProperty()

Determines whether the PopOver header should remain visible, even while attached.

hideback to summary
public final void hide()

Overrides javafx.stage.PopupWindow.hide.

Hides the pop over by quickly changing its opacity to 0.

Annotations
@Override
See Also
hide(Duration)
hideback to summary
public final void hide(Duration fadeOutDuration)

Hides the pop over by quickly changing its opacity to 0.

Parameters
fadeOutDuration:Duration

the duration of the fade transition that is being used to change the opacity of the pop over

Since
1.0
isAnimatedback to summary
public final boolean isAnimated()

Returns the value of the "animated" property.

Returns:boolean

true if the PopOver will be shown and hidden with a short fade animation

See Also
animatedProperty()
isCloseButtonEnabledback to summary
public final boolean isCloseButtonEnabled()

Returns the value of the closeButtonEnabled property.

Returns:boolean

true if the header's close button is enabled

See Also
closeButtonEnabledProperty()
isDetachableback to summary
public final boolean isDetachable()

Returns the value of the detachable property.

Returns:boolean

true if the user is allowed to detach / tear off the pop over

See Also
detachableProperty()
isDetachedback to summary
public final boolean isDetached()

Returns the value of the detached property.

Returns:boolean

true if the pop over is currently detached.

See Also
detachedProperty()
isHeaderAlwaysVisibleback to summary
public final boolean isHeaderAlwaysVisible()

Returns the value of the detachable property.

Returns:boolean

true if the header is visible even while attached

See Also
headerAlwaysVisibleProperty()
ownerWindowHidingback to summary
private void ownerWindowHiding()
setAnimatedback to summary
public final void setAnimated(boolean animated)

Sets the value of the "animated" property.

Parameters
animated:boolean

if true the PopOver will be shown and hidden with a short fade animation

See Also
animatedProperty()
setArrowIndentback to summary
public final void setArrowIndent(double size)

Sets the value of the arrow indent property.

Parameters
size:double

the arrow indent value

See Also
arrowIndentProperty()
setArrowLocationback to summary
public final void setArrowLocation(PopOver.ArrowLocation location)

Sets the value of the arrow location property.

Parameters
location:PopOver.ArrowLocation

the requested location

See Also
arrowLocationProperty()
setArrowSizeback to summary
public final void setArrowSize(double size)

Sets the value of the arrow size property.

Parameters
size:double

the new value of the arrow size property

See Also
arrowSizeProperty()
setCloseButtonEnabledback to summary
public final void setCloseButtonEnabled(boolean enabled)

Sets the value of the closeButtonEnabled property.

Parameters
enabled:boolean

if false, the pop over will not be closeable by the header's close button

See Also
closeButtonEnabledProperty()
setContentNodeback to summary
public final void setContentNode(Node content)

Sets the value of the content property.

Parameters
content:Node

the new content node value

See Also
contentNodeProperty()
setCornerRadiusback to summary
public final void setCornerRadius(double radius)

Sets the value of the corner radius property.

Parameters
radius:double

the corner radius

See Also
cornerRadiusProperty()
setDetachableback to summary
public final void setDetachable(boolean detachable)

Sets the value of the detachable property.

Parameters
detachable:boolean

if true then the user can detach / tear off the pop over

See Also
detachableProperty()
setDetachedback to summary
public final void setDetached(boolean detached)

Sets the value of the detached property.

Parameters
detached:boolean

if true the pop over will change its apperance to "detached" mode

See Also
detachedProperty()
setFadeInDurationback to summary
public final void setFadeInDuration(Duration duration)

Sets the value of the fade-in duration property. This should be set before calling PopOver.show(..).

Parameters
duration:Duration

the requested fade-in duration

See Also
fadeInDurationProperty()
setFadeOutDurationback to summary
public final void setFadeOutDuration(Duration duration)

Sets the value of the fade-out duration property.

Parameters
duration:Duration

the requested fade-out duration

See Also
fadeOutDurationProperty()
setHeaderAlwaysVisibleback to summary
public final void setHeaderAlwaysVisible(boolean visible)

Sets the value of the headerAlwaysVisible property.

Parameters
visible:boolean

if true, then the header is visible even while attached

See Also
headerAlwaysVisibleProperty()
setTitleback to summary
public final void setTitle(String title)

Sets the value of the title property.

Parameters
title:String

the title to use when detached

See Also
titleProperty()
showback to summary
public final void show(Node owner)

Shows the pop over in a position relative to the edges of the given owner node. The position is dependent on the arrow location. If the arrow is pointing to the right then the pop over will be placed to the left of the given owner. If the arrow points up then the pop over will be placed below the given owner node. The arrow will slightly overlap with the owner node.

Parameters
owner:Node

the owner of the pop over

showback to summary
public final void show(Node owner, double offset)

Shows the pop over in a position relative to the edges of the given owner node. The position is dependent on the arrow location. If the arrow is pointing to the right then the pop over will be placed to the left of the given owner. If the arrow points up then the pop over will be placed below the given owner node.

Parameters
owner:Node

the owner of the pop over

offset:double

if negative specifies the distance to the owner node or when positive specifies the number of pixels that the arrow will overlap with the owner node (positive values are recommended)

showback to summary
public final void show(Node owner, double x, double y, Duration fadeInDuration)

Makes the pop over visible at the give location and associates it with the given owner node. The x and y coordinate will be the target location of the arrow of the pop over and not the location of the window.

Parameters
owner:Node

the owning node

x:double

the x coordinate for the pop over arrow tip

y:double

the y coordinate for the pop over arrow tip

fadeInDuration:Duration

the time it takes for the pop over to be fully visible. This duration takes precedence over the fade-in property without setting.

showFadeInAnimationback to summary
private void showFadeInAnimation(Duration fadeInDuration)
titlePropertyback to summary
public final StringProperty titleProperty()

Stores the title to display in the PopOver's header.

Returns:StringProperty

the title property

org.controlsfx.control back to summary

public final Enum PopOver.ArrowLocation

extends Enum<PopOver.ArrowLocation>
Class Inheritance

All possible arrow locations.

Field Summary

Modifier and TypeField and Description
public static final PopOver.ArrowLocation
public static final PopOver.ArrowLocation
public static final PopOver.ArrowLocation
public static final PopOver.ArrowLocation
public static final PopOver.ArrowLocation
public static final PopOver.ArrowLocation
public static final PopOver.ArrowLocation
public static final PopOver.ArrowLocation
public static final PopOver.ArrowLocation
public static final PopOver.ArrowLocation
public static final PopOver.ArrowLocation
public static final PopOver.ArrowLocation

Constructor Summary

AccessConstructor and Description
private

Method Summary

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

Field Detail

BOTTOM_CENTERback to summary
public static final PopOver.ArrowLocation BOTTOM_CENTER
BOTTOM_LEFTback to summary
public static final PopOver.ArrowLocation BOTTOM_LEFT
BOTTOM_RIGHTback to summary
public static final PopOver.ArrowLocation BOTTOM_RIGHT
LEFT_BOTTOMback to summary
public static final PopOver.ArrowLocation LEFT_BOTTOM
LEFT_CENTERback to summary
public static final PopOver.ArrowLocation LEFT_CENTER
LEFT_TOPback to summary
public static final PopOver.ArrowLocation LEFT_TOP
RIGHT_BOTTOMback to summary
public static final PopOver.ArrowLocation RIGHT_BOTTOM
RIGHT_CENTERback to summary
public static final PopOver.ArrowLocation RIGHT_CENTER
RIGHT_TOPback to summary
public static final PopOver.ArrowLocation RIGHT_TOP
TOP_CENTERback to summary
public static final PopOver.ArrowLocation TOP_CENTER
TOP_LEFTback to summary
public static final PopOver.ArrowLocation TOP_LEFT
TOP_RIGHTback to summary
public static final PopOver.ArrowLocation TOP_RIGHT

Constructor Detail

ArrowLocationback to summary
private ArrowLocation()

Method Detail

valueOfback to summary
public static PopOver.ArrowLocation valueOf(String name)
valuesback to summary
public static PopOver.ArrowLocation[] values()