java.lang.Object
com.flexganttfx.model.repository.ActivityRepositoryBase<A>
com.flexganttfx.model.calendar.CalendarBase<WeekendCalendarActivity>
com.flexganttfx.model.calendar.WeekendCalendar
- All Implemented Interfaces:
ActivityRepository<WeekendCalendarActivity>
,Calendar<WeekendCalendarActivity>
,EventTarget
public class WeekendCalendar extends CalendarBase<WeekendCalendarActivity>
A calendar specialized on returning activities that represent weekend days
(default: saturday, sunday). The days that are considered weekend days can be
configured by calling
setWeekendDays(DayOfWeek...)
.- Since:
- 1.0
-
Property Summary
Properties inherited from class com.flexganttfx.model.calendar.CalendarBase
name, visible
-
Constructor Summary
Constructors Constructor Description WeekendCalendar()
Constructs a new weekend calendar. -
Method Summary
Modifier and Type Method Description Iterator<WeekendCalendarActivity>
getActivities(Layer layer, Instant startTime, Instant endTime, TemporalUnit temporalUnit, ZoneId zoneId)
Returns an iterator for iterating over all activities found for the given layer and time interval.DayOfWeek[]
getWeekendDays()
Returns the days of the week that are to be considered weekend days.protected boolean
isSupportedUnit(TemporalUnit unit)
Determines if weekends will be shown for the given temporal unit.void
setWeekendDays(DayOfWeek... days)
Sets the days of the week that are considered to be a weekend day.Methods inherited from class com.flexganttfx.model.calendar.CalendarBase
getName, isVisible, nameProperty, setName, setVisible, visibleProperty
Methods inherited from class com.flexganttfx.model.repository.ActivityRepositoryBase
addEventHandler, buildEventDispatchChain, fireEvent, getEarliestTimeUsed, getLatestTimeUsed, removeEventHandler
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.flexganttfx.model.ActivityRepository
addEventHandler, getEarliestTimeUsed, getLatestTimeUsed, removeEventHandler
Methods inherited from interface javafx.event.EventTarget
buildEventDispatchChain
-
Constructor Details
-
WeekendCalendar
public WeekendCalendar()Constructs a new weekend calendar.- Since:
- 1.0
-
-
Method Details
-
setWeekendDays
Sets the days of the week that are considered to be a weekend day. By defaultDayOfWeek.SATURDAY
andDayOfWeek.SUNDAY
are considered weekend days.- Parameters:
days
- the days of the week that are to be considered weekend days- Since:
- 1.0
-
getWeekendDays
Returns the days of the week that are to be considered weekend days. By defaultDayOfWeek.SATURDAY
andDayOfWeek.SUNDAY
are considered weekend days.- Returns:
- the days of the week used as weekend days
- Since:
- 1.0
-
getActivities
public Iterator<WeekendCalendarActivity> getActivities(Layer layer, Instant startTime, Instant endTime, TemporalUnit temporalUnit, ZoneId zoneId)Description copied from interface:ActivityRepository
Returns an iterator for iterating over all activities found for the given layer and time interval. This method has to return very fast as it gets called many times during rendering of the chart. A slow implementation will have a direct impact on scrolling / rendering performance.- Parameters:
layer
- the layer for which to return the activitiesstartTime
- the start time of the time interval for which to return the activitiesendTime
- the end time of the time interval for which to return the activitiestemporalUnit
- the temporal unit currently displayed in the datelinezoneId
- the timezone currently displayed in the dateline- Returns:
- the activities on the given layer and in the given time interval
-
isSupportedUnit
Determines if weekends will be shown for the given temporal unit. By default we only show weekends forChronoUnit.DAYS
andChronoUnit.WEEKS
. To support more units simply override this method in a subclass.- Parameters:
unit
- the unit to check- Returns:
- true if weekend information will be shown in the Gantt chart
- Since:
- 1.0
-