Top Description Fields Constructors Methods
com.calendarfx.view

public Class MonthView

extends MonthViewBase
implements ZonedDateTimeProvider
Class Inheritance
All Implemented Interfaces
com.calendarfx.view.ZonedDateTimeProvider
Imports
com.calendarfx.model.Entry, impl.com.calendarfx.view.MonthViewSkin, javafx.beans.Observable, javafx.beans.property.BooleanProperty, .ObjectProperty, .SimpleBooleanProperty, .SimpleObjectProperty, javafx.beans.value.ObservableValue, javafx.collections.ObservableList, javafx.scene.control.Skin, javafx.util.Callback, org.controlsfx.control.PropertySheet.Item, java.time.LocalDate, .ZoneId, .ZonedDateTime, java.util.Optional

Visualizes an entire month including the last days of the previous month and the first days of the next month. Each day is shown in its own box with its entries. These entries are of type MonthEntryView. Month View

Field Summary

Modifier and TypeField and Description
private static final String
private final ObjectProperty<Callback<Entry<?>, MonthEntryView>>
private static final String
private final BooleanProperty
private final BooleanProperty
private final BooleanProperty
private final BooleanProperty
private final BooleanProperty

Constructor Summary

AccessConstructor and Description
public
MonthView()

Constructs a new month view.

Method Summary

Modifier and TypeMethod and Description
protected Skin<?>
createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

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

public final ObjectProperty<Callback<Entry<?>, MonthEntryView>>

Returns:

the entry view factory
entryViewFactoryProperty
()

A factory used for creating instances of type MonthEntryView.

public final Callback<Entry<?>, MonthEntryView>

Returns:

the entry view factory
getEntryViewFactory
()

Returns the value of entryViewFactoryProperty().

public ObservableList<PropertySheet.Item>
getPropertySheetItems()

Overrides com.calendarfx.view.MonthViewBase.getPropertySheetItems.

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

public final 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
)

Implements com.calendarfx.view.ZonedDateTimeProvider.getZonedDateTimeAt.

Returns the time at the given location.

public void
goBack()

Overrides com.calendarfx.view.DateControl.goBack.

Makes the control go forward in time by removing one or more days from the current date.

public void
goForward()

Overrides com.calendarfx.view.DateControl.goForward.

Makes the control go forward in time by adding one or more days to the current date.

public final boolean

Returns:

true if the current week will be highlighted
isShowCurrentWeek
()

Returns the value of showCurrentWeekProperty().

public final boolean

Returns:

true if full-day entries will be shown
isShowFullDayEntries
()

Returns the value of showFullDayEntriesProperty().

public final boolean

Returns:

true if timed entries will be shown
isShowTimedEntries
()

Returns the value of showTimedEntriesProperty().

public final boolean

Returns:

true if week day names will be shown
isShowWeekdays
()

Returns the value of showWeekdaysProperty().

public final boolean

Returns:

true if weekend days will be shown differently
isShowWeekends
()

Returns the value of showWeekendsProperty().

public final void
setEntryViewFactory(Callback<Entry<?>, MonthEntryView>
the entry view factory
factory
)

Sets the value of entryViewFactoryProperty().

public final void
setShowCurrentWeek(boolean
if true will highlight the current week
show
)

Sets the value of showCurrentWeekProperty().

public final void
setShowFullDayEntries(boolean
if true full-day entries will be shown
show
)

Sets the value of showFullDayEntriesProperty().

public final void
setShowTimedEntries(boolean
if true timed entries will be shown
show
)

Sets the value of showTimedEntriesProperty().

public final void
setShowWeekdays(boolean
if true will show the names of the week days
show
)

Sets the value of showWeekdaysProperty().

public final void
setShowWeekends(boolean
if true will show weekend days differently
show
)

Sets the value of showWeekendsProperty().

public final BooleanProperty

Returns:

true if the current week will be highlighted
showCurrentWeekProperty
()

Controls whether the view will highlight the current week.

public final BooleanProperty

Returns:

true if full day entries will be shown
showFullDayEntriesProperty
()

Controls whether the view will show calendar entries that are "full-day" entries (e.g. "Birthday Dirk").

public final BooleanProperty

Returns:

true if timed entries will be shown
showTimedEntriesProperty
()

Controls whether the view will show calendar entries that are not "full-day" entries (e.g. "soccer training from 6pm till 8pm").

public final BooleanProperty

Returns:

true if the week day names will be shown
showWeekdaysProperty
()

Controls whether the view will show the names of the week days ("Mo", "Tu", "We", ...).

public final BooleanProperty

Returns:

true if the weekend days will be shown differently
showWeekendsProperty
()

Controls whether the view will show weekend days differently than regular week days.

Inherited from com.calendarfx.view.MonthViewBase:
getSelectedDatesgetYearMonthisShowWeekNumberssetShowWeekNumbersshowWeekNumbersPropertyyearMonthProperty

Field Detail

DEFAULT_STYLE_CLASSback to summary
private static final String DEFAULT_STYLE_CLASS
entryViewFactoryback to summary
private final ObjectProperty<Callback<Entry<?>, MonthEntryView>> entryViewFactory
MONTH_PAGE_CATEGORYback to summary
private static final String MONTH_PAGE_CATEGORY
showCurrentWeekback to summary
private final BooleanProperty showCurrentWeek
showFullDayEntriesback to summary
private final BooleanProperty showFullDayEntries
showTimedEntriesback to summary
private final BooleanProperty showTimedEntries
showWeekdaysback to summary
private final BooleanProperty showWeekdays
showWeekendsback to summary
private final BooleanProperty showWeekends

