- java.lang.Object
-
- javafx.stage.Window
-
- javafx.stage.PopupWindow
-
- javafx.scene.control.PopupControl
-
- All Implemented Interfaces:
Styleable
,EventTarget
,Skinnable
- Direct Known Subclasses:
ContextMenu
,Tooltip
public class PopupControl extends PopupWindow implements Skinnable, Styleable
An extension of PopupWindow that allows for CSS styling.- Since:
- JavaFX 2.0
-
-
Property Summary
Properties Type Property Description StringProperty
id
The id of thisPopupControl
.DoubleProperty
maxHeight
Property for overriding the control's computed maximum height.DoubleProperty
maxWidth
Property for overriding the control's computed maximum width.DoubleProperty
minHeight
Property for overriding the control's computed minimum height.DoubleProperty
minWidth
Property for overriding the control's computed minimum width.DoubleProperty
prefHeight
Property for overriding the control's computed preferred height.DoubleProperty
prefWidth
Property for overriding the control's computed preferred width.ObjectProperty<Skin<?>>
skin
Skin is responsible for rendering thisPopupControl
.StringProperty
style
-
Properties inherited from class javafx.stage.PopupWindow
anchorLocation, anchorX, anchorY, autoFix, autoHide, consumeAutoHidingEvents, hideOnEscape, onAutoHide, ownerNode, ownerWindow
-
Properties inherited from class javafx.stage.Window
eventDispatcher, focused, forceIntegerRenderScale, height, onCloseRequest, onHidden, onHiding, onShowing, onShown, opacity, outputScaleX, outputScaleY, renderScaleX, renderScaleY, scene, showing, width, x, y
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
PopupControl.CSSBridge
The link between the popup window and the scenegraph.-
Nested classes/interfaces inherited from class javafx.stage.PopupWindow
PopupWindow.AnchorLocation
-
-
Field Summary
Fields Modifier and Type Field Description protected PopupControl.CSSBridge
bridge
We need a special root node, except we can't replace the special root node already in the PopupControl.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.
-
Constructor Summary
Constructors Constructor Description PopupControl()
Create a new empty PopupControl.
-
Method Summary
Modifier and Type Method Description protected Skin<?>
createDefaultSkin()
Create a new instance of the default skin for this control.static List<CssMetaData<? extends Styleable,?>>
getClassCssMetaData()
List<CssMetaData<? extends Styleable,?>>
getCssMetaData()
The CssMetaData of this Styleable.String
getId()
The id of thisPopupControl
.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()
Gets the value of the property skin.String
getStyle()
A string representation of the CSS style associated with this specificPopupControl
.Node
getStyleableNode()
Returns the Node that represents this Styleable object.Styleable
getStyleableParent()
Return the parent of this Styleable, or null if there is no parent.ObservableList<String>
getStyleClass()
Returns the list of String identifiers that make up the styleClass for this PopupControl.String
getTypeSelector()
The type of thisStyleable
that is to be used in selector matching.StringProperty
idProperty()
The id of thisPopupControl
.double
maxHeight(double width)
Called during layout to determine the maximum height for this node.DoubleProperty
maxHeightProperty()
Property for overriding the control's computed maximum height.double
maxWidth(double height)
Called during layout to determine the maximum width for this node.DoubleProperty
maxWidthProperty()
Property for overriding the control's computed maximum width.double
minHeight(double width)
Called during layout to determine the minimum height for this node.DoubleProperty
minHeightProperty()
Property for overriding the control's computed minimum height.double
minWidth(double height)
Called during layout to determine the minimum width for this node.DoubleProperty
minWidthProperty()
Property for overriding the control's computed minimum width.double
prefHeight(double width)
Called during layout to determine the preferred height for this node.DoubleProperty
prefHeightProperty()
Property for overriding the control's computed preferred height.double
prefWidth(double height)
Called during layout to determine the preferred width for this node.DoubleProperty
prefWidthProperty()
Property for overriding the control's computed preferred width.void
pseudoClassStateChanged(PseudoClass pseudoClass, boolean active)
void
setId(String value)
Sets the id of thisPopupControl
.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 value of the property skin.void
setStyle(String value)
A string representation of the CSS style associated with this specificPopupControl
.ObjectProperty<Skin<?>>
skinProperty()
Skin is responsible for rendering thisPopupControl
.StringProperty
styleProperty()
-
Methods inherited from class javafx.stage.PopupWindow
anchorLocationProperty, anchorXProperty, anchorYProperty, autoFixProperty, autoHideProperty, consumeAutoHidingEventsProperty, getAnchorLocation, getAnchorX, getAnchorY, getConsumeAutoHidingEvents, getOnAutoHide, getOwnerNode, getOwnerWindow, hide, hideOnEscapeProperty, isAutoFix, isAutoHide, isHideOnEscape, onAutoHideProperty, ownerNodeProperty, ownerWindowProperty, setAnchorLocation, setAnchorX, setAnchorY, setAutoFix, setAutoHide, setConsumeAutoHidingEvents, setHideOnEscape, setOnAutoHide, setScene, show, show, show
-
Methods inherited from class javafx.stage.Window
addEventFilter, addEventHandler, buildEventDispatchChain, centerOnScreen, eventDispatcherProperty, fireEvent, focusedProperty, forceIntegerRenderScaleProperty, getEventDispatcher, getHeight, getOnCloseRequest, getOnHidden, getOnHiding, getOnShowing, getOnShown, getOpacity, getOutputScaleX, getOutputScaleY, getProperties, getRenderScaleX, getRenderScaleY, getScene, getUserData, getWidth, getWindows, getX, getY, hasProperties, heightProperty, isFocused, isForceIntegerRenderScale, isShowing, onCloseRequestProperty, onHiddenProperty, onHidingProperty, onShowingProperty, onShownProperty, opacityProperty, outputScaleXProperty, outputScaleYProperty, removeEventFilter, removeEventHandler, renderScaleXProperty, renderScaleYProperty, requestFocus, sceneProperty, setEventDispatcher, setEventHandler, setForceIntegerRenderScale, setHeight, setOnCloseRequest, setOnHidden, setOnHiding, setOnShowing, setOnShown, setOpacity, setRenderScaleX, setRenderScaleY, setUserData, setWidth, setX, setY, show, showingProperty, sizeToScene, widthProperty, xProperty, yProperty
-
-
-
-
Property Detail
-
id
public final StringProperty idProperty
The id of thisPopupControl
. 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).- Default value:
- null
- See Also:
getId()
,setId(String)
-
style
public final StringProperty styleProperty
- See Also:
getStyle()
,setStyle(String)
-
skin
public final ObjectProperty<Skin<?>> skinProperty
Skin is responsible for rendering thisPopupControl
. From the perspective of thePopupControl
, theSkin
is a black box. It listens and responds to changes in state in aPopupControl
.There is a one-to-one relationship between a
PopupControl
and itsSkin
. EverySkin
maintains a back reference to thePopupControl
.A skin may be null.
- Specified by:
skinProperty
in interfaceSkinnable
- See Also:
getSkin()
,setSkin(Skin)
-
minWidth
public final DoubleProperty minWidthProperty
Property for overriding the control's computed minimum width. This should only be set if the control's internally computed minimum width doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetMinWidth(forHeight)
will return the control's internally computed minimum width.Setting this value to the
USE_PREF_SIZE
flag will causegetMinWidth(forHeight)
to return the control's preferred width, enabling applications to easily restrict the resizability of the control.- See Also:
getMinWidth()
,setMinWidth(double)
-
minHeight
public final DoubleProperty minHeightProperty
Property for overriding the control's computed minimum height. This should only be set if the control's internally computed minimum height doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetMinHeight(forWidth)
will return the control's internally computed minimum height.Setting this value to the
USE_PREF_SIZE
flag will causegetMinHeight(forWidth)
to return the control's preferred height, enabling applications to easily restrict the resizability of the control.- See Also:
getMinHeight()
,setMinHeight(double)
-
prefWidth
public final DoubleProperty prefWidthProperty
Property for overriding the control's computed preferred width. This should only be set if the control's internally computed preferred width doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetPrefWidth(forHeight)
will return the control's internally computed preferred width.- See Also:
getPrefWidth()
,setPrefWidth(double)
-
prefHeight
public final DoubleProperty prefHeightProperty
Property for overriding the control's computed preferred height. This should only be set if the control's internally computed preferred height doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetPrefHeight(forWidth)
will return the control's internally computed preferred width.- See Also:
getPrefHeight()
,setPrefHeight(double)
-
maxWidth
public final DoubleProperty maxWidthProperty
Property for overriding the control's computed maximum width. This should only be set if the control's internally computed maximum width doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetMaxWidth(forHeight)
will return the control's internally computed maximum width.Setting this value to the
USE_PREF_SIZE
flag will causegetMaxWidth(forHeight)
to return the control's preferred width, enabling applications to easily restrict the resizability of the control.- See Also:
getMaxWidth()
,setMaxWidth(double)
-
maxHeight
public final DoubleProperty maxHeightProperty
Property for overriding the control's computed maximum height. This should only be set if the control's internally computed maximum height doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetMaxHeight(forWidth)
will return the control's internally computed maximum height.Setting this value to the
USE_PREF_SIZE
flag will causegetMaxHeight(forWidth)
to return the control's preferred height, enabling applications to easily restrict the resizability of the control.- See Also:
getMaxHeight()
,setMaxHeight(double)
-
-
Field Detail
-
USE_PREF_SIZE
public static final 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.- See Also:
- Constant Field Values
-
USE_COMPUTED_SIZE
public static final 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().- See Also:
- Constant Field Values
-
bridge
protected PopupControl.CSSBridge bridge
We need a special root node, except we can't replace the special root node already in the PopupControl. So we'll set our own special almost-root node that is a child of the root. This special root node is responsible for mapping the id, styleClass, and style defined on the PopupControl such that CSS will read the values from the PopupControl, and then apply CSS state to that special node. The node will then be able to pass cssSet calls along, such that any subclass of PopupControl will be able to use the Styleable properties and we'll be able to style it from CSS, in such a way that it participates and applies to the skin, exactly the way that normal Skin's work for normal Controls.- Since:
- JavaFX 2.1
-
-
Method Detail
-
idProperty
public final StringProperty idProperty()
The id of thisPopupControl
. 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).- Default value:
- null
- See Also:
getId()
,setId(String)
-
setId
public final void setId(String value)
Sets the id of thisPopupControl
. 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).- Default value:
- null
- Parameters:
value
- the id assigned to thisPopupControl
using thesetId
method ornull
, if no id has been assigned.
-
getId
public final String getId()
The id of thisPopupControl
. 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).
-
getStyleClass
public final ObservableList<String> getStyleClass()
Returns the list of String identifiers that make up the styleClass for this PopupControl.- Specified by:
getStyleClass
in interfaceStyleable
- Returns:
- a list of String identifiers which can be used to logically group Nodes, specifically for an external style engine
- See Also:
- CSS3 class selectors
-
setStyle
public final void setStyle(String value)
A string representation of the CSS style associated with this specificPopupControl
. 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.- Default value:
- empty string
- Parameters:
value
- The inline CSS style to use for thisPopupControl
.null
is implicitly converted to an empty String.
-
getStyle
public final String getStyle()
A string representation of the CSS style associated with this specificPopupControl
. 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.
-
styleProperty
public final StringProperty styleProperty()
- See Also:
getStyle()
,setStyle(String)
-
skinProperty
public final ObjectProperty<Skin<?>> skinProperty()
Skin is responsible for rendering thisPopupControl
. From the perspective of thePopupControl
, theSkin
is a black box. It listens and responds to changes in state in aPopupControl
.There is a one-to-one relationship between a
PopupControl
and itsSkin
. EverySkin
maintains a back reference to thePopupControl
.A skin may be null.
- Specified by:
skinProperty
in interfaceSkinnable
- See Also:
getSkin()
,setSkin(Skin)
-
setSkin
public final void setSkin(Skin<?> value)
Sets the value of the property skin.- Specified by:
setSkin
in interfaceSkinnable
- Property description:
- Skin is responsible for rendering this
PopupControl
. From the perspective of thePopupControl
, theSkin
is a black box. It listens and responds to changes in state in aPopupControl
.There is a one-to-one relationship between a
PopupControl
and itsSkin
. EverySkin
maintains a back reference to thePopupControl
.A skin may be null.
- Parameters:
value
- the skin value for this control
-
getSkin
public final Skin<?> getSkin()
Gets the value of the property skin.- Specified by:
getSkin
in interfaceSkinnable
- Property description:
- Skin is responsible for rendering this
PopupControl
. From the perspective of thePopupControl
, theSkin
is a black box. It listens and responds to changes in state in aPopupControl
.There is a one-to-one relationship between a
PopupControl
and itsSkin
. EverySkin
maintains a back reference to thePopupControl
.A skin may be null.
- Returns:
- the skin for this control
-
setMinWidth
public final void setMinWidth(double value)
Property for overriding the control's computed minimum width. This should only be set if the control's internally computed minimum width doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetMinWidth(forHeight)
will return the control's internally computed minimum width.Setting this value to the
USE_PREF_SIZE
flag will causegetMinWidth(forHeight)
to return the control's preferred width, enabling applications to easily restrict the resizability of the control.- Parameters:
value
- the minimum width
-
getMinWidth
public final double getMinWidth()
Property for overriding the control's computed minimum width. This should only be set if the control's internally computed minimum width doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetMinWidth(forHeight)
will return the control's internally computed minimum width.Setting this value to the
USE_PREF_SIZE
flag will causegetMinWidth(forHeight)
to return the control's preferred width, enabling applications to easily restrict the resizability of the control.- Returns:
- the minimum width
-
minWidthProperty
public final DoubleProperty minWidthProperty()
Property for overriding the control's computed minimum width. This should only be set if the control's internally computed minimum width doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetMinWidth(forHeight)
will return the control's internally computed minimum width.Setting this value to the
USE_PREF_SIZE
flag will causegetMinWidth(forHeight)
to return the control's preferred width, enabling applications to easily restrict the resizability of the control.- See Also:
getMinWidth()
,setMinWidth(double)
-
setMinHeight
public final void setMinHeight(double value)
Property for overriding the control's computed minimum height. This should only be set if the control's internally computed minimum height doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetMinHeight(forWidth)
will return the control's internally computed minimum height.Setting this value to the
USE_PREF_SIZE
flag will causegetMinHeight(forWidth)
to return the control's preferred height, enabling applications to easily restrict the resizability of the control.- Parameters:
value
- the minimum height
-
getMinHeight
public final double getMinHeight()
Property for overriding the control's computed minimum height. This should only be set if the control's internally computed minimum height doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetMinHeight(forWidth)
will return the control's internally computed minimum height.Setting this value to the
USE_PREF_SIZE
flag will causegetMinHeight(forWidth)
to return the control's preferred height, enabling applications to easily restrict the resizability of the control.- Returns:
- the minimum height
-
minHeightProperty
public final DoubleProperty minHeightProperty()
Property for overriding the control's computed minimum height. This should only be set if the control's internally computed minimum height doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetMinHeight(forWidth)
will return the control's internally computed minimum height.Setting this value to the
USE_PREF_SIZE
flag will causegetMinHeight(forWidth)
to return the control's preferred height, enabling applications to easily restrict the resizability of the control.- See Also:
getMinHeight()
,setMinHeight(double)
-
setMinSize
public void setMinSize(double minWidth, double minHeight)
Convenience method for overriding the control's computed minimum width and height. This should only be called if the control's internally computed minimum size doesn't meet the application's layout needs.- Parameters:
minWidth
- the override value for minimum widthminHeight
- the override value for minimum height- See Also:
setMinWidth(double)
,setMinHeight(double)
-
setPrefWidth
public final void setPrefWidth(double value)
Property for overriding the control's computed preferred width. This should only be set if the control's internally computed preferred width doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetPrefWidth(forHeight)
will return the control's internally computed preferred width.- Parameters:
value
- the preferred width
-
getPrefWidth
public final double getPrefWidth()
Property for overriding the control's computed preferred width. This should only be set if the control's internally computed preferred width doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetPrefWidth(forHeight)
will return the control's internally computed preferred width.- Returns:
- the preferred width
-
prefWidthProperty
public final DoubleProperty prefWidthProperty()
Property for overriding the control's computed preferred width. This should only be set if the control's internally computed preferred width doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetPrefWidth(forHeight)
will return the control's internally computed preferred width.- See Also:
getPrefWidth()
,setPrefWidth(double)
-
setPrefHeight
public final void setPrefHeight(double value)
Property for overriding the control's computed preferred height. This should only be set if the control's internally computed preferred height doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetPrefHeight(forWidth)
will return the control's internally computed preferred width.- Parameters:
value
- the preferred height
-
getPrefHeight
public final double getPrefHeight()
Property for overriding the control's computed preferred height. This should only be set if the control's internally computed preferred height doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetPrefHeight(forWidth)
will return the control's internally computed preferred width.- Returns:
- the preferred height
-
prefHeightProperty
public final DoubleProperty prefHeightProperty()
Property for overriding the control's computed preferred height. This should only be set if the control's internally computed preferred height doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetPrefHeight(forWidth)
will return the control's internally computed preferred width.- See Also:
getPrefHeight()
,setPrefHeight(double)
-
setPrefSize
public void setPrefSize(double prefWidth, double prefHeight)
Convenience method for overriding the control's computed preferred width and height. This should only be called if the control's internally computed preferred size doesn't meet the application's layout needs.- Parameters:
prefWidth
- the override value for preferred widthprefHeight
- the override value for preferred height- See Also:
setPrefWidth(double)
,setPrefHeight(double)
-
setMaxWidth
public final void setMaxWidth(double value)
Property for overriding the control's computed maximum width. This should only be set if the control's internally computed maximum width doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetMaxWidth(forHeight)
will return the control's internally computed maximum width.Setting this value to the
USE_PREF_SIZE
flag will causegetMaxWidth(forHeight)
to return the control's preferred width, enabling applications to easily restrict the resizability of the control.- Parameters:
value
- the maximum width
-
getMaxWidth
public final double getMaxWidth()
Property for overriding the control's computed maximum width. This should only be set if the control's internally computed maximum width doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetMaxWidth(forHeight)
will return the control's internally computed maximum width.Setting this value to the
USE_PREF_SIZE
flag will causegetMaxWidth(forHeight)
to return the control's preferred width, enabling applications to easily restrict the resizability of the control.- Returns:
- the maximum width
-
maxWidthProperty
public final DoubleProperty maxWidthProperty()
Property for overriding the control's computed maximum width. This should only be set if the control's internally computed maximum width doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetMaxWidth(forHeight)
will return the control's internally computed maximum width.Setting this value to the
USE_PREF_SIZE
flag will causegetMaxWidth(forHeight)
to return the control's preferred width, enabling applications to easily restrict the resizability of the control.- See Also:
getMaxWidth()
,setMaxWidth(double)
-
setMaxHeight
public final void setMaxHeight(double value)
Property for overriding the control's computed maximum height. This should only be set if the control's internally computed maximum height doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetMaxHeight(forWidth)
will return the control's internally computed maximum height.Setting this value to the
USE_PREF_SIZE
flag will causegetMaxHeight(forWidth)
to return the control's preferred height, enabling applications to easily restrict the resizability of the control.- Parameters:
value
- the maximum height
-
getMaxHeight
public final double getMaxHeight()
Property for overriding the control's computed maximum height. This should only be set if the control's internally computed maximum height doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetMaxHeight(forWidth)
will return the control's internally computed maximum height.Setting this value to the
USE_PREF_SIZE
flag will causegetMaxHeight(forWidth)
to return the control's preferred height, enabling applications to easily restrict the resizability of the control.- Returns:
- the maximum height
-
maxHeightProperty
public final DoubleProperty maxHeightProperty()
Property for overriding the control's computed maximum height. This should only be set if the control's internally computed maximum height doesn't meet the application's layout needs.Defaults to the
USE_COMPUTED_SIZE
flag, which means thatgetMaxHeight(forWidth)
will return the control's internally computed maximum height.Setting this value to the
USE_PREF_SIZE
flag will causegetMaxHeight(forWidth)
to return the control's preferred height, enabling applications to easily restrict the resizability of the control.- See Also:
getMaxHeight()
,setMaxHeight(double)
-
setMaxSize
public void setMaxSize(double maxWidth, double maxHeight)
Convenience method for overriding the control's computed maximum width and height. This should only be called if the control's internally computed maximum size doesn't meet the application's layout needs.- Parameters:
maxWidth
- the override value for maximum widthmaxHeight
- the override value for maximum height- See Also:
setMaxWidth(double)
,setMaxHeight(double)
-
minWidth
public final double minWidth(double height)
Called during layout to determine the minimum width for this node. Returns the value fromminWidth(forHeight)
unless the application overrode the minimum width by setting the minWidth property.- Parameters:
height
- the height- Returns:
- the minimum width that this node should be resized to during layout
- See Also:
setMinWidth(double)
-
minHeight
public final double minHeight(double width)
Called during layout to determine the minimum height for this node. Returns the value fromminHeight(forWidth)
unless the application overrode the minimum height by setting the minHeight property.- Parameters:
width
- The width- Returns:
- the minimum height that this node should be resized to during layout
- See Also:
setMinHeight(double)
-
prefWidth
public final double prefWidth(double height)
Called during layout to determine the preferred width for this node. Returns the value fromprefWidth(forHeight)
unless the application overrode the preferred width by setting the prefWidth property.- Parameters:
height
- the height- Returns:
- the preferred width that this node should be resized to during layout
- See Also:
setPrefWidth(double)
-
prefHeight
public final double prefHeight(double width)
Called during layout to determine the preferred height for this node. Returns the value fromprefHeight(forWidth)
unless the application overrode the preferred height by setting the prefHeight property.- Parameters:
width
- the width- Returns:
- the preferred height that this node should be resized to during layout
- See Also:
setPrefHeight(double)
-
maxWidth
public final double maxWidth(double height)
Called during layout to determine the maximum width for this node. Returns the value frommaxWidth(forHeight)
unless the application overrode the maximum width by setting the maxWidth property.- Parameters:
height
- the height- Returns:
- the maximum width that this node should be resized to during layout
- See Also:
setMaxWidth(double)
-
maxHeight
public final double maxHeight(double width)
Called during layout to determine the maximum height for this node. Returns the value frommaxHeight(forWidth)
unless the application overrode the maximum height by setting the maxHeight property.- Parameters:
width
- the width- Returns:
- the maximum height that this node should be resized to during layout
- See Also:
setMaxHeight(double)
-
createDefaultSkin
protected Skin<?> 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 withsetSkin(...)
.- Returns:
- new instance of default skin for this control. If null then the control will have no skin unless one is provided by css.
- Since:
- JavaFX 8.0
-
getClassCssMetaData
public static List<CssMetaData<? extends Styleable,?>> getClassCssMetaData()
- Returns:
- The CssMetaData associated with this class, which may include the CssMetaData of its superclasses.
- Since:
- JavaFX 8.0
-
getCssMetaData
public List<CssMetaData<? extends Styleable,?>> getCssMetaData()
The CssMetaData of this Styleable. This may be returned as an unmodifiable list.- Specified by:
getCssMetaData
in interfaceStyleable
- Returns:
- the CssMetaData
- Since:
- JavaFX 8.0
-
pseudoClassStateChanged
public final void pseudoClassStateChanged(PseudoClass pseudoClass, boolean active)
- Parameters:
pseudoClass
- the pseudo classactive
- the active state- Since:
- JavaFX 8.0
- See Also:
Node.pseudoClassStateChanged(javafx.css.PseudoClass, boolean)
-
getTypeSelector
public String getTypeSelector()
The type of thisStyleable
that is to be used in selector matching. This is analogous to an "element" in HTML. (CSS Type Selector).- Specified by:
getTypeSelector
in interfaceStyleable
- Returns:
- "PopupControl"
- Since:
- JavaFX 8.0
-
getStyleableParent
public Styleable getStyleableParent()
Return the parent of this Styleable, or null if there is no parent. A PopupControl's styles are based on the popup "owner" which is theownerNode
or, if the ownerNode is not set, the root of theownerWindow's
scene. If the popup has not been shown, both ownerNode and ownerWindow will be null andnull
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.- Specified by:
getStyleableParent
in interfaceStyleable
- Returns:
PopupWindow.getOwnerNode()
,PopupWindow.getOwnerWindow()
, or null.- Since:
- JavaFX 8.0
-
getPseudoClassStates
public final ObservableSet<PseudoClass> getPseudoClassStates()
Return the pseudo-class state of this Styleable. CSS assumes this set is read-only.- Specified by:
getPseudoClassStates
in interfaceStyleable
- Returns:
- the pseudo-class state
- Since:
- JavaFX 8.0
-
getStyleableNode
public Node getStyleableNode()
Returns the Node that represents this Styleable object. This method should be overridden in cases where the Styleable is not itself a Node, so that it may optionally return the relevant root node representation of itself. By default this method returns null, which can mean that either the Styleable itself is a Node, or if that is not the case, that the Styleable does not have a node representation available at the time of request.- Specified by:
getStyleableNode
in interfaceStyleable
- Returns:
- the Node that represents this Styleable object
-
-