tilesfx icon indicating copy to clipboard operation
tilesfx copied to clipboard

Section definition in FXML

Open fchrist opened this issue 3 years ago • 0 comments

I am using the 11.45 release with Java 11 and JavaFX 11.

I want to define the sections of my Gauge in FXML like this:

<Tile userData="/home/gewaechshaus/temperatur" skinType="GAUGE" lowerThreshold="0.0" referenceValue="20.0" threshold="30.0" thresholdVisible="false" maxValue="50.0" minValue="-20.0" title="Gewächshaus" unit="°C" sectionsVisible="true" sectionsAlwaysVisible="true" highlightSections="true" >
     <sections>
         <Section start="-20" stop="0.0" color="blue" />
         <Section start="0.0" stop="30.0" color="green" />
         <Section start="30.0" stop="50" color="red" />
     </sections>
 </Tile>

Unfortunately, the sections are not used.

Screenshot 2020-10-01 15:43:46

Doing the same in code works perfectly fine.

Tile test = TileBuilder.create()
        .skinType(Tile.SkinType.GAUGE)
        .title("Temp 2")
        .unit("°C")
        .minValue(-20)
        .maxValue(50)
        .value(22.0)
        .threshold(30)
        .thresholdVisible(false)
        .sections(new Section(-20, 0, Tile.BLUE),
                new Section(0, 30, Tile.GREEN),
                new Section(30, 50, Tile.RED))
        .sectionsAlwaysVisible(true)
        .sectionsVisible(true)
        .build();

Screenshot 2020-10-01 15:47:51

Would be really nice to have this in FXML, too.

fchrist avatar Oct 01 '20 13:10 fchrist