Class ICalendarAgenda

java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.control.Control
jfxtras.scene.control.agenda.Agenda
jfxtras.scene.control.agenda.icalendar.ICalendarAgenda
All Implemented Interfaces:
javafx.css.Styleable, javafx.event.EventTarget, javafx.scene.control.Skinnable

public class ICalendarAgenda extends Agenda

The ICalendarAgenda control is designed to take a VCALENDAR object, which is based on the iCalendar RFC 5545 standard, and renders it in Agenda, which is a calendar display control. ICalendarAgenda renders only the displayable iCalendar components which are VEVENT, VTODO, and VJOURNAL. Other calendar components are ignored.

The ICalendarAgenda control has a number of features, including:

  • Powerful edit control to modify calendar components:
    • Edits DATE or DATE-TIME properties including:
      • DTSTART - when the calendar component begins.
      • DTEND - when the calendar component ends.
    • Can toggle between DATE or DATE-TIME values
    • Edits descriptive properties including:
    • Edits RRULE, recurrence rule, elements including:
      • FREQUENCY - type of recurrence, including Daily, Weekly, Monthly and Yearly
      • INTERVAL - represents the intervals the recurrence rule repeats
      • COUNT - the number of occurrences.
      • UNTIL - the DATE or DATE-TIME value that bounds the recurrence rule in an inclusive manner
      • EXDATE - list of DATE-TIME values that are skipped
    • Displays a easy-to-read description of the RRULE, recurrence rule
  • Automatically synchronizes graphical changes with the VCALENDAR object.
  • Uses an abstract RecurrenceFactory to create Agenda.Appointment objects that are rendered by Agenda
  • Uses an abstract VComponentFactory to create VDisplayable objects when new events are drawn by clicking and drag-and-drop actions.

If not using the default Agenda.AppointmentImplTemporal implementation, but a different Agenda.Appointment implementation, then use the following setter methods to configure the required factories and callback:

Creating a ICalendarAgenda

Firstly, a VCALENDAR instance needs to be defined. For example:

 VCalendar vCalendar = new VCalendar();
Optionally, the VCALENDAR instance can be set with calendar components. This can be done by reading a .ics file or building the calendar components programmatically through the API. Please see the iCalendarFX documentation for more details. An empty VCALENDAR is also acceptable.

Next, the VCALENDAR instance must be provided in the ICalendarAgenda constructor as shown below:.

 ICalendarAgenda iCalendarAgenda = new ICalendarAgenda(vCalendar);
Nothing else special is required to instantiate ICalendarAgenda if you use the default factories.

A simple example to display a ICalendarAgenda with an example VEVENT is below:


public class ICalendarAgendaSimpleTrial extends Application
{        
   public static void main(String[] args) {
      launch(args);       
}

  public void start(Stage primaryStage) {
      VCalendar vCalendar = new VCalendar();
      VEvent vEvent = new VEvent()
              .withDateTimeStart(LocalDateTime.now().minusMonths(1))
              .withDateTimeEnd(LocalDateTime.now().minusMonths(1).plusHours(1))
              .withSummary("Example Daily Event")
              .withRecurrenceRule("RRULE:FREQ=DAILY")
              .withUniqueIdentifier("exampleuid000jfxtras.org");
      vCalendar.addChild(vEvent);
      ICalendarAgenda agenda = new ICalendarAgenda(vCalendar);
      
      BorderPane root = new BorderPane();
      root.setCenter(agenda);
      Scene scene = new Scene(root, 1366, 768);
      primaryStage.setScene(scene);
      primaryStage.setTitle("ICalendar Agenda Simple Demo");
      primaryStage.show();
  }
}

