- java.lang.Object
-
- eu.hansolo.tilesfx.Alarm
-
public class Alarm extends java.lang.ObjectCreated by hansolo on 19.12.16.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAlarm.AlarmMarkerEventstatic classAlarm.Repetition
-
Field Summary
Fields Modifier and Type Field Description Alarm.AlarmMarkerEventALARM_MARKER_PRESSED_EVENTAlarm.AlarmMarkerEventALARM_MARKER_RELEASED_EVENTstatic booleanARMEDstatic booleanUNARMED
-
Constructor Summary
Constructors Constructor Description Alarm()Represents a point in time where something should be triggered.Alarm(Alarm.Repetition REPETITION, java.time.ZonedDateTime TIME)Alarm(Alarm.Repetition REPETITION, java.time.ZonedDateTime TIME, boolean ARMED)Alarm(Alarm.Repetition REPETITION, java.time.ZonedDateTime TIME, boolean ARMED, java.lang.String TEXT)Alarm(Alarm.Repetition REPETITION, java.time.ZonedDateTime TIME, boolean ARMED, java.lang.String TEXT, Command COMMAND)Alarm(Alarm.Repetition REPETITION, java.time.ZonedDateTime TIME, boolean ARMED, java.lang.String TEXT, Command COMMAND, javafx.scene.paint.Color COLOR)Alarm(Alarm.Repetition REPETITION, java.time.ZonedDateTime TIME, javafx.scene.paint.Color COLOR)Alarm(java.time.ZonedDateTime TIME)Alarm(java.time.ZonedDateTime TIME, javafx.scene.paint.Color COLOR)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecuteCommand()voidfireAlarmMarkerEvent(Alarm.AlarmMarkerEvent EVENT)javafx.scene.paint.ColorgetColor()Returns the color that will be used to colorize the alarm in a clock.CommandgetCommand()Returns an instance of a class that implements the Command interface.javafx.event.EventHandler<Alarm.AlarmMarkerEvent>getOnMarkerPressed()javafx.event.EventHandler<Alarm.AlarmMarkerEvent>getOnMarkerReleased()Alarm.RepetitiongetRepetition()Returns the repetition rate of the alarm.java.lang.StringgetText()Returns the text that was defined for the alarm.java.time.ZonedDateTimegetTime()Returns the time of the alarm.booleanisArmed()Returns true if the alarm is activated.javafx.beans.property.ObjectProperty<javafx.event.EventHandler<Alarm.AlarmMarkerEvent>>onMarkerPressedProperty()javafx.beans.property.ObjectProperty<javafx.event.EventHandler<Alarm.AlarmMarkerEvent>>onMarkerReleasedProperty()voidsetArmed(boolean ARMED)Defines if the alarm is activated.voidsetColor(javafx.scene.paint.Color COLOR)Defines the color that will be used to colorize the alarmvoidsetCommand(Command COMMAND)Defines a class that implements the Command interface and which execute() method will be called when the alarm is triggered.voidsetOnMarkerPressed(javafx.event.EventHandler<Alarm.AlarmMarkerEvent> value)voidsetOnMarkerReleased(javafx.event.EventHandler<Alarm.AlarmMarkerEvent> value)voidsetRepetition(Alarm.Repetition REPETITION)Defines the repetition rate of the alarm.voidsetText(java.lang.String TEXT)Defines a text for the alarm.voidsetTime(java.time.ZonedDateTime TIME)Defines the time of the alarm.java.lang.StringtoString()
-
-
-
Field Detail
-
ARMED
public static final boolean ARMED
- See Also:
- Constant Field Values
-
UNARMED
public static final boolean UNARMED
- See Also:
- Constant Field Values
-
ALARM_MARKER_PRESSED_EVENT
public final Alarm.AlarmMarkerEvent ALARM_MARKER_PRESSED_EVENT
-
ALARM_MARKER_RELEASED_EVENT
public final Alarm.AlarmMarkerEvent ALARM_MARKER_RELEASED_EVENT
-
-
Constructor Detail
-
Alarm
public Alarm()
Represents a point in time where something should be triggered.
-
Alarm
public Alarm(java.time.ZonedDateTime TIME)
-
Alarm
public Alarm(java.time.ZonedDateTime TIME, javafx.scene.paint.Color COLOR)
-
Alarm
public Alarm(Alarm.Repetition REPETITION, java.time.ZonedDateTime TIME)
-
Alarm
public Alarm(Alarm.Repetition REPETITION, java.time.ZonedDateTime TIME, javafx.scene.paint.Color COLOR)
-
Alarm
public Alarm(Alarm.Repetition REPETITION, java.time.ZonedDateTime TIME, boolean ARMED)
-
Alarm
public Alarm(Alarm.Repetition REPETITION, java.time.ZonedDateTime TIME, boolean ARMED, java.lang.String TEXT)
-
Alarm
public Alarm(Alarm.Repetition REPETITION, java.time.ZonedDateTime TIME, boolean ARMED, java.lang.String TEXT, Command COMMAND)
-
Alarm
public Alarm(Alarm.Repetition REPETITION, java.time.ZonedDateTime TIME, boolean ARMED, java.lang.String TEXT, Command COMMAND, javafx.scene.paint.Color COLOR)
-
-
Method Detail
-
getRepetition
public Alarm.Repetition getRepetition()
Returns the repetition rate of the alarm. The values are ONCE, HALF_HOURLY, HOURLY, DAILY, WEEKLY- Returns:
- the repetition rate of the alarm
-
setRepetition
public void setRepetition(Alarm.Repetition REPETITION)
Defines the repetition rate of the alarm. The values are ONCE, HALF_HOURLY, HOURLY, DAILY, WEEKLY- Parameters:
REPETITION-
-
getTime
public java.time.ZonedDateTime getTime()
Returns the time of the alarm.- Returns:
- the time of the alarm
-
setTime
public void setTime(java.time.ZonedDateTime TIME)
Defines the time of the alarm.- Parameters:
TIME-
-
isArmed
public boolean isArmed()
Returns true if the alarm is activated. If an alarm is not armed it will be drawn gray translucent.- Returns:
- true if the alarm is activated
-
setArmed
public void setArmed(boolean ARMED)
Defines if the alarm is activated. If an alarm is not armed it will be drawn gray translucent.- Parameters:
ARMED-
-
getText
public java.lang.String getText()
Returns the text that was defined for the alarm. The text will be shown in tooltips.- Returns:
- the text that was defined for the alarm
-
setText
public void setText(java.lang.String TEXT)
Defines a text for the alarm. The text will be shown in tooltips.- Parameters:
TEXT-
-
getCommand
public Command getCommand()
Returns an instance of a class that implements the Command interface. This interface only contains one method execute() which will be called when the alarm is triggered. With this one could execute specific tasks defined in separate classes.- Returns:
- an instance of a class that implements the Command interface
-
setCommand
public void setCommand(Command COMMAND)
Defines a class that implements the Command interface and which execute() method will be called when the alarm is triggered.- Parameters:
COMMAND-
-
executeCommand
public void executeCommand()
-
getColor
public javafx.scene.paint.Color getColor()
Returns the color that will be used to colorize the alarm in a clock.- Returns:
- the color that will be used to colorize the alarm
-
setColor
public void setColor(javafx.scene.paint.Color COLOR)
Defines the color that will be used to colorize the alarm- Parameters:
COLOR-
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
onMarkerPressedProperty
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<Alarm.AlarmMarkerEvent>> onMarkerPressedProperty()
-
setOnMarkerPressed
public final void setOnMarkerPressed(javafx.event.EventHandler<Alarm.AlarmMarkerEvent> value)
-
getOnMarkerPressed
public final javafx.event.EventHandler<Alarm.AlarmMarkerEvent> getOnMarkerPressed()
-
onMarkerReleasedProperty
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<Alarm.AlarmMarkerEvent>> onMarkerReleasedProperty()
-
setOnMarkerReleased
public final void setOnMarkerReleased(javafx.event.EventHandler<Alarm.AlarmMarkerEvent> value)
-
getOnMarkerReleased
public final javafx.event.EventHandler<Alarm.AlarmMarkerEvent> getOnMarkerReleased()
-
fireAlarmMarkerEvent
public void fireAlarmMarkerEvent(Alarm.AlarmMarkerEvent EVENT)
-
-