T
- This type is used to represent the type of the objects stored in
the AvatarPane's items
ObservableList.@DefaultProperty(value="items")
public class AvatarPane<T>
extends javafx.scene.control.Control
The AvatarPane contains a collection of Avatar
s on the top, over a content Node
.
Typically the content being shown is a description of the corresponding selected Avatar, the user selects
an Avatar by clicking/tapping that Avatar.
An items property exists to hold the collection of items from a data model. For the creation of each Avatar the programmer must set an Avatar factory, the Avatar factory receives an item and should create an Avatar based on that item. A content factory, with a return type of Node, is also needed to populate the content beneath the Avatars.
The following example creates an AvatarPane containing a list of speakers. Sets the Avatar factory with a
factory that returns an Avatar with speaker.getPicture()
as the Image
URL, and
sets a content factory that returns a vertical list containing speaker.getFullName()
,
speaker.getJobTitle()
, speaker.getCompany()
and speaker.getSummary()
.
AvatarPane<Speaker> avatarPane = new AvatarPane<>(speakers);
avatarPane.setAvatarFactory(speaker -> {
Avatar avatar = new Avatar();
Image image = new Image(speaker.getPicture());
avatar.setImage(image);
return avatar;
});
avatarPane.setContentFactory(speaker -> {
VBox container = new VBox();
Label name = new Label(speaker.getFullName());
name.setWrapText(true);
Label jobTitle = new Label(speaker.getJobTitle());
jobTitle.setWrapText(true);
Label company = new Label(speaker.getCompany());
company.setWrapText(true);
Label summary = new Label(speaker.getSummary());
summary.setWrapText(true);
container.getChildren().addAll(name, jobTitle, company, summary);
return container;
});
Avatar
Type | Property and Description |
---|---|
javafx.beans.property.ObjectProperty<javafx.util.Callback<T,Avatar>> |
avatarFactory
For every item in the AvatarPane the avatar factory is called to get the
Avatar to be placed with the other Avatars on the top. |
javafx.beans.property.BooleanProperty |
collapsible
If set to true the AvatarPane may be expanded or collapsed (refer to
expandedProperty() )
by the user by pressing the currently selected Avatar . |
javafx.beans.property.ObjectProperty<javafx.util.Callback<T,javafx.scene.Node>> |
contentFactory
For every item in the AvatarPane the content factory is called to get the content
Node
to show below the corresponding Avatar . |
javafx.beans.property.ObjectProperty<java.lang.Runnable> |
exitAction |
javafx.beans.property.BooleanProperty |
expanded
Whether the content should be expanded.
|
javafx.beans.property.ListProperty<T> |
items
The list of items to be shown in this AvatarPane.
|
javafx.beans.property.ObjectProperty<T> |
value
The selected item.
|
contextMenu, skinClassName, skin, tooltip
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, impl_showMnemonics, impl_treeVisible, 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, visible
Constructor and Description |
---|
AvatarPane()
The default constructor, creates an empty AvatarPane with no items.
|
AvatarPane(javafx.collections.ObservableList<T> items)
Creates an AvatarPane with the items passed in as a parameter.
|
Modifier and Type | Method and Description |
---|---|
javafx.beans.property.ObjectProperty<javafx.util.Callback<T,Avatar>> |
avatarFactoryProperty()
For every item in the AvatarPane the avatar factory is called to get the
Avatar to be placed with the other Avatars on the top. |
javafx.beans.property.BooleanProperty |
collapsibleProperty()
If set to true the AvatarPane may be expanded or collapsed (refer to
expandedProperty() )
by the user by pressing the currently selected Avatar . |
javafx.beans.property.ObjectProperty<javafx.util.Callback<T,javafx.scene.Node>> |
contentFactoryProperty()
For every item in the AvatarPane the content factory is called to get the content
Node
to show below the corresponding Avatar . |
protected javafx.scene.control.Skin<?> |
createDefaultSkin() |
javafx.beans.property.ObjectProperty<java.lang.Runnable> |
exitActionProperty() |
javafx.beans.property.BooleanProperty |
expandedProperty()
Whether the content should be expanded.
|
javafx.util.Callback<T,Avatar> |
getAvatarFactory()
Gets the value of the property avatarFactory.
|
javafx.util.Callback<T,javafx.scene.Node> |
getContentFactory()
Gets the value of the property contentFactory.
|
java.lang.Runnable |
getExitAction()
Gets the value of the property exitAction.
|
javafx.collections.ObservableList<T> |
getItems()
Gets the value of the property items.
|
java.lang.String |
getUserAgentStylesheet() |
T |
getValue()
Gets the value of the property value.
|
boolean |
isCollapsible()
Gets the value of the property collapsible.
|
boolean |
isExpanded()
Gets the value of the property expanded.
|
javafx.beans.property.ListProperty<T> |
itemsProperty()
The list of items to be shown in this AvatarPane.
|
void |
setAvatarFactory(javafx.util.Callback<T,Avatar> value)
Sets the value of the property avatarFactory.
|
void |
setCollapsible(boolean value)
Sets the value of the property collapsible.
|
void |
setContentFactory(javafx.util.Callback<T,javafx.scene.Node> value)
Sets the value of the property contentFactory.
|
void |
setExitAction(java.lang.Runnable value)
Sets the value of the property exitAction.
|
void |
setExpanded(boolean value)
Sets the value of the property expanded.
|
void |
setItems(javafx.collections.ObservableList<T> items)
Sets the value of the property items.
|
void |
setValue(T value)
Sets the value of the property value.
|
javafx.beans.property.ObjectProperty<T> |
valueProperty()
The selected item.
|
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, executeAccessibleAction, getBaselineOffset, getClassCssMetaData, getContextMenu, getControlCssMetaData, getCssMetaData, getSkin, getTooltip, impl_cssGetFocusTraversableInitialValue, impl_processCSS, isResizable, layoutChildren, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinClassNameProperty, skinProperty, tooltipProperty
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getWidth, heightProperty, impl_computeContains, impl_computeGeomBounds, impl_computeLayoutBounds, impl_createPeer, impl_notifyLayoutBoundsChanged, impl_pickNodeLocal, impl_updatePeer, 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, snapSize, snapSpace, snapToPixelProperty, widthProperty
getChildren, getChildrenUnmodifiable, getImpl_traversalEngine, getManagedChildren, getStylesheets, impl_getAllParentStylesheets, impl_processMXNode, impl_traversalEngineProperty, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setImpl_traversalEngine, setNeedsLayout, updateBounds
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, containsBounds, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, 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, hasProperties, hoverProperty, idProperty, impl_clearDirty, impl_computeIntersects, impl_cssGetCursorInitialValue, impl_findStyles, impl_geomChanged, impl_getLeafTransform, impl_getMatchingStyles, impl_getPeer, impl_getPivotX, impl_getPivotY, impl_getPivotZ, impl_getStyleMap, impl_hasTransforms, impl_intersects, impl_intersectsBounds, impl_isDirty, impl_isDirtyEmpty, impl_isShowMnemonics, impl_isTreeVisible, impl_layoutBoundsChanged, impl_markDirty, impl_pickNode, impl_processCSS, impl_reapplyCSS, impl_setShowMnemonics, impl_setStyleMap, impl_showMnemonicsProperty, impl_syncPeer, impl_transformsChanged, impl_traverse, impl_treeVisibleProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, 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, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, visibleProperty
public final javafx.beans.property.ListProperty<T> itemsProperty
getItems()
,
setItems(ObservableList)
public final javafx.beans.property.ObjectProperty<javafx.util.Callback<T,Avatar>> avatarFactoryProperty
Avatar
to be placed with the other Avatars on the top.getAvatarFactory()
,
setAvatarFactory(Callback)
public final javafx.beans.property.ObjectProperty<javafx.util.Callback<T,javafx.scene.Node>> contentFactoryProperty
Node
to show below the corresponding Avatar
.getContentFactory()
,
setContentFactory(Callback)
public final javafx.beans.property.ObjectProperty<T> valueProperty
Avatar
.getValue()
,
setValue(T)
public final javafx.beans.property.BooleanProperty expandedProperty
isExpanded()
,
setExpanded(boolean)
public final javafx.beans.property.BooleanProperty collapsibleProperty
expandedProperty()
)
by the user by pressing the currently selected Avatar
.isCollapsible()
,
setCollapsible(boolean)
public final javafx.beans.property.ObjectProperty<java.lang.Runnable> exitActionProperty
getExitAction()
,
setExitAction(Runnable)
public AvatarPane()
public AvatarPane(javafx.collections.ObservableList<T> items)
items
- The items to be included in this AvatarPane.public final javafx.beans.property.ListProperty<T> itemsProperty()
getItems()
,
setItems(ObservableList)
public final javafx.collections.ObservableList<T> getItems()
public final void setItems(javafx.collections.ObservableList<T> items)
public final javafx.beans.property.ObjectProperty<javafx.util.Callback<T,Avatar>> avatarFactoryProperty()
Avatar
to be placed with the other Avatars on the top.getAvatarFactory()
,
setAvatarFactory(Callback)
public final javafx.util.Callback<T,Avatar> getAvatarFactory()
Avatar
to be placed with the other Avatars on the top.public final void setAvatarFactory(javafx.util.Callback<T,Avatar> value)
Avatar
to be placed with the other Avatars on the top.public final javafx.beans.property.ObjectProperty<javafx.util.Callback<T,javafx.scene.Node>> contentFactoryProperty()
Node
to show below the corresponding Avatar
.getContentFactory()
,
setContentFactory(Callback)
public final javafx.util.Callback<T,javafx.scene.Node> getContentFactory()
Node
to show below the corresponding Avatar
.public final void setContentFactory(javafx.util.Callback<T,javafx.scene.Node> value)
Node
to show below the corresponding Avatar
.public final javafx.beans.property.ObjectProperty<T> valueProperty()
Avatar
.getValue()
,
setValue(T)
public final T getValue()
Avatar
.public final void setValue(T value)
Avatar
.public final javafx.beans.property.BooleanProperty expandedProperty()
isExpanded()
,
setExpanded(boolean)
public final void setExpanded(boolean value)
public final boolean isExpanded()
public final javafx.beans.property.BooleanProperty collapsibleProperty()
expandedProperty()
)
by the user by pressing the currently selected Avatar
.isCollapsible()
,
setCollapsible(boolean)
public final void setCollapsible(boolean value)
expandedProperty()
)
by the user by pressing the currently selected Avatar
.public final boolean isCollapsible()
expandedProperty()
)
by the user by pressing the currently selected Avatar
.public final javafx.beans.property.ObjectProperty<java.lang.Runnable> exitActionProperty()
getExitAction()
,
setExitAction(Runnable)
public final java.lang.Runnable getExitAction()
public final void setExitAction(java.lang.Runnable value)
protected javafx.scene.control.Skin<?> createDefaultSkin()
createDefaultSkin
in class javafx.scene.control.Control
public java.lang.String getUserAgentStylesheet()
getUserAgentStylesheet
in class javafx.scene.layout.Region