Author:
David Bal
See Also:
  • Nested Class Summary

  • Property Summary

    Properties
    Type
    Property
    Description
    javafx.beans.property.ObjectProperty<Organizer>
     

    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, 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
    static final String
     
    static final String
     
    static final String
     
    static final String
     

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

    Modifier and Type
    Method
    Description
    javafx.collections.ObservableList<String>
    Gets the value of the categories list
    javafx.util.Callback<Agenda.Appointment, javafx.scene.control.ButtonBar.ButtonData>
    Sets the value of the new appointment callback.
    Gets the value of the organizer property.
    Gets the value of the VComponent factory
    javafx.util.Callback<Agenda.Appointment, Void>
    Gets the value of the select one appointment callback.
    set UID callback generator.
    get the VCalendar object that is a model of the iCalendar RFC 5545 specification
     
    Gets the value of the VComponent factory
    javafx.beans.property.ObjectProperty<Organizer>
     
    void
    setCategories(javafx.collections.ObservableList<String> categories)
    Sets the value of the categories list
    void
    setNewAppointmentDrawnCallback(javafx.util.Callback<Agenda.Appointment, javafx.scene.control.ButtonBar.ButtonData> c)
    Gets the value of the new appointment callback.
    void
    setOrganizer(String organizer)
     
    void
    Sets the value of the organizer property.
    void
    Sets the value of the recurrence factory
    void
    Sets the value of the select one appointment callback.
    void
    set UID callback generator.
    void
     
    void
    Sets the value of the VComponent factory
    void
    Clear and make new appointments for all displayable VComponents
    withOrganizer(String organizer)
     
     
    set UID callback generator.

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

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

    Methods inherited from interface javafx.css.Styleable

    getStyleableNode
  • Property Details

  • Field Details

  • Constructor Details

    • ICalendarAgenda

      public ICalendarAgenda()
    • ICalendarAgenda

      public ICalendarAgenda(VCalendar vCalendar)
  • Method Details

    • organizerProperty

      public javafx.beans.property.ObjectProperty<Organizer> organizerProperty()
      Returns:
      the organizer property
      See Also:
    • getOrganizer

      public Organizer getOrganizer()
      Gets the value of the organizer property.
      Property description:
      Returns:
      the value of the organizer property
      See Also:
    • setOrganizer

      public void setOrganizer(Organizer organizer)
      Sets the value of the organizer property.
      Property description:
      Parameters:
      organizer - the value for the organizer property
      See Also:
    • setOrganizer

      public void setOrganizer(String organizer)
    • withOrganizer

      public ICalendarAgenda withOrganizer(Organizer organizer)
    • withOrganizer

      public ICalendarAgenda withOrganizer(String organizer)
    • getUidGeneratorCallback

      public Callback<Void,String> getUidGeneratorCallback()
      set UID callback generator. It makes UID values for new components.
    • setUidGeneratorCallback

      public void setUidGeneratorCallback(Callback<Void,String> uidCallback)
      set UID callback generator. It makes UID values for new components.
    • withUidGeneratorCallback

      public ICalendarAgenda withUidGeneratorCallback(Callback<Void,String> uidCallback)
      set UID callback generator. Return itself for chaining.
    • getVCalendar

      public VCalendar getVCalendar()
      get the VCalendar object that is a model of the iCalendar RFC 5545 specification
    • getVComponentFactory

      public VComponentFactory<Agenda.Appointment> getVComponentFactory()
      Gets the value of the VComponent factory
    • setVComponentFactory

      public void setVComponentFactory(VComponentFactory<Agenda.Appointment> vComponentFactory)
      Sets the value of the VComponent factory
    • getRecurrenceFactory

      public RecurrenceFactory<Agenda.Appointment> getRecurrenceFactory()
      Gets the value of the VComponent factory
    • setRecurrenceFactory

      public void setRecurrenceFactory(RecurrenceFactory<Agenda.Appointment> recurrenceFactory)
      Sets the value of the recurrence factory
    • setVCalendarUpdatedConsumer

      public void setVCalendarUpdatedConsumer(Consumer<VCalendar> calendarConsumer)
    • getVCalendarUpdatedConsumer

      public Consumer<VCalendar> getVCalendarUpdatedConsumer()
    • getCategories

      public javafx.collections.ObservableList<String> getCategories()
      Gets the value of the categories list
    • setCategories

      public void setCategories(javafx.collections.ObservableList<String> categories)
      Sets the value of the categories list
    • setSelectedOneAppointmentCallback

      public void setSelectedOneAppointmentCallback(javafx.util.Callback<Agenda.Appointment, Void> c)
      Sets the value of the select one appointment callback. The callback is executed only one appointment is selected in Agenda. This is done by primary clicking on one appointment. Pressing and holding Ctrl and clicking other appointments does not trigger this callback.
    • getSelectedOneAppointmentCallback

      public javafx.util.Callback<Agenda.Appointment, Void> getSelectedOneAppointmentCallback()
      Gets the value of the select one appointment callback. The callback is executed only one appointment is selected in Agenda. This is done by primary clicking on one appointment. Pressing and holding Ctrl and clicking other appointments does not trigger this callback.
    • getNewAppointmentDrawnCallback

      public javafx.util.Callback<Agenda.Appointment, javafx.scene.control.ButtonBar.ButtonData> getNewAppointmentDrawnCallback()
      Sets the value of the new appointment callback. The callback is executed after a new appointment is added in Agenda. This is done by clicking on the start time, dragging, and releasing on the end time.
    • setNewAppointmentDrawnCallback

      public void setNewAppointmentDrawnCallback(javafx.util.Callback<Agenda.Appointment, javafx.scene.control.ButtonBar.ButtonData> c)
      Gets the value of the new appointment callback. The callback is executed after a new appointment is added in Agenda. This is done by clicking on the start time, dragging, and releasing on the end time.
    • updateAppointments

      public void updateAppointments()
      Clear and make new appointments for all displayable VComponents