java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.control.Control
com.dlsc.gemsfx.StripView<T>
- Type Parameters:
T- the type of the items shown by the view
- All Implemented Interfaces:
javafx.css.Styleable,javafx.event.EventTarget,javafx.scene.control.Skinnable
public class StripView<T>
extends javafx.scene.control.Control
A view which can be used to lay out a fixed number of items horizontally. If the
available width is not sufficient then scrolling buttons will appear on either side
of the view so that the user can make hidden items visible. The nice thing about
this control is that it uses a
MaskedView to fade out the elements on the
side. This ensures that the scroll buttons will be fully visible.-
Property Summary
PropertiesTypePropertyDescriptionfinal javafx.beans.property.BooleanPropertyA flag used to signal whether the currently selected item should always end up in the center location of the view (if possible).final javafx.beans.property.BooleanPropertyEnables or disables whether animation is being used when scrolling to the left or right.final javafx.beans.property.ObjectProperty<javafx.util.Duration>Determines the duration of the scroll animation.final javafx.beans.property.BooleanPropertyDetermines whether the view will automatically scroll to a newly selected item.final javafx.beans.property.ObjectProperty<javafx.util.Callback<StripView<T>,StripView.StripCell<T>>> A factory used for creating cells that will display the items added to the strip view.final javafx.beans.property.DoublePropertySpecifies the size of the fade in / out areas on the left- and right-hand side.final javafx.beans.property.ListProperty<T>The model used by the strip view control.final javafx.beans.property.ObjectProperty<T>Stores the currently selected item.Properties inherited from class javafx.scene.control.Control
contextMenu, skin, tooltipProperties inherited from class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, widthProperties inherited from class javafx.scene.Parent
needsLayoutProperties inherited from class javafx.scene.Node
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, focusVisible, focusWithin, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible -
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA strip cell is being used by cell factories of theStripViewcontrol. -
Field Summary
FieldsFields inherited from class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZEFields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal javafx.beans.property.BooleanPropertyA flag used to signal whether the currently selected item should always end up in the center location of the view (if possible).final javafx.beans.property.BooleanPropertyEnables or disables whether animation is being used when scrolling to the left or right.final javafx.beans.property.ObjectProperty<javafx.util.Duration>Determines the duration of the scroll animation.final javafx.beans.property.BooleanPropertyDetermines whether the view will automatically scroll to a newly selected item.final javafx.beans.property.ObjectProperty<javafx.util.Callback<StripView<T>,StripView.StripCell<T>>> A factory used for creating cells that will display the items added to the strip view.protected javafx.scene.control.Skin<?>final javafx.beans.property.DoublePropertySpecifies the size of the fade in / out areas on the left- and right-hand side.final javafx.util.DurationGets the value of theanimationDurationproperty.final javafx.util.Callback<StripView<T>,StripView.StripCell<T>> Gets the value of thecellFactoryproperty.final doubleGets the value of thefadingSizeproperty.final javafx.collections.ObservableList<T>getItems()Gets the value of theitemsproperty.final TGets the value of theselectedItemproperty.final booleanGets the value of thealwaysCenterproperty.final booleanGets the value of theanimateScrollingproperty.final booleanGets the value of theautoScrollingproperty.final javafx.beans.property.ListProperty<T>The model used by the strip view control.voidfinal javafx.beans.property.ObjectProperty<T>Stores the currently selected item.final voidsetAlwaysCenter(boolean alwaysCenter) Sets the value of thealwaysCenterproperty.final voidsetAnimateScrolling(boolean animateScrolling) Sets the value of theanimateScrollingproperty.final voidsetAnimationDuration(javafx.util.Duration animationDuration) Sets the value of theanimationDurationproperty.final voidsetAutoScrolling(boolean autoScrolling) Sets the value of theautoScrollingproperty.final voidsetCellFactory(javafx.util.Callback<StripView<T>, StripView.StripCell<T>> cellFactory) Sets the value of thecellFactoryproperty.final voidsetFadingSize(double fadingSize) Sets the value of thefadingSizeproperty.final voidSets the value of theitemsproperty.final voidsetSelectedItem(T selectedItem) Sets the value of theselectedItemproperty.Methods inherited from class javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, executeAccessibleAction, getBaselineOffset, getClassCssMetaData, getContextMenu, getControlCssMetaData, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, layoutChildren, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinProperty, tooltipPropertyMethods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthPropertyMethods inherited from class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBoundsMethods inherited from class javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, focusVisibleProperty, focusWithinProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isFocusVisible, isFocusWithin, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visiblePropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javafx.css.Styleable
getStyleableNode
-
Property Details
-
alwaysCenter
public final javafx.beans.property.BooleanProperty alwaysCenterPropertyA flag used to signal whether the currently selected item should always end up in the center location of the view (if possible). -
fadingSize
public final javafx.beans.property.DoubleProperty fadingSizePropertySpecifies the size of the fade in / out areas on the left- and right-hand side. -
autoScrolling
public final javafx.beans.property.BooleanProperty autoScrollingPropertyDetermines whether the view will automatically scroll to a newly selected item. -
animateScrolling
public final javafx.beans.property.BooleanProperty animateScrollingPropertyEnables or disables whether animation is being used when scrolling to the left or right. -
animationDuration
public final javafx.beans.property.ObjectProperty<javafx.util.Duration> animationDurationPropertyDetermines the duration of the scroll animation. -
selectedItem
Stores the currently selected item. -
items
The model used by the strip view control. -
cellFactory
public final javafx.beans.property.ObjectProperty<javafx.util.Callback<StripView<T>,StripView.StripCell<T>>> cellFactoryPropertyA factory used for creating cells that will display the items added to the strip view.
-
-
Field Details
-
selectedItem
-
-
Constructor Details
-
StripView
public StripView()Constructs a new strip view.
-
-
Method Details
-
createDefaultSkin
protected javafx.scene.control.Skin<?> createDefaultSkin()- Overrides:
createDefaultSkinin classjavafx.scene.control.Control
-
getUserAgentStylesheet
- Overrides:
getUserAgentStylesheetin classjavafx.scene.layout.Region
-
isAlwaysCenter
public final boolean isAlwaysCenter()Gets the value of thealwaysCenterproperty.- Property description:
- A flag used to signal whether the currently selected item should always end up in the center location of the view (if possible).
- Returns:
- the value of the
alwaysCenterproperty - See Also:
-
alwaysCenterProperty
public final javafx.beans.property.BooleanProperty alwaysCenterProperty()A flag used to signal whether the currently selected item should always end up in the center location of the view (if possible).- Returns:
- true if the selected item will be centered
- See Also:
-
setAlwaysCenter
public final void setAlwaysCenter(boolean alwaysCenter) Sets the value of thealwaysCenterproperty.- Property description:
- A flag used to signal whether the currently selected item should always end up in the center location of the view (if possible).
- Parameters:
alwaysCenter- the value for thealwaysCenterproperty- See Also:
-
getFadingSize
public final double getFadingSize()Gets the value of thefadingSizeproperty.- Property description:
- Specifies the size of the fade in / out areas on the left- and right-hand side.
- Returns:
- the value of the
fadingSizeproperty - See Also:
-
fadingSizeProperty
public final javafx.beans.property.DoubleProperty fadingSizeProperty()Specifies the size of the fade in / out areas on the left- and right-hand side.- Returns:
- the size of the fading areas / the clips used for fading
- See Also:
-
setFadingSize
public final void setFadingSize(double fadingSize) Sets the value of thefadingSizeproperty.- Property description:
- Specifies the size of the fade in / out areas on the left- and right-hand side.
- Parameters:
fadingSize- the value for thefadingSizeproperty- See Also:
-
autoScrollingProperty
public final javafx.beans.property.BooleanProperty autoScrollingProperty()Determines whether the view will automatically scroll to a newly selected item.- Returns:
- true if the control uses automatic scrolling when an item becomes selected
- See Also:
-
isAutoScrolling
public final boolean isAutoScrolling()Gets the value of theautoScrollingproperty.- Property description:
- Determines whether the view will automatically scroll to a newly selected item.
- Returns:
- the value of the
autoScrollingproperty - See Also:
-
setAutoScrolling
public final void setAutoScrolling(boolean autoScrolling) Sets the value of theautoScrollingproperty.- Property description:
- Determines whether the view will automatically scroll to a newly selected item.
- Parameters:
autoScrolling- the value for theautoScrollingproperty- See Also:
-
animateScrollingProperty
public final javafx.beans.property.BooleanProperty animateScrollingProperty()Enables or disables whether animation is being used when scrolling to the left or right.- Returns:
- true if the scroll operation will be animated
- See Also:
-
isAnimateScrolling
public final boolean isAnimateScrolling()Gets the value of theanimateScrollingproperty.- Property description:
- Enables or disables whether animation is being used when scrolling to the left or right.
- Returns:
- the value of the
animateScrollingproperty - See Also:
-
setAnimateScrolling
public final void setAnimateScrolling(boolean animateScrolling) Sets the value of theanimateScrollingproperty.- Property description:
- Enables or disables whether animation is being used when scrolling to the left or right.
- Parameters:
animateScrolling- the value for theanimateScrollingproperty- See Also:
-
animationDurationProperty
public final javafx.beans.property.ObjectProperty<javafx.util.Duration> animationDurationProperty()Determines the duration of the scroll animation.- Returns:
- the scroll animation duration
- See Also:
-
getAnimationDuration
public final javafx.util.Duration getAnimationDuration()Gets the value of theanimationDurationproperty.- Property description:
- Determines the duration of the scroll animation.
- Returns:
- the value of the
animationDurationproperty - See Also:
-
setAnimationDuration
public final void setAnimationDuration(javafx.util.Duration animationDuration) Sets the value of theanimationDurationproperty.- Property description:
- Determines the duration of the scroll animation.
- Parameters:
animationDuration- the value for theanimationDurationproperty- See Also:
-
selectedItemProperty
Stores the currently selected item.- Returns:
- the selected item
- See Also:
-
getSelectedItem
Gets the value of theselectedItemproperty.- Property description:
- Stores the currently selected item.
- Returns:
- the value of the
selectedItemproperty - See Also:
-
setSelectedItem
Sets the value of theselectedItemproperty.- Property description:
- Stores the currently selected item.
- Parameters:
selectedItem- the value for theselectedItemproperty- See Also:
-
itemsProperty
The model used by the strip view control.- Returns:
- the list of items shown in the view
- See Also:
-
getItems
Gets the value of theitemsproperty.- Property description:
- The model used by the strip view control.
- Returns:
- the value of the
itemsproperty - See Also:
-
setItems
Sets the value of theitemsproperty.- Property description:
- The model used by the strip view control.
- Parameters:
items- the value for theitemsproperty- See Also:
-
getCellFactory
Gets the value of thecellFactoryproperty.- Property description:
- A factory used for creating cells that will display the items added to the strip view.
- Returns:
- the value of the
cellFactoryproperty - See Also:
-
cellFactoryProperty
public final javafx.beans.property.ObjectProperty<javafx.util.Callback<StripView<T>,StripView.StripCell<T>>> cellFactoryProperty()A factory used for creating cells that will display the items added to the strip view.- Returns:
- the cell factory
- See Also:
-
setCellFactory
public final void setCellFactory(javafx.util.Callback<StripView<T>, StripView.StripCell<T>> cellFactory) Sets the value of thecellFactoryproperty.- Property description:
- A factory used for creating cells that will display the items added to the strip view.
- Parameters:
cellFactory- the value for thecellFactoryproperty- See Also:
-
scrollTo
-