use of eu.hansolo.tilesfx.Tile.ImageMask in project tilesfx by HanSolo.
the class Demo method init.
@Override
public void init() {
long start = System.currentTimeMillis();
value = new SimpleDoubleProperty(0);
// AreaChart Data
XYChart.Series<String, Number> series1 = new XYChart.Series();
series1.setName("Whatever");
series1.getData().add(new XYChart.Data("MO", 23));
series1.getData().add(new XYChart.Data("TU", 21));
series1.getData().add(new XYChart.Data("WE", 20));
series1.getData().add(new XYChart.Data("TH", 22));
series1.getData().add(new XYChart.Data("FR", 24));
series1.getData().add(new XYChart.Data("SA", 22));
series1.getData().add(new XYChart.Data("SU", 20));
// LineChart Data
XYChart.Series<String, Number> series2 = new XYChart.Series();
series2.setName("Inside");
series2.getData().add(new XYChart.Data("MO", 8));
series2.getData().add(new XYChart.Data("TU", 5));
series2.getData().add(new XYChart.Data("WE", 0));
series2.getData().add(new XYChart.Data("TH", 2));
series2.getData().add(new XYChart.Data("FR", 4));
series2.getData().add(new XYChart.Data("SA", 3));
series2.getData().add(new XYChart.Data("SU", 5));
XYChart.Series<String, Number> series3 = new XYChart.Series();
series3.setName("Outside");
series3.getData().add(new XYChart.Data("MO", 8));
series3.getData().add(new XYChart.Data("TU", 5));
series3.getData().add(new XYChart.Data("WE", 0));
series3.getData().add(new XYChart.Data("TH", 2));
series3.getData().add(new XYChart.Data("FR", 4));
series3.getData().add(new XYChart.Data("SA", 3));
series3.getData().add(new XYChart.Data("SU", 5));
// WorldMap Data
for (int i = 0; i < Country.values().length; i++) {
double value = RND.nextInt(10);
Color color;
if (value > 8) {
color = Tile.RED;
} else if (value > 6) {
color = Tile.ORANGE;
} else if (value > 4) {
color = Tile.YELLOW_ORANGE;
} else if (value > 2) {
color = Tile.GREEN;
} else {
color = Tile.BLUE;
}
Country.values()[i].setColor(color);
}
// TimeControl Data
TimeSection timeSection = TimeSectionBuilder.create().start(LocalTime.now().plusSeconds(20)).stop(LocalTime.now().plusHours(1)).color(Tile.GRAY).highlightColor(Tile.RED).build();
timeSection.setOnTimeSectionEntered(e -> System.out.println("Section ACTIVE"));
timeSection.setOnTimeSectionLeft(e -> System.out.println("Section INACTIVE"));
// BarChart Items
barChartItem1 = new BarChartItem("Gerrit", 47, Tile.BLUE);
barChartItem2 = new BarChartItem("Sandra", 43, Tile.RED);
barChartItem3 = new BarChartItem("Lilli", 12, Tile.GREEN);
barChartItem4 = new BarChartItem("Anton", 8, Tile.ORANGE);
barChartItem1.setFormatString("%.1f kWh");
// LeaderBoard Items
leaderBoardItem1 = new LeaderBoardItem("Gerrit", 47);
leaderBoardItem2 = new LeaderBoardItem("Sandra", 43);
leaderBoardItem3 = new LeaderBoardItem("Lilli", 12);
leaderBoardItem4 = new LeaderBoardItem("Anton", 8);
// Chart Data
chartData1 = new ChartData("Item 1", 24.0, Tile.GREEN);
chartData2 = new ChartData("Item 2", 10.0, Tile.BLUE);
chartData3 = new ChartData("Item 3", 12.0, Tile.RED);
chartData4 = new ChartData("Item 4", 13.0, Tile.YELLOW_ORANGE);
chartData5 = new ChartData("Item 5", 13.0, Tile.BLUE);
chartData6 = new ChartData("Item 6", 13.0, Tile.BLUE);
chartData7 = new ChartData("Item 7", 13.0, Tile.BLUE);
chartData8 = new ChartData("Item 8", 13.0, Tile.BLUE);
smoothChartData1 = new ChartData("Item 1", RND.nextDouble() * 25, Tile.BLUE);
smoothChartData2 = new ChartData("Item 2", RND.nextDouble() * 25, Tile.BLUE);
smoothChartData3 = new ChartData("Item 3", RND.nextDouble() * 25, Tile.BLUE);
smoothChartData4 = new ChartData("Item 4", RND.nextDouble() * 25, Tile.BLUE);
// Creating Tiles
percentageTile = TileBuilder.create().skinType(SkinType.PERCENTAGE).prefSize(TILE_WIDTH, TILE_HEIGHT).title("Percentage Tile").unit(Helper.PERCENTAGE).description("Test").maxValue(60).build();
clockTile = TileBuilder.create().skinType(SkinType.CLOCK).prefSize(TILE_WIDTH, TILE_HEIGHT).title("Clock Tile").text("Whatever text").dateVisible(true).locale(Locale.US).running(true).build();
gaugeTile = TileBuilder.create().skinType(SkinType.GAUGE).prefSize(TILE_WIDTH, TILE_HEIGHT).title("Gauge Tile").unit("V").threshold(75).build();
sparkLineTile = TileBuilder.create().skinType(SkinType.SPARK_LINE).prefSize(TILE_WIDTH, TILE_HEIGHT).title("SparkLine Tile").unit("mb").gradientStops(new Stop(0, Tile.GREEN), new Stop(0.5, Tile.YELLOW), new Stop(1.0, Tile.RED)).strokeWithGradient(true).build();
// sparkLineTile.valueProperty().bind(value);
areaChartTile = TileBuilder.create().skinType(SkinType.SMOOTHED_CHART).prefSize(TILE_WIDTH, TILE_HEIGHT).title("SmoothedChart Tile").chartType(ChartType.AREA).smoothing(true).tooltipTimeout(1000).tilesFxSeries(new TilesFXSeries<>(series1, Tile.BLUE, new LinearGradient(0, 0, 0, 1, true, CycleMethod.NO_CYCLE, new Stop(0, Tile.BLUE), new Stop(1, Color.TRANSPARENT)))).build();
lineChartTile = TileBuilder.create().skinType(SkinType.SMOOTHED_CHART).prefSize(TILE_WIDTH, TILE_HEIGHT).title("SmoothedChart Tile").smoothing(false).series(series2, series3).build();
highLowTile = TileBuilder.create().skinType(SkinType.HIGH_LOW).prefSize(TILE_WIDTH, TILE_HEIGHT).title("HighLow Tile").unit("\u20AC").description("Test").text("Whatever text").referenceValue(6.7).value(8.2).build();
timerControlTile = TileBuilder.create().skinType(SkinType.TIMER_CONTROL).prefSize(TILE_WIDTH, TILE_HEIGHT).title("TimerControl Tile").text("Whatever text").secondsVisible(true).dateVisible(true).timeSections(timeSection).running(true).build();
numberTile = TileBuilder.create().skinType(SkinType.NUMBER).prefSize(TILE_WIDTH, TILE_HEIGHT).title("Number Tile").text("Whatever text").value(13).unit("mb").description("Test").textVisible(true).build();
textTile = TileBuilder.create().skinType(SkinType.TEXT).prefSize(TILE_WIDTH, TILE_HEIGHT).title("Text Tile").text("Whatever text").description("May the force be with you\n...always").descriptionAlignment(Pos.TOP_LEFT).textVisible(true).build();
plusMinusTile = TileBuilder.create().skinType(SkinType.PLUS_MINUS).prefSize(TILE_WIDTH, TILE_HEIGHT).maxValue(30).minValue(0).title("PlusMinus Tile").text("Whatever text").description("Test").unit("\u00B0C").build();
sliderTile = TileBuilder.create().skinType(SkinType.SLIDER).prefSize(TILE_WIDTH, TILE_HEIGHT).title("Slider Tile").text("Whatever text").description("Test").unit("\u00B0C").barBackgroundColor(Tile.FOREGROUND).build();
switchTile = TileBuilder.create().skinType(SkinType.SWITCH).prefSize(TILE_WIDTH, TILE_HEIGHT).title("Switch Tile").text("Whatever text").build();
switchTile.setOnSwitchPressed(e -> System.out.println("Switch pressed"));
switchTile.setOnSwitchReleased(e -> System.out.println("Switch released"));
worldTile = TileBuilder.create().prefSize(300, TILE_HEIGHT).skinType(SkinType.WORLDMAP).title("WorldMap Tile").text("Whatever text").textVisible(false).build();
timeTile = TileBuilder.create().skinType(SkinType.TIME).prefSize(TILE_WIDTH, TILE_HEIGHT).title("Time Tile").text("Whatever text").duration(LocalTime.of(1, 22)).description("Average reply time").textVisible(true).build();
barChartTile = TileBuilder.create().skinType(SkinType.BAR_CHART).prefSize(TILE_WIDTH, TILE_HEIGHT).title("BarChart Tile").text("Whatever text").barChartItems(barChartItem1, barChartItem2, barChartItem3, barChartItem4).decimals(0).build();
customTile = TileBuilder.create().skinType(SkinType.CUSTOM).prefSize(TILE_WIDTH, TILE_HEIGHT).title("Custom Tile").text("Whatever text").graphic(new Button("Click Me")).roundedCorners(false).build();
leaderBoardTile = TileBuilder.create().skinType(SkinType.LEADER_BOARD).prefSize(TILE_WIDTH, TILE_HEIGHT).title("LeaderBoard Tile").text("Whatever text").leaderBoardItems(leaderBoardItem1, leaderBoardItem2, leaderBoardItem3, leaderBoardItem4).build();
mapTile = TileBuilder.create().skinType(SkinType.MAP).prefSize(TILE_WIDTH, TILE_HEIGHT).title("Map Tile").text("Some text").description("Description").currentLocation(new Location(51.91178, 7.63379, "Home", TileColor.MAGENTA.color)).pointsOfInterest(new Location(51.914405, 7.635732, "POI 1", TileColor.RED.color), new Location(51.912529, 7.631752, "POI 2", TileColor.BLUE.color), new Location(51.923993, 7.628906, "POI 3", TileColor.YELLOW_ORANGE.color)).mapProvider(MapProvider.TOPO).build();
radialChartTile = TileBuilder.create().skinType(SkinType.RADIAL_CHART).prefSize(TILE_WIDTH, TILE_HEIGHT).title("RadialChart Tile").text("Some text").textVisible(false).chartData(chartData1, chartData2, chartData3, chartData4).build();
donutChartTile = TileBuilder.create().skinType(SkinType.DONUT_CHART).prefSize(TILE_WIDTH, TILE_HEIGHT).title("DonutChart Tile").text("Some text").textVisible(false).chartData(chartData1, chartData2, chartData3, chartData4).build();
circularProgressTile = TileBuilder.create().skinType(SkinType.CIRCULAR_PROGRESS).prefSize(TILE_WIDTH, TILE_HEIGHT).title("CircularProgress Tile").text("Some text").unit(Helper.PERCENTAGE).build();
stockTile = TileBuilder.create().skinType(SkinType.STOCK).prefSize(TILE_WIDTH, TILE_HEIGHT).title("Stock Tile").minValue(0).maxValue(1000).averagingPeriod(100).build();
gaugeSparkLineTile = TileBuilder.create().skinType(SkinType.GAUGE_SPARK_LINE).prefSize(TILE_WIDTH, TILE_HEIGHT).title("GaugeSparkLine Tile").animated(true).textVisible(false).averagingPeriod(25).autoReferenceValue(true).barColor(Tile.YELLOW_ORANGE).barBackgroundColor(Color.rgb(255, 255, 255, 0.1)).sections(new eu.hansolo.tilesfx.Section(0, 33, Tile.LIGHT_GREEN), new eu.hansolo.tilesfx.Section(33, 67, Tile.YELLOW), new eu.hansolo.tilesfx.Section(67, 100, Tile.LIGHT_RED)).sectionsVisible(true).highlightSections(true).strokeWithGradient(true).fixedYScale(true).gradientStops(new Stop(0.0, Tile.LIGHT_GREEN), new Stop(0.33, Tile.LIGHT_GREEN), new Stop(0.33, Tile.YELLOW), new Stop(0.67, Tile.YELLOW), new Stop(0.67, Tile.LIGHT_RED), new Stop(1.0, Tile.LIGHT_RED)).build();
radarChartTile1 = TileBuilder.create().skinType(SkinType.RADAR_CHART).prefSize(TILE_WIDTH, TILE_HEIGHT).minValue(0).maxValue(50).title("RadarChartTileSkin Sector").unit("Unit").radarChartMode(RadarChartMode.SECTOR).gradientStops(new Stop(0.00000, Color.TRANSPARENT), new Stop(0.00001, Color.web("#3552a0")), new Stop(0.09090, Color.web("#456acf")), new Stop(0.27272, Color.web("#45a1cf")), new Stop(0.36363, Color.web("#30c8c9")), new Stop(0.45454, Color.web("#30c9af")), new Stop(0.50909, Color.web("#56d483")), new Stop(0.72727, Color.web("#9adb49")), new Stop(0.81818, Color.web("#efd750")), new Stop(0.90909, Color.web("#ef9850")), new Stop(1.00000, Color.web("#ef6050"))).text("Test").chartData(chartData1, chartData2, chartData3, chartData4, chartData5, chartData6, chartData7, chartData8).tooltipText("").animated(true).build();
radarChartTile2 = TileBuilder.create().skinType(SkinType.RADAR_CHART).prefSize(TILE_WIDTH, TILE_HEIGHT).minValue(0).maxValue(50).title("RadarChartTileSkin Polygon").unit("Unit").radarChartMode(RadarChartMode.POLYGON).gradientStops(new Stop(0.00000, Color.TRANSPARENT), new Stop(0.00001, Color.web("#3552a0")), new Stop(0.09090, Color.web("#456acf")), new Stop(0.27272, Color.web("#45a1cf")), new Stop(0.36363, Color.web("#30c8c9")), new Stop(0.45454, Color.web("#30c9af")), new Stop(0.50909, Color.web("#56d483")), new Stop(0.72727, Color.web("#9adb49")), new Stop(0.81818, Color.web("#efd750")), new Stop(0.90909, Color.web("#ef9850")), new Stop(1.00000, Color.web("#ef6050"))).text("Test").chartData(chartData1, chartData2, chartData3, chartData4, chartData5, chartData6, chartData7, chartData8).tooltipText("").animated(true).build();
smoothAreaChartTile = TileBuilder.create().skinType(SkinType.SMOOTH_AREA_CHART).prefSize(TILE_WIDTH, TILE_HEIGHT).minValue(0).maxValue(40).title("SmoothAreaChart Tile").unit("Unit").text("Test").chartData(smoothChartData1, smoothChartData2, smoothChartData3, smoothChartData4).tooltipText("").animated(true).build();
firstRank = new Rank(Ranking.FIRST, Tile.YELLOW_ORANGE);
countryTile = TileBuilder.create().skinType(SkinType.COUNTRY).prefSize(TILE_WIDTH, TILE_HEIGHT).minValue(0).maxValue(40).title("Country Tile").unit("Unit").country(Country.DE).tooltipText("").animated(true).build();
characterTile = TileBuilder.create().skinType(SkinType.CHARACTER).prefSize(TILE_WIDTH, TILE_HEIGHT).title("Character Tile").titleAlignment(TextAlignment.CENTER).description("G").build();
flipTile = TileBuilder.create().skinType(SkinType.FLIP).prefSize(TILE_WIDTH, TILE_HEIGHT).characters(Helper.TIME_0_TO_5).flipTimeInMS(500).flipText(" ").build();
switchSliderTile = TileBuilder.create().skinType(SkinType.SWITCH_SLIDER).prefSize(TILE_WIDTH, TILE_HEIGHT).title("SwitchSlider Tile").text("Test").build();
dateTile = TileBuilder.create().skinType(SkinType.DATE).prefSize(TILE_WIDTH, TILE_HEIGHT).build();
ZonedDateTime now = ZonedDateTime.now();
List<ChartData> calendarData = new ArrayList<>(10);
calendarData.add(new ChartData("Item 1", now.minusDays(1).toInstant()));
calendarData.add(new ChartData("Item 2", now.plusDays(2).toInstant()));
calendarData.add(new ChartData("Item 3", now.plusDays(10).toInstant()));
calendarData.add(new ChartData("Item 4", now.plusDays(15).toInstant()));
calendarData.add(new ChartData("Item 5", now.plusDays(15).toInstant()));
calendarData.add(new ChartData("Item 6", now.plusDays(20).toInstant()));
calendarData.add(new ChartData("Item 7", now.plusDays(7).toInstant()));
calendarData.add(new ChartData("Item 8", now.minusDays(1).toInstant()));
calendarData.add(new ChartData("Item 9", now.toInstant()));
calendarData.add(new ChartData("Item 10", now.toInstant()));
calendarTile = TileBuilder.create().skinType(SkinType.CALENDAR).prefSize(TILE_WIDTH, TILE_HEIGHT).chartData(calendarData).build();
TreeNode tree = new TreeNode(new ChartData("ROOT"));
TreeNode first = new TreeNode(new ChartData("1st", 8.3, Tile.BLUE), tree);
TreeNode second = new TreeNode(new ChartData("2nd", 2.2, Tile.ORANGE), tree);
TreeNode third = new TreeNode(new ChartData("3rd", 1.4, Tile.PINK), tree);
TreeNode fourth = new TreeNode(new ChartData("4th", 1.2, Tile.LIGHT_GREEN), tree);
TreeNode jan = new TreeNode(new ChartData("Jan", 3.5), first);
TreeNode feb = new TreeNode(new ChartData("Feb", 3.1), first);
TreeNode mar = new TreeNode(new ChartData("Mar", 1.7), first);
TreeNode apr = new TreeNode(new ChartData("Apr", 1.1), second);
TreeNode may = new TreeNode(new ChartData("May", 0.8), second);
TreeNode jun = new TreeNode(new ChartData("Jun", 0.3), second);
TreeNode jul = new TreeNode(new ChartData("Jul", 0.7), third);
TreeNode aug = new TreeNode(new ChartData("Aug", 0.6), third);
TreeNode sep = new TreeNode(new ChartData("Sep", 0.1), third);
TreeNode oct = new TreeNode(new ChartData("Oct", 0.5), fourth);
TreeNode nov = new TreeNode(new ChartData("Nov", 0.4), fourth);
TreeNode dec = new TreeNode(new ChartData("Dec", 0.3), fourth);
sunburstTile = TileBuilder.create().skinType(SkinType.SUNBURST).prefSize(TILE_WIDTH, TILE_HEIGHT).title("Sunburst Tile").textVisible(false).sunburstTree(tree).sunburstBackgroundColor(Tile.BACKGROUND).sunburstTextColor(Tile.BACKGROUND).sunburstUseColorFromParent(true).sunburstTextOrientation(TextOrientation.TANGENT).sunburstAutoTextColor(true).sunburstUseChartDataTextColor(true).sunburstInteractive(true).build();
matrixTile = TileBuilder.create().skinType(SkinType.MATRIX).prefSize(TILE_WIDTH, TILE_HEIGHT).title("Matrix Tile").text("Any Text").textVisible(false).animated(true).matrixSize(8, 50).chartData(chartData1, chartData2, chartData3, chartData4, chartData5, chartData6, chartData7, chartData8).build();
radialPercentageTile = TileBuilder.create().skinType(SkinType.RADIAL_PERCENTAGE).prefSize(TILE_WIDTH, TILE_HEIGHT).maxValue(1000).title("RadialPercentage Tile").description("Product 1").textVisible(false).chartData(chartData1, chartData2, chartData3).animated(true).referenceValue(100).value(chartData1.getValue()).descriptionColor(Tile.GRAY).barColor(Tile.BLUE).decimals(0).build();
Indicator leftGraphics = new Indicator(Tile.RED);
leftGraphics.setOn(true);
Indicator middleGraphics = new Indicator(Tile.YELLOW);
middleGraphics.setOn(true);
Indicator rightGraphics = new Indicator(Tile.GREEN);
rightGraphics.setOn(true);
statusTile = TileBuilder.create().skinType(SkinType.STATUS).prefSize(TILE_WIDTH, TILE_HEIGHT).title("Status Tile").description("Notifications").leftText("CRITICAL").middleText("WARNING").rightText("INFORMATION").leftGraphics(leftGraphics).middleGraphics(middleGraphics).rightGraphics(rightGraphics).text("Text").build();
barGaugeTile = TileBuilder.create().skinType(SkinType.BAR_GAUGE).prefSize(TILE_WIDTH, TILE_HEIGHT).minValue(0).maxValue(100).startFromZero(true).threshold(80).thresholdVisible(true).title("BarGauge Tile").unit("F").text("Whatever text").gradientStops(new Stop(0, Bright.BLUE), new Stop(0.1, Bright.BLUE_GREEN), new Stop(0.2, Bright.GREEN), new Stop(0.3, Bright.GREEN_YELLOW), new Stop(0.4, Bright.YELLOW), new Stop(0.5, Bright.YELLOW_ORANGE), new Stop(0.6, Bright.ORANGE), new Stop(0.7, Bright.ORANGE_RED), new Stop(0.8, Bright.RED), new Stop(1.0, Dark.RED)).strokeWithGradient(true).animated(true).build();
imageTile = TileBuilder.create().skinType(SkinType.IMAGE).prefSize(TILE_WIDTH, TILE_HEIGHT).title("Image Tile").image(new Image(Demo.class.getResourceAsStream("HanSolo.png"))).imageMask(ImageMask.ROUND).text("Whatever text").textAlignment(TextAlignment.CENTER).build();
timelineTile = TileBuilder.create().skinType(SkinType.TIMELINE).prefSize(TILE_WIDTH, TILE_HEIGHT).title("Timeline Tile").unit("mg/dl").minValue(0).maxValue(350).smoothing(true).lowerThreshold(70).lowerThresholdColor(TileColor.RED.color).threshold(240).thresholdColor(TileColor.RED.color).thresholdVisible(true).tickLabelColor(Helper.getColorWithOpacity(Tile.FOREGROUND, 0.5)).sections(new Section(0, 70, "Low", Helper.getColorWithOpacity(Dark.RED, 0.1)), new Section(70, 140, "Ok", Helper.getColorWithOpacity(Bright.GREEN, 0.15)), new Section(140, 350, "High", Helper.getColorWithOpacity(Dark.RED, 0.1))).highlightSections(true).sectionsVisible(true).textAlignment(TextAlignment.CENTER).timePeriod(java.time.Duration.ofMinutes(1)).maxTimePeriod(java.time.Duration.ofMinutes(1)).timePeriodResolution(TimeUnit.SECONDS).numberOfValuesForTrendCalculation(5).trendVisible(true).maxTimePeriod(java.time.Duration.ofSeconds(60)).gradientStops(new Stop(0, Dark.RED), new Stop(0.15, Dark.RED), new Stop(0.2, Bright.YELLOW_ORANGE), new Stop(0.25, Bright.GREEN), new Stop(0.3, Bright.GREEN), new Stop(0.35, Bright.GREEN), new Stop(0.45, Bright.YELLOW_ORANGE), new Stop(0.5, Bright.ORANGE), new Stop(0.685, Dark.RED), new Stop(1.0, Dark.RED)).strokeWithGradient(true).averageVisible(true).averagingPeriod(60).timeoutMs(60000).build();
imageCounterTile = TileBuilder.create().skinType(SkinType.IMAGE_COUNTER).prefSize(TILE_WIDTH, TILE_HEIGHT).title("ImageCounter Tile").text("Whatever text").description("Whatever\nnumbers").image(new Image(Demo.class.getResourceAsStream("HanSolo.png"))).imageMask(ImageMask.ROUND).build();
ledTile = TileBuilder.create().skinType(SkinType.LED).prefSize(TILE_WIDTH, TILE_HEIGHT).title("Led Tile").description("Description").text("Whatever text").build();
countdownTile = TileBuilder.create().skinType(SkinType.COUNTDOWN_TIMER).prefSize(TILE_WIDTH, TILE_HEIGHT).title("CountdownTimer Tile").description("Description").text("Text").barColor(Bright.ORANGE_RED).timePeriod(Duration.ofSeconds(30)).onAlarm(e -> System.out.println("Alarm")).build();
MatrixIcon matrixIcon1 = new MatrixIcon();
matrixIcon1.fillPixels(2, 5, 1, Color.BLACK);
matrixIcon1.setPixelAt(1, 2, Color.BLACK);
matrixIcon1.fillPixels(2, 5, 2, Color.WHITE);
matrixIcon1.setPixelAt(6, 2, Color.BLACK);
matrixIcon1.setPixelAt(0, 3, Color.BLACK);
matrixIcon1.fillPixels(1, 2, 3, Color.WHITE);
matrixIcon1.fillPixels(3, 4, 3, Color.web("#4d79ff"));
matrixIcon1.fillPixels(5, 6, 3, Color.WHITE);
matrixIcon1.setPixelAt(7, 3, Color.BLACK);
matrixIcon1.setPixelAt(0, 4, Color.BLACK);
matrixIcon1.fillPixels(1, 2, 4, Color.WHITE);
matrixIcon1.fillPixels(3, 4, 4, Color.web("#4d79ff"));
matrixIcon1.fillPixels(5, 6, 4, Color.WHITE);
matrixIcon1.setPixelAt(7, 4, Color.BLACK);
matrixIcon1.setPixelAt(1, 5, Color.BLACK);
matrixIcon1.fillPixels(2, 5, 5, Color.WHITE);
matrixIcon1.setPixelAt(6, 5, Color.BLACK);
matrixIcon1.fillPixels(2, 5, 6, Color.BLACK);
MatrixIcon matrixIcon2 = new MatrixIcon();
matrixIcon2.fillPixels(1, 6, 2, Color.BLACK);
matrixIcon2.setPixelAt(0, 3, Color.BLACK);
matrixIcon2.fillPixels(1, 2, 3, Color.WHITE);
matrixIcon2.fillPixels(3, 4, 3, Color.web("#4d79ff"));
matrixIcon2.fillPixels(5, 6, 3, Color.WHITE);
matrixIcon2.setPixelAt(7, 3, Color.BLACK);
matrixIcon2.setPixelAt(0, 4, Color.BLACK);
matrixIcon2.fillPixels(1, 2, 4, Color.WHITE);
matrixIcon2.fillPixels(3, 4, 4, Color.web("#4d79ff"));
matrixIcon2.fillPixels(5, 6, 4, Color.WHITE);
matrixIcon2.setPixelAt(7, 4, Color.BLACK);
matrixIcon2.setPixelAt(1, 5, Color.BLACK);
matrixIcon2.fillPixels(2, 5, 5, Color.WHITE);
matrixIcon2.setPixelAt(6, 5, Color.BLACK);
matrixIcon2.fillPixels(2, 5, 6, Color.BLACK);
MatrixIcon matrixIcon3 = new MatrixIcon();
matrixIcon3.fillPixels(0, 7, 3, Color.BLACK);
matrixIcon3.setPixelAt(0, 4, Color.BLACK);
matrixIcon3.fillPixels(1, 2, 4, Color.WHITE);
matrixIcon3.fillPixels(3, 4, 4, Color.web("#4d79ff"));
matrixIcon3.fillPixels(5, 6, 4, Color.WHITE);
matrixIcon3.setPixelAt(7, 4, Color.BLACK);
matrixIcon3.setPixelAt(1, 5, Color.BLACK);
matrixIcon3.fillPixels(2, 5, 5, Color.WHITE);
matrixIcon3.setPixelAt(6, 5, Color.BLACK);
matrixIcon3.fillPixels(2, 5, 6, Color.BLACK);
MatrixIcon matrixIcon4 = new MatrixIcon();
matrixIcon4.setPixelAt(0, 3, Color.BLACK);
matrixIcon4.setPixelAt(7, 3, Color.BLACK);
matrixIcon4.fillPixels(0, 7, 4, Color.BLACK);
matrixIcon4.setPixelAt(1, 5, Color.BLACK);
matrixIcon4.fillPixels(2, 5, 5, Color.WHITE);
matrixIcon4.setPixelAt(6, 5, Color.BLACK);
matrixIcon4.fillPixels(2, 5, 6, Color.BLACK);
MatrixIcon matrixIcon5 = new MatrixIcon();
matrixIcon5.setPixelAt(0, 3, Color.BLACK);
matrixIcon5.setPixelAt(7, 3, Color.BLACK);
matrixIcon5.setPixelAt(0, 4, Color.BLACK);
matrixIcon5.setPixelAt(7, 4, Color.BLACK);
matrixIcon5.setPixelAt(1, 5, Color.BLACK);
matrixIcon5.fillPixels(2, 5, 5, Color.BLACK);
matrixIcon5.setPixelAt(6, 5, Color.BLACK);
matrixIcon5.fillPixels(2, 5, 6, Color.BLACK);
MatrixIcon matrixIcon6 = new MatrixIcon();
matrixIcon6.setPixelAt(0, 3, Color.BLACK);
matrixIcon6.setPixelAt(7, 3, Color.BLACK);
matrixIcon6.fillPixels(0, 7, 4, Color.BLACK);
matrixIcon6.setPixelAt(1, 5, Color.BLACK);
matrixIcon6.fillPixels(2, 5, 5, Color.WHITE);
matrixIcon6.setPixelAt(6, 5, Color.BLACK);
matrixIcon6.fillPixels(2, 5, 6, Color.BLACK);
MatrixIcon matrixIcon7 = new MatrixIcon();
matrixIcon7.fillPixels(0, 7, 3, Color.BLACK);
matrixIcon7.setPixelAt(0, 4, Color.BLACK);
matrixIcon7.fillPixels(1, 2, 4, Color.WHITE);
matrixIcon7.fillPixels(3, 4, 4, Color.web("#4d79ff"));
matrixIcon7.fillPixels(5, 6, 4, Color.WHITE);
matrixIcon7.setPixelAt(7, 4, Color.BLACK);
matrixIcon7.setPixelAt(1, 5, Color.BLACK);
matrixIcon7.fillPixels(2, 5, 5, Color.WHITE);
matrixIcon7.setPixelAt(6, 5, Color.BLACK);
matrixIcon7.fillPixels(2, 5, 6, Color.BLACK);
MatrixIcon matrixIcon8 = new MatrixIcon();
matrixIcon8.fillPixels(1, 6, 2, Color.BLACK);
matrixIcon8.setPixelAt(0, 3, Color.BLACK);
matrixIcon8.fillPixels(1, 2, 3, Color.WHITE);
matrixIcon8.fillPixels(3, 4, 3, Color.web("#4d79ff"));
matrixIcon8.fillPixels(5, 6, 3, Color.WHITE);
matrixIcon8.setPixelAt(7, 3, Color.BLACK);
matrixIcon8.setPixelAt(0, 4, Color.BLACK);
matrixIcon8.fillPixels(1, 2, 4, Color.WHITE);
matrixIcon8.fillPixels(3, 4, 4, Color.web("#4d79ff"));
matrixIcon8.fillPixels(5, 6, 4, Color.WHITE);
matrixIcon8.setPixelAt(7, 4, Color.BLACK);
matrixIcon8.setPixelAt(1, 5, Color.BLACK);
matrixIcon8.fillPixels(2, 5, 5, Color.WHITE);
matrixIcon8.setPixelAt(6, 5, Color.BLACK);
matrixIcon8.fillPixels(2, 5, 6, Color.BLACK);
MatrixIcon matrixIcon9 = new MatrixIcon();
matrixIcon9.fillPixels(2, 5, 1, Color.BLACK);
matrixIcon9.setPixelAt(1, 2, Color.BLACK);
matrixIcon9.fillPixels(2, 5, 2, Color.WHITE);
matrixIcon9.setPixelAt(6, 2, Color.BLACK);
matrixIcon9.setPixelAt(0, 3, Color.BLACK);
matrixIcon9.fillPixels(1, 2, 3, Color.WHITE);
matrixIcon9.fillPixels(3, 4, 3, Color.web("#4d79ff"));
matrixIcon9.fillPixels(5, 6, 3, Color.WHITE);
matrixIcon9.setPixelAt(7, 3, Color.BLACK);
matrixIcon9.setPixelAt(0, 4, Color.BLACK);
matrixIcon9.fillPixels(1, 2, 4, Color.WHITE);
matrixIcon9.fillPixels(3, 4, 4, Color.web("#4d79ff"));
matrixIcon9.fillPixels(5, 6, 4, Color.WHITE);
matrixIcon9.setPixelAt(7, 4, Color.BLACK);
matrixIcon9.setPixelAt(1, 5, Color.BLACK);
matrixIcon9.fillPixels(2, 5, 5, Color.WHITE);
matrixIcon9.setPixelAt(6, 5, Color.BLACK);
matrixIcon9.fillPixels(2, 5, 6, Color.BLACK);
matrixIconTile = TileBuilder.create().skinType(SkinType.MATRIX_ICON).prefSize(TILE_WIDTH, TILE_HEIGHT).title("MatrixIcon Tile").matrixIcons(matrixIcon1, matrixIcon2, matrixIcon3, matrixIcon4, matrixIcon5, matrixIcon6, matrixIcon7, matrixIcon8, matrixIcon9).animationDuration(50).animated(true).build();
cycleStepTile = TileBuilder.create().skinType(SkinType.CYCLE_STEP).prefSize(TILE_WIDTH, TILE_HEIGHT).title("CycleStep Tile").textVisible(false).chartData(chartData1, chartData2, chartData3, chartData4, chartData5).animated(true).decimals(1).build();
Label name = new Label("Name");
name.setTextFill(Tile.FOREGROUND);
name.setAlignment(Pos.CENTER_LEFT);
HBox.setHgrow(name, Priority.NEVER);
Region spacer = new Region();
spacer.setPrefSize(5, 5);
HBox.setHgrow(spacer, Priority.ALWAYS);
Label views = new Label("Cases / Deaths");
views.setTextFill(Tile.FOREGROUND);
views.setAlignment(Pos.CENTER_RIGHT);
HBox.setHgrow(views, Priority.NEVER);
HBox header = new HBox(5, name, spacer, views);
header.setAlignment(Pos.CENTER_LEFT);
header.setFillHeight(true);
HBox usa = getCountryItem(Flag.UNITED_STATES_OF_AMERICA, "USA", "1.618.757 / 96.909");
HBox brazil = getCountryItem(Flag.BRAZIL, "Brazil", "363.211 / 22.666");
HBox uk = getCountryItem(Flag.UNITED_KINGDOM, "UK", "259.563 / 36.793");
HBox spain = getCountryItem(Flag.SPAIN, "Spain", "235.772 / 28.752");
HBox italy = getCountryItem(Flag.ITALY, "Italy", "229.585 / 32.785");
HBox germany = getCountryItem(Flag.GERMANY, "Germany", "178.570 / 8.257");
HBox france = getCountryItem(Flag.FRANCE, "France", "142.204 / 28.315");
VBox dataTable = new VBox(0, header, usa, brazil, uk, spain, italy, germany, france);
dataTable.setFillWidth(true);
customFlagChartTile = TileBuilder.create().skinType(SkinType.CUSTOM).title("Custom Tile Covid-19").text("Data from 26.05.2020").graphic(dataTable).build();
colorTile = TileBuilder.create().skinType(SkinType.COLOR).prefSize(TILE_WIDTH, TILE_HEIGHT).title("Color Tile").description("Whatever").animated(false).build();
turnoverTile = TileBuilder.create().skinType(SkinType.TURNOVER).prefSize(TILE_WIDTH, TILE_HEIGHT).title("Turnover Tile").text("Gerrit Grunwald").decimals(0).unit("$").image(new Image(Demo.class.getResourceAsStream("HanSolo.png"))).animated(true).checkThreshold(true).onTileEvent(e -> {
if (EventType.THRESHOLD_EXCEEDED == e.getEventType()) {
turnoverTile.setRank(firstRank);
turnoverTile.setValueColor(firstRank.getColor());
turnoverTile.setUnitColor(firstRank.getColor());
} else if (EventType.THRESHOLD_UNDERRUN == e.getEventType()) {
turnoverTile.setRank(Rank.DEFAULT);
turnoverTile.setValueColor(Tile.FOREGROUND);
turnoverTile.setUnitColor(Tile.FOREGROUND);
}
}).threshold(// triggers the rotation effect
70).build();
fluidTile = TileBuilder.create().skinType(SkinType.FLUID).prefSize(TILE_WIDTH, TILE_HEIGHT).title("Fluid Tile").text("Waterlevel").unit("\u0025").decimals(0).barColor(// defines the fluid color, alternatively use sections or gradientstops
Tile.BLUE).animated(true).build();
fireSmokeTile = TileBuilder.create().skinType(SkinType.FIRE_SMOKE).prefSize(TILE_WIDTH, TILE_HEIGHT).title("FireSmoke Tile").text("CPU temp").unit("\u00b0C").threshold(// triggers the fire and smoke effect
40).decimals(0).animated(true).build();
gauge2Tile = TileBuilder.create().skinType(SkinType.GAUGE2).prefSize(TILE_WIDTH, TILE_HEIGHT).title("Gauge2 Tile").text("Whatever").unit("Unit").textVisible(true).value(0).gradientStops(new Stop(0, Tile.BLUE), new Stop(0.25, Tile.GREEN), new Stop(0.5, Tile.YELLOW), new Stop(0.75, Tile.ORANGE), new Stop(1, Tile.RED)).strokeWithGradient(true).animated(true).build();
HappinessIndicator happy = new HappinessIndicator(Happiness.HAPPY, 0.67);
HappinessIndicator neutral = new HappinessIndicator(Happiness.NEUTRAL, 0.25);
HappinessIndicator unhappy = new HappinessIndicator(Happiness.UNHAPPY, 0.08);
HBox happiness = new HBox(unhappy, neutral, happy);
happiness.setFillHeight(true);
HBox.setHgrow(happy, Priority.ALWAYS);
HBox.setHgrow(neutral, Priority.ALWAYS);
HBox.setHgrow(unhappy, Priority.ALWAYS);
happinessTile = TileBuilder.create().skinType(SkinType.CUSTOM).prefSize(TILE_WIDTH, TILE_HEIGHT).title("Custom Tile Happiness").text("Whatever").textVisible(true).graphic(happiness).value(0).animated(true).build();
List<ChartData> glucoseData = new ArrayList<>();
for (int i = 0; i < 288; i++) {
glucoseData.add(new ChartData("", RND.nextDouble() * 300 + 50));
}
radialDistributionTile = TileBuilder.create().skinType(SkinType.RADIAL_DISTRIBUTION).title("RadialDistribution Tile").text("Whatever").description("Description").minValue(0).maxValue(400).lowerThreshold(70).threshold(140).tickLabelDecimals(0).decimals(0).chartData(glucoseData).barColor(Color.rgb(254, 1, 154)).gradientStops(new Stop(0, Helper.getColorWithOpacity(Color.RED, 0.1)), new Stop(0.1375, Helper.getColorWithOpacity(Color.RED, 0.1)), new Stop(0.15625, Helper.getColorWithOpacity(Color.web("#FA711F"), 0.1)), new Stop(0.175, Helper.getColorWithOpacity(ColorSkin.GREEN, 0.1)), new Stop(0.2625, Helper.getColorWithOpacity(ColorSkin.GREEN, 0.1)), new Stop(0.35, Helper.getColorWithOpacity(ColorSkin.GREEN, 0.1)), new Stop(0.3501, Helper.getColorWithOpacity(ColorSkin.YELLOW, 0.1)), new Stop(0.45, Helper.getColorWithOpacity(Color.web("#FA711F"), 0.1)), new Stop(0.6625, Helper.getColorWithOpacity(Color.web("#FA711F"), 0.1)), new Stop(0.875, Helper.getColorWithOpacity(Color.RED, 0.1)), new Stop(1.0, Helper.getColorWithOpacity(Color.RED, 0.1))).strokeWithGradient(true).build();
lastTimerCall = System.nanoTime();
timer = new AnimationTimer() {
@Override
public void handle(long now) {
if (now > lastTimerCall + 3_500_000_000L) {
percentageTile.setValue(RND.nextDouble() * percentageTile.getRange() * 1.5 + percentageTile.getMinValue());
gaugeTile.setValue(RND.nextDouble() * gaugeTile.getRange() * 1.5 + gaugeTile.getMinValue());
gauge2Tile.setValue(RND.nextDouble() * gaugeTile.getRange() + gaugeTile.getMinValue());
sparkLineTile.setValue(RND.nextDouble() * sparkLineTile.getRange() * 1.5 + sparkLineTile.getMinValue());
// value.set(RND.nextDouble() * sparkLineTile.getRange() * 1.5 + sparkLineTile.getMinValue());
// sparkLineTile.setValue(20);
highLowTile.setValue(RND.nextDouble() * 10);
series1.getData().forEach(data -> data.setYValue(RND.nextInt(100)));
series2.getData().forEach(data -> data.setYValue(RND.nextInt(30)));
series3.getData().forEach(data -> data.setYValue(RND.nextInt(10)));
chartData1.setValue(RND.nextDouble() * 50);
chartData2.setValue(RND.nextDouble() * 50);
chartData3.setValue(RND.nextDouble() * 50);
chartData4.setValue(RND.nextDouble() * 50);
chartData5.setValue(RND.nextDouble() * 50);
chartData6.setValue(RND.nextDouble() * 50);
chartData7.setValue(RND.nextDouble() * 50);
chartData8.setValue(RND.nextDouble() * 50);
barChartTile.getBarChartItems().get(RND.nextInt(3)).setValue(RND.nextDouble() * 80);
leaderBoardTile.getLeaderBoardItems().get(RND.nextInt(3)).setValue(RND.nextDouble() * 80);
circularProgressTile.setValue(RND.nextDouble() * 120);
stockTile.setValue(RND.nextDouble() * 50 + 500);
gaugeSparkLineTile.setValue(RND.nextDouble() * 100);
countryTile.setValue(RND.nextDouble() * 100);
smoothChartData1.setValue(smoothChartData2.getValue());
smoothChartData2.setValue(smoothChartData3.getValue());
smoothChartData3.setValue(smoothChartData4.getValue());
smoothChartData4.setValue(RND.nextDouble() * 25);
characterTile.setDescription(Helper.ALPHANUMERIC[RND.nextInt(Helper.ALPHANUMERIC.length - 1)]);
flipTile.setFlipText(Helper.TIME_0_TO_5[RND.nextInt(Helper.TIME_0_TO_5.length - 1)]);
radialPercentageTile.setValue(chartData1.getValue());
if (statusTile.getLeftValue() > 1000) {
statusTile.setLeftValue(0);
}
if (statusTile.getMiddleValue() > 1000) {
statusTile.setMiddleValue(0);
}
if (statusTile.getRightValue() > 1000) {
statusTile.setRightValue(0);
}
statusTile.setLeftValue(statusTile.getLeftValue() + RND.nextInt(4));
statusTile.setMiddleValue(statusTile.getMiddleValue() + RND.nextInt(3));
statusTile.setRightValue(statusTile.getRightValue() + RND.nextInt(3));
barGaugeTile.setValue(RND.nextDouble() * 100);
timelineTile.addChartData(new ChartData("", RND.nextDouble() * 300 + 50, Instant.now()));
imageCounterTile.increaseValue(1);
ledTile.setActive(!ledTile.isActive());
if (!countdownTile.isRunning()) {
countdownTile.setTimePeriod(Duration.ofSeconds(30));
countdownTile.setRunning(true);
}
colorTile.setValue(RND.nextDouble() * 100);
turnoverTile.setValue(RND.nextDouble() * 100);
fluidTile.setValue(RND.nextDouble() * 100);
fireSmokeTile.setValue(RND.nextDouble() * 100);
lastTimerCall = now;
}
}
};
System.out.println("Initialization: " + (System.currentTimeMillis() - start) + "ms");
}
use of eu.hansolo.tilesfx.Tile.ImageMask in project tilesfx by HanSolo.
the class TileBuilder method build.
public final Tile build() {
final Tile TILE;
if (properties.containsKey("skinType")) {
SkinType skinType = ((ObjectProperty<SkinType>) properties.get("skinType")).get();
TILE = new Tile(skinType);
switch(skinType) {
case SMOOTHED_CHART:
break;
case BAR_CHART:
TILE.setItemSorting(ItemSorting.DESCENDING);
TILE.setAnimated(false);
break;
case CLOCK:
break;
case GAUGE:
TILE.setAnimated(true);
TILE.setTickLabelDecimals(0);
TILE.setBarColor(Tile.FOREGROUND);
TILE.setThresholdColor(Tile.BLUE);
TILE.setThresholdVisible(true);
break;
case GAUGE2:
TILE.setAngleRange(240);
TILE.setStartAngle(330);
TILE.setAnimated(true);
TILE.setTickLabelDecimals(0);
TILE.setBarColor(Tile.BLUE);
TILE.setBarBackgroundColor(Tile.BACKGROUND.brighter());
break;
case HIGH_LOW:
TILE.setMaxValue(Double.MAX_VALUE);
TILE.setDecimals(2);
TILE.setTickLabelDecimals(1);
break;
case PERCENTAGE:
TILE.setAnimated(true);
TILE.setThresholdColor(Tile.GRAY);
TILE.setTickLabelDecimals(0);
break;
case PLUS_MINUS:
break;
case SLIDER:
TILE.setBarBackgroundColor(Tile.FOREGROUND);
break;
case SPARK_LINE:
TILE.setTextVisible(false);
TILE.setAnimated(false);
TILE.setAveragingEnabled(true);
TILE.setAveragingPeriod(10);
TILE.setDecimals(0);
TILE.setTickLabelDecimals(0);
break;
case SWITCH:
break;
case WORLDMAP:
TILE.setPrefSize(380, 250);
break;
case TIMER_CONTROL:
TILE.setSectionsVisible(true);
TILE.setHighlightSections(true);
TILE.setCheckSectionsForValue(true);
break;
case NUMBER:
break;
case TEXT:
break;
case TIME:
break;
case CUSTOM:
break;
case CUSTOM_SCROLLABLE:
break;
case LEADER_BOARD:
TILE.setItemSorting(ItemSorting.DESCENDING);
break;
case MAP:
break;
case RADIAL_CHART:
TILE.setAnimated(true);
break;
case DONUT_CHART:
TILE.setItemSorting(ItemSorting.DESCENDING);
TILE.setAnimated(true);
break;
case CIRCULAR_PROGRESS:
TILE.setBarBackgroundColor(TILE.getBackgroundColor().brighter());
TILE.setAnimated(true);
break;
case STOCK:
TILE.setAnimated(false);
TILE.setAveragingPeriod(720);
TILE.setAveragingEnabled(true);
TILE.setDecimals(2);
TILE.setTickLabelDecimals(2);
TILE.setThresholdColor(Tile.GRAY);
TILE.setTextVisible(false);
break;
case GAUGE_SPARK_LINE:
TILE.setBarBackgroundColor(Tile.BACKGROUND.brighter());
TILE.setBarColor(Tile.BLUE);
TILE.setAngleRange(270);
break;
case SMOOTH_AREA_CHART:
TILE.setSmoothing(true);
TILE.setChartType(ChartType.AREA);
break;
case RADAR_CHART:
break;
case RADAR_NODE_CHART:
break;
case COUNTRY:
break;
case CHARACTER:
break;
case FLIP:
break;
case SWITCH_SLIDER:
TILE.setBarBackgroundColor(Tile.FOREGROUND);
break;
case DATE:
TILE.setTitleAlignment(TextAlignment.CENTER);
TILE.setTextAlignment(TextAlignment.CENTER);
break;
case CALENDAR:
TILE.setTitleAlignment(TextAlignment.CENTER);
TILE.setTextAlignment(TextAlignment.CENTER);
break;
case SUNBURST:
break;
case MATRIX:
break;
case MATRIX_ICON:
break;
case RADIAL_PERCENTAGE:
TILE.setBarBackgroundColor(TILE.getBackgroundColor().brighter());
TILE.setAnimated(true);
break;
case STATUS:
TILE.setDescriptionAlignment(Pos.TOP_CENTER);
break;
case BAR_GAUGE:
TILE.setBarBackgroundColor(Tile.BACKGROUND.brighter());
TILE.setBarColor(Tile.BLUE);
TILE.setAngleRange(180);
TILE.setTickLabelDecimals(0);
break;
case IMAGE:
TILE.setTextAlignment(TextAlignment.CENTER);
break;
case IMAGE_COUNTER:
TILE.setTextAlignment(TextAlignment.LEFT);
TILE.setDecimals(0);
break;
case TIMELINE:
TILE.setDataPointsVisible(true);
TILE.setTextVisible(false);
TILE.setAnimated(false);
TILE.setAveragingEnabled(true);
TILE.setAveragingPeriod(Helper.calcNumberOfDatapointsForPeriod(TILE.getTimePeriod(), TILE.getTimePeriodResolution()));
TILE.setDecimals(0);
TILE.setTickLabelDecimals(0);
break;
case CLUSTER_MONITOR:
TILE.setTitle("");
TILE.setTextVisible(false);
TILE.setUnit(Helper.PERCENTAGE);
TILE.setAnimated(false);
TILE.setDecimals(0);
TILE.setBarColor(Tile.BLUE);
break;
case LED:
TILE.setActiveColor(Bright.GREEN);
break;
case COUNTDOWN_TIMER:
TILE.setBarBackgroundColor(TILE.getBackgroundColor().brighter());
TILE.setAnimated(false);
TILE.setTimePeriod(java.time.Duration.ofSeconds(60));
break;
case CYCLE_STEP:
break;
case COLOR:
TILE.setForegroundColor(Color.WHITE);
TILE.setUnit("\u0025");
TILE.setDecimals(0);
TILE.setBarBackgroundColor(Tile.BACKGROUND);
break;
case FLUID:
break;
case FIRE_SMOKE:
break;
case TURNOVER:
TILE.setTextAlignment(TextAlignment.CENTER);
TILE.setImageMask(ImageMask.ROUND);
break;
case RADIAL_DISTRIBUTION:
TILE.setStartAngle(330);
TILE.setAngleRange(240);
TILE.setAnimated(false);
TILE.setTickLabelDecimals(0);
TILE.setBarBackgroundColor(Tile.BACKGROUND.brighter());
break;
default:
break;
}
} else {
TILE = new Tile();
}
// Make sure that sections, areas and markers will be added first
if (properties.keySet().contains("sectionsArray")) {
TILE.setSections(((ObjectProperty<Section[]>) properties.get("sectionsArray")).get());
}
if (properties.keySet().contains("sectionsList")) {
TILE.setSections(((ObjectProperty<List<Section>>) properties.get("sectionsList")).get());
}
if (properties.keySet().contains("characterArray")) {
TILE.setCharacters(((ObjectProperty<String[]>) properties.get("characterArray")).get());
}
if (properties.keySet().contains("foregroundBaseColor")) {
TILE.setForegroundBaseColor(((ObjectProperty<Color>) properties.get("foregroundBaseColor")).get());
}
if (properties.keySet().contains("maxValue")) {
TILE.setMaxValue(((DoubleProperty) properties.get("maxValue")).get());
}
if (properties.keySet().contains("minValue")) {
TILE.setMinValue(((DoubleProperty) properties.get("minValue")).get());
}
if (properties.keySet().contains("alarmsArray")) {
TILE.setAlarms(((ObjectProperty<Alarm[]>) properties.get("alarmsArray")).get());
}
if (properties.keySet().contains("alarmsList")) {
TILE.setAlarms(((ObjectProperty<List<Alarm>>) properties.get("alarmsList")).get());
}
if (properties.keySet().contains("timeSectionsArray")) {
TILE.setTimeSections(((ObjectProperty<TimeSection[]>) properties.get("timeSectionsArray")).get());
}
if (properties.keySet().contains("timeSectionsList")) {
TILE.setTimeSections(((ObjectProperty<List<TimeSection>>) properties.get("timeSectionsList")).get());
}
if (properties.keySet().contains("seriesArray")) {
TILE.setSeries(((ObjectProperty<Series<String, Number>[]>) properties.get("seriesArray")).get());
}
if (properties.keySet().contains("seriesList")) {
TILE.setSeries(((ObjectProperty<List<Series<String, Number>>>) properties.get("seriesList")).get());
}
if (properties.keySet().contains("tilesFxSeriesArray")) {
TILE.setTilesFXSeries(((ObjectProperty<TilesFXSeries<String, Number>[]>) properties.get("tilesFxSeriesArray")).get());
}
if (properties.keySet().contains("tilesFxSeriesList")) {
TILE.setTilesFXSeries(((ObjectProperty<List<TilesFXSeries<String, Number>>>) properties.get("tilesFxSeriesList")).get());
}
if (properties.keySet().contains("barChartItemsArray")) {
BarChartItem[] items = ((ObjectProperty<BarChartItem[]>) properties.get("barChartItemsArray")).get();
for (BarChartItem item : items) {
item.getChartData().setAnimated(TILE.isAnimated());
}
TILE.setBarChartItems(items);
}
if (properties.keySet().contains("barChartItemsList")) {
List<BarChartItem> items = ((ObjectProperty<List<BarChartItem>>) properties.get("barChartItemsList")).get();
for (BarChartItem item : items) {
item.getChartData().setAnimated(TILE.isAnimated());
}
TILE.setBarChartItems(items);
}
if (properties.keySet().contains("leaderBoardItemsArray")) {
TILE.setLeaderBoardItems(((ObjectProperty<LeaderBoardItem[]>) properties.get("leaderBoardItemsArray")).get());
}
if (properties.keySet().contains("leaderBoardItemsList")) {
TILE.setLeaderBoardItems(((ObjectProperty<List<LeaderBoardItem>>) properties.get("leaderBoardItemsList")).get());
}
if (properties.keySet().contains("gradientStopsArray")) {
TILE.setGradientStops(((ObjectProperty<Stop[]>) properties.get("gradientStopsArray")).get());
}
if (properties.keySet().contains("gradientStopsList")) {
TILE.setGradientStops(((ObjectProperty<List<Stop>>) properties.get("gradientStopsList")).get());
}
if (properties.keySet().contains("matrixIconsArray")) {
TILE.setMatrixIcons(((ObjectProperty<MatrixIcon[]>) properties.get("matrixIconsArray")).get());
}
if (properties.keySet().contains("matrixIconsList")) {
TILE.setMatrixIcons(((ObjectProperty<List<MatrixIcon>>) properties.get("matrixIconsList")).get());
}
if (properties.keySet().contains("chartDataArray")) {
TILE.setChartData(((ObjectProperty<ChartData[]>) properties.get("chartDataArray")).get());
}
if (properties.keySet().contains("chartDataList")) {
TILE.setChartData(((ObjectProperty<List<ChartData>>) properties.get("chartDataList")).get());
}
if (properties.keySet().contains("poiArray")) {
TILE.setPoiLocations(((ObjectProperty<Location[]>) properties.get("poiArray")).get());
}
if (properties.keySet().contains("poiList")) {
TILE.setPoiList(((ObjectProperty<List<Location>>) properties.get("poiList")).get());
}
if (properties.keySet().contains("trackArray")) {
TILE.setTrack(((ObjectProperty<Location[]>) properties.get("trackArray")).get());
}
if (properties.keySet().contains("trackList")) {
TILE.setTrack(((ObjectProperty<List<Location>>) properties.get("trackList")).get());
}
for (String key : properties.keySet()) {
if ("prefSize".equals(key)) {
Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
TILE.setPrefSize(dim.getWidth(), dim.getHeight());
} else if ("minSize".equals(key)) {
Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
TILE.setMinSize(dim.getWidth(), dim.getHeight());
} else if ("maxSize".equals(key)) {
Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
TILE.setMaxSize(dim.getWidth(), dim.getHeight());
} else if ("prefWidth".equals(key)) {
TILE.setPrefWidth(((DoubleProperty) properties.get(key)).get());
} else if ("prefHeight".equals(key)) {
TILE.setPrefHeight(((DoubleProperty) properties.get(key)).get());
} else if ("minWidth".equals(key)) {
TILE.setMinWidth(((DoubleProperty) properties.get(key)).get());
} else if ("minHeight".equals(key)) {
TILE.setMinHeight(((DoubleProperty) properties.get(key)).get());
} else if ("maxWidth".equals(key)) {
TILE.setMaxWidth(((DoubleProperty) properties.get(key)).get());
} else if ("maxHeight".equals(key)) {
TILE.setMaxHeight(((DoubleProperty) properties.get(key)).get());
} else if ("scaleX".equals(key)) {
TILE.setScaleX(((DoubleProperty) properties.get(key)).get());
} else if ("scaleY".equals(key)) {
TILE.setScaleY(((DoubleProperty) properties.get(key)).get());
} else if ("layoutX".equals(key)) {
TILE.setLayoutX(((DoubleProperty) properties.get(key)).get());
} else if ("layoutY".equals(key)) {
TILE.setLayoutY(((DoubleProperty) properties.get(key)).get());
} else if ("translateX".equals(key)) {
TILE.setTranslateX(((DoubleProperty) properties.get(key)).get());
} else if ("translateY".equals(key)) {
TILE.setTranslateY(((DoubleProperty) properties.get(key)).get());
} else if ("padding".equals(key)) {
TILE.setPadding(((ObjectProperty<Insets>) properties.get(key)).get());
} else if ("styleClass".equals(key)) {
TILE.getStyleClass().setAll("tile");
TILE.getStyleClass().addAll(((ObjectProperty<String[]>) properties.get(key)).get());
} else if ("autoScale".equals(key)) {
TILE.setAutoScale(((BooleanProperty) properties.get(key)).get());
} else if ("value".equals(key)) {
TILE.setValue(((DoubleProperty) properties.get(key)).get());
} else if ("decimals".equals(key)) {
TILE.setDecimals(((IntegerProperty) properties.get(key)).get());
} else if ("tickLabelDecimals".equals(key)) {
TILE.setTickLabelDecimals(((IntegerProperty) properties.get(key)).get());
} else if ("tickLabelsXVisible".equals(key)) {
TILE.setTickLabelsXVisible(((BooleanProperty) properties.get(key)).get());
} else if ("tickLabelsYVisible".equals(key)) {
TILE.setTickLabelsYVisible(((BooleanProperty) properties.get(key)).get());
} else if ("minValueVisible".equals(key)) {
TILE.setMinValueVisible(((BooleanProperty) properties.get(key)).get());
} else if ("maxValueVisible".equals(key)) {
TILE.setMaxValueVisible(((BooleanProperty) properties.get(key)).get());
} else if ("title".equals(key)) {
TILE.setTitle(((StringProperty) properties.get(key)).get());
} else if ("titleAlignment".equals(key)) {
TILE.setTitleAlignment(((ObjectProperty<TextAlignment>) properties.get(key)).get());
} else if ("description".equals(key)) {
TILE.setDescription(((StringProperty) properties.get(key)).get());
} else if ("descriptionAlignment".equals(key)) {
TILE.setDescriptionAlignment(((ObjectProperty<Pos>) properties.get(key)).get());
} else if ("unit".equals(key)) {
TILE.setUnit(((StringProperty) properties.get(key)).get());
} else if ("thumbColor".equals(key)) {
TILE.setThumbColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("flatUI".equals(key)) {
TILE.setFlatUI(((BooleanProperty) properties.get(key)).get());
} else if ("selected".equals(key)) {
TILE.setActive(((BooleanProperty) properties.get(key)).get());
} else if ("averagingEnabled".equals(key)) {
TILE.setAveragingEnabled(((BooleanProperty) properties.get(key)).get());
} else if ("averagingPeriod".equals(key)) {
TILE.setAveragingPeriod(((IntegerProperty) properties.get(key)).get());
} else if ("timePeriod".equals(key)) {
TILE.setTimePeriod(((ObjectProperty<java.time.Duration>) properties.get(key)).get());
} else if ("maxTimePeriod".equals(key)) {
TILE.setMaxTimePeriod(((ObjectProperty<java.time.Duration>) properties.get(key)).get());
} else if ("timePeriodResolution".equals(key)) {
TILE.setTimePeriodResolution(((ObjectProperty<TimeUnit>) properties.get(key)).get());
} else if ("fixedYScale".equals(key)) {
TILE.setFixedYScale(((BooleanProperty) properties.get(key)).get());
} else if ("startFromZero".equals(key)) {
TILE.setStartFromZero(((BooleanProperty) properties.get(key)).get());
} else if ("returnToZero".equals(key)) {
TILE.setReturnToZero(((BooleanProperty) properties.get(key)).get());
} else if ("minMeasuredValueVisible".equals(key)) {
TILE.setMinMeasuredValueVisible(((BooleanProperty) properties.get(key)).get());
} else if ("maxMeasuredValueVisible".equals(key)) {
TILE.setMaxMeasuredValueVisible(((BooleanProperty) properties.get(key)).get());
} else if ("oldValueVisible".equals(key)) {
TILE.setOldValueVisible(((BooleanProperty) properties.get(key)).get());
} else if ("valueVisible".equals(key)) {
TILE.setValueVisible(((BooleanProperty) properties.get(key)).get());
} else if ("foregroundColor".equals(key)) {
TILE.setForegroundColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("backgroundColor".equals(key)) {
TILE.setBackgroundColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("borderColor".equals(key)) {
TILE.setBorderColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("borderWidth".equals(key)) {
TILE.setBorderWidth(((DoubleProperty) properties.get(key)).get());
} else if ("knobColor".equals(key)) {
TILE.setKnobColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("animated".equals(key)) {
TILE.setAnimated(((BooleanProperty) properties.get(key)).get());
} else if ("animationDuration".equals(key)) {
TILE.setAnimationDuration(((LongProperty) properties.get(key)).get());
} else if ("pauseDuration".equals(key)) {
TILE.setPauseDuration(((LongProperty) properties.get(key)).get());
} else if ("startAngle".equals(key)) {
TILE.setStartAngle(((DoubleProperty) properties.get(key)).get());
} else if ("angleRange".equals(key)) {
TILE.setAngleRange(((DoubleProperty) properties.get(key)).get());
} else if ("needleColor".equals(key)) {
TILE.setNeedleColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("barColor".equals(key)) {
TILE.setBarColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("barBackgroundColor".equals(key)) {
TILE.setBarBackgroundColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("locale".equals(key)) {
TILE.setLocale(((ObjectProperty<Locale>) properties.get(key)).get());
} else if ("numberFormat".equals(key)) {
TILE.setNumberFormat(((ObjectProperty<NumberFormat>) properties.get(key)).get());
} else if ("shadowsEnabled".equals(key)) {
TILE.setShadowsEnabled(((BooleanProperty) properties.get(key)).get());
} else if ("style".equals(key)) {
TILE.setStyle(((StringProperty) properties.get(key)).get());
} else if ("innerShadowEnabled".equals(key)) {
TILE.setInnerShadowEnabled(((BooleanProperty) properties.get(key)).get());
} else if ("thresholdVisible".equals(key)) {
TILE.setThresholdVisible(((BooleanProperty) properties.get(key)).get());
} else if ("lowerThresholdVisible".equals(key)) {
TILE.setLowerThresholdVisible(((BooleanProperty) properties.get(key)).get());
} else if ("averageVisible".equals(key)) {
TILE.setAverageVisible(((BooleanProperty) properties.get(key)).get());
} else if ("sectionsVisible".equals(key)) {
TILE.setSectionsVisible(((BooleanProperty) properties.get(key)).get());
} else if ("sectionsAlwaysVisible".equals(key)) {
TILE.setSectionsAlwaysVisible(((BooleanProperty) properties.get(key)).get());
} else if ("sectionTextVisible".equals(key)) {
TILE.setSectionTextVisible(((BooleanProperty) properties.get(key)).get());
} else if ("sectionIconsVisible".equals(key)) {
TILE.setSectionIconsVisible(((BooleanProperty) properties.get(key)).get());
} else if ("highlightSections".equals(key)) {
TILE.setHighlightSections(((BooleanProperty) properties.get(key)).get());
} else if ("titleColor".equals(key)) {
TILE.setTitleColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("descriptionColor".equals(key)) {
TILE.setDescriptionColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("unitColor".equals(key)) {
TILE.setUnitColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("valueColor".equals(key)) {
TILE.setValueColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("thresholdColor".equals(key)) {
TILE.setThresholdColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("lowerThresholdColor".equals(key)) {
TILE.setLowerThresholdColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("orientation".equals(key)) {
TILE.setOrientation(((ObjectProperty<Orientation>) properties.get(key)).get());
} else if ("checkSectionsForValue".equals(key)) {
TILE.setCheckSectionsForValue(((BooleanProperty) properties.get(key)).get());
} else if ("checkThreshold".equals(key)) {
TILE.setCheckThreshold(((BooleanProperty) properties.get(key)).get());
} else if ("checkLowerThreshold".equals(key)) {
TILE.setCheckLowerThreshold(((BooleanProperty) properties.get(key)).get());
} else if ("onValueChanged".equals(key)) {
TILE.currentValueProperty().addListener(((ObjectProperty<InvalidationListener>) properties.get(key)).get());
} else if ("keepAspect".equals(key)) {
TILE.setKeepAspect(((BooleanProperty) properties.get(key)).get());
} else if ("threshold".equals(key)) {
TILE.setThreshold(((DoubleProperty) properties.get(key)).get());
} else if ("lowerThreshold".equals(key)) {
TILE.setLowerThreshold(((DoubleProperty) properties.get(key)).get());
} else if ("referenceValue".equals(key)) {
TILE.setReferenceValue(((DoubleProperty) properties.get(key)).get());
} else if ("autoReferenceValue".equals(key)) {
TILE.setAutoReferenceValue(((BooleanProperty) properties.get(key)).get());
} else if ("customFontEnabled".equals(key)) {
TILE.setCustomFontEnabled(((BooleanProperty) properties.get(key)).get());
} else if ("customFont".equals(key)) {
TILE.setCustomFont(((ObjectProperty<Font>) properties.get(key)).get());
} else if ("customDecimalFormatEnabled".equals(key)) {
TILE.setCustomDecimalFormatEnabled(((BooleanProperty) properties.get(key)).get());
} else if ("customDecimalFormat".equals(key)) {
TILE.setCustomDecimalFormat(((ObjectProperty<DecimalFormat>) properties.get(key)).get());
} else if ("alertMessage".equals(key)) {
TILE.setAlertMessage(((StringProperty) properties.get(key)).get());
} else if ("smoothing".equals(key)) {
TILE.setSmoothing(((BooleanProperty) properties.get(key)).get());
} else if ("time".equals(key)) {
TILE.setTime(((ObjectProperty<ZonedDateTime>) properties.get(key)).get());
} else if ("text".equals(key)) {
TILE.setText(((StringProperty) properties.get(key)).get());
} else if ("textAlignment".equals(key)) {
TILE.setTextAlignment(((ObjectProperty<TextAlignment>) properties.get(key)).get());
} else if ("discreteSeconds".equals(key)) {
TILE.setDiscreteSeconds(((BooleanProperty) properties.get(key)).get());
} else if ("discreteMinutes".equals(key)) {
TILE.setDiscreteMinutes(((BooleanProperty) properties.get(key)).get());
} else if ("discreteHours".equals(key)) {
TILE.setDiscreteHours(((BooleanProperty) properties.get(key)).get());
} else if ("secondsVisible".equals(key)) {
TILE.setSecondsVisible(((BooleanProperty) properties.get(key)).get());
} else if ("textVisible".equals(key)) {
TILE.setTextVisible(((BooleanProperty) properties.get(key)).get());
} else if ("dateVisible".equals(key)) {
TILE.setDateVisible(((BooleanProperty) properties.get(key)).get());
} else if ("textColor".equals(key)) {
TILE.setTextColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("dateColor".equals(key)) {
TILE.setDateColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("hourTickMarkColor".equals(key)) {
TILE.setHourTickMarkColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("minuteTickMarkColor".equals(key)) {
TILE.setMinuteTickMarkColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("alarmColor".equals(key)) {
TILE.setAlarmColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("tickLabelColor".equals(key)) {
TILE.setTickLabelColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("tickMarkColor".equals(key)) {
TILE.setTickMarkColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("hourTickMarksVisible".equals(key)) {
TILE.setHourTickMarksVisible(((BooleanProperty) properties.get(key)).get());
} else if ("minuteTickMarksVisible".equals(key)) {
TILE.setMinuteTickMarksVisible(((BooleanProperty) properties.get(key)).get());
} else if ("hourColor".equals(key)) {
TILE.setHourColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("minuteColor".equals(key)) {
TILE.setMinuteColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("secondColor".equals(key)) {
TILE.setSecondColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("onAlarm".equals(key)) {
TILE.setOnAlarm(((ObjectProperty<AlarmEventListener>) properties.get(key)).get());
} else if ("onTimeEvent".equals(key)) {
TILE.setOnTimeEvent(((ObjectProperty<TimeEventListener>) properties.get(key)).get());
} else if ("onTileEvent".equals(key)) {
TILE.setOnTileEvent(((ObjectProperty<TileEventListener>) properties.get(key)).get());
} else if ("alarmsEnabled".equals(key)) {
TILE.setAlarmsEnabled(((BooleanProperty) properties.get(key)).get());
} else if ("alarmsVisible".equals(key)) {
TILE.setAlarmsVisible(((BooleanProperty) properties.get(key)).get());
} else if ("running".equals(key)) {
TILE.setRunning(((BooleanProperty) properties.get(key)).get());
} else if ("increment".equals(key)) {
TILE.setIncrement(((DoubleProperty) properties.get(key)).get());
} else if ("activeColor".equals(key)) {
TILE.setActiveColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("duration".equals(key)) {
TILE.setDuration(((ObjectProperty<LocalTime>) properties.get(key)).get());
} else if ("strokeWithGradient".equals(key)) {
TILE.setStrokeWithGradient(((BooleanProperty) properties.get(key)).get());
} else if ("fillWithGradient".equals(key)) {
TILE.setFillWithGradient(((BooleanProperty) properties.get(key)).get());
} else if ("image".equals(key)) {
TILE.setImage(((ObjectProperty<Image>) properties.get(key)).get());
} else if ("imageMask".equals(key)) {
TILE.setImageMask(((ObjectProperty<ImageMask>) properties.get(key)).get());
} else if ("graphic".equals(key)) {
TILE.setGraphic(((ObjectProperty<Node>) properties.get(key)).get());
} else if ("svgPath".equals(key)) {
TILE.setSVGPath(((ObjectProperty<SVGPath>) properties.get(key)).get());
} else if ("roundedCorners".equals(key)) {
TILE.setRoundedCorners(((BooleanProperty) properties.get(key)).get());
} else if ("textSize".equals(key)) {
TILE.setTextSize(((ObjectProperty<TextSize>) properties.get(key)).get());
} else if ("currentLocation".equals(key)) {
TILE.setCurrentLocation(((ObjectProperty<Location>) properties.get(key)).get());
} else if ("trackColor".equals(key)) {
TILE.setTrackColor(((ObjectProperty<TileColor>) properties.get(key)).get());
} else if ("mapProvider".equals(key)) {
TILE.setMapProvider(((ObjectProperty<MapProvider>) properties.get(key)).get());
} else if ("tooltipText".equals(key)) {
TILE.setTooltipText(((StringProperty) properties.get(key)).get());
} else if ("xAxis".equals(key)) {
TILE.setXAxis(((ObjectProperty<Axis>) properties.get(key)).get());
} else if ("yAxis".equals(key)) {
TILE.setYAxis(((ObjectProperty<Axis>) properties.get(key)).get());
} else if ("radarChartMode".equals(key)) {
TILE.setRadarChartMode(((ObjectProperty<RadarChartMode>) properties.get(key)).get());
} else if ("chartGridColor".equals(key)) {
TILE.setChartGridColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("country".equals(key)) {
TILE.setCountry(((ObjectProperty<Country>) properties.get(key)).get());
} else if ("countryGroup".equals(key)) {
TILE.setCountryGroup(((ObjectProperty<CountryGroup>) properties.get(key)).get());
} else if ("flipTimeInMS".equals(key)) {
TILE.setFlipTimeInMS(((LongProperty) properties.get(key)).get());
} else if ("flipText".equals(key)) {
TILE.setFlipText(((StringProperty) properties.get(key)).get());
} else if ("itemSorting".equals(key)) {
TILE.setItemSorting(((ObjectProperty<ItemSorting>) properties.get(key)).get());
} else if ("itemSortingTopic".equals(key)) {
TILE.setItemSortingTopic(((ObjectProperty<ItemSortingTopic>) properties.get(key)).get());
} else if ("dataPointsVisible".equals(key)) {
TILE.setDataPointsVisible(((BooleanProperty) properties.get(key)).get());
} else if ("sunburstTree".equals(key)) {
TILE.getSunburstChart().setTree(((ObjectProperty<TreeNode>) properties.get(key)).get());
} else if ("sunburstBackgroundColor".equals(key)) {
TILE.getSunburstChart().setBackgroundColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("sunburstTextColor".equals(key)) {
TILE.getSunburstChart().setTextColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("sunburstUseColorFromParent".equals(key)) {
TILE.getSunburstChart().setUseColorFromParent(((BooleanProperty) properties.get(key)).get());
} else if ("sunburstTextOrientation".equals(key)) {
TILE.getSunburstChart().setTextOrientation(((ObjectProperty<TextOrientation>) properties.get(key)).get());
} else if ("sunburstVisibleData".equals(key)) {
TILE.getSunburstChart().setVisibleData(((ObjectProperty<VisibleData>) properties.get(key)).get());
} else if ("sunburstInteractive".equals(key)) {
TILE.getSunburstChart().setInteractive(((BooleanProperty) properties.get(key)).get());
} else if ("sunburstAutoTextColor".equals(key)) {
TILE.getSunburstChart().setAutoTextColor(((BooleanProperty) properties.get(key)).get());
} else if ("sunburstUseChartDataTextColor".equals(key)) {
TILE.getSunburstChart().setUseChartDataTextColor(((BooleanProperty) properties.get(key)).get());
} else if ("snapToTicks".equals(key)) {
TILE.setSnapToTicks(((BooleanProperty) properties.get(key)).get());
} else if ("minorTickCount".equals(key)) {
TILE.setMinorTickCount(((IntegerProperty) properties.get(key)).get());
} else if ("majorTickUnit".equals(key)) {
TILE.setMajorTickUnit(((DoubleProperty) properties.get(key)).get());
} else if ("matrixSize".equals(key)) {
final int COLS = ((IntegerProperty) properties.get("matrixColumns")).get();
final int ROWS = ((IntegerProperty) properties.get("matrixRows")).get();
TILE.setMatrixSize(COLS, ROWS);
} else if ("chartType".equals(key)) {
TILE.setChartType(((ObjectProperty<ChartType>) properties.get(key)).get());
} else if ("tooltipTimeout".equals(key)) {
TILE.setTooltipTimeout(((DoubleProperty) properties.get(key)).get());
} else if ("notifyRegionBackgroundColor".equals(key)) {
TILE.setNotifyRegionBackgroundColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("notifyRegionForegroundColor".equals(key)) {
TILE.setNotifyRegionForegroundColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("notifyRegionTooltipText".equals(key)) {
TILE.setNotifyRegionTooltipText(((StringProperty) properties.get(key)).get());
} else if ("showNotifyRegion".equals(key)) {
TILE.showNotifyRegion(((BooleanProperty) properties.get(key)).get());
} else if ("infoRegionBackgroundColor".equals(key)) {
TILE.setInfoRegionBackgroundColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("infoRegionForegroundColor".equals(key)) {
TILE.setInfoRegionForegroundColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("infoRegionTooltipText".equals(key)) {
TILE.setInfoRegionTooltipText(((StringProperty) properties.get(key)).get());
} else if ("showInfoRegion".equals(key)) {
TILE.showInfoRegion(((BooleanProperty) properties.get(key)).get());
} else if ("lowerRightRegionBackgroundColor".equals(key)) {
TILE.setLowerRightRegionBackgroundColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("lowerRightRegionForegroundColor".equals(key)) {
TILE.setLowerRightRegionForegroundColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("lowerRightRegionTooltipText".equals(key)) {
TILE.setLowerRightRegionTooltipText(((StringProperty) properties.get(key)).get());
} else if ("showLowerRightRegion".equals(key)) {
TILE.showLowerRightRegion(((BooleanProperty) properties.get(key)).get());
} else if ("leftText".equals(key)) {
TILE.setLeftText(((StringProperty) properties.get(key)).get());
} else if ("middleText".equals(key)) {
TILE.setMiddleText(((StringProperty) properties.get(key)).get());
} else if ("rightText".equals(key)) {
TILE.setRightText(((StringProperty) properties.get(key)).get());
} else if ("leftValue".equals(key)) {
TILE.setLeftValue(((DoubleProperty) properties.get(key)).get());
} else if ("middleValue".equals(key)) {
TILE.setMiddleValue(((DoubleProperty) properties.get(key)).get());
} else if ("rightValue".equals(key)) {
TILE.setRightValue(((DoubleProperty) properties.get(key)).get());
} else if ("leftGraphics".equals(key)) {
TILE.setLeftGraphics(((ObjectProperty<Node>) properties.get(key)).get());
} else if ("middleGraphics".equals(key)) {
TILE.setMiddleGraphics(((ObjectProperty<Node>) properties.get(key)).get());
} else if ("rightGraphics".equals(key)) {
TILE.setRightGraphics(((ObjectProperty<Node>) properties.get(key)).get());
} else if ("trendVisible".equals(key)) {
TILE.setTrendVisible(((BooleanProperty) properties.get(key)).get());
} else if ("timeoutMs".equals(key)) {
TILE.setTimeoutMs(((LongProperty) properties.get(key)).get());
} else if ("rank".equals(key)) {
TILE.setRank(((ObjectProperty<Rank>) properties.get(key)).get());
} else if ("interactive".equals(key)) {
TILE.setInteractive(((BooleanProperty) properties.get(key)).get());
} else if ("numberOfValuesForTrendCalculation".equals(key)) {
TILE.setNumberOfValuesForTrendCalculation(((IntegerProperty) properties.get(key)).get());
} else if ("backgroundImage".equals(key)) {
TILE.setBackgroundImage(((ObjectProperty<Image>) properties.get(key)).get());
} else if ("backgroundImageOpacity".equals(key)) {
TILE.setBackgroundImageOpacity(((DoubleProperty) properties.get(key)).get());
} else if ("backgroundImageKeepAspect".equals(key)) {
TILE.setBackgroundImageKeepAspect(((BooleanProperty) properties.get(key)).get());
} else if ("infoRegionEventHandler".equals(key)) {
TILE.setInfoRegionEventHandler(((ObjectProperty<EventHandler<MouseEvent>>) properties.get(key)).get());
} else if ("infoRegionTooltipText".equals(key)) {
TILE.setInfoRegionTooltipText(((StringProperty) properties.get(key)).get());
} else if ("notifyRegionTooltipText".equals(key)) {
TILE.setNotifyRegionTooltipText(((StringProperty) properties.get(key)).get());
}
}
properties.clear();
return TILE;
}
Aggregations