Class StripView<T>

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

    Properties
    Type
    Property
    Description
    final javafx.beans.property.BooleanProperty
    A 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.BooleanProperty
    Enables 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.BooleanProperty
    Determines 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.DoubleProperty
    Specifies 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.BooleanProperty
    Property to determine whether the selection should loop from the end to the start and vice versa.
    final javafx.beans.property.ObjectProperty<T>
    Stores the currently selected item.

    Properties inherited from class javafx.scene.control.Control

    contextMenu, skin, tooltip

    Properties inherited from class javafx.scene.layout.Region

    background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width

    Properties inherited from class javafx.scene.Parent

    needsLayout

    Properties 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 Classes
    Modifier and Type
    Class
    Description
    static class 
    A strip cell is being used by cell factories of the StripView control.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final javafx.beans.property.ObjectProperty<T>
     

    Fields inherited from class javafx.scene.layout.Region

    USE_COMPUTED_SIZE, USE_PREF_SIZE

    Fields inherited from class javafx.scene.Node

    BASELINE_OFFSET_SAME_AS_HEIGHT
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new strip view.
  • Method Summary

    Modifier and Type
    Method
    Description
    final javafx.beans.property.BooleanProperty
    A 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.BooleanProperty
    Enables 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.BooleanProperty
    Determines 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.DoubleProperty
    Specifies the size of the fade in / out areas on the left- and right-hand side.
    final javafx.util.Duration
    Gets the value of the property animationDuration.
    final javafx.util.Callback<StripView<T>,StripView.StripCell<T>>
    Gets the value of the property cellFactory.
    static List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>>
     
    protected List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>>
     
    final double
    Gets the value of the property fadingSize.
    final javafx.collections.ObservableList<T>
    Gets the value of the property items.
    final T
    Gets the value of the property selectedItem.
     
    final boolean
    Gets the value of the property alwaysCenter.
    final boolean
    Gets the value of the property animateScrolling.
    final boolean
    Gets the value of the property autoScrolling.
    final boolean
    Gets the value of the property loopSelection.
    final javafx.beans.property.ListProperty<T>
    The model used by the strip view control.
    final javafx.beans.property.BooleanProperty
    Property to determine whether the selection should loop from the end to the start and vice versa.
    void
    scrollTo(T item)
     
    final javafx.beans.property.ObjectProperty<T>
    Stores the currently selected item.
    final void
    setAlwaysCenter(boolean alwaysCenter)
    Sets the value of the property alwaysCenter.
    final void
    setAnimateScrolling(boolean animateScrolling)
    Sets the value of the property animateScrolling.
    final void
    setAnimationDuration(javafx.util.Duration animationDuration)
    Sets the value of the property animationDuration.
    final void
    setAutoScrolling(boolean autoScrolling)
    Sets the value of the property autoScrolling.
    final void
    setCellFactory(javafx.util.Callback<StripView<T>,StripView.StripCell<T>> cellFactory)
    Sets the value of the property cellFactory.
    final void
    setFadingSize(double fadingSize)
    Sets the value of the property fadingSize.
    final void
    setItems(javafx.collections.ObservableList<T> items)
    Sets the value of the property items.
    final void
    setLoopSelection(boolean value)
    Sets the value of the property loopSelection.
    final void
    setSelectedItem(T selectedItem)
    Sets the value of the property selectedItem.

    Methods inherited from class javafx.scene.control.Control

    computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, executeAccessibleAction, getBaselineOffset, getContextMenu, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, layoutChildren, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinProperty, tooltipProperty

    Methods 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, widthProperty

    Methods inherited from class javafx.scene.Parent

    getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBounds

    Methods 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, visibleProperty

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface javafx.css.Styleable

    getStyleableNode
  • Property Details

    • alwaysCenter

      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).
      See Also:
    • fadingSize

      public final javafx.beans.property.DoubleProperty fadingSizeProperty
      Specifies the size of the fade in / out areas on the left- and right-hand side.
      See Also:
    • autoScrolling

      public final javafx.beans.property.BooleanProperty autoScrollingProperty
      Determines whether the view will automatically scroll to a newly selected item.
      See Also:
    • animateScrolling

      public final javafx.beans.property.BooleanProperty animateScrollingProperty
      Enables or disables whether animation is being used when scrolling to the left or right.
      See Also:
    • animationDuration

      public final javafx.beans.property.ObjectProperty<javafx.util.Duration> animationDurationProperty
      Determines the duration of the scroll animation.
      See Also:
    • selectedItem

      public final javafx.beans.property.ObjectProperty<T> selectedItemProperty
      Stores the currently selected item.
      See Also:
    • items

      public final javafx.beans.property.ListProperty<T> itemsProperty
      The model used by the strip view control.
      See Also:
    • cellFactory

      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.
      See Also:
    • loopSelection

      public final javafx.beans.property.BooleanProperty loopSelectionProperty
      Property to determine whether the selection should loop from the end to the start and vice versa. true means that the selection will loop.
      See Also:
  • Field Details

    • selectedItem

      public final javafx.beans.property.ObjectProperty<T> selectedItem
  • Constructor Details

    • StripView

      public StripView()
      Constructs a new strip view.
  • Method Details

    • createDefaultSkin

      protected javafx.scene.control.Skin<?> createDefaultSkin()
      Overrides:
      createDefaultSkin in class javafx.scene.control.Control
    • getUserAgentStylesheet

      public String getUserAgentStylesheet()
      Overrides:
      getUserAgentStylesheet in class javafx.scene.layout.Region
    • isAlwaysCenter

      public final boolean isAlwaysCenter()
      Gets the value of the property alwaysCenter.
      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).
    • 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).
      See Also:
    • setAlwaysCenter

      public final void setAlwaysCenter(boolean alwaysCenter)
      Sets the value of the property alwaysCenter.
      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).
    • getFadingSize

      public final double getFadingSize()
      Gets the value of the property fadingSize.
      Property description:
      Specifies the size of the fade in / out areas on the left- and right-hand side.
    • fadingSizeProperty

      public final javafx.beans.property.DoubleProperty fadingSizeProperty()
      Specifies the size of the fade in / out areas on the left- and right-hand side.
      See Also:
    • setFadingSize

      public final void setFadingSize(double fadingSize)
      Sets the value of the property fadingSize.
      Property description:
      Specifies the size of the fade in / out areas on the left- and right-hand side.
    • autoScrollingProperty

      public final javafx.beans.property.BooleanProperty autoScrollingProperty()
      Determines whether the view will automatically scroll to a newly selected item.
      See Also:
    • isAutoScrolling

      public final boolean isAutoScrolling()
      Gets the value of the property autoScrolling.
      Property description:
      Determines whether the view will automatically scroll to a newly selected item.
    • setAutoScrolling

      public final void setAutoScrolling(boolean autoScrolling)
      Sets the value of the property autoScrolling.
      Property description:
      Determines whether the view will automatically scroll to a newly selected item.
    • animateScrollingProperty

      public final javafx.beans.property.BooleanProperty animateScrollingProperty()
      Enables or disables whether animation is being used when scrolling to the left or right.
      See Also:
    • isAnimateScrolling

      public final boolean isAnimateScrolling()
      Gets the value of the property animateScrolling.
      Property description:
      Enables or disables whether animation is being used when scrolling to the left or right.
    • setAnimateScrolling

      public final void setAnimateScrolling(boolean animateScrolling)
      Sets the value of the property animateScrolling.
      Property description:
      Enables or disables whether animation is being used when scrolling to the left or right.
    • animationDurationProperty

      public final javafx.beans.property.ObjectProperty<javafx.util.Duration> animationDurationProperty()
      Determines the duration of the scroll animation.
      See Also:
    • getAnimationDuration

      public final javafx.util.Duration getAnimationDuration()
      Gets the value of the property animationDuration.
      Property description:
      Determines the duration of the scroll animation.
    • setAnimationDuration

      public final void setAnimationDuration(javafx.util.Duration animationDuration)
      Sets the value of the property animationDuration.
      Property description:
      Determines the duration of the scroll animation.
    • selectedItemProperty

      public final javafx.beans.property.ObjectProperty<T> selectedItemProperty()
      Stores the currently selected item.
      See Also:
    • getSelectedItem

      public final T getSelectedItem()
      Gets the value of the property selectedItem.
      Property description:
      Stores the currently selected item.
    • setSelectedItem

      public final void setSelectedItem(T selectedItem)
      Sets the value of the property selectedItem.
      Property description:
      Stores the currently selected item.
    • itemsProperty

      public final javafx.beans.property.ListProperty<T> itemsProperty()
      The model used by the strip view control.
      See Also:
    • getItems

      public final javafx.collections.ObservableList<T> getItems()
      Gets the value of the property items.
      Property description:
      The model used by the strip view control.
    • setItems

      public final void setItems(javafx.collections.ObservableList<T> items)
      Sets the value of the property items.
      Property description:
      The model used by the strip view control.
    • getCellFactory

      public final javafx.util.Callback<StripView<T>,StripView.StripCell<T>> getCellFactory()
      Gets the value of the property cellFactory.
      Property description:
      A factory used for creating cells that will display the items added to the strip view.
    • 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.
      See Also:
    • setCellFactory

      public final void setCellFactory(javafx.util.Callback<StripView<T>,StripView.StripCell<T>> cellFactory)
      Sets the value of the property cellFactory.
      Property description:
      A factory used for creating cells that will display the items added to the strip view.
    • scrollTo

      public void scrollTo(T item)
    • isLoopSelection

      public final boolean isLoopSelection()
      Gets the value of the property loopSelection.
      Property description:
      Property to determine whether the selection should loop from the end to the start and vice versa. true means that the selection will loop.
    • setLoopSelection

      public final void setLoopSelection(boolean value)
      Sets the value of the property loopSelection.
      Property description:
      Property to determine whether the selection should loop from the end to the start and vice versa. true means that the selection will loop.
    • loopSelectionProperty

      public final javafx.beans.property.BooleanProperty loopSelectionProperty()
      Property to determine whether the selection should loop from the end to the start and vice versa. true means that the selection will loop.
      See Also:
    • getControlCssMetaData

      protected List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>> getControlCssMetaData()
      Overrides:
      getControlCssMetaData in class javafx.scene.control.Control
    • getClassCssMetaData

      public static List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>> getClassCssMetaData()