Search in sources :

Example 1 with Ranking

use of eu.hansolo.tilesfx.tools.Ranking in project tilesfx by HanSolo.

the class TurnoverTileSkin method redraw.

@Override
protected void redraw() {
    super.redraw();
    titleText.setText(tile.getTitle());
    text.setText(tile.getText());
    if (tile.getCustomDecimalFormatEnabled()) {
        valueText.setText(decimalFormat.format(tile.getCurrentValue()));
    } else {
        valueText.setText(String.format(locale, formatString, tile.getCurrentValue()));
    }
    if (tile.getUnit().contains("/")) {
        String[] units = tile.getUnit().split("/");
        upperUnitText.setText(units[0]);
        unitText.setText(units[1]);
        Helper.enableNode(fractionLine, true);
    } else {
        upperUnitText.setText(" ");
        unitText.setText(tile.getUnit());
        Helper.enableNode(fractionLine, false);
    }
    rankingText.setText(Integer.toString(tile.getRank().getRanking().getAsInt()));
    resizeDynamicText();
    resizeStaticText();
    rotationEffect.setColor(tile.getForegroundColor());
    Ranking ranking = tile.getRank().getRanking();
    Color rankColor = tile.getRank().getColor();
    roundFrame.setStroke(Ranking.NONE == ranking ? tile.getForegroundColor() : rankColor);
    rectangularFrame.setStroke(Ranking.NONE == ranking ? tile.getForegroundColor() : rankColor);
    rankingCircle.setFill(rankColor);
    rankingText.setFill(tile.getBackgroundColor());
    rankingContainer.setVisible(Ranking.NONE == ranking ? false : true);
    titleText.setFill(tile.getTitleColor());
    valueText.setFill(tile.getValueColor());
    upperUnitText.setFill(tile.getUnitColor());
    fractionLine.setStroke(tile.getUnitColor());
    unitText.setFill(tile.getUnitColor());
    text.setFill(tile.getTextColor());
}
Also used : Ranking(eu.hansolo.tilesfx.tools.Ranking) Color(javafx.scene.paint.Color)

Aggregations

Ranking (eu.hansolo.tilesfx.tools.Ranking)1 Color (javafx.scene.paint.Color)1