Spec-Zone .ru
спецификации, руководства, описания, API
|
public abstract class PopupWindow extends Window
Popup
and Tooltip
and ContextMenu
.
A PopupWindow is a secondary window which has no window decorations or title bar. It doesn't show up in the OS as a top-level window. It is typically used for tool tip like notification, drop down boxes, menus, and so forth.
The PopupWindow cannot be shown without an owner. PopupWindows require that an owner window exist in order to be shown. However, it is possible to create a PopupWindow ahead of time and simply set the owner (or change the owner) before first being made visible. Attempting to change the owner while the PopupWindow is visible will result in an IllegalStateException.
The PopupWindow encapsulates much of the behavior and functionality common to popups, such as the ability to close when the "esc" key is pressed, or the ability to hide all child popup windows whenever this window is hidden. These abilities can be enabled or disabled via properties.
Type | Property and Description |
---|---|
BooleanProperty |
autoFix
This convenience variable indicates whether, when the popup is shown,
it should automatically correct its position such that it doesn't end
up positioned off the screen.
|
BooleanProperty |
autoHide
Specifies whether Popups should auto hide.
|
BooleanProperty |
hideOnEscape
Specifies whether the PopupWindow should be hidden when an unhandled escape key
is pressed while the popup has focus.
|
ObjectProperty<EventHandler<Event>> |
onAutoHide
Called after autoHide is run.
|
ReadOnlyObjectProperty<Node> |
ownerNode
The node which is the owner of this popup.
|
ReadOnlyObjectProperty<Window> |
ownerWindow
The window which is the parent of this popup.
|
eventDispatcherProperty, focusedProperty, heightProperty, onCloseRequestProperty, onHiddenProperty, onHidingProperty, onShowingProperty, onShownProperty, opacityProperty, sceneProperty, showingProperty, widthProperty, xProperty, yProperty
Constructor and Description |
---|
PopupWindow() |
Modifier and Type | Method and Description |
---|---|
BooleanProperty |
autoFixProperty()
This convenience variable indicates whether, when the popup is shown,
it should automatically correct its position such that it doesn't end
up positioned off the screen.
|
BooleanProperty |
autoHideProperty()
Specifies whether Popups should auto hide.
|
EventHandler<Event> |
getOnAutoHide()
Called after autoHide is run.
|
Node |
getOwnerNode()
The node which is the owner of this popup.
|
Window |
getOwnerWindow()
The window which is the parent of this popup.
|
void |
hide()
Hide this Popup and all its children
|
BooleanProperty |
hideOnEscapeProperty()
Specifies whether the PopupWindow should be hidden when an unhandled escape key
is pressed while the popup has focus.
|
boolean |
isAutoFix()
This convenience variable indicates whether, when the popup is shown,
it should automatically correct its position such that it doesn't end
up positioned off the screen.
|
boolean |
isAutoHide()
Specifies whether Popups should auto hide.
|
boolean |
isHideOnEscape()
Specifies whether the PopupWindow should be hidden when an unhandled escape key
is pressed while the popup has focus.
|
ObjectProperty<EventHandler<Event>> |
onAutoHideProperty()
Called after autoHide is run.
|
ReadOnlyObjectProperty<Node> |
ownerNodeProperty()
The node which is the owner of this popup.
|
ReadOnlyObjectProperty<Window> |
ownerWindowProperty()
The window which is the parent of this popup.
|
void |
setAutoFix(boolean value)
This convenience variable indicates whether, when the popup is shown,
it should automatically correct its position such that it doesn't end
up positioned off the screen.
|
void |
setAutoHide(boolean value)
Specifies whether Popups should auto hide.
|
void |
setHideOnEscape(boolean value)
Specifies whether the PopupWindow should be hidden when an unhandled escape key
is pressed while the popup has focus.
|
void |
setOnAutoHide(EventHandler<Event> value)
Called after autoHide is run.
|
protected void |
setScene(Scene scene)
Note to subclasses: the scene used by PopupWindow is very specifically
managed by PopupWindow, along with the root node.
|
void |
show(Node ownerNode,
double screenX,
double screenY)
Show the Popup at the specified x,y location relative to the screen
|
void |
show(Window owner)
Show the popup.
|
void |
show(Window ownerWindow,
double screenX,
double screenY)
Show the Popup at the specified x,y location relative to the screen
|
addEventFilter, addEventHandler, buildEventDispatchChain, centerOnScreen, eventDispatcherProperty, fireEvent, focusedProperty, getEventDispatcher, getHeight, getOnCloseRequest, getOnHidden, getOnHiding, getOnShowing, getOnShown, getOpacity, getScene, getWidth, getX, getY, heightProperty, isFocused, isShowing, onCloseRequestProperty, onHiddenProperty, onHidingProperty, onShowingProperty, onShownProperty, opacityProperty, removeEventFilter, removeEventHandler, requestFocus, sceneProperty, setEventDispatcher, setEventHandler, setHeight, setOnCloseRequest, setOnHidden, setOnHiding, setOnShowing, setOnShown, setOpacity, setWidth, setX, setY, show, showingProperty, sizeToScene, widthProperty, xProperty, yProperty
getOwnerWindow()
getOwnerNode()
isAutoFix()
,
setAutoFix(boolean)
isAutoHide()
,
setAutoHide(boolean)
getOnAutoHide()
,
setOnAutoHide(EventHandler)
isHideOnEscape()
,
setHideOnEscape(boolean)
public final Window getOwnerWindow()
public final ReadOnlyObjectProperty<Window> ownerWindowProperty()
getOwnerWindow()
public final Node getOwnerNode()
public final ReadOnlyObjectProperty<Node> ownerNodeProperty()
getOwnerNode()
protected final void setScene(Scene scene)
public final void setAutoFix(boolean value)
public final boolean isAutoFix()
public final BooleanProperty autoFixProperty()
isAutoFix()
,
setAutoFix(boolean)
public final void setAutoHide(boolean value)
public final boolean isAutoHide()
public final BooleanProperty autoHideProperty()
isAutoHide()
,
setAutoHide(boolean)
public final void setOnAutoHide(EventHandler<Event> value)
public final EventHandler<Event> getOnAutoHide()
public final ObjectProperty<EventHandler<Event>> onAutoHideProperty()
getOnAutoHide()
,
setOnAutoHide(EventHandler)
public final void setHideOnEscape(boolean value)
public final boolean isHideOnEscape()
public final BooleanProperty hideOnEscapeProperty()
isHideOnEscape()
,
setHideOnEscape(boolean)
public void show(Window owner)
owner
- The owner of the popup. This must not be null.public void show(Node ownerNode, double screenX, double screenY)
ownerNode
- The owner Node of the popup. It must not be null
and must be associated with a Window.screenX
- the x location in screen coordinates at which to
show this PopupWindow.screenY
- the y location in screen coordiates at which to
show this PopupWindow.public void show(Window ownerWindow, double screenX, double screenY)
ownerWindow
- The owner of the popup. This must not be null.screenX
- the x location in screen coordinates at which to
show this PopupWindow.screenY
- the y location in screen coordiates at which to
show this PopupWindow.Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. Use is subject to