Top Description Inners Fields Constructors Methods
com.calendarfx.view.print

public Class TimeRangeView

extends ViewTypeControl
Class Inheritance
Imports
com.calendarfx.view.CalendarView, com.calendarfx.view.print.TimeRangeField.TimeRangeFieldValue, impl.com.calendarfx.view.print.TimeRangeViewSkin, impl.com.calendarfx.view.util.Util, javafx.beans.InvalidationListener, javafx.beans.property.ObjectProperty, .ReadOnlyIntegerProperty, .ReadOnlyIntegerWrapper, .ReadOnlyObjectProperty, .ReadOnlyObjectWrapper, .SimpleObjectProperty, javafx.scene.control.Skin, java.time.Duration, .LocalDate, .LocalTime, .Month, .YearMonth, java.time.temporal.ChronoField, .WeekFields, java.util.EnumMap, .Map, .Objects

A control for specifying the start and end time of a time range. This control is used as part of the print preview functionality. It allows the user to specify the time range that has to be printed. The control supports day ranges, week rangers, or month ranges. The default style class used by this control is "time-range-view". Time Range View

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private static final String
private final ReadOnlyObjectWrapper<LocalDate>
private final TimeRangeField
public final InvalidationListener
public final Map<ViewType, TimeRangeView.TimeRangeOldValues>
private final ReadOnlyObjectWrapper<LocalDate>
private final TimeRangeField
private final ObjectProperty<LocalDate>
private final ReadOnlyIntegerWrapper
private final ObjectProperty<WeekFields>

Constructor Summary

AccessConstructor and Description
public
TimeRangeView()

Constructs a new time range view.

Method Summary

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

Overrides javafx.scene.control.Control.createDefaultSkin.

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

public final ReadOnlyObjectProperty<LocalDate>
private void
private void
public final LocalDate
public final TimeRangeField
private LocalDate
private LocalDate
private LocalDate
private LocalDate
public final LocalDate
public final TimeRangeField
private LocalDate
private LocalDate
private LocalDate
private LocalDate
public final LocalDate

Returns:

the date representing "today"
getToday
()

Returns the value of todayProperty().

private LocalDate
public final int
public final WeekFields

Returns:

the week fields
getWeekFields
()

Returns the value of weekFieldsProperty().

private boolean
private boolean
private boolean
private boolean
public final void
loadDropDownValues(LocalDate
Used to calculate values of combos when dialog is opened for the first time.
date
)

Set the expected values for TimeRange combos.

private void
private void
public final void
setToday(LocalDate
the date representing "today"
date
)

Sets the value of todayProperty().

private void
setUnitsToPrint(int unitsToPrint)

public final void
setWeekFields(WeekFields
the new week fields
fields
)

Sets the value of weekFieldsProperty().

public final ReadOnlyObjectProperty<LocalDate>
public final ObjectProperty<LocalDate>

Returns:

the date representing "today"
todayProperty
()

Stores the date that is considered to represent "today".

public final ReadOnlyIntegerProperty
private void
private void
private void
public final ObjectProperty<WeekFields>

Returns:

the week fields
weekFieldsProperty
()

Week fields are used to determine the first day of a week (e.g. "Monday" in Germany or "Sunday" in the US).

Inherited from com.calendarfx.view.print.ViewTypeControl:
getPropertySheetItemsgetViewTypesetViewTypeviewTypeProperty

Field Detail

DEFAULT_STYLEback to summary
private static final String DEFAULT_STYLE
endDateback to summary
private final ReadOnlyObjectWrapper<LocalDate> endDate
endFieldback to summary
private final TimeRangeField endField
OldValuesListenerback to summary
public final InvalidationListener OldValuesListener
oldValuesMapback to summary
public final Map<ViewType, TimeRangeView.TimeRangeOldValues> oldValuesMap
startDateback to summary
private final ReadOnlyObjectWrapper<LocalDate> startDate
startFieldback to summary
private final TimeRangeField startField
todayback to summary
private final ObjectProperty<LocalDate> today
unitsToPrintback to summary
private final ReadOnlyIntegerWrapper unitsToPrint
weekFieldsback to summary
private final ObjectProperty<WeekFields> weekFields

