Top Description Inners Fields Constructors Methods
com.calendarfx.view

public Class WeekView

extends DayViewBase
Class Inheritance
Imports
com.calendarfx.util.ViewHelper, impl.com.calendarfx.view.WeekViewSkin, javafx.beans.property.BooleanProperty, .IntegerProperty, .ObjectProperty, .ReadOnlyObjectProperty, .ReadOnlyObjectWrapper, .SimpleBooleanProperty, .SimpleIntegerProperty, .SimpleObjectProperty, javafx.beans.value.ObservableValue, javafx.collections.FXCollections, .ObservableList, javafx.geometry.Bounds, javafx.scene.control.Skin, javafx.scene.layout.Region, javafx.util.Callback, org.controlsfx.control.PropertySheet, java.time.LocalDate, .ZoneId, .ZonedDateTime, java.util.Objects, .Optional

A view for showing several week days in a row, normally seven. However the view can be configured to show any number of days. A factory is used to create instances of WeekDayView on the fly as needed. Another factory is required for creating the child control AllDayView. The image below shows the appearance of this view when it is embedded inside the DetailedWeekView. Week View

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
WeekView.WeekDayParameter

The parameter object for the week day view factory.

Field Summary

Modifier and TypeField and Description
private final BooleanProperty
private static final String
private final ReadOnlyObjectWrapper<LocalDate>
private final IntegerProperty
private final ObjectProperty<Callback<WeekView, Region>>
private final ReadOnlyObjectWrapper<LocalDate>
private static final String
private final ObjectProperty<Callback<WeekView.WeekDayParameter, WeekDayView>>
private final ObservableList<WeekDayView>
Inherited from com.calendarfx.view.DayViewBase:
MILLIS_PER_HOUR

Constructor Summary

AccessConstructor and Description
public
WeekView()

Constructs a new week view with seven days.

public
WeekView(int
the number of days (day views)
numberOfDays
)

Constructs a new week view with the given number of days.

Method Summary

Modifier and TypeMethod and Description
public final BooleanProperty

Returns:

true if the view always shows the first day of the week
adjustToFirstDayOfWeekProperty
()

A flag used to indicate that the view should always show the first day of the week (e.g. "Monday") at its beginning even if the dateProperty() is set to another day (e.g. "Thursday").

private LocalDate
protected Skin<?>
createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Create a new instance of the default skin for this control.

public final ReadOnlyObjectProperty<LocalDate>

Returns:

the latest date shown
endDateProperty
()

The latest date shown by the view.

public final LocalDate

Returns:

the latest date shown
getEndDate
()

Returns the value of endDateProperty().

public final int

Returns:

the number of days shown by the view
getNumberOfDays
()

Returns the value of numberOfDaysProperty().

public ObservableList<PropertySheet.Item>
getPropertySheetItems()

Overrides com.calendarfx.view.DayViewBase.getPropertySheetItems.

Returns a list of property items that can be shown by the PropertySheet of ControlsFX.

public final Callback<WeekView, Region>
public final LocalDate

Returns:

the earliest date shown
getStartDate
()

Returns the value of startDateProperty().

private WeekDayView
getWeekDayViewAt(double x)

public final Callback<WeekView.WeekDayParameter, WeekDayView>

Returns:

the week day view factory
getWeekDayViewFactory
()

Returns the value of weekDayViewFactoryProperty().

public final ObservableList<WeekDayView>

Returns:

