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();
   }
 }

See Also:
  • Property Details

  • Field Details

  • Constructor Details

    • ICalendarAgenda

      public ICalendarAgenda()
    • ICalendarAgenda

      public ICalendarAgenda(VCalendar vCalendar)
  • Method Details

    • organizerProperty

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

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

      public void setOrganizer(Organizer organizer)
      Sets the value of the property organizer.
      Property description:
    • 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.
    • revisorParamGenerator

      private Object[] revisorParamGenerator(VDisplayable<?> vComponent, Agenda.Appointment appointment)
      Generate the parameters required for SimpleRevisorFactory
    • makeAppointments

      private Collection<Agenda.Appointment> makeAppointments(VDisplayable<?> v)
    • updateAppointments

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