Class Calendar

java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.control.Control
atlantafx.base.controls.Calendar
All Implemented Interfaces:
javafx.css.Styleable, javafx.event.EventTarget, javafx.scene.control.Skinnable

public class Calendar extends javafx.scene.control.Control
The Calendar control allows the user to select a date. The calendar is based on either the standard ISO-8601 chronology or any of the other chronology classes defined in the java.time.chrono package.
  • The value property represents the currently selected LocalDate. The default value is null.
  • The chronology property specifies a calendar system to be used for parsing, displaying, and choosing dates.
  • The value property is always defined in the ISO calendar system, however, so applications based on a different chronology may use the conversion methods provided in the Chronology API to get or set the corresponding ChronoLocalDate value.
  • Property Summary

    Properties
    Type
    Property
    Description
    javafx.beans.property.ObjectProperty<javafx.scene.Node>
    Represents the custom node to be placed at the bottom of the Calendar below the day-cell grid.
    javafx.beans.property.ObjectProperty<Chronology>
    The calendar system used for parsing, displaying, and choosing dates in the Calendar control.
    final javafx.beans.property.ObjectProperty<javafx.util.Callback<Calendar,javafx.scene.control.DateCell>>
    A custom cell factory can be provided to customize individual day cells Refer to DateCell and Cell for more information on cell factories.
    final javafx.beans.property.BooleanProperty
    Whether the Calendar should display a column showing week numbers.
    javafx.beans.property.ObjectProperty<javafx.scene.Node>
    Represents the custom node to be placed at the top of the Calendar above the month-year area.
    javafx.beans.property.ObjectProperty<LocalDate>
    Represents the currently selected LocalDate.

    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
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Chronology
     
    protected LocalDate
     

    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
    Creates a default Calendar instance with a null date value set.
    Calendar(@Nullable LocalDate localDate)
    Creates a Calendar instance and sets the value to the specified date.
  • Method Summary

    Modifier and Type
    Method
    Description
    javafx.beans.property.ObjectProperty<javafx.scene.Node>
    Represents the custom node to be placed at the bottom of the Calendar below the day-cell grid.
    javafx.beans.property.ObjectProperty<Chronology>
    The calendar system used for parsing, displaying, and choosing dates in the Calendar control.
    protected javafx.scene.control.Skin<?>
    final javafx.beans.property.ObjectProperty<javafx.util.Callback<Calendar,javafx.scene.control.DateCell>>
    A custom cell factory can be provided to customize individual day cells Refer to DateCell and Cell for more information on cell factories.
    final javafx.scene.Node
    Gets the value of the property bottomNode.
    Gets the value of the property chronology.
    static List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>>
    Returns the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.
    List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>>
    final javafx.util.Callback<Calendar,javafx.scene.control.DateCell>
    Gets the value of the property dayCellFactory.
    final javafx.scene.Node
    Gets the value of the property topNode.
    final LocalDate
    Gets the value of the property value.
    final boolean
    Gets the value of the property showWeekNumbers.
    final void
    setBottomNode(javafx.scene.Node value)
    Sets the value of the property bottomNode.
    final void
    Sets the value of the property chronology.
    final void
    setDayCellFactory(javafx.util.Callback<Calendar,javafx.scene.control.DateCell> value)
    Sets the value of the property dayCellFactory.
    final void
    setShowWeekNumbers(boolean value)
    Sets the value of the property showWeekNumbers.
    final void
    setTopNode(javafx.scene.Node value)
    Sets the value of the property topNode.
    final void
    Sets the value of the property value.
    final javafx.beans.property.BooleanProperty
    Whether the Calendar should display a column showing week numbers.
    javafx.beans.property.ObjectProperty<javafx.scene.Node>
    Represents the custom node to be placed at the top of the Calendar above the month-year area.
    javafx.beans.property.ObjectProperty<LocalDate>
    Represents the currently selected LocalDate.

    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, getUserAgentStylesheet, 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

    • value

      public javafx.beans.property.ObjectProperty<LocalDate> valueProperty
      Represents the currently selected LocalDate. The default value is null.
      See Also:
    • dayCellFactory

      public final javafx.beans.property.ObjectProperty<javafx.util.Callback<Calendar,javafx.scene.control.DateCell>> dayCellFactoryProperty
      A custom cell factory can be provided to customize individual day cells Refer to DateCell and Cell for more information on cell factories.
      See Also:
    • chronology

      public javafx.beans.property.ObjectProperty<Chronology> chronologyProperty
      The calendar system used for parsing, displaying, and choosing dates in the Calendar control.

      The default is usually IsoChronology unless provided explicitly in the Locale by use of a Locale calendar extension.

      Setting the value to null will restore the default chronology.

      See Also:
    • showWeekNumbers

      public final javafx.beans.property.BooleanProperty showWeekNumbersProperty
      Whether the Calendar should display a column showing week numbers.

      The default value is specified in a resource bundle, and depends on the country of the current locale.

      See Also:
    • topNode

      public javafx.beans.property.ObjectProperty<javafx.scene.Node> topNodeProperty
      Represents the custom node to be placed at the top of the Calendar above the month-year area.
      See Also:
    • bottomNode

      public javafx.beans.property.ObjectProperty<javafx.scene.Node> bottomNodeProperty
      Represents the custom node to be placed at the bottom of the Calendar below the day-cell grid.
      See Also:
  • Field Details

    • lastValidDate

      protected LocalDate lastValidDate
    • lastValidChronology

      protected Chronology lastValidChronology
  • Constructor Details

    • Calendar

      public Calendar()
      Creates a default Calendar instance with a null date value set.
    • Calendar

      public Calendar(@Nullable @Nullable LocalDate localDate)
      Creates a Calendar instance and sets the value to the specified date.
      Parameters:
      localDate - The date to be set as the currently selected date in the Calendar.
  • Method Details

    • createDefaultSkin

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

      public javafx.beans.property.ObjectProperty<LocalDate> valueProperty()
      Represents the currently selected LocalDate. The default value is null.
      See Also:
    • getValue

      public final LocalDate getValue()
      Gets the value of the property value.
      Property description:
      Represents the currently selected LocalDate. The default value is null.
    • setValue

      public final void setValue(LocalDate value)
      Sets the value of the property value.
      Property description:
      Represents the currently selected LocalDate. The default value is null.
    • setDayCellFactory

      public final void setDayCellFactory(javafx.util.Callback<Calendar,javafx.scene.control.DateCell> value)
      Sets the value of the property dayCellFactory.
      Property description:
      A custom cell factory can be provided to customize individual day cells Refer to DateCell and Cell for more information on cell factories.
    • getDayCellFactory

      public final javafx.util.Callback<Calendar,javafx.scene.control.DateCell> getDayCellFactory()
      Gets the value of the property dayCellFactory.
      Property description:
      A custom cell factory can be provided to customize individual day cells Refer to DateCell and Cell for more information on cell factories.
    • dayCellFactoryProperty

      public final javafx.beans.property.ObjectProperty<javafx.util.Callback<Calendar,javafx.scene.control.DateCell>> dayCellFactoryProperty()
      A custom cell factory can be provided to customize individual day cells Refer to DateCell and Cell for more information on cell factories.
      See Also:
    • chronologyProperty

      public javafx.beans.property.ObjectProperty<Chronology> chronologyProperty()
      The calendar system used for parsing, displaying, and choosing dates in the Calendar control.

      The default is usually IsoChronology unless provided explicitly in the Locale by use of a Locale calendar extension.

      Setting the value to null will restore the default chronology.

      See Also:
    • getChronology

      public final Chronology getChronology()
      Gets the value of the property chronology.
      Property description:
      The calendar system used for parsing, displaying, and choosing dates in the Calendar control.

      The default is usually IsoChronology unless provided explicitly in the Locale by use of a Locale calendar extension.

      Setting the value to null will restore the default chronology.

    • setChronology

      public final void setChronology(Chronology value)
      Sets the value of the property chronology.
      Property description:
      The calendar system used for parsing, displaying, and choosing dates in the Calendar control.

      The default is usually IsoChronology unless provided explicitly in the Locale by use of a Locale calendar extension.

      Setting the value to null will restore the default chronology.

    • showWeekNumbersProperty

      public final javafx.beans.property.BooleanProperty showWeekNumbersProperty()
      Whether the Calendar should display a column showing week numbers.

      The default value is specified in a resource bundle, and depends on the country of the current locale.

      See Also:
    • setShowWeekNumbers

      public final void setShowWeekNumbers(boolean value)
      Sets the value of the property showWeekNumbers.
      Property description:
      Whether the Calendar should display a column showing week numbers.

      The default value is specified in a resource bundle, and depends on the country of the current locale.

    • isShowWeekNumbers

      public final boolean isShowWeekNumbers()
      Gets the value of the property showWeekNumbers.
      Property description:
      Whether the Calendar should display a column showing week numbers.

      The default value is specified in a resource bundle, and depends on the country of the current locale.

    • topNodeProperty

      public javafx.beans.property.ObjectProperty<javafx.scene.Node> topNodeProperty()
      Represents the custom node to be placed at the top of the Calendar above the month-year area.
      See Also:
    • setTopNode

      public final void setTopNode(javafx.scene.Node value)
      Sets the value of the property topNode.
      Property description:
      Represents the custom node to be placed at the top of the Calendar above the month-year area.
    • getTopNode

      public final javafx.scene.Node getTopNode()
      Gets the value of the property topNode.
      Property description:
      Represents the custom node to be placed at the top of the Calendar above the month-year area.
    • bottomNodeProperty

      public javafx.beans.property.ObjectProperty<javafx.scene.Node> bottomNodeProperty()
      Represents the custom node to be placed at the bottom of the Calendar below the day-cell grid.
      See Also:
    • setBottomNode

      public final void setBottomNode(javafx.scene.Node value)
      Sets the value of the property bottomNode.
      Property description:
      Represents the custom node to be placed at the bottom of the Calendar below the day-cell grid.
    • getBottomNode

      public final javafx.scene.Node getBottomNode()
      Gets the value of the property bottomNode.
      Property description:
      Represents the custom node to be placed at the bottom of the Calendar below the day-cell grid.
    • getClassCssMetaData

      public static List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>> getClassCssMetaData()
      Returns the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.
    • getControlCssMetaData

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