- java.lang.Object
-
- eu.hansolo.tilesfx.Section
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSection.SectionEvent
-
Field Summary
Fields Modifier and Type Field Description Section.SectionEventENTERED_EVENTSection.SectionEventLEFT_EVENTSection.SectionEventUPDATE_EVENT
-
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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javafx.beans.property.ReadOnlyBooleanPropertyactiveProperty()voidcheckForValue(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>colorProperty()intcompareTo(Section SECTION)booleancontains(double VALUE)Returns true if the given value is within the range between section.getStart() and section.getStop()booleanequals(Section SECTION)voidfireSectionEvent(Section.SectionEvent EVENT)javafx.scene.paint.ColorgetColor()Returns the color that will be used to colorize the section in a gauge.javafx.scene.paint.ColorgetHighlightColor()Returns 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.javafx.event.EventHandler<Section.SectionEvent>getOnSectionEntered()javafx.event.EventHandler<Section.SectionEvent>getOnSectionLeft()javafx.event.EventHandler<Section.SectionEvent>getOnSectionUpdate()doublegetStart()Returns the value where the section begins.doublegetStop()Returns the value where the section ends.java.lang.StringgetStyleClass()Returns the style class that can be used to colorize the section.java.lang.StringgetText()Returns the text that was set for the section.javafx.scene.paint.ColorgetTextColor()Returns the color that will be used to colorize the section text.javafx.beans.property.ObjectProperty<javafx.scene.paint.Color>highlightColorProperty()javafx.beans.property.ObjectProperty<javafx.scene.image.Image>iconProperty()booleanisActive()javafx.beans.property.ObjectProperty<javafx.event.EventHandler<Section.SectionEvent>>onSectionEnteredProperty()javafx.beans.property.ObjectProperty<javafx.event.EventHandler<Section.SectionEvent>>onSectionLeftProperty()javafx.beans.property.ObjectProperty<javafx.event.EventHandler<Section.SectionEvent>>onSectionUpdateProperty()voidsetActive(boolean ACTIVE)voidsetColor(javafx.scene.paint.Color COLOR)Defines the color that will be used to colorize the section in a gauge.voidsetHighlightColor(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.voidsetOnSectionEntered(javafx.event.EventHandler<Section.SectionEvent> value)voidsetOnSectionLeft(javafx.event.EventHandler<Section.SectionEvent> value)voidsetOnSectionUpdate(javafx.event.EventHandler<Section.SectionEvent> value)voidsetStart(double START)Defines the value where the section begins.voidsetStop(double STOP)Defines the value where the section ends.voidsetStyleClass(java.lang.String STYLE_CLASS)Defines the style class that can be used to colorize the section.voidsetText(java.lang.String TEXT)Defines a text for the section.voidsetTextColor(javafx.scene.paint.Color COLOR)Defines the color that will be used to colorize the section text.javafx.beans.property.DoublePropertystartProperty()javafx.beans.property.DoublePropertystopProperty()javafx.beans.property.ObjectProperty<javafx.scene.paint.Color>textColorProperty()javafx.beans.property.StringPropertytextProperty()org.json.simple.JSONObjecttoJSON()java.lang.StringtoJSONString()java.lang.StringtoString()
-
-
-
Field Detail
-
ENTERED_EVENT
public final Section.SectionEvent ENTERED_EVENT
-
LEFT_EVENT
public final Section.SectionEvent LEFT_EVENT
-
UPDATE_EVENT
public final Section.SectionEvent UPDATE_EVENT
-
-
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:
compareToin interfacejava.lang.Comparable<Section>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.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()
-
fireSectionEvent
public void fireSectionEvent(Section.SectionEvent EVENT)
-
-