java.lang.Object
eu.hansolo.tilesfx.TimeSection
- All Implemented Interfaces:
Comparable<TimeSection>
Created by hansolo on 31.01.16.
-
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.ReadOnlyBooleanPropertyjavafx.beans.property.ObjectProperty<javafx.scene.paint.Color> javafx.beans.property.ObjectProperty<javafx.scene.paint.Color> javafx.beans.property.ObjectProperty<javafx.scene.image.Image> final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<TimeSection.TimeSectionEvent>> final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<TimeSection.TimeSectionEvent>> javafx.beans.property.ObjectProperty<LocalTime> javafx.beans.property.ObjectProperty<LocalTime> javafx.beans.property.ObjectProperty<javafx.scene.paint.Color> javafx.beans.property.StringProperty -
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
ConstructorsConstructorDescriptionRepresents an area of a given range, defined by a start and stop time.TimeSection(LocalTime START, LocalTime STOP) TimeSection(LocalTime START, LocalTime STOP, String TEXT, javafx.scene.image.Image ICON, javafx.scene.paint.Color COLOR, javafx.scene.paint.Color TEXT_COLOR) TimeSection(LocalTime START, LocalTime STOP, String TEXT, javafx.scene.image.Image ICON, javafx.scene.paint.Color COLOR, javafx.scene.paint.Color HIGHLIGHT_COLOR, javafx.scene.paint.Color TEXT_COLOR, boolean ACTIVE, DayOfWeek... DAYS) TimeSection(LocalTime START, LocalTime STOP, String TEXT, javafx.scene.paint.Color COLOR) TimeSection(LocalTime START, LocalTime STOP, String TEXT, javafx.scene.paint.Color COLOR, javafx.scene.paint.Color TEXT_COLOR) TimeSection(LocalTime START, LocalTime STOP, javafx.scene.image.Image ICON, javafx.scene.paint.Color COLOR) TimeSection(LocalTime START, LocalTime STOP, javafx.scene.paint.Color COLOR) TimeSection(LocalTime START, LocalTime STOP, javafx.scene.paint.Color COLOR, javafx.scene.paint.Color HIGHLIGHT_COLOR) TimeSection(LocalTime START, LocalTime STOP, javafx.scene.paint.Color COLOR, javafx.scene.paint.Color HIGHLIGHT_COLOR, DayOfWeek... DAYS) -
Method Summary
Modifier and TypeMethodDescriptionjavafx.beans.property.ReadOnlyBooleanPropertyvoidvoidcheckForTime(LocalTime VALUE) Checks if the section contains the given time and fires an event in case the value "entered" or "left" the section.voidcheckForTimeAndDate(ZonedDateTime DATE_TIME) Checks if the section days contains the day of week of the given ZonedDateTime object and if the section contains the time itself.voidcheckForTimeAndDay(LocalTime VALUE, DayOfWeek DAY) voidjavafx.beans.property.ObjectProperty<javafx.scene.paint.Color> intcompareTo(TimeSection SECTION) booleanReturns true if the given time is within the range between section.getStart() and section.getStop()booleanvoidjavafx.scene.paint.ColorgetColor()Returns the color that will be used to colorize the section in a clock.getDays()javafx.scene.paint.ColorReturns the color that will be used to colorize the section in a gauge when it is highlighted.javafx.scene.image.ImagegetImage()Returns the image that was defined for the section.final javafx.event.EventHandler<TimeSection.TimeSectionEvent> Gets the value of theonTimeSectionEnteredproperty.final javafx.event.EventHandler<TimeSection.TimeSectionEvent> Gets the value of theonTimeSectionLeftproperty.getStart()Returns the time when the section begins.getStop()Returns the time when the section ends.getText()Returns the text that was set for the section.javafx.scene.paint.ColorReturns the color that will be used to colorize the section text.inthashCode()javafx.beans.property.ObjectProperty<javafx.scene.paint.Color> javafx.beans.property.ObjectProperty<javafx.scene.image.Image> booleanisActive()Gets the value of theactiveproperty.final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<TimeSection.TimeSectionEvent>> final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<TimeSection.TimeSectionEvent>> voidvoidsetActive(boolean ACTIVE) Sets the value of theactiveproperty.voidsetColor(javafx.scene.paint.Color COLOR) Defines the color that will be used to colorize the section in a clock.voidvoidvoidsetHighlightColor(javafx.scene.paint.Color COLOR) Defines the color that will be used to colorize a highlighted sectionvoidsetIcon(javafx.scene.image.Image IMAGE) Defines an image for the section.final voidsetOnTimeSectionEntered(javafx.event.EventHandler<TimeSection.TimeSectionEvent> value) Sets the value of theonTimeSectionEnteredproperty.final voidsetOnTimeSectionLeft(javafx.event.EventHandler<TimeSection.TimeSectionEvent> value) Sets the value of theonTimeSectionLeftproperty.voidDefines the time when the section starts.voidDefines the time when the section endsvoidDefines the text for the sectionvoidsetTextColor(javafx.scene.paint.Color COLOR) Defines the color that will be used to colorize the section textjavafx.beans.property.ObjectProperty<LocalTime> javafx.beans.property.ObjectProperty<LocalTime> javafx.beans.property.ObjectProperty<javafx.scene.paint.Color> javafx.beans.property.StringPropertytoString()
-
Property Details
-
start
- See Also:
-
stop
- See Also:
-
text
public javafx.beans.property.StringProperty textProperty- See Also:
-
icon
public javafx.beans.property.ObjectProperty<javafx.scene.image.Image> iconProperty- See Also:
-
color
public javafx.beans.property.ObjectProperty<javafx.scene.paint.Color> colorProperty- See Also:
-
highlightColor
public javafx.beans.property.ObjectProperty<javafx.scene.paint.Color> highlightColorProperty- See Also:
-
textColor
public javafx.beans.property.ObjectProperty<javafx.scene.paint.Color> textColorProperty- See Also:
-
active
public javafx.beans.property.ReadOnlyBooleanProperty activeProperty- See Also:
-
onTimeSectionEntered
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<TimeSection.TimeSectionEvent>> onTimeSectionEnteredProperty- See Also:
-
onTimeSectionLeft
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<TimeSection.TimeSectionEvent>> onTimeSectionLeftProperty- See Also:
-
-
Field Details
-
ENTERED_EVENT
-
LEFT_EVENT
-
-
Constructor Details
-
TimeSection
public TimeSection()Represents an area of a given range, defined by a start and stop time. This class is used for regions and areas in many clocks. It is possible to check a time against the defined range and fire events in case the value enters or leaves the defined region. -
TimeSection
-
TimeSection
-
TimeSection
-
TimeSection
-
TimeSection
-
TimeSection
-
TimeSection
-
TimeSection
-
TimeSection
-
-
Method Details
-
getStart
Returns the time when the section begins.- Returns:
- the time when the section begins
-
setStart
Defines the time when the section starts.- Parameters:
START-
-
startProperty
- Returns:
- the
startproperty - See Also:
-
getStop
Returns the time when the section ends.- Returns:
- the time when the section ends
-
setStop
Defines the time when the section ends- Parameters:
STOP-
-
stopProperty
- Returns:
- the
stopproperty - See Also:
-
getText
Returns the text that was set for the section.- Returns:
- the text that was set for the section
-
setText
Defines the text for the section- Parameters:
TEXT-
-
textProperty
public javafx.beans.property.StringProperty textProperty()- Returns:
- the
textproperty - See Also:
-
getImage
public javafx.scene.image.Image getImage()Returns the image that was defined for the section.- Returns:
- the image that was defined for the section
-
setIcon
public void setIcon(javafx.scene.image.Image IMAGE) Defines an image for the section.- Parameters:
IMAGE-
-
iconProperty
public javafx.beans.property.ObjectProperty<javafx.scene.image.Image> iconProperty()- Returns:
- the
iconproperty - See Also:
-
getColor
public javafx.scene.paint.Color getColor()Returns the color that will be used to colorize the section in a clock.- Returns:
- the color that will be used to colorize the section
-
setColor
public void setColor(javafx.scene.paint.Color COLOR) Defines the color that will be used to colorize the section in a clock.- Parameters:
COLOR-
-
colorProperty
public javafx.beans.property.ObjectProperty<javafx.scene.paint.Color> colorProperty()- Returns:
- the
colorproperty - See Also:
-
getHighlightColor
public javafx.scene.paint.Color getHighlightColor()Returns the color that will be used to colorize the section in a gauge when it is highlighted.- Returns:
- the color that will be used to colorize a highlighted section
-
setHighlightColor
public void setHighlightColor(javafx.scene.paint.Color COLOR) Defines the color that will be used to colorize a highlighted section- Parameters:
COLOR-
-
highlightColorProperty
public javafx.beans.property.ObjectProperty<javafx.scene.paint.Color> highlightColorProperty()- Returns:
- the
highlightColorproperty - See Also:
-
getTextColor
public javafx.scene.paint.Color getTextColor()Returns the color that will be used to colorize the section text.- Returns:
- the color that will bused to colorize the section text
-
setTextColor
public void setTextColor(javafx.scene.paint.Color COLOR) Defines the color that will be used to colorize the section text- Parameters:
COLOR-
-
textColorProperty
public javafx.beans.property.ObjectProperty<javafx.scene.paint.Color> textColorProperty()- Returns:
- the
textColorproperty - See Also:
-
isActive
public boolean isActive()Gets the value of theactiveproperty.- Property description:
- Returns:
- the value of the
activeproperty - See Also:
-
setActive
public void setActive(boolean ACTIVE) Sets the value of theactiveproperty.- Property description:
- Parameters:
ACTIVE- the value for theactiveproperty- See Also:
-
activeProperty
public javafx.beans.property.ReadOnlyBooleanProperty activeProperty()- Returns:
- the
activeproperty - See Also:
-
getDays
-
getDaysAsList
-
setDays
-
setDays
-
addDay
-
removeDay
-
clearDays
public void clearDays() -
contains
Returns true if the given time is within the range between section.getStart() and section.getStop()- Parameters:
VALUE-- Returns:
- true if the given time is within the range of the section
-
checkForTime
Checks if the section contains the given time and fires an event in case the value "entered" or "left" the section. With this one can react if a time "enters"/"leaves" a section. This can be useful to control things like switching lights on if the time enters the region and switching it of again when the time left the region. When calling this method the days won't be taken into account but only the time!!! If the TimeSection is not active no event will be fired.- Parameters:
VALUE-
-
checkForTimeAndDay
-
checkForTimeAndDate
Checks if the section days contains the day of week of the given ZonedDateTime object and if the section contains the time itself. With this one can react if a time "enters"/"leaves" a section.- Parameters:
DATE_TIME-
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<TimeSection>
-
toString
-
toJSONString
-
onTimeSectionEnteredProperty
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<TimeSection.TimeSectionEvent>> onTimeSectionEnteredProperty()- Returns:
- the
onTimeSectionEnteredproperty - See Also:
-
setOnTimeSectionEntered
public final void setOnTimeSectionEntered(javafx.event.EventHandler<TimeSection.TimeSectionEvent> value) Sets the value of theonTimeSectionEnteredproperty.- Property description:
- Parameters:
value- the value for theonTimeSectionEnteredproperty- See Also:
-
getOnTimeSectionEntered
Gets the value of theonTimeSectionEnteredproperty.- Property description:
- Returns:
- the value of the
onTimeSectionEnteredproperty - See Also:
-
onTimeSectionLeftProperty
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<TimeSection.TimeSectionEvent>> onTimeSectionLeftProperty()- Returns:
- the
onTimeSectionLeftproperty - See Also:
-
setOnTimeSectionLeft
public final void setOnTimeSectionLeft(javafx.event.EventHandler<TimeSection.TimeSectionEvent> value) Sets the value of theonTimeSectionLeftproperty.- Property description:
- Parameters:
value- the value for theonTimeSectionLeftproperty- See Also:
-
getOnTimeSectionLeft
Gets the value of theonTimeSectionLeftproperty.- Property description:
- Returns:
- the value of the
onTimeSectionLeftproperty - See Also:
-
fireTimeSectionEvent
-