Constructor Detail

TimeRangeViewback to summary
public TimeRangeView()

Constructs a new time range view.

Method Detail

catchOldValuesback to summary
private void catchOldValues()
cleanOldValuesback to summary
public void cleanOldValues()
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()
fixEndFieldback to summary
private void fixEndField()
fixStartFieldback to summary
private void fixStartField()
getEndDateback to summary
public final LocalDate getEndDate()
getEndFieldback to summary
public final TimeRangeField getEndField()
getEndOfMonthback to summary
private LocalDate getEndOfMonth(LocalDate date)
getEndOfWeekback to summary
private LocalDate getEndOfWeek(LocalDate date)
getNextMonthDateback to summary
private LocalDate getNextMonthDate()
getNextWeekDateback to summary
private LocalDate getNextWeekDate()
getStartDateback to summary
public final LocalDate getStartDate()
getStartFieldback to summary
public final TimeRangeField getStartField()
getStartOfMonthback to summary
private LocalDate getStartOfMonth(LocalDate date)
getStartOfWeekback to summary
private LocalDate getStartOfWeek(LocalDate date)
getThisMonthDateback to summary
private LocalDate getThisMonthDate()
getThisWeekDateback to summary
private LocalDate getThisWeekDate()
getTodayback to summary
public final LocalDate getToday()

Returns the value of todayProperty().

Returns:LocalDate

the date representing "today"

getTomorrowback to summary
private LocalDate getTomorrow()
getUnitsToPrintback to summary
public final int getUnitsToPrint()
getWeekFieldsback to summary
public final WeekFields getWeekFields()

Returns the value of weekFieldsProperty().

Returns:WeekFields

the week fields

isCurrentMonthback to summary
private boolean isCurrentMonth(LocalDate date)
isCurrentWeekback to summary
private boolean isCurrentWeek(LocalDate date)
isNextMonthback to summary
private boolean isNextMonth(LocalDate date)
isNextWeekback to summary
private boolean isNextWeek(LocalDate date)
loadDropDownValuesback to summary
public final void loadDropDownValues(LocalDate date)

Set the expected values for TimeRange combos.
If dialog is opened for the first time or user hasn't made any change It will calculate the values based on CalendarView#dateProperty(). Otherwise, It will search on OldValuesMap in order to mantain in combos what user does while dialog is opened.

When dialog get closed, old values get cleaned.

Parameters
date:LocalDate

Used to calculate values of combos when dialog is opened for the first time.

setEndDateback to summary
private void setEndDate(LocalDate endDate)
setStartDateback to summary
private void setStartDate(LocalDate startDate)
setTodayback to summary
public final void setToday(LocalDate date)

Sets the value of todayProperty().

Parameters
date:LocalDate

the date representing "today"

setUnitsToPrintback to summary
private void setUnitsToPrint(int unitsToPrint)
setWeekFieldsback to summary
public final void setWeekFields(WeekFields fields)

Sets the value of weekFieldsProperty().

Parameters
fields:WeekFields

the new week fields

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

Stores the date that is considered to represent "today". This property is initialized with LocalDate#now() but can be any date.

Returns:ObjectProperty<LocalDate>

the date representing "today"

unitsToPrintPropertyback to summary
public final ReadOnlyIntegerProperty unitsToPrintProperty()
updateEndDateback to summary
private void updateEndDate()
updateStartDateback to summary
private void updateStartDate()
updateUnitsToPrintback to summary
private void updateUnitsToPrint()
weekFieldsPropertyback to summary
public final ObjectProperty<WeekFields> weekFieldsProperty()

Week fields are used to determine the first day of a week (e.g. "Monday" in Germany or "Sunday" in the US). It is also used to calculate the week number as the week fields determine how many days are needed in the first week of a year. This property is initialized with WeekFields#ISO.

Returns:ObjectProperty<WeekFields>

the week fields

com.calendarfx.view.print back to summary

private Class TimeRangeView.TimeRangeOldValues

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final TimeRangeField
private final TimeRangeField

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

endFieldback to summary
private final TimeRangeField endField
startFieldback to summary
private final TimeRangeField startField

Constructor Detail

TimeRangeOldValuesback to summary
public TimeRangeOldValues()