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 |
consumeAutoHidingEvents
Specifies whether the event, which caused the Popup to hide, should be
consumed.
|
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.
|
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.
|
BooleanProperty |
consumeAutoHidingEventsProperty()
Specifies whether the event, which caused the Popup to hide, should be
consumed.
|
boolean |
getConsumeAutoHidingEvents() |
EventHandler<Event> |
getOnAutoHide()
Gets the value of the property onAutoHide.
|
Node |
getOwnerNode()
Gets the value of the property ownerNode.
|
Window |
getOwnerWindow()
Gets the value of the property ownerWindow.
|
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()
Gets the value of the property autoFix.
|
boolean |
isAutoHide()
Gets the value of the property autoHide.
|
boolean |
isHideOnEscape()
Gets the value of the property hideOnEscape.
|
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)
Sets the value of the property autoFix.
|
void |
setAutoHide(boolean value)
Sets the value of the property autoHide.
|
void |
setConsumeAutoHidingEvents(boolean value)
Sets the value of the property consumeAutoHidingEvents.
|
void |
setHideOnEscape(boolean value)
Sets the value of the property hideOnEscape.
|
void |
setOnAutoHide(EventHandler<Event> value)
Sets the value of the property onAutoHide.
|
protected void |
setScene(Scene scene)
Note to subclasses: the scene used by PopupWindow is very specifically
managed by PopupWindow.
|
void |
show(Node ownerNode,
double screenX,
double screenY)
Shows 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
public final ReadOnlyObjectProperty<Window> ownerWindowProperty
getOwnerWindow()
public final ReadOnlyObjectProperty<Node> ownerNodeProperty
getOwnerNode()
public final BooleanProperty autoFixProperty
isAutoFix()
,
setAutoFix(boolean)
public final BooleanProperty autoHideProperty
isAutoHide()
,
setAutoHide(boolean)
public final ObjectProperty<EventHandler<Event>> onAutoHideProperty
getOnAutoHide()
,
setOnAutoHide(EventHandler)
public final BooleanProperty hideOnEscapeProperty
isHideOnEscape()
,
setHideOnEscape(boolean)
public final BooleanProperty consumeAutoHidingEventsProperty
setConsumeAutoHidingEvents(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 final void setConsumeAutoHidingEvents(boolean value)
public final boolean getConsumeAutoHidingEvents()
public final BooleanProperty consumeAutoHidingEventsProperty()
setConsumeAutoHidingEvents(boolean)
public void show(Window owner)
owner
- The owner of the popup. This must not be null.java.lang.NullPointerException
- if owner is nulljava.lang.IllegalArgumentException
- if the specified owner window would
create cycle in the window hierarchypublic void show(Node ownerNode, double screenX, double screenY)
Window
which contains the owner node at the time of the call becomes an owner
window of the displayed popup.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.java.lang.NullPointerException
- if ownerNode is nulljava.lang.IllegalArgumentException
- if the specified owner node is not
associated with a Window or when the window would create cycle
in the window hierarchypublic 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.java.lang.NullPointerException
- if ownerWindow is nulljava.lang.IllegalArgumentException
- if the specified owner window would
create cycle in the window hierarchyCopyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. Use is subject to