Class Control
- All Implemented Interfaces:
LayoutMeasurable,LayoutMeasurableMixin,HasBackgroundProperty,HasBlendModeProperty,HasBorderProperty,HasClipProperty,HasEffectProperty,HasHeightProperty,HasLayoutXProperty,HasLayoutYProperty,HasManagedProperty,HasMaxHeightProperty,HasMaxWidthProperty,HasMinHeightProperty,HasMinWidthProperty,HasMouseTransparentProperty,HasOnMouseClickedProperty,HasOpacityProperty,HasPaddingProperty,HasParentProperty,HasPrefHeightProperty,HasPrefWidthProperty,HasSnapToPixelProperty,HasVisibleProperty,HasWidthProperty,Styleable,EventTarget,Skinnable,INode,PreferenceResizableNode
- Direct Known Subclasses:
ButtonBar,ChoiceBox,ComboBoxBase,Labeled,ProgressIndicator,ScrollPane,Separator,Slider,SplitPane,TabPane,TextInputControl
- Author:
- Bruno Salmon
-
Property Summary
PropertiesTypePropertyDescriptionfinal ObjectProperty<ContextMenu>The ContextMenu to show for this control.final ObjectProperty<Skin<?>>Skin is responsible for rendering thisControl.final ObjectProperty<Tooltip>The ToolTip for this control.Properties inherited from class javafx.scene.layout.Region
background, border, height, insets, maxHeight, maxWidth, minHeight, minWidth, padding, prefHeight, prefWidth, snapToPixel, widthProperties inherited from class javafx.scene.Parent
needsLayoutProperties inherited from class javafx.scene.Node
blendMode, cacheHint, cache, clip, cursor, disabled, disable, effect, eventDispatcher, focused, focusTraversable, hover, id, layoutBounds, layoutX, layoutY, managed, mouseTransparent, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragged, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onScroll, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, opacity, parent, pressed, rotate, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, visibleProperties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBlendModeProperty
blendModeProperties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasClipProperty
clipProperties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasEffectProperty
effectProperties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutXProperty
layoutXProperties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutYProperty
layoutYProperties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasManagedProperty
managedProperties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMouseTransparentProperty
mouseTransparentProperties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOnMouseClickedProperty
onMouseClickedProperties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOpacityProperty
opacityProperties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasParentProperty
parentProperties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasVisibleProperty
visible -
Field Summary
Fields inherited from interface javafx.scene.INode
BASELINE_OFFSET_SAME_AS_HEIGHTFields inherited from interface javafx.scene.layout.PreferenceResizableNode
USE_COMPUTED_SIZE, USE_PREF_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected doublecomputeMaxHeight(double width) Computes the maximum allowable height of the Control, based on the provided width.protected doublecomputeMaxWidth(double height) Computes the maximum allowable width of the Control, based on the provided height.protected doublecomputeMinHeight(double width) Computes the minimum allowable height of the Control, based on the provided width.protected doublecomputeMinWidth(double height) Computes the minimum allowable width of the Control, based on the provided height.protected doublecomputePrefHeight(double width) Computes the preferred height of this region for the given width; Region subclasses should override this method to return an appropriate value based on their content and layout strategy.protected doublecomputePrefWidth(double height) Computes the preferred width of this region for the given height.final ObjectProperty<ContextMenu>The ContextMenu to show for this control.protected Skin<?>Create a new instance of the default skin for this control.doubleCalculates the baseline offset based on the first managed child.final ContextMenuGets the value of thecontextMenuproperty.final Skin<?>getSkin()Gets the value of theskinproperty.final TooltipGets the value of thetooltipproperty.protected voidInvoked during the layout pass to layout the children in thisParent.final voidsetContextMenu(ContextMenu value) Sets the value of thecontextMenuproperty.final voidSets the value of theskinproperty.final voidsetTooltip(Tooltip value) Sets the value of thetooltipproperty.booleanfinal ObjectProperty<Skin<?>>Skin is responsible for rendering thisControl.final ObjectProperty<Tooltip>The ToolTip for this control.Methods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, boundedSize, getInsets, heightProperty, impl_computeGeomBounds, impl_computeLayoutBounds, impl_maxHeight, impl_maxWidth, impl_minHeight, impl_minWidth, impl_prefHeight, impl_prefWidth, insetsProperty, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeightProperty, maxWidthProperty, minHeightProperty, minWidthProperty, paddingProperty, positionInArea, positionInArea, prefHeightProperty, prefWidthProperty, resize, setMaxSize, setMinSize, setPrefSize, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthPropertyMethods inherited from class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, isNeedsLayout, layout, needsLayoutProperty, requestLayout, requestParentLayout, setLayoutFlag, setNeedsLayout, setSceneRootMethods inherited from class javafx.scene.Node
addEventFilter, addEventHandler, autosize, blendModeProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, createLayoutMeasurable, cursorProperty, disabledProperty, disableProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAllNodeTransforms, getBoundsInLocal, getCacheHint, getCursor, getEventDispatcher, getId, getLayoutMeasurable, getNodePeer, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseDragged, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnScroll, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOrCreateAndBindNodePeer, getProperties, getRotate, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleClass, getTransforms, getTranslateX, getTranslateY, getUserData, hasProperties, hoverProperty, idProperty, impl_getLayoutBounds, impl_isTreeVisible, impl_traverse, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isPressed, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToScene, localToScene, localToScreen, localToScreen, localToScreen, localToScreen, managedProperty, mouseTransparentProperty, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDraggedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onNodePeerReady, onPeerSizeChanged, onScrollProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, opacityProperty, parentProperty, parentToLocal, pressedProperty, removeEventFilter, removeEventHandler, requestFocus, requestPeerFocus, rotateProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, setCache, setCacheHint, setCursor, setDisable, setDisabled, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setNodePeer, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseDragged, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnScroll, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setPressed, setRotate, setScaleX, setScaleY, setScaleZ, setScene, setStyle, setTranslateX, setTranslateY, setUserData, snapshot, startDragAndDrop, styleProperty, toBack, toFront, translateXProperty, translateYProperty, visiblePropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBackgroundProperty
getBackground, setBackgroundMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBlendModeProperty
blendModeProperty, getBlendMode, setBlendModeMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBorderProperty
getBorder, setBorderMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasClipProperty
clipProperty, getClip, setClipMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasEffectProperty
effectProperty, getEffect, setEffectMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasHeightProperty
getHeight, setHeightMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutXProperty
getLayoutX, layoutXProperty, setLayoutXMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutYProperty
getLayoutY, layoutYProperty, setLayoutYMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasManagedProperty
isManaged, managedProperty, setManagedMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMaxHeightProperty
getMaxHeight, setMaxHeightMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMaxWidthProperty
getMaxWidth, setMaxWidthMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMinHeightProperty
getMinHeight, setMinHeightMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMinWidthProperty
getMinWidth, setMinWidthMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMouseTransparentProperty
isMouseTransparent, mouseTransparentProperty, setMouseTransparentMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOnMouseClickedProperty
getOnMouseClicked, onMouseClickedProperty, setOnMouseClickedMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOpacityProperty
getOpacity, opacityProperty, setOpacityMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasPaddingProperty
getPadding, setPaddingMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasParentProperty
getParent, parentProperty, setParentMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasPrefHeightProperty
getPrefHeight, setPrefHeightMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasPrefWidthProperty
getPrefWidth, setPrefWidthMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasSnapToPixelProperty
isSnapToPixel, setSnapToPixelMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasVisibleProperty
isVisible, setVisible, visiblePropertyMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasWidthProperty
getWidth, setWidthMethods inherited from interface javafx.scene.INode
autosize, getAllNodeTransforms, getContentBias, getNodePeer, getOrCreateAndBindNodePeer, getProperties, getScene, getTransforms, hasProperties, relocate, resizeRelocateMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.emul_coupling.LayoutMeasurableMixin
clearCache, getLayoutBounds, getLayoutMeasurable, maxHeight, maxWidth, minHeight, minWidth, prefHeight, prefWidthMethods inherited from interface javafx.scene.layout.PreferenceResizableNode
isResizable
-
Property Details
-
tooltip
The ToolTip for this control.- See Also:
-
contextMenu
The ContextMenu to show for this control. -
skin
Skin is responsible for rendering thisControl. From the perspective of theControl, theSkinis a black box. It listens and responds to changes in state in aControl.There is a one-to-one relationship between a
Controland itsSkin. EverySkinmaintains a back reference to theControlvia theSkin.getSkinnable()method.A skin may be null.
- Specified by:
skinPropertyin interfaceSkinnable- See Also:
-
-
Constructor Details
-
Control
protected Control()Create a new Control.
-
-
Method Details
-
tooltipProperty
The ToolTip for this control.- Returns:
- the tool tip for this control
- See Also:
-
setTooltip
Sets the value of thetooltipproperty.- Property description:
- The ToolTip for this control.
- Parameters:
value- the value for thetooltipproperty- See Also:
-
getTooltip
Gets the value of thetooltipproperty.- Property description:
- The ToolTip for this control.
- Returns:
- the value of the
tooltipproperty - See Also:
-
contextMenuProperty
The ContextMenu to show for this control.- Returns:
- the
contextMenuproperty - See Also:
-
setContextMenu
Sets the value of thecontextMenuproperty.- Property description:
- The ContextMenu to show for this control.
- Parameters:
value- the value for thecontextMenuproperty- See Also:
-
getContextMenu
Gets the value of thecontextMenuproperty.- Property description:
- The ContextMenu to show for this control.
- Returns:
- the value of the
contextMenuproperty - See Also:
-
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-skinor 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
-
skinProperty
Skin is responsible for rendering thisControl. From the perspective of theControl, theSkinis a black box. It listens and responds to changes in state in aControl.There is a one-to-one relationship between a
Controland itsSkin. EverySkinmaintains a back reference to theControlvia theSkin.getSkinnable()method.A skin may be null.
- Specified by:
skinPropertyin interfaceSkinnable- Returns:
- the
skinproperty - See Also:
-
setSkin
Sets the value of theskinproperty.- Specified by:
setSkinin interfaceSkinnable- Property description:
- Skin is responsible for rendering this
Control. From the perspective of theControl, theSkinis a black box. It listens and responds to changes in state in aControl.There is a one-to-one relationship between a
Controland itsSkin. EverySkinmaintains a back reference to theControlvia theSkin.getSkinnable()method.A skin may be null.
- Parameters:
value- the value for theskinproperty- See Also:
-
getSkin
Gets the value of theskinproperty.- Specified by:
getSkinin interfaceSkinnable- Property description:
- Skin is responsible for rendering this
Control. From the perspective of theControl, theSkinis a black box. It listens and responds to changes in state in aControl.There is a one-to-one relationship between a
Controland itsSkin. EverySkinmaintains a back reference to theControlvia theSkin.getSkinnable()method.A skin may be null.
- Returns:
- the value of the
skinproperty - See Also:
-
computeMinWidth
protected double computeMinWidth(double height) Computes the minimum allowable width of the Control, based on the provided height. The minimum width is not calculated within the Control, instead the calculation is delegated to theLayoutMeasurableMixin.minWidth(double)method of theSkin. If the Skin is null, the returned value is 0.- Overrides:
computeMinWidthin classRegion- Parameters:
height- The height of the Control, in case this value might dictate the minimum width.- Returns:
- A double representing the minimum width of this control.
-
computeMinHeight
protected double computeMinHeight(double width) Computes the minimum allowable height of the Control, based on the provided width. The minimum height is not calculated within the Control, instead the calculation is delegated to theLayoutMeasurableMixin.minHeight(double)method of theSkin. If the Skin is null, the returned value is 0.- Overrides:
computeMinHeightin classRegion- Parameters:
width- The width of the Control, in case this value might dictate the minimum height.- Returns:
- A double representing the minimum height of this control.
-
computeMaxWidth
protected double computeMaxWidth(double height) Computes the maximum allowable width of the Control, based on the provided height. The maximum width is not calculated within the Control, instead the calculation is delegated to theLayoutMeasurableMixin.maxWidth(double)method of theSkin. If the Skin is null, the returned value is 0.- Overrides:
computeMaxWidthin classRegion- Parameters:
height- The height of the Control, in case this value might dictate the maximum width.- Returns:
- A double representing the maximum width of this control.
-
computeMaxHeight
protected double computeMaxHeight(double width) Computes the maximum allowable height of the Control, based on the provided width. The maximum height is not calculated within the Control, instead the calculation is delegated to theLayoutMeasurableMixin.maxHeight(double)method of theSkin. If the Skin is null, the returned value is 0.- Overrides:
computeMaxHeightin classRegion- Parameters:
width- The width of the Control, in case this value might dictate the maximum height.- Returns:
- A double representing the maximum height of this control.
-
computePrefWidth
protected double computePrefWidth(double height) Computes the preferred width of this region for the given height. Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a VERTICAL content bias, then the height parameter can be ignored.- Overrides:
computePrefWidthin classRegion- Parameters:
height- the height that should be used if preferred width depends on it- Returns:
- the computed preferred width for this region
-
computePrefHeight
protected double computePrefHeight(double width) Computes the preferred height of this region for the given width; Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.- Overrides:
computePrefHeightin classRegion- Parameters:
width- the width that should be used if preferred height depends on it- Returns:
- the computed preferred height for this region
-
getBaselineOffset
public double getBaselineOffset()Calculates the baseline offset based on the first managed child. If there is no such child, returnsINode.getBaselineOffset().- Specified by:
getBaselineOffsetin interfaceINode- Overrides:
getBaselineOffsetin classParent- Returns:
- baseline offset
-
layoutChildren
protected void layoutChildren()Invoked during the layout pass to layout the children in thisParent. By default it will only set the size of managed, resizable content to their preferred sizes and does not do any node positioning.Subclasses should override this function to layout content as needed.
- Overrides:
layoutChildrenin classParent
-
shouldUseLayoutMeasurable
public boolean shouldUseLayoutMeasurable()- Overrides:
shouldUseLayoutMeasurablein classNode
-