java.lang.Object
javafx.scene.control.SkinBase<ListSpinner<T>>
jfxtras.internal.scene.control.skin.ListSpinnerSkin<T>
- All Implemented Interfaces:
javafx.scene.control.Skin<ListSpinner<T>>
-
Property Summary
PropertiesTypePropertyDescriptionfinal javafx.beans.property.ObjectProperty
<ListSpinnerSkin.ArrowDirection> arrowDirectionfinal javafx.beans.property.ObjectProperty
<ListSpinnerSkin.ArrowPosition> arrowPositionfinal javafx.beans.property.ObjectProperty
<javafx.geometry.Pos> valueAlignment -
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static enum
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate javafx.beans.property.ObjectProperty
<ListSpinnerSkin.ArrowDirection> private javafx.beans.property.ObjectProperty
<ListSpinnerSkin.ArrowPosition> private javafx.scene.layout.Region
private javafx.scene.layout.Region
private final Timer
private final Timer
private javafx.scene.layout.BorderPane
private javafx.scene.control.TextField
private final Timer
private javafx.beans.property.ObjectProperty
<javafx.geometry.Pos> private javafx.scene.layout.BorderPane
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
align the value inside the plave holderfinal javafx.beans.property.ObjectProperty
<ListSpinnerSkin.ArrowDirection> arrowDirectionfinal javafx.beans.property.ObjectProperty
<ListSpinnerSkin.ArrowPosition> arrowPositionprivate void
private void
Construct the nodes.Gets the value of thearrowDirection
property.Gets the value of thearrowPosition
property.static List
<javafx.css.CssMetaData<? extends javafx.css.Styleable, ?>> List
<javafx.css.CssMetaData<? extends javafx.css.Styleable, ?>> This method should delegate toNode.getClassCssMetaData()
so that a Node's CssMetaData can be accessed without the need for reflection.final javafx.geometry.Pos
Gets the value of thevalueAlignment
property.private void
layout()
Lays out the spinner, depending on the location and direction of the arrows.private boolean
mouseEventOverArrow
(javafx.scene.input.MouseEvent evt, javafx.scene.layout.Region region) Check if the mouse event is considered to have happened over the arrowvoid
Parse the value (which usually comes from the TextField in the skin).protected void
parse
(javafx.scene.control.TextField textField) Parse the contents of the textfieldprivate void
private void
Put the correct node for the value's place holder: - either the TextField when in editable mode, - or a node generated by the cell factory when in readonly mode.private void
Set the CSS according to the direction of the arrows, so the correct arrows are shownfinal void
Sets the value of thearrowDirection
property.final void
Sets the value of thearrowPosition
property.final void
setValueAlignment
(javafx.geometry.Pos value) Sets the value of thevalueAlignment
property.private void
Remove clicked CSS styling from the arrowsfinal javafx.beans.property.ObjectProperty
<javafx.geometry.Pos> valueAlignmentfinal ListSpinnerSkin
<T> final ListSpinnerSkin
<T> final ListSpinnerSkin
<T> withValueAlignment
(javafx.geometry.Pos value) Methods inherited from class javafx.scene.control.SkinBase
computeBaselineOffset, computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, consumeMouseEvents, dispose, executeAccessibleAction, getChildren, getNode, getSkinnable, layoutChildren, layoutInArea, layoutInArea, layoutInArea, positionInArea, positionInArea, pseudoClassStateChanged, queryAccessibleAttribute, registerChangeListener, registerInvalidationListener, registerListChangeListener, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, unregisterChangeListeners, unregisterInvalidationListeners, unregisterListChangeListeners
-
Property Details
-
arrowPosition
public final javafx.beans.property.ObjectProperty<ListSpinnerSkin.ArrowPosition> arrowPositionPropertyarrowPosition- See Also:
-
arrowDirection
public final javafx.beans.property.ObjectProperty<ListSpinnerSkin.ArrowDirection> arrowDirectionPropertyarrowDirection- See Also:
-
valueAlignment
public final javafx.beans.property.ObjectProperty<javafx.geometry.Pos> valueAlignmentPropertyvalueAlignment- See Also:
-
-
Field Details
-
arrowPosition
-
arrowDirection
-
valueAlignment
private javafx.beans.property.ObjectProperty<javafx.geometry.Pos> valueAlignment -
decrementArrow
private javafx.scene.layout.Region decrementArrow -
incrementArrow
private javafx.scene.layout.Region incrementArrow -
skinNode
private javafx.scene.layout.BorderPane skinNode -
valueHolderNode
private javafx.scene.layout.BorderPane valueHolderNode -
unclickTimer
-
repeatDecrementClickTimer
-
repeatIncrementClickTimer
-
textField
private javafx.scene.control.TextField textField
-
-
Constructor Details
-
ListSpinnerSkin
-
-
Method Details
-
construct
private void construct() -
refreshValue
private void refreshValue() -
arrowPositionProperty
public final javafx.beans.property.ObjectProperty<ListSpinnerSkin.ArrowPosition> arrowPositionProperty()arrowPosition- Returns:
- the
arrowPosition
property - See Also:
-
setArrowPosition
Sets the value of thearrowPosition
property.- Property description:
- arrowPosition
- Parameters:
value
- the value for thearrowPosition
property- See Also:
-
getArrowPosition
Gets the value of thearrowPosition
property.- Property description:
- arrowPosition
- Returns:
- the value of the
arrowPosition
property - See Also:
-
withArrowPosition
-
arrowDirectionProperty
public final javafx.beans.property.ObjectProperty<ListSpinnerSkin.ArrowDirection> arrowDirectionProperty()arrowDirection- Returns:
- the
arrowDirection
property - See Also:
-
setArrowDirection
Sets the value of thearrowDirection
property.- Property description:
- arrowDirection
- Parameters:
value
- the value for thearrowDirection
property- See Also:
-
getArrowDirection
Gets the value of thearrowDirection
property.- Property description:
- arrowDirection
- Returns:
- the value of the
arrowDirection
property - See Also:
-
withArrowDirection
-
valueAlignmentProperty
public final javafx.beans.property.ObjectProperty<javafx.geometry.Pos> valueAlignmentProperty()valueAlignment- Returns:
- the
valueAlignment
property - See Also:
-
setValueAlignment
public final void setValueAlignment(javafx.geometry.Pos value) Sets the value of thevalueAlignment
property.- Property description:
- valueAlignment
- Parameters:
value
- the value for thevalueAlignment
property- See Also:
-
getValueAlignment
public final javafx.geometry.Pos getValueAlignment()Gets the value of thevalueAlignment
property.- Property description:
- valueAlignment
- Returns:
- the value of the
valueAlignment
property - See Also:
-
withValueAlignment
-
getClassCssMetaData
- Returns:
- The CssMetaData associated with this class, which may include the CssMetaData of its super classes.
-
getCssMetaData
This method should delegate toNode.getClassCssMetaData()
so that a Node's CssMetaData can be accessed without the need for reflection.- Overrides:
getCssMetaData
in classjavafx.scene.control.SkinBase<ListSpinner<T>>
- Returns:
- The CssMetaData associated with this node, which may include the CssMetaData of its super classes.
-
createNodes
private void createNodes()Construct the nodes. Spinner uses a GridPane where the arrows and the node for the value are laid out according to the arrows direction and location. A place holder in inserted into the GridPane to hold the value node, so the spinner can alternate between editable or readonly mode, without having to recreate the GridPane. -
mouseEventOverArrow
private boolean mouseEventOverArrow(javafx.scene.input.MouseEvent evt, javafx.scene.layout.Region region) Check if the mouse event is considered to have happened over the arrow- Parameters:
evt
-region
-- Returns:
-
unclickArrows
private void unclickArrows()Remove clicked CSS styling from the arrows -
replaceValueNode
private void replaceValueNode()Put the correct node for the value's place holder: - either the TextField when in editable mode, - or a node generated by the cell factory when in readonly mode. -
alignValue
private void alignValue()align the value inside the plave holder -
parse
protected void parse(javafx.scene.control.TextField textField) Parse the contents of the textfield- Parameters:
textField
-
-
layout
private void layout()Lays out the spinner, depending on the location and direction of the arrows. -
setArrowCSS
private void setArrowCSS()Set the CSS according to the direction of the arrows, so the correct arrows are shown -
parse
Parse the value (which usually comes from the TextField in the skin). If the value exists in the current items, select it. If not and a callback is defined, call the callback to have it handle it. Otherwise do nothing (leave it to the skin).
-