Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format string is overwritten on LeaderBoardTileSkin #41

Closed
point85 opened this issue Jan 12, 2018 · 1 comment
Closed

Format string is overwritten on LeaderBoardTileSkin #41

point85 opened this issue Jan 12, 2018 · 1 comment

Comments

@point85
Copy link

point85 commented Jan 12, 2018

The method registerItemListeners() sets the format string thus overwriting what the application set in setFormatString(). Commenting out this line (see below) prevents the overwrite, but it might not be the correct fix.

private void registerItemListeners() {
    tile.getLeaderBoardItems().forEach(item -> {
        //item.setFormatString(formatString);
        item.addChartDataEventListener(updateHandler);
        EventHandler<MouseEvent> clickHandler = e -> tile.fireTileEvent(new TileEvent(TileEvent.EventType.SELECTED_CHART_DATA, item.getChartData()));
        handlerMap.put(item, clickHandler);
        item.addEventHandler(MouseEvent.MOUSE_PRESSED, clickHandler);
    });
}
@HanSolo
Copy link
Owner

HanSolo commented Jan 14, 2018

The formatString is a protected variable in TileSkin which will be updated on each call to it's redraw() method. In this method it will be build from the decimals defined in Tile decimals property. Every time the leader board items will be changed (e.g. adding a new one) the formatString on the leaderBoardItem will be set to the one defined in TileSkin.

@HanSolo HanSolo closed this as completed Jan 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants