public class PopupControl extends PopupWindow implements Skinnable, Styleable
Modifier and Type | Class and Description |
---|---|
protected class |
PopupControl.CSSBridge
The link between the popup window and the scenegraph.
|
PopupWindow.AnchorLocation
Modifier and Type | Field and Description |
---|---|
protected PopupControl.CSSBridge |
bridge
We need a special root node, except we can't replace the special
root node already in the PopupControl.
|
private java.lang.String |
currentSkinClassName
Keeps a reference to the name of the class currently acting as the skin.
|
private DoubleProperty |
maxHeight
Property for overriding the control's computed maximum height.
|
private double |
maxHeightCache |
private DoubleProperty |
maxWidth
Property for overriding the control's computed maximum width.
|
private double |
maxWidthCache |
private DoubleProperty |
minHeight
Property for overriding the control's computed minimum height.
|
private double |
minHeightCache |
private DoubleProperty |
minWidth
Property for overriding the control's computed minimum width.
|
private double |
minWidthCache |
private DoubleProperty |
prefHeight
Property for overriding the control's computed preferred height.
|
private double |
prefHeightCache |
private DoubleProperty |
prefWidth
Property for overriding the control's computed preferred width.
|
private double |
prefWidthCache
Cached prefWidth, prefHeight, minWidth, minHeight.
|
private ObjectProperty<Skin<?>> |
skin |
private static CssMetaData<PopupControl.CSSBridge,java.lang.String> |
SKIN
*
StyleSheet Handling *
*
|
private StringProperty |
skinClassName
A property that acts as a proxy between the skin property and css.
|
private boolean |
skinSizeComputed |
private static java.util.List<CssMetaData<? extends Styleable,?>> |
STYLEABLES |
static double |
USE_COMPUTED_SIZE
Sentinel value which can be passed to a control's setMinWidth(), setMinHeight(),
setPrefWidth(), setPrefHeight(), setMaxWidth(), setMaxHeight() methods
to reset the control's size constraint back to it's intrinsic size returned
by computeMinWidth(), computeMinHeight(), computePrefWidth(), computePrefHeight(),
computeMaxWidth(), or computeMaxHeight().
|
static double |
USE_PREF_SIZE
Sentinel value which can be passed to a control's setMinWidth(), setMinHeight(),
setMaxWidth() or setMaxHeight() methods to indicate that the preferred dimension
should be used for that max and/or min constraint.
|
impl_peer, peerListener
Constructor and Description |
---|
PopupControl()
Create a new empty PopupControl.
|
Modifier and Type | Method and Description |
---|---|
protected Skin<?> |
createDefaultSkin()
Create a new instance of the default skin for this control.
|
static java.util.List<CssMetaData<? extends Styleable,?>> |
getClassCssMetaData() |
java.util.List<CssMetaData<? extends Styleable,?>> |
getCssMetaData()
The CssMetaData of this Styleable.
|
java.lang.String |
getId()
The id of this
PopupControl . |
double |
getMaxHeight()
Property for overriding the control's computed maximum height.
|
double |
getMaxWidth()
Property for overriding the control's computed maximum width.
|
double |
getMinHeight()
Property for overriding the control's computed minimum height.
|
double |
getMinWidth()
Property for overriding the control's computed minimum width.
|
double |
getPrefHeight()
Property for overriding the control's computed preferred height.
|
double |
getPrefWidth()
Property for overriding the control's computed preferred width.
|
ObservableSet<PseudoClass> |
getPseudoClassStates()
Return the pseudo-class state of this Styleable.
|
Skin<?> |
getSkin()
Returns the skin that renders this
Control |
private Node |
getSkinNode()
Gets the Skin's node, or returns null if there is no Skin.
|
java.lang.String |
getStyle()
A string representation of the CSS style associated with this
specific
PopupControl . |
Styleable |
getStyleableParent()
Return the parent of this Styleable, or null if there is no parent.
|
ObservableList<java.lang.String> |
getStyleClass()
Returns the list of String identifiers that make up the styleClass
for this PopupControl.
|
java.lang.String |
getTypeSelector()
The type of this
Styleable that is to be used in selector matching. |
StringProperty |
idProperty()
The id of this
PopupControl . |
Node |
impl_styleableGetNode()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
double |
maxHeight(double width)
Called during layout to determine the maximum height for this node.
|
DoubleProperty |
maxHeightProperty() |
double |
maxWidth(double height)
Called during layout to determine the maximum width for this node.
|
DoubleProperty |
maxWidthProperty() |
double |
minHeight(double width)
Called during layout to determine the minimum height for this node.
|
DoubleProperty |
minHeightProperty() |
double |
minWidth(double height)
Called during layout to determine the minimum width for this node.
|
DoubleProperty |
minWidthProperty() |
double |
prefHeight(double width)
Called during layout to determine the preferred height for this node.
|
DoubleProperty |
prefHeightProperty() |
double |
prefWidth(double height)
Called during layout to determine the preferred width for this node.
|
DoubleProperty |
prefWidthProperty() |
void |
pseudoClassStateChanged(PseudoClass pseudoClass,
boolean active) |
private double |
recalculateMaxHeight(double width) |
private double |
recalculateMaxWidth(double height) |
private double |
recalculateMinHeight(double width) |
private double |
recalculateMinWidth(double height) |
private double |
recalculatePrefHeight(double width) |
private double |
recalculatePrefWidth(double height) |
private void |
recomputeSkinSize() |
void |
setId(java.lang.String value)
Sets the id of this
PopupControl . |
void |
setMaxHeight(double value)
Property for overriding the control's computed maximum height.
|
void |
setMaxSize(double maxWidth,
double maxHeight)
Convenience method for overriding the control's computed maximum width and height.
|
void |
setMaxWidth(double value)
Property for overriding the control's computed maximum width.
|
void |
setMinHeight(double value)
Property for overriding the control's computed minimum height.
|
void |
setMinSize(double minWidth,
double minHeight)
Convenience method for overriding the control's computed minimum width and height.
|
void |
setMinWidth(double value)
Property for overriding the control's computed minimum width.
|
void |
setPrefHeight(double value)
Property for overriding the control's computed preferred height.
|
void |
setPrefSize(double prefWidth,
double prefHeight)
Convenience method for overriding the control's computed preferred width and height.
|
void |
setPrefWidth(double value)
Property for overriding the control's computed preferred width.
|
void |
setSkin(Skin<?> value)
Sets the skin that will render this
Control |
void |
setStyle(java.lang.String value)
A string representation of the CSS style associated with this
specific
PopupControl . |
private StringProperty |
skinClassNameProperty() |
ObjectProperty<Skin<?>> |
skinProperty()
Skin is responsible for rendering this
PopupControl . |
StringProperty |
styleProperty() |
anchorLocationProperty, anchorXProperty, anchorYProperty, autoFixProperty, autoHideProperty, consumeAutoHidingEventsProperty, getAnchorLocation, getAnchorX, getAnchorY, getConsumeAutoHidingEvents, getContent, getOnAutoHide, getOwnerNode, getOwnerWindow, hide, hideOnEscapeProperty, impl_visibleChanged, impl_visibleChanging, isAutoFix, isAutoHide, isHideOnEscape, onAutoHideProperty, ownerNodeProperty, ownerWindowProperty, setAnchorLocation, setAnchorX, setAnchorY, setAutoFix, setAutoHide, setConsumeAutoHidingEvents, setHideOnEscape, setOnAutoHide, setScene, show, show, show
addEventFilter, addEventHandler, buildEventDispatchChain, centerOnScreen, eventDispatcherProperty, fireEvent, focusedProperty, getEventDispatcher, getHeight, getOnCloseRequest, getOnHidden, getOnHiding, getOnShowing, getOnShown, getOpacity, getProperties, getScene, getUserData, getWidth, getX, getY, hasProperties, heightProperty, impl_getMXWindowType, impl_getPeer, impl_getWindows, isFocused, isShowing, onCloseRequestProperty, onHiddenProperty, onHidingProperty, onShowingProperty, onShownProperty, opacityProperty, removeEventFilter, removeEventHandler, requestFocus, sceneProperty, setEventDispatcher, setEventHandler, setFocused, setHeight, setOnCloseRequest, setOnHidden, setOnHiding, setOnShowing, setOnShown, setOpacity, setUserData, setWidth, setX, setY, show, showingProperty, sizeToScene, widthProperty, xProperty, yProperty
public static final double USE_PREF_SIZE
public static final double USE_COMPUTED_SIZE
protected PopupControl.CSSBridge bridge
private final ObjectProperty<Skin<?>> skin
private java.lang.String currentSkinClassName
private StringProperty skinClassName
private DoubleProperty minWidth
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getMinWidth(forHeight)
will return the control's internally
computed minimum width.
Setting this value to the USE_PREF_SIZE
flag will cause
getMinWidth(forHeight)
to return the control's preferred width,
enabling applications to easily restrict the resizability of the control.
private DoubleProperty minHeight
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getMinHeight(forWidth)
will return the control's internally
computed minimum height.
Setting this value to the USE_PREF_SIZE
flag will cause
getMinHeight(forWidth)
to return the control's preferred height,
enabling applications to easily restrict the resizability of the control.
private DoubleProperty prefWidth
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getPrefWidth(forHeight)
will return the control's internally
computed preferred width.
private DoubleProperty prefHeight
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getPrefHeight(forWidth)
will return the control's internally
computed preferred width.
private DoubleProperty maxWidth
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getMaxWidth(forHeight)
will return the control's internally
computed maximum width.
Setting this value to the USE_PREF_SIZE
flag will cause
getMaxWidth(forHeight)
to return the control's preferred width,
enabling applications to easily restrict the resizability of the control.
private DoubleProperty maxHeight
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getMaxHeight(forWidth)
will return the control's internally
computed maximum height.
Setting this value to the USE_PREF_SIZE
flag will cause
getMaxHeight(forWidth)
to return the control's preferred height,
enabling applications to easily restrict the resizability of the control.
private double prefWidthCache
private double prefHeightCache
private double minWidthCache
private double minHeightCache
private double maxWidthCache
private double maxHeightCache
private boolean skinSizeComputed
private static final CssMetaData<PopupControl.CSSBridge,java.lang.String> SKIN
private static final java.util.List<CssMetaData<? extends Styleable,?>> STYLEABLES
public final StringProperty idProperty()
PopupControl
. This simple string identifier is useful for
finding a specific Node within the scene graph. While the id of a Node
should be unique within the scene graph, this uniqueness is not enforced.
This is analogous to the "id" attribute on an HTML element
(CSS ID Specification).public final void setId(java.lang.String value)
PopupControl
. This simple string identifier is useful for
finding a specific Node within the scene graph. While the id of a Node
should be unique within the scene graph, this uniqueness is not enforced.
This is analogous to the "id" attribute on an HTML element
(CSS ID Specification).value
- the id assigned to this PopupControl
using the setId
method or null
, if no id has been assigned.public final java.lang.String getId()
PopupControl
. This simple string identifier is useful for
finding a specific Node within the scene graph. While the id of a Node
should be unique within the scene graph, this uniqueness is not enforced.
This is analogous to the "id" attribute on an HTML element
(CSS ID Specification).public final ObservableList<java.lang.String> getStyleClass()
getStyleClass
in interface Styleable
public final void setStyle(java.lang.String value)
PopupControl
. This is analogous to the "style" attribute of an
HTML element. Note that, like the HTML style attribute, this
variable contains style properties and values and not the
selector portion of a style rule.value
- The inline CSS style to use for this PopupControl
.
null
is implicitly converted to an empty String.public final java.lang.String getStyle()
PopupControl
. This is analogous to the "style" attribute of an
HTML element. Note that, like the HTML style attribute, this
variable contains style properties and values and not the
selector portion of a style rule.public final StringProperty styleProperty()
public final ObjectProperty<Skin<?>> skinProperty()
PopupControl
. From the
perspective of the PopupControl
, the Skin
is a black box.
It listens and responds to changes in state in a PopupControl
.
There is a one-to-one relationship between a PopupControl
and its
Skin
. Every Skin
maintains a back reference to the
PopupControl
.
A skin may be null.
skinProperty
in interface Skinnable
public final void setSkin(Skin<?> value)
Skinnable
Control
public final Skin<?> getSkin()
Skinnable
Control
private StringProperty skinClassNameProperty()
private Node getSkinNode()
public final void setMinWidth(double value)
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getMinWidth(forHeight)
will return the control's internally
computed minimum width.
Setting this value to the USE_PREF_SIZE
flag will cause
getMinWidth(forHeight)
to return the control's preferred width,
enabling applications to easily restrict the resizability of the control.
public final double getMinWidth()
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getMinWidth(forHeight)
will return the control's internally
computed minimum width.
Setting this value to the USE_PREF_SIZE
flag will cause
getMinWidth(forHeight)
to return the control's preferred width,
enabling applications to easily restrict the resizability of the control.
public final DoubleProperty minWidthProperty()
public final void setMinHeight(double value)
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getMinHeight(forWidth)
will return the control's internally
computed minimum height.
Setting this value to the USE_PREF_SIZE
flag will cause
getMinHeight(forWidth)
to return the control's preferred height,
enabling applications to easily restrict the resizability of the control.
public final double getMinHeight()
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getMinHeight(forWidth)
will return the control's internally
computed minimum height.
Setting this value to the USE_PREF_SIZE
flag will cause
getMinHeight(forWidth)
to return the control's preferred height,
enabling applications to easily restrict the resizability of the control.
public final DoubleProperty minHeightProperty()
public void setMinSize(double minWidth, double minHeight)
minWidth
- the override value for minimum widthminHeight
- the override value for minimum heightsetMinWidth(double)
,
setMinHeight(double)
public final void setPrefWidth(double value)
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getPrefWidth(forHeight)
will return the control's internally
computed preferred width.
public final double getPrefWidth()
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getPrefWidth(forHeight)
will return the control's internally
computed preferred width.
public final DoubleProperty prefWidthProperty()
public final void setPrefHeight(double value)
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getPrefHeight(forWidth)
will return the control's internally
computed preferred width.
public final double getPrefHeight()
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getPrefHeight(forWidth)
will return the control's internally
computed preferred width.
public final DoubleProperty prefHeightProperty()
public void setPrefSize(double prefWidth, double prefHeight)
prefWidth
- the override value for preferred widthprefHeight
- the override value for preferred heightsetPrefWidth(double)
,
setPrefHeight(double)
public final void setMaxWidth(double value)
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getMaxWidth(forHeight)
will return the control's internally
computed maximum width.
Setting this value to the USE_PREF_SIZE
flag will cause
getMaxWidth(forHeight)
to return the control's preferred width,
enabling applications to easily restrict the resizability of the control.
public final double getMaxWidth()
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getMaxWidth(forHeight)
will return the control's internally
computed maximum width.
Setting this value to the USE_PREF_SIZE
flag will cause
getMaxWidth(forHeight)
to return the control's preferred width,
enabling applications to easily restrict the resizability of the control.
public final DoubleProperty maxWidthProperty()
public final void setMaxHeight(double value)
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getMaxHeight(forWidth)
will return the control's internally
computed maximum height.
Setting this value to the USE_PREF_SIZE
flag will cause
getMaxHeight(forWidth)
to return the control's preferred height,
enabling applications to easily restrict the resizability of the control.
public final double getMaxHeight()
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getMaxHeight(forWidth)
will return the control's internally
computed maximum height.
Setting this value to the USE_PREF_SIZE
flag will cause
getMaxHeight(forWidth)
to return the control's preferred height,
enabling applications to easily restrict the resizability of the control.
public final DoubleProperty maxHeightProperty()
public void setMaxSize(double maxWidth, double maxHeight)
maxWidth
- the override value for maximum widthmaxHeight
- the override value for maximum heightsetMaxWidth(double)
,
setMaxHeight(double)
public final double minWidth(double height)
minWidth(forHeight)
unless
the application overrode the minimum width by setting the minWidth property.height
- the heightsetMinWidth(double)
public final double minHeight(double width)
minHeight(forWidth)
unless
the application overrode the minimum height by setting the minHeight property.width
- The widthsetMinHeight(double)
public final double prefWidth(double height)
prefWidth(forHeight)
unless
the application overrode the preferred width by setting the prefWidth property.height
- the heightsetPrefWidth(double)
public final double prefHeight(double width)
prefHeight(forWidth)
unless
the application overrode the preferred height by setting the prefHeight property.width
- the widthsetPrefHeight(double)
public final double maxWidth(double height)
maxWidth(forHeight)
unless
the application overrode the maximum width by setting the maxWidth property.height
- the heightsetMaxWidth(double)
public final double maxHeight(double width)
maxHeight(forWidth)
unless
the application overrode the maximum height by setting the maxHeight property.width
- the widthsetMaxHeight(double)
private double recalculateMinWidth(double height)
private double recalculateMinHeight(double width)
private double recalculateMaxWidth(double height)
private double recalculateMaxHeight(double width)
private double recalculatePrefWidth(double height)
private double recalculatePrefHeight(double width)
private void recomputeSkinSize()
protected Skin<?> createDefaultSkin()
-fx-skin
or set explicitly in a sub-class with setSkin(...)
.public static java.util.List<CssMetaData<? extends Styleable,?>> getClassCssMetaData()
public java.util.List<CssMetaData<? extends Styleable,?>> getCssMetaData()
getCssMetaData
in interface Styleable
public final void pseudoClassStateChanged(PseudoClass pseudoClass, boolean active)
Node.pseudoClassStateChanged(javafx.css.PseudoClass, boolean)
public java.lang.String getTypeSelector()
Styleable
that is to be used in selector matching.
This is analogous to an "element" in HTML.
(CSS Type Selector).getTypeSelector
in interface Styleable
public Styleable getStyleableParent()
ownerNode
or,
if the ownerNode is not set, the root of the ownerWindow's
scene. If the popup has not been shown, both ownerNode and ownerWindow will be null and null
will be returned.
Note that the PopupWindow's scene root is not returned because there is no way to guarantee that the
PopupWindow's scene root would properly return the ownerNode or ownerWindow.getStyleableParent
in interface Styleable
PopupWindow.getOwnerNode()
, PopupWindow.getOwnerWindow()
,
or null.public final ObservableSet<PseudoClass> getPseudoClassStates()
getPseudoClassStates
in interface Styleable
@Deprecated public Node impl_styleableGetNode()