the currently used list of week day views (please note that this list is very volatile and will be updated very often.
getWeekDayViews
()

A list of the WeekDayView instances that the view created via the factory.

public ZonedDateTime
getZonedDateTimeAt(double
the x coordinate of the input event
x
,
double
the y coordinate of the input event
y
,
ZoneId
the zoneID for which we query the time
zoneId
)

Overrides com.calendarfx.view.DayViewBase.getZonedDateTimeAt.

Implements com.calendarfx.view.ZonedDateTimeProvider.getZonedDateTimeAt.

Returns the time at the given location.

public final boolean

Returns:

true if the view always shows the first day of the week
isAdjustToFirstDayOfWeek
()

Returns the value of adjustToFirstDayOfWeekProperty().

public final IntegerProperty

Returns:

the number of days shown by the view
numberOfDaysProperty
()

Stores the number of days that will be shown by this view.

public final ObjectProperty<Callback<WeekView, Region>>

Returns:

the separator factory
separatorFactoryProperty
()

A factory used for creating (optional) vertical separators between the week days.

public final void
setAdjustToFirstDayOfWeek(boolean
if true the view will always show the first day of the week
adjust
)

Sets the value of adjustToFirstDayOfWeekProperty().

public final void
setNumberOfDays(int
the new number of days shown by the view
number
)

Sets the value of numberOfDaysProperty().

public final void
public final void
public final ReadOnlyObjectProperty<LocalDate>

Returns:

the earliest date shown
startDateProperty
()

The earliest date shown by the view.

private void
public final ObjectProperty<Callback<WeekView.WeekDayParameter, WeekDayView>>

Returns:

the week day view factory
weekDayViewFactoryProperty
()

A factory used for creating instances of WeekDayView on the fly as required.

Inherited from com.calendarfx.view.DayViewBase:
bindearliestTimeUsedPropertyearlyLateHoursStrategyPropertyenableCurrentTimeCirclePropertyenableCurrentTimeMarkerPropertyenableStartAndEndTimesFlipPropertyentryViewAvailabilityEditingBehaviourPropertyentryViewAvailabilityEditingOpacityPropertyentryWidthPercentagePropertygetEarliestTimeUsedgetEarlyLateHoursStrategygetEntryViewAvailabilityEditingBehaviourgetEntryViewAvailabilityEditingOpacitygetEntryWidthPercentagegetGridLineColorgetGridLinesgetGridTypegetHourHeightgetHourHeightCompressedgetHoursLayoutStrategygetInstantAtgetInstantAtgetLassoColorgetLassoEndgetLassoStartgetLatestTimeUsedgetLocationgetLocationgetMaxHourHeightgetMinHourHeightgetOnLassoFinishedgetOverlapResolutionStrategygetScrollTimegetVisibleHoursgetZonedDateTimegetZonedDateTimeAtgetZonedDateTimeEndgetZonedDateTimeMaxgetZonedDateTimeMingetZonedDateTimeStartgridLineColorPropertygridLinesPropertygridTypePropertyhourHeightCompressedPropertyhourHeightPropertyhoursLayoutStrategyPropertyinstallDefaultLassoFinishedBehaviourisEnableCurrentCircleMarkerisEnableCurrentTimeMarkerisEnableStartAndEndTimesFlipisScrollingEnabledisShowCurrentTimeMarkerisShowCurrentTimeTodayMarkerisTrimTimeBoundslassoColorPropertylassoEndPropertylassoStartPropertylatestTimeUsedPropertymaxHourHeightPropertyminHourHeightPropertyonLassoFinishedPropertyoverlapResolutionStrategyPropertyscrollingEnabledPropertyscrollTimePropertysetEarlyLateHoursStrategysetEnableCurrentTimeCirclesetEnableCurrentTimeMarkersetEnableStartAndEndTimesFlipsetEntryViewAvailabilityEditingBehavioursetEntryViewAvailabilityEditingOpacitysetEntryWidthPercentagesetGridLineColorsetGridLinessetGridTypesetHourHeightsetHourHeightCompressedsetHoursLayoutStrategysetLassoColorsetLassoEndsetLassoStartsetMaxHourHeightsetMinHourHeightsetOnLassoFinishedsetOverlapResolutionStrategysetScrollingEnabledsetScrollTimesetTrimTimeBoundssetVisibleHoursshowCurrentTimeMarkerPropertyshowCurrentTimeTodayMarkerPropertytrimTimeBoundsPropertyunbindvisibleHoursProperty

Field Detail

adjustToFirstDayOfWeekback to summary
private final BooleanProperty adjustToFirstDayOfWeek
DEFAULT_STYLE_CLASSback to summary
private static final String DEFAULT_STYLE_CLASS
endDateback to summary
private final ReadOnlyObjectWrapper<LocalDate> endDate
numberOfDaysback to summary
private final IntegerProperty numberOfDays
separatorFactoryback to summary
private final ObjectProperty<Callback<WeekView, Region>> separatorFactory
startDateback to summary
private final ReadOnlyObjectWrapper<LocalDate> startDate
WEEK_VIEW_CATEGORYback to summary
private static final String WEEK_VIEW_CATEGORY
weekDayViewFactoryback to summary
private final ObjectProperty<Callback<WeekView.WeekDayParameter, WeekDayView>> weekDayViewFactory
weekDayViewsback to summary
private final ObservableList<WeekDayView> weekDayViews

Constructor Detail

WeekViewback to summary
public WeekView()

Constructs a new week view with seven days.

WeekViewback to summary
public WeekView(int numberOfDays)

Constructs a new week view with the given number of days.

Parameters
numberOfDays:int

the number of days (day views)

Method Detail

adjustToFirstDayOfWeekPropertyback to summary
public final BooleanProperty adjustToFirstDayOfWeekProperty()

A flag used to indicate that the view should always show the first day of the week (e.g. "Monday") at its beginning even if the dateProperty() is set to another day (e.g. "Thursday").

Returns:BooleanProperty

true if the view always shows the first day of the week

calculateStartDateback to summary
private LocalDate calculateStartDate()
createDefaultSkinback to summary
protected Skin<?> createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Doc from javafx.scene.control.Control.createDefaultSkin.

Create a new instance of the default skin for this control. This is called to create a skin for the control if no skin is provided via CSS -fx-skin or set explicitly in a sub-class with setSkin(...).

Returns:Skin<?>

new instance of default skin for this control. If null then the control will have no skin unless one is provided by css.

Annotations
@Override
endDatePropertyback to summary
public final ReadOnlyObjectProperty<LocalDate> endDateProperty()

The latest date shown by the view.

Returns:ReadOnlyObjectProperty<LocalDate>

the latest date shown

getEndDateback to summary
public final LocalDate getEndDate()

Returns the value of endDateProperty().

Returns:LocalDate

the latest date shown

getNumberOfDaysback to summary
public final int getNumberOfDays()

Returns the value of numberOfDaysProperty().

Returns:int

the number of days shown by the view

getPropertySheetItemsback to summary
public ObservableList<PropertySheet.Item> getPropertySheetItems()

Overrides com.calendarfx.view.DayViewBase.getPropertySheetItems.

Doc from com.calendarfx.view.CalendarFXControl.getPropertySheetItems.

Returns a list of property items that can be shown by the PropertySheet of ControlsFX.

Returns:ObservableList<PropertySheet.Item>

the property sheet items

Annotations
@Override
getSeparatorFactoryback to summary
public final Callback<WeekView, Region> getSeparatorFactory()
getStartDateback to summary
public final LocalDate getStartDate()

Returns the value of startDateProperty().

Returns:LocalDate

the earliest date shown

getWeekDayViewAtback to summary
private WeekDayView getWeekDayViewAt(double x)
getWeekDayViewFactoryback to summary
public final Callback<WeekView.WeekDayParameter, WeekDayView> getWeekDayViewFactory()

Returns the value of weekDayViewFactoryProperty().

Returns:Callback<WeekView.WeekDayParameter, WeekDayView>

the week day view factory

getWeekDayViewsback to summary
public final ObservableList<WeekDayView> getWeekDayViews()

A list of the WeekDayView instances that the view created via the factory.

Returns:ObservableList<WeekDayView>

the currently used list of week day views (please note that this list is very volatile and will be updated very often.

See Also
setWeekDayViewFactory(Callback)
getZonedDateTimeAtback to summary
public ZonedDateTime getZonedDateTimeAt(double x, double y, ZoneId zoneId)

Overrides com.calendarfx.view.DayViewBase.getZonedDateTimeAt.

Implements com.calendarfx.view.ZonedDateTimeProvider.getZonedDateTimeAt.

Doc from com.calendarfx.view.ZonedDateTimeProvider.getZonedDateTimeAt.

Returns the time at the given location.

Parameters
x:double

the x coordinate of the input event

y:double

the y coordinate of the input event

zoneId:ZoneId

the zoneID for which we query the time

Returns:ZonedDateTime

the time at the given location

Annotations
@Override
isAdjustToFirstDayOfWeekback to summary
public final boolean isAdjustToFirstDayOfWeek()

Returns the value of adjustToFirstDayOfWeekProperty().

Returns:boolean

true if the view always shows the first day of the week

numberOfDaysPropertyback to summary
public final IntegerProperty numberOfDaysProperty()

Stores the number of days that will be shown by this view. This value will be 1 if the view is used in combination with the DayView and 7 if used together with the DetailedWeekView.

Returns:IntegerProperty

the number of days shown by the view

separatorFactoryPropertyback to summary
public final ObjectProperty<Callback<WeekView, Region>> separatorFactoryProperty()

A factory used for creating (optional) vertical separators between the week days.

Returns:ObjectProperty<Callback<WeekView, Region>>

the separator factory

setAdjustToFirstDayOfWeekback to summary
public final void setAdjustToFirstDayOfWeek(boolean adjust)

Sets the value of adjustToFirstDayOfWeekProperty().

Parameters
adjust:boolean

if true the view will always show the first day of the week

setNumberOfDaysback to summary
public final void setNumberOfDays(int number)

Sets the value of numberOfDaysProperty().

Parameters
number:int

the new number of days shown by the view

setSeparatorFactoryback to summary
public final void setSeparatorFactory(Callback<WeekView, Region> separatorFactory)
setWeekDayViewFactoryback to summary
public final void setWeekDayViewFactory(Callback<WeekView.WeekDayParameter, WeekDayView> factory)

Sets the value of weekDayViewFactoryProperty().

Parameters
factory:Callback<WeekView.WeekDayParameter, WeekDayView>

the new factory

startDatePropertyback to summary
public final ReadOnlyObjectProperty<LocalDate> startDateProperty()

The earliest date shown by the view.

Returns:ReadOnlyObjectProperty<LocalDate>

the earliest date shown

updateStartAndEndDatesback to summary
private void updateStartAndEndDates()
weekDayViewFactoryPropertyback to summary
public final ObjectProperty<Callback<WeekView.WeekDayParameter, WeekDayView>> weekDayViewFactoryProperty()

A factory used for creating instances of WeekDayView on the fly as required.

Returns:ObjectProperty<Callback<WeekView.WeekDayParameter, WeekDayView>>

the week day view factory

com.calendarfx.view back to summary

public final Class WeekView.WeekDayParameter

extends Object
Class Inheritance

The parameter object for the week day view factory.
See Also
weekDayViewFactoryProperty()

Field Summary

Modifier and TypeField and Description
private final WeekView

Constructor Summary

AccessConstructor and Description
public
WeekDayParameter(WeekView
the week view for which the week day view will be used
weekView
)

Constructs a new parameter object.

Method Summary

Modifier and TypeMethod and Description
public WeekView

Returns:

the week view
getWeekView
()

Returns the week view where the day view will be used.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

weekViewback to summary
private final WeekView weekView

Constructor Detail

WeekDayParameterback to summary
public WeekDayParameter(WeekView weekView)

Constructs a new parameter object.

Parameters
weekView:WeekView

the week view for which the week day view will be used

Method Detail

getWeekViewback to summary
public WeekView getWeekView()

Returns the week view where the day view will be used.

Returns:WeekView

the week view