Search in sources :

Example 1 with DataPoint

use of eu.hansolo.tilesfx.weather.DataPoint in project tilesfx by HanSolo.

the class WeatherTileSkin method redraw.

@Override
protected void redraw() {
    super.redraw();
    titleText.setText(tile.getTitle());
    resizeStaticText();
    DataPoint today = darkSky.getToday();
    Unit unit = darkSky.getUnit();
    valueText.setText(String.format(Locale.US, "%.0f", today.getTemperature()));
    unitText.setText(unit.temperatureUnitString);
    weatherSymbol.setCondition(today.getCondition());
    text.setText(normalize(today.getSummary()));
    sunriseText.setText(TF.format(today.getSunriseTime()));
    sunsetText.setText(TF.format(today.getSunsetTime()));
    resizeDynamicText();
    titleText.setFill(tile.getTitleColor());
    valueText.setFill(tile.getValueColor());
    unitText.setFill(tile.getUnitColor());
    text.setFill(tile.getTextColor());
    weatherSymbol.setSymbolColor(tile.getForegroundColor());
    sunriseSymbol.setSymbolColor(tile.getForegroundColor());
    sunsetSymbol.setSymbolColor(tile.getForegroundColor());
}
Also used : DataPoint(eu.hansolo.tilesfx.weather.DataPoint) Unit(eu.hansolo.tilesfx.weather.DarkSky.Unit)

Aggregations

Unit (eu.hansolo.tilesfx.weather.DarkSky.Unit)1 DataPoint (eu.hansolo.tilesfx.weather.DataPoint)1