Friday, May 29, 2020

TilesFX 11.37

Aloha,

Time for some new stuff...
Last weekend I've stumbled upon some dashboards that had some interesting visualizations. The first one was a visualization of sales cycle steps that looked as follows:


The interesting part here for me is the chart where each bar starts where the last bar ended. I took a look at TilesFX but did not found something that made stuff like this possible in an easy way. So I decided to add a new skin that I called CycleStepTileskin (I know I'm not good in naming things). Here is how it looks like:


To be honest I'm not sure if this is useful but you never know right :)

The other tile I've found was nothing really special but I realized it has something that I missed in TilesFX...flags. This is what I'm talking about...


Not everyone needs flags but sometimes they come in really handy and so I was looking for flag images that I could use. Lucky me I've found free flags over at flaticon and added them to TilesFX. I've added them as enum and control.
So if you need an icon image you can now simply do something like follows:

ImageView flagImage = new ImageView(Flag.GERMANY.getImage(48));

The Flag enum has two methods to get an image, the standard getImage() method always returns a flag image with the size of 30x30 px. If you need a different size you can simply call the getImage(SIZE) method to get the flag in the size you want it.
The flag images are always square!
The other class I've added is called FlagIcon which is more or less a wrapper around an ImageView of the given image. Meaning to say it behaves like a control, so it will be resized automatically BUT it will resize the image based on the given flagSize. So if you have a flag of size 48 px and you increase the size of the FlagIcon it will get pixelated.
So if you would like to avoid pixelation you need to set the FlagSize to a bigger value but that will also increase memory consumption...so it's up to you.
In the end the FlagIcon is just a convenience class that comes in handy if you simply need a flag somewhere. You can use it as follows:

FlagIcon flagIcon = new FlagIcon(Flag.SINGAPORE, 24);

This will give you a control that shows a flag that is based on an image with 24px.

As an example of what you can do with that I've simply added a tile that shows the Covid-19 cases of some countries based on data from Mai 26th 2020. For this tile I simply used the custom tile skin and added a VBox with some HBoxes. If you are interested in how I did that, please take a look at the Demo class in the TilesFX project.



Here is a little bigger screenshot of it...


That's it for today so as always you can find the code over at github and the binary either at bintray or at maven central.

That's it for today...so keep coding and stay healthy...

Sunday, May 17, 2020

MatrixIcon Tile Skin

Aloha,

This morning when I took a shower I got the idea that it might be nice to have some kind of animated icons in TilesFX. I own two lametric clocks and on this clocks you have the ability to have an icon and a text. They provide the ability to animate the icon by simply having multiple 8x8 pixel images that will shown in an animation.
So why not having such a feature in TilesFX?

Well just tooks a bit more than 1h to implement it and here is the result...



If you take a look at the Demo class in the TilesFX sources you can see how this was done.

As always you can find the latest version (11.35) over at

github

bintray

maven central

That's it for today...so keep coding...

Friday, May 15, 2020

TilesFX update

Aloha,

You might have heard that Darksky has joined Apple. Well I used the darksky weather api for the WeatherTileSkin and therefor had a dependency to the json-simple library to be able to parse the json data from darksky correctly. I never was a big fan of having TilesFX depending on other libraries and 2 weeks ago there was an issue on github where someone asked to remove the dependency because of jlink problems.
Well after Darksky moved to Apple and won't probably be available in the future any more I've decided to remove the WeatherTileSkin and the Darksky objects from the library.
So from version 11.33 you won't find the WeatherTileSkin any longer in TilesFX but I've created an addon library called tilesfxweather which will make it possible to continue using the WeatherTileSkin as a custom skin in combination with the Darksky api.
If you take a look at the Demo class in the tilesfxweather project you will see how to use the WeatherTileSkin. Because Darksky might go away I've also removed the dependencies from the skin to the Darksky object so that you now only have to provide a DataPoint object that could contain data from where ever you want. But as I mentioned everything is in the Demo class of the tilesfxweather project.
In addition to the above things the new release also contains some bugfixes and a new property called fixedYScale which will be used in the SparkLineTileSkin when set to true.
The y-axis in the SparkLineTileSkin will usually automatically be adjusted to the min- and maxMeasured values of the current view but if fixedYScale=true the y-axis will always be based on the min- and maxValue from the tile.

Oh and you can find both libraries on maven central:

TilesFX

TilesFXWeather

Well in principle that's it for now...so stay healthy and...keep coding...