Wednesday, January 12, 2011

Mavenized Steel...

A happy new year everybody...
During the last weeks i made some modifications to the steelseries library that i was asked for at Devoxx 2010 (yes are the reason for this).

The question was if i could switch to maven as a build system...well i had no idea on what's coming up to me and agreed (there was a time when i thought this was a big mistake). Well switching to maven was not a big deal but that was only the first part of the story, the second part was how to publish the library in the maven central repo ???

I never thought that this could be so damn hard...well now i know but even with help from others and from the internet it was tough.

But long story's done and the SteelSeries library should appear in the maven central repo and right now is available here.

A T T E N T I O N   P L E A S E 


Ah, by the way i also made a lot of refactorings to the library which lead to a reduction in size about 120 kb...

I figured out that in principle i have four groups of gauges in my lib

- Radials 
  (Radial1, Radial1Lcd, Radial2, Radial2Lcd, Radial3, Radial3Lcd, Radial4, 
- RadialBargraphs
  (RadialBargraph1, RadialBargraph1Lcd, RadialBargraph2, RadialBargraph2Lcd,
   RadialBargraph3, RadialBargraph3Lcd, RadialBargraph4, RadialBargraph3Lcd)
- Linears
  (Linear, LinearLcd)
- LinearBargraphs
  (LinearBargraph, LinearBargraphLcd)

and some others that do not fit into this scheme.

So i removed all these Radial1, Radial2, Radial4 etc. gauges and replaced them with the following new classes

- Radial
- RadialBargraph
- Linear
- LinearBargraph

To get the same results as before i added a enum named GaugeType that contains TYPE1, TYPE2, TYPE3, TYPE4.
Each of the new classes get a method setGaugeType() and getGaugeType() so that one could switch between the types of gauges.
In addition i added the lcd to each of the new components and one could now use setLcdVisible() to switch the lcd on or off.

Another modification was the new enum named FrameType which contains ROUND and SQUARE. This enum is used to switch the frame on the Radial and RadialBargraph components between the circular and the square one.
This little add on made it possible to remove the RadialSquareVertical component from the lib and now give you the ability to set a rectangular frame to all Radial components.

There are also two new frameDesigns available...brass and steel which looks like this...

The idea for these colors came to me when i was looking around in a watch store where i saw watches in these colors.

But that's not enough...i also extended the possibilities of the area feature. In the steelseries version 2 you could add one area but i figured out that this might not be enough so i now allow as much areas as you like...
That could lead to gauges that looks like this...

Looks funny right...

The sections that in version 2 have been placed on the inside of the gauge are now placed under the tickmarks, where also the track is placed. That means you could combine the track with the sections feature which could look like this...

As you can see the track which goes from 75 - 100 in the image above has not exactly the same size as the section and i might change this in the next version but i looks funny.

There's also another pointer available TYPE3 which looks like this...

This pointer might be useful if you have many values in you scaling and need a needle like pointer that is smaller than the standard one.

Unfortunately the Radial1Square component had some problems with negative values in the scale and to avoid problems i disabled the possibility to change the orientation of the gauge. So in this release you could only use the standard orientation. I might create a new version of the Radial1Square component that is easier to handle than the current one...just need more time...

There are some other projects i'm working on and which might be of interest for some of you...

You might hear about HTML5's i started fiddeling around with it and what should i say...i'm working on a canvas port of the steelseries lib.
To give you a little preview of my work i prepared a little gauge in swing and the same version in canvas...take a look...

It's amazing...isn't it...

The really fun part of it is that one could use it also on a mobile device like my android phone or an iPad...think about the possibilities...

One of the next steps will be the extension of the FXG converter so that it also will convert fxg files to html5 canvas.

I guess that's it for today...keep coding...

1 comment:

  1. Happy new year, I beleived you didn't pass the year/winter^^. I miss Friday Fun ! I hope the html5 wont stop your java development ;). Glad to see you back.