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
TypePropertyDescriptionfinal 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.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
Modifier and TypeClassDescriptionstatic class
A strip cell is being used by cell factories of theStripView
control. -
Field Summary
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
-
Method Summary
Modifier and TypeMethodDescriptionfinal 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 theanimationDuration
property.final javafx.util.Callback<StripView<T>,
StripView.StripCell<T>> Gets the value of thecellFactory
property.final double
Gets the value of thefadingSize
property.final javafx.collections.ObservableList<T>
getItems()
Gets the value of theitems
property.final T
Gets the value of theselectedItem
property.final boolean
Gets the value of thealwaysCenter
property.final boolean
Gets the value of theanimateScrolling
property.final boolean
Gets the value of theautoScrolling
property.final javafx.beans.property.ListProperty<T>
The model used by the strip view control.void
final javafx.beans.property.ObjectProperty<T>
Stores the currently selected item.final void
setAlwaysCenter
(boolean alwaysCenter) Sets the value of thealwaysCenter
property.final void
setAnimateScrolling
(boolean animateScrolling) Sets the value of theanimateScrolling
property.final void
setAnimationDuration
(javafx.util.Duration animationDuration) Sets the value of theanimationDuration
property.final void
setAutoScrolling
(boolean autoScrolling) Sets the value of theautoScrolling
property.final void
setCellFactory
(javafx.util.Callback<StripView<T>, StripView.StripCell<T>> cellFactory) Sets the value of thecellFactory
property.final void
setFadingSize
(double fadingSize) Sets the value of thefadingSize
property.final void
Sets the value of theitems
property.final void
setSelectedItem
(T selectedItem) Sets the value of theselectedItem
property.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, 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 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:
createDefaultSkin
in classjavafx.scene.control.Control
-
getUserAgentStylesheet
- Overrides:
getUserAgentStylesheet
in classjavafx.scene.layout.Region
-
isAlwaysCenter
public final boolean isAlwaysCenter()Gets the value of thealwaysCenter
property.- 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
alwaysCenter
property - 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 thealwaysCenter
property.- 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 thealwaysCenter
property- See Also:
-
getFadingSize
public final double getFadingSize()Gets the value of thefadingSize
property.- Property description:
- Specifies the size of the fade in / out areas on the left- and right-hand side.
- Returns:
- the value of the
fadingSize
property - 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 thefadingSize
property.- Property description:
- Specifies the size of the fade in / out areas on the left- and right-hand side.
- Parameters:
fadingSize
- the value for thefadingSize
property- 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 theautoScrolling
property.- Property description:
- Determines whether the view will automatically scroll to a newly selected item.
- Returns:
- the value of the
autoScrolling
property - See Also:
-
setAutoScrolling
public final void setAutoScrolling(boolean autoScrolling) Sets the value of theautoScrolling
property.- Property description:
- Determines whether the view will automatically scroll to a newly selected item.
- Parameters:
autoScrolling
- the value for theautoScrolling
property- 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 theanimateScrolling
property.- Property description:
- Enables or disables whether animation is being used when scrolling to the left or right.
- Returns:
- the value of the
animateScrolling
property - See Also:
-
setAnimateScrolling
public final void setAnimateScrolling(boolean animateScrolling) Sets the value of theanimateScrolling
property.- Property description:
- Enables or disables whether animation is being used when scrolling to the left or right.
- Parameters:
animateScrolling
- the value for theanimateScrolling
property- 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 theanimationDuration
property.- Property description:
- Determines the duration of the scroll animation.
- Returns:
- the value of the
animationDuration
property - See Also:
-
setAnimationDuration
public final void setAnimationDuration(javafx.util.Duration animationDuration) Sets the value of theanimationDuration
property.- Property description:
- Determines the duration of the scroll animation.
- Parameters:
animationDuration
- the value for theanimationDuration
property- See Also:
-
selectedItemProperty
Stores the currently selected item.- Returns:
- the selected item
- See Also:
-
getSelectedItem
Gets the value of theselectedItem
property.- Property description:
- Stores the currently selected item.
- Returns:
- the value of the
selectedItem
property - See Also:
-
setSelectedItem
Sets the value of theselectedItem
property.- Property description:
- Stores the currently selected item.
- Parameters:
selectedItem
- the value for theselectedItem
property- 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 theitems
property.- Property description:
- The model used by the strip view control.
- Returns:
- the value of the
items
property - See Also:
-
setItems
Sets the value of theitems
property.- Property description:
- The model used by the strip view control.
- Parameters:
items
- the value for theitems
property- See Also:
-
getCellFactory
Gets the value of thecellFactory
property.- Property description:
- A factory used for creating cells that will display the items added to the strip view.
- Returns:
- the value of the
cellFactory
property - 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 thecellFactory
property.- Property description:
- A factory used for creating cells that will display the items added to the strip view.
- Parameters:
cellFactory
- the value for thecellFactory
property- See Also:
-
scrollTo
-