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.BooleanPropertyProperty 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, 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 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 doubleGets the value of the property fadingSize.final javafx.collections.ObservableList<T>getItems()Gets the value of the property items.final TGets the value of the property selectedItem.final booleanGets the value of the property alwaysCenter.final booleanGets the value of the property animateScrolling.final booleanGets the value of the property autoScrolling.final booleanGets the value of the property loopSelection.final javafx.beans.property.ListProperty<T>The model used by the strip view control.final javafx.beans.property.BooleanPropertyProperty to determine whether the selection should loop from the end to the start and vice versa.voidfinal javafx.beans.property.ObjectProperty<T>Stores the currently selected item.final voidsetAlwaysCenter(boolean alwaysCenter) Sets the value of the property alwaysCenter.final voidsetAnimateScrolling(boolean animateScrolling) Sets the value of the property animateScrolling.final voidsetAnimationDuration(javafx.util.Duration animationDuration) Sets the value of the property animationDuration.final voidsetAutoScrolling(boolean autoScrolling) Sets the value of the property autoScrolling.final voidsetCellFactory(javafx.util.Callback<StripView<T>, StripView.StripCell<T>> cellFactory) Sets the value of the property cellFactory.final voidsetFadingSize(double fadingSize) Sets the value of the property fadingSize.final voidSets the value of the property items.final voidsetLoopSelection(boolean value) Sets the value of the property loopSelection.final voidsetSelectedItem(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, 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).- See Also:
-
fadingSize
public final javafx.beans.property.DoubleProperty fadingSizePropertySpecifies the size of the fade in / out areas on the left- and right-hand side.- See Also:
-
autoScrolling
public final javafx.beans.property.BooleanProperty autoScrollingPropertyDetermines whether the view will automatically scroll to a newly selected item.- See Also:
-
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.- See Also:
-
items
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>>> cellFactoryPropertyA factory used for creating cells that will display the items added to the strip view.- See Also:
-
loopSelection
public final javafx.beans.property.BooleanProperty loopSelectionPropertyProperty 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
-
-
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 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. -
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. -
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
Stores the currently selected item.- See Also:
-
getSelectedItem
Gets the value of the property selectedItem.- Property description:
- Stores the currently selected item.
-
setSelectedItem
Sets the value of the property selectedItem.- Property description:
- Stores the currently selected item.
-
itemsProperty
The model used by the strip view control.- See Also:
-
getItems
Gets the value of the property items.- Property description:
- The model used by the strip view control.
-
setItems
Sets the value of the property items.- Property description:
- The model used by the strip view control.
-
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
-
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
- Overrides:
getControlCssMetaDatain classjavafx.scene.control.Control
-
getClassCssMetaData
-