Class Section

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

public class Section extends Object implements Comparable<Section>
Created by hansolo on 11.12.15.
  • Property Summary

    Properties
    Type
    Property
    Description
    javafx.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<Section.SectionEvent>>
     
    final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<Section.SectionEvent>>
     
    final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<Section.SectionEvent>>
     
    javafx.beans.property.ReadOnlyDoubleProperty
     
    javafx.beans.property.DoubleProperty
     
    javafx.beans.property.DoubleProperty
     
    javafx.beans.property.ObjectProperty<javafx.scene.paint.Color>
     
    javafx.beans.property.StringProperty
     
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
     
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Represents an area of a given range, defined by a start and stop value.
    Section(double START, double STOP)
     
    Section(double START, double STOP, String TEXT, javafx.scene.image.Image ICON, javafx.scene.paint.Color COLOR, javafx.scene.paint.Color TEXT_COLOR)
     
    Section(double START, double 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)
     
    Section(double START, double 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, String STYLE_CLASS)
     
    Section(double START, double STOP, String TEXT, javafx.scene.paint.Color COLOR)
     
    Section(double START, double STOP, String TEXT, javafx.scene.paint.Color COLOR, javafx.scene.paint.Color TEXT_COLOR)
     
    Section(double START, double STOP, javafx.scene.image.Image ICON, javafx.scene.paint.Color COLOR)
     
    Section(double START, double STOP, javafx.scene.paint.Color COLOR)
     
    Section(double START, double STOP, javafx.scene.paint.Color COLOR, javafx.scene.paint.Color HIGHLIGHT_COLOR)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    checkForValue(double VALUE)
    Checks if the section contains the given value and fires an event in case the value "entered" or "left" the section.
    javafx.beans.property.ObjectProperty<javafx.scene.paint.Color>
     
    int
    compareTo(Section SECTION)
     
    boolean
    contains(double VALUE)
    Returns true if the given value is within the range between section.getStart() and section.getStop()
    boolean
    equals(Section SECTION)
     
    void
     
    javafx.scene.paint.Color
    Returns the color that will be used to colorize the section in a gauge.
    javafx.scene.paint.Color
    Returns the color that will be used to colorize the section in a gauge when it is highlighted.
    javafx.scene.image.Image
    Returns the image that was defined for the section.
    final javafx.event.EventHandler<Section.SectionEvent>
    Gets the value of the property onSectionEntered.
    final javafx.event.EventHandler<Section.SectionEvent>
    Gets the value of the property onSectionLeft.
    final javafx.event.EventHandler<Section.SectionEvent>
    Gets the value of the property onSectionUpdate.
    double
    Returns the absolute range between stop and start
    double
    Returns the value where the section begins.
    double
    Returns the value where the section ends.
    Returns the style class that can be used to colorize the section.
    Returns the text that was set for the section.
    javafx.scene.paint.Color
    Returns the color that will be used to colorize the section text.
    javafx.beans.property.ObjectProperty<javafx.scene.paint.Color>
     
    javafx.beans.property.ObjectProperty<javafx.scene.image.Image>
     
    final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<Section.SectionEvent>>
     
    final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<Section.SectionEvent>>
     
    final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<Section.SectionEvent>>
     
    javafx.beans.property.ReadOnlyDoubleProperty
     
    void
    setColor(javafx.scene.paint.Color COLOR)
    Defines the color that will be used to colorize the section in a gauge.
    void
    setHighlightColor(javafx.scene.paint.Color COLOR)
    Defines the color that will be used to colorize a highlighted section
    void
    setIcon(javafx.scene.image.Image IMAGE)
    Defines an image for the section.
    final void
    setOnSectionEntered(javafx.event.EventHandler<Section.SectionEvent> value)
    Sets the value of the property onSectionEntered.
    final void
    setOnSectionLeft(javafx.event.EventHandler<Section.SectionEvent> value)
    Sets the value of the property onSectionLeft.
    final void
    setOnSectionUpdate(javafx.event.EventHandler<Section.SectionEvent> value)
    Sets the value of the property onSectionUpdate.
    void
    setStart(double START)
    Defines the value where the section begins.
    void
    setStop(double STOP)
    Defines the value where the section ends.
    void
    setStyleClass(String STYLE_CLASS)
    Defines the style class that can be used to colorize the section.
    void
    Defines a text for the section.
    void
    setTextColor(javafx.scene.paint.Color COLOR)
    Defines the color that will be used to colorize the section text.
    javafx.beans.property.DoubleProperty
     
    javafx.beans.property.DoubleProperty
     
    javafx.beans.property.ObjectProperty<javafx.scene.paint.Color>
     
    javafx.beans.property.StringProperty
     
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Property Details

  • Field Details

  • Constructor Details

    • Section

      public Section()
      Represents an area of a given range, defined by a start and stop value. This class is used for regions and areas in many gauges. It is possible to check a value against the defined range and fire events in case the value enters or leaves the defined region.
    • Section

      public Section(double START, double STOP)
    • Section

      public Section(double START, double STOP, javafx.scene.paint.Color COLOR)
    • Section

      public Section(double START, double STOP, javafx.scene.paint.Color COLOR, javafx.scene.paint.Color HIGHLIGHT_COLOR)
    • Section

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

      public Section(double START, double STOP, String TEXT, javafx.scene.paint.Color COLOR)
    • Section

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

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

      public Section(double START, double 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)
    • Section

      public Section(double START, double 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, String STYLE_CLASS)
  • Method Details

    • getStart

      public double getStart()
      Returns the value where the section begins.
      Returns:
      the value where the section begins
    • setStart

      public void setStart(double START)
      Defines the value where the section begins.
      Parameters:
      START -
    • startProperty

      public javafx.beans.property.DoubleProperty startProperty()
      See Also:
    • getStop

      public double getStop()
      Returns the value where the section ends.
      Returns:
      the value where the section ends
    • setStop

      public void setStop(double STOP)
      Defines the value where the section ends.
      Parameters:
      STOP -
    • stopProperty

      public javafx.beans.property.DoubleProperty stopProperty()
      See Also:
    • getRange

      public double getRange()
      Returns the absolute range between stop and start
      Returns:
      the absolute range between stop and start
    • rangeProperty

      public javafx.beans.property.ReadOnlyDoubleProperty rangeProperty()
      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 a 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. In some skins the image will be drawn (e.g. SimpleSkin).
      Returns:
      the image that was defined for the section
    • setIcon

      public void setIcon(javafx.scene.image.Image IMAGE)
      Defines an image for the section. In some skins the image will be drawn (e.g. SimpleSkin)
      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 gauge.
      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 gauge.
      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 be used 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:
    • getStyleClass

      public String getStyleClass()
      Returns the style class that can be used to colorize the section. This is not implemented in the current available skins.
      Returns:
      the style class that can be used to colorize the section
    • setStyleClass

      public void setStyleClass(String STYLE_CLASS)
      Defines the style class that can be used to colorize the section. This is not implemented in the current available skins.
      Parameters:
      STYLE_CLASS -
    • contains

      public boolean contains(double VALUE)
      Returns true if the given value is within the range between section.getStart() and section.getStop()
      Parameters:
      VALUE -
      Returns:
      true if the given value is within the range of the section
    • checkForValue

      public void checkForValue(double VALUE)
      Checks if the section contains the given value and fires an event in case the value "entered" or "left" the section. With this one can react if a value enters/leaves a specific region in a gauge.
      Parameters:
      VALUE -
    • equals

      public boolean equals(Section SECTION)
    • compareTo

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

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

      public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<Section.SectionEvent>> onSectionEnteredProperty()
      See Also:
    • setOnSectionEntered

      public final void setOnSectionEntered(javafx.event.EventHandler<Section.SectionEvent> value)
      Sets the value of the property onSectionEntered.
      Property description:
    • getOnSectionEntered

      public final javafx.event.EventHandler<Section.SectionEvent> getOnSectionEntered()
      Gets the value of the property onSectionEntered.
      Property description:
    • onSectionLeftProperty

      public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<Section.SectionEvent>> onSectionLeftProperty()
      See Also:
    • setOnSectionLeft

      public final void setOnSectionLeft(javafx.event.EventHandler<Section.SectionEvent> value)
      Sets the value of the property onSectionLeft.
      Property description:
    • getOnSectionLeft

      public final javafx.event.EventHandler<Section.SectionEvent> getOnSectionLeft()
      Gets the value of the property onSectionLeft.
      Property description:
    • onSectionUpdateProperty

      public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<Section.SectionEvent>> onSectionUpdateProperty()
      See Also:
    • setOnSectionUpdate

      public final void setOnSectionUpdate(javafx.event.EventHandler<Section.SectionEvent> value)
      Sets the value of the property onSectionUpdate.
      Property description:
    • getOnSectionUpdate

      public final javafx.event.EventHandler<Section.SectionEvent> getOnSectionUpdate()
      Gets the value of the property onSectionUpdate.
      Property description:
    • fireSectionEvent

      public void fireSectionEvent(Section.SectionEvent EVENT)