Class ListSpinnerSkin<T>
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>>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumprivate static class -
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 -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate javafx.beans.property.ObjectProperty<ListSpinnerSkin.ArrowDirection> private javafx.beans.property.ObjectProperty<ListSpinnerSkin.ArrowPosition> private javafx.scene.layout.Regionprivate javafx.scene.layout.Regionprivate final Timerprivate final Timerprivate javafx.scene.layout.BorderPaneprivate javafx.scene.control.TextFieldprivate final Timerprivate javafx.beans.property.ObjectProperty<javafx.geometry.Pos> private javafx.scene.layout.BorderPane -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidalign the value inside the plave holderfinal javafx.beans.property.ObjectProperty<ListSpinnerSkin.ArrowDirection> arrowDirectionfinal javafx.beans.property.ObjectProperty<ListSpinnerSkin.ArrowPosition> arrowPositionprivate voidprivate voidConstruct the nodes.Gets the value of thearrowDirectionproperty.Gets the value of thearrowPositionproperty.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.PosGets the value of thevalueAlignmentproperty.private voidlayout()Lays out the spinner, depending on the location and direction of the arrows.private booleanmouseEventOverArrow(javafx.scene.input.MouseEvent evt, javafx.scene.layout.Region region) Check if the mouse event is considered to have happened over the arrowvoidParse the value (which usually comes from the TextField in the skin).protected voidparse(javafx.scene.control.TextField textField) Parse the contents of the textfieldprivate voidprivate voidPut 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 voidSet the CSS according to the direction of the arrows, so the correct arrows are shownfinal voidSets the value of thearrowDirectionproperty.final voidSets the value of thearrowPositionproperty.final voidsetValueAlignment(javafx.geometry.Pos value) Sets the value of thevalueAlignmentproperty.private voidRemove 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
arrowPositionproperty - See Also:
-
setArrowPosition
Sets the value of thearrowPositionproperty.- Property description:
- arrowPosition
- Parameters:
value- the value for thearrowPositionproperty- See Also:
-
getArrowPosition
Gets the value of thearrowPositionproperty.- Property description:
- arrowPosition
- Returns:
- the value of the
arrowPositionproperty - See Also:
-
withArrowPosition
-
arrowDirectionProperty
public final javafx.beans.property.ObjectProperty<ListSpinnerSkin.ArrowDirection> arrowDirectionProperty()arrowDirection- Returns:
- the
arrowDirectionproperty - See Also:
-
setArrowDirection
Sets the value of thearrowDirectionproperty.- Property description:
- arrowDirection
- Parameters:
value- the value for thearrowDirectionproperty- See Also:
-
getArrowDirection
Gets the value of thearrowDirectionproperty.- Property description:
- arrowDirection
- Returns:
- the value of the
arrowDirectionproperty - See Also:
-
withArrowDirection
-
valueAlignmentProperty
public final javafx.beans.property.ObjectProperty<javafx.geometry.Pos> valueAlignmentProperty()valueAlignment- Returns:
- the
valueAlignmentproperty - See Also:
-
setValueAlignment
public final void setValueAlignment(javafx.geometry.Pos value) Sets the value of thevalueAlignmentproperty.- Property description:
- valueAlignment
- Parameters:
value- the value for thevalueAlignmentproperty- See Also:
-
getValueAlignment
public final javafx.geometry.Pos getValueAlignment()Gets the value of thevalueAlignmentproperty.- Property description:
- valueAlignment
- Returns:
- the value of the
valueAlignmentproperty - 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:
getCssMetaDatain 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).
-