Class TimeSection

java.lang.Object
eu.hansolo.medusa.TimeSection
All Implemented Interfaces:
Comparable<TimeSection>

public class TimeSection extends Object implements Comparable<TimeSection>
Created by hansolo on 31.01.16.
  • Property Details

  • Field Details

  • 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

      public TimeSection(LocalTime START, LocalTime STOP)
    • TimeSection

      public TimeSection(LocalTime START, LocalTime STOP, javafx.scene.paint.Color COLOR)
    • TimeSection

      public TimeSection(LocalTime START, LocalTime STOP, javafx.scene.paint.Color COLOR, javafx.scene.paint.Color HIGHLIGHT_COLOR)
    • TimeSection

      public TimeSection(LocalTime START, LocalTime STOP, javafx.scene.image.Image ICON, javafx.scene.paint.Color COLOR)
    • TimeSection

      public TimeSection(LocalTime START, LocalTime STOP, String TEXT, javafx.scene.paint.Color COLOR)
    • TimeSection

      public TimeSection(LocalTime START, LocalTime STOP, String TEXT, javafx.scene.paint.Color COLOR, javafx.scene.paint.Color TEXT_COLOR)
    • TimeSection

      public TimeSection(LocalTime START, LocalTime STOP, String TEXT, javafx.scene.image.Image ICON, javafx.scene.paint.Color COLOR, javafx.scene.paint.Color TEXT_COLOR)
    • TimeSection

      public 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)
  • Method Details

    • getStart

      public LocalTime getStart()
      Returns the time when the section begins.
      Returns:
      the time when the section begins
    • setStart

      public void setStart(LocalTime START)
      Defines the time when the section starts.
      Parameters:
      START -
    • startProperty

      public javafx.beans.property.ObjectProperty<LocalTime> startProperty()
      See Also:
    • getStop

      public LocalTime getStop()
      Returns the time when the section ends.
      Returns:
      the time when the section ends
    • setStop

      public void setStop(LocalTime STOP)
      Defines the time when the section ends
      Parameters:
      STOP -
    • stopProperty

      public javafx.beans.property.ObjectProperty<LocalTime> stopProperty()
      See Also:
    • getText

      public String getText()
      Returns the text that was set for the section.
      Returns:
      the text that was set for the section
    • setText

      public void setText(String TEXT)
      Defines the text for the section
      Parameters:
      TEXT -
    • textProperty

      public javafx.beans.property.StringProperty 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()
      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()
      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()
      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()
      See Also:
    • contains

      public boolean contains(LocalTime VALUE)
      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
    • checkForValue

      public void checkForValue(LocalTime VALUE)
      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 specific region in a gauge. 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.
      Parameters:
      VALUE -
    • equals

      public boolean equals(TimeSection SECTION)
    • compareTo

      public int compareTo(TimeSection SECTION)
      Specified by:
      compareTo in interface Comparable<TimeSection>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • onTimeSectionEnteredProperty

      public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<TimeSection.TimeSectionEvent>> onTimeSectionEnteredProperty()
      See Also:
    • setOnTimeSectionEntered

      public final void setOnTimeSectionEntered(javafx.event.EventHandler<TimeSection.TimeSectionEvent> value)
      Sets the value of the property onTimeSectionEntered.
      Property description:
    • getOnTimeSectionEntered

      public final javafx.event.EventHandler<TimeSection.TimeSectionEvent> getOnTimeSectionEntered()
      Gets the value of the property onTimeSectionEntered.
      Property description:
    • onTimeSectionLeftProperty

      public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<TimeSection.TimeSectionEvent>> onTimeSectionLeftProperty()
      See Also:
    • setOnTimeSectionLeft

      public final void setOnTimeSectionLeft(javafx.event.EventHandler<TimeSection.TimeSectionEvent> value)
      Sets the value of the property onTimeSectionLeft.
      Property description:
    • getOnTimeSectionLeft

      public final javafx.event.EventHandler<TimeSection.TimeSectionEvent> getOnTimeSectionLeft()
      Gets the value of the property onTimeSectionLeft.
      Property description:
    • fireTimeSectionEvent

      public void fireTimeSectionEvent(TimeSection.TimeSectionEvent EVENT)