Class Section

  • All Implemented Interfaces:
    java.lang.Comparable<Section>

    public class Section
    extends java.lang.Object
    implements java.lang.Comparable<Section>
    Created by hansolo on 19.12.16.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Section.SectionEvent  
    • Constructor Summary

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

      • Section

        public Section​(java.lang.String JSON_STRING)
        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()
      • 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,
                       java.lang.String TEXT,
                       javafx.scene.paint.Color COLOR)
      • Section

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

        public Section​(double START,
                       double STOP,
                       java.lang.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,
                       java.lang.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,
                       java.lang.String TEXT,
                       javafx.scene.image.Image ICON,
                       javafx.scene.paint.Color COLOR,
                       javafx.scene.paint.Color HIGHLIGHT_COLOR,
                       javafx.scene.paint.Color TEXT_COLOR,
                       java.lang.String STYLE_CLASS)
    • Method Detail

      • 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()
      • 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()
      • getText

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

        public void setText​(java.lang.String TEXT)
        Defines a text for the section.
        Parameters:
        TEXT -
      • textProperty

        public javafx.beans.property.StringProperty textProperty()
      • 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()
      • 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()
      • 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()
      • 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()
      • isActive

        public boolean isActive()
      • setActive

        public void setActive​(boolean ACTIVE)
      • activeProperty

        public javafx.beans.property.ReadOnlyBooleanProperty activeProperty()
      • getStyleClass

        public java.lang.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​(java.lang.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 java.lang.Comparable<Section>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toJSON

        public org.json.simple.JSONObject toJSON()
      • toJSONString

        public java.lang.String toJSONString()
      • onSectionEnteredProperty

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

        public final void setOnSectionEntered​(javafx.event.EventHandler<Section.SectionEvent> value)
      • getOnSectionEntered

        public final javafx.event.EventHandler<Section.SectionEvent> getOnSectionEntered()
      • onSectionLeftProperty

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

        public final void setOnSectionLeft​(javafx.event.EventHandler<Section.SectionEvent> value)
      • getOnSectionLeft

        public final javafx.event.EventHandler<Section.SectionEvent> getOnSectionLeft()
      • onSectionUpdateProperty

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

        public final void setOnSectionUpdate​(javafx.event.EventHandler<Section.SectionEvent> value)
      • getOnSectionUpdate

        public final javafx.event.EventHandler<Section.SectionEvent> getOnSectionUpdate()