Constructor Detail

MonthViewback to summary
public MonthView()

Constructs a new month view.

Method Detail

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
entryViewFactoryPropertyback to summary
public final ObjectProperty<Callback<Entry<?>, MonthEntryView>> entryViewFactoryProperty()

A factory used for creating instances of type MonthEntryView. These views will be shown within each day cell.

Code Example

setEntryViewFactory(entry -> {
	return new MonthEntryView(entry);
});
Returns:ObjectProperty<Callback<Entry<?>, MonthEntryView>>

the entry view factory

getEntryViewFactoryback to summary
public final Callback<Entry<?>, MonthEntryView> getEntryViewFactory()

Returns the value of entryViewFactoryProperty().

Returns:Callback<Entry<?>, MonthEntryView>

the entry view factory

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

Overrides com.calendarfx.view.MonthViewBase.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
getZonedDateTimeAtback to summary
public final ZonedDateTime getZonedDateTimeAt(double x, double y, ZoneId zoneId)

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
goBackback to summary
public void goBack()

Overrides com.calendarfx.view.DateControl.goBack.

Doc from com.calendarfx.view.DateControl.goBack.

Makes the control go forward in time by removing one or more days from the current date. Subclasses override this method to adjust it to their needs, e.g. the DetailedWeekView removes the number of days found in DetailedWeekView#getNumberOfDays().

Annotations
@Override
goForwardback to summary
public void goForward()

Overrides com.calendarfx.view.DateControl.goForward.

Doc from com.calendarfx.view.DateControl.goForward.

Makes the control go forward in time by adding one or more days to the current date. Subclasses override this method to adjust it to their needs, e.g. the DetailedWeekView adds the number of days found in DetailedWeekView#getNumberOfDays().

Annotations
@Override
isShowCurrentWeekback to summary
public final boolean isShowCurrentWeek()

Returns the value of showCurrentWeekProperty().

Returns:boolean

true if the current week will be highlighted

isShowFullDayEntriesback to summary
public final boolean isShowFullDayEntries()

Returns the value of showFullDayEntriesProperty().

Returns:boolean

true if full-day entries will be shown

isShowTimedEntriesback to summary
public final boolean isShowTimedEntries()

Returns the value of showTimedEntriesProperty().

Returns:boolean

true if timed entries will be shown

isShowWeekdaysback to summary
public final boolean isShowWeekdays()

Returns the value of showWeekdaysProperty().

Returns:boolean

true if week day names will be shown

isShowWeekendsback to summary
public final boolean isShowWeekends()

Returns the value of showWeekendsProperty().

Returns:boolean

true if weekend days will be shown differently

setEntryViewFactoryback to summary
public final void setEntryViewFactory(Callback<Entry<?>, MonthEntryView> factory)

Sets the value of entryViewFactoryProperty().

Parameters
factory:Callback<Entry<?>, MonthEntryView>

the entry view factory

setShowCurrentWeekback to summary
public final void setShowCurrentWeek(boolean show)

Sets the value of showCurrentWeekProperty().

Parameters
show:boolean

if true will highlight the current week

setShowFullDayEntriesback to summary
public final void setShowFullDayEntries(boolean show)

Sets the value of showFullDayEntriesProperty().

Parameters
show:boolean

if true full-day entries will be shown

setShowTimedEntriesback to summary
public final void setShowTimedEntries(boolean show)

Sets the value of showTimedEntriesProperty().

Parameters
show:boolean

if true timed entries will be shown

setShowWeekdaysback to summary
public final void setShowWeekdays(boolean show)

Sets the value of showWeekdaysProperty().

Parameters
show:boolean

if true will show the names of the week days

setShowWeekendsback to summary
public final void setShowWeekends(boolean show)

Sets the value of showWeekendsProperty().

Parameters
show:boolean

if true will show weekend days differently

showCurrentWeekPropertyback to summary
public final BooleanProperty showCurrentWeekProperty()

Controls whether the view will highlight the current week. The image below shows an example: Current Week

Returns:BooleanProperty

true if the current week will be highlighted

See Also
DateControl#todayProperty()
showFullDayEntriesPropertyback to summary
public final BooleanProperty showFullDayEntriesProperty()

Controls whether the view will show calendar entries that are "full-day" entries (e.g. "Birthday Dirk").

Returns:BooleanProperty

true if full day entries will be shown

showTimedEntriesPropertyback to summary
public final BooleanProperty showTimedEntriesProperty()

Controls whether the view will show calendar entries that are not "full-day" entries (e.g. "soccer training from 6pm till 8pm").

Returns:BooleanProperty

true if timed entries will be shown

showWeekdaysPropertyback to summary
public final BooleanProperty showWeekdaysProperty()

Controls whether the view will show the names of the week days ("Mo", "Tu", "We", ...). The image below shows an example: Weekdays

Returns:BooleanProperty

true if the week day names will be shown

showWeekendsPropertyback to summary
public final BooleanProperty showWeekendsProperty()

Controls whether the view will show weekend days differently than regular week days. The image below shows an example: Weekend

Returns:BooleanProperty

true if the weekend days will be shown differently