Hello again...it's time for another release of the SteelSeries Java Swing component library.
Enable / disable nice scaling...
Because somebody asked for it i added the functionality to disable the usage of the automatic tickmark calculation. If you have for example limits of
- minValue = 0
- maxValue = 124
and you use the automatic tickmark calculation (niceScale=true) the calculation will set the maximum value to 140 instead of 124 to get a nice scaling. There might be usecases where you need to have the scale ends at 124 and for this reason one could now enable/disable the nice scaling by the method setNiceScale(boolean) which default's true.
A picture will better explain what this means...
On the left gauge the niceScale property is set to true and on the right it is set to false.
More realistic inner shadow on radial gauges...
Another tiny thing that annoyed me a long time was the inner shadow of the radial gauges. Somehow it looked not the way it should and therefore i modified it a little bit so that it looks better to my eyes now.
You might not even noticed the difference but for me it was visible all the time so i had to change it... :-)
New backgrounds...
When i was playing around with the lib i thought i might add more background colors to the gauges and so i've added six new designs...
Well not all of them might be useful but you never know...so feel free to play around with it. Here i would like to thank Wolfgang Zitzelsberger of Jyloo Software for the idea with the carbon. And by the way if you don't know him you should know that he's in charge of the Synthetica look and feel which you could find here.
StopWatch component...
And i have to say thanx again to Wolfgang because he also asked me for a StopWatch component and here it is...
It's nothing special with this stopwatch, just a simple analog stopwatch.
Additional clock design...
And talking about clocks...there's also a new clock design available in the existing Clock component of the SteelSeries. I while ago i created a Swing component that looked like the clock of the german railway company "Deutsche Bahn". So for those who do not know this clock just click this link and you will find some images of it. So my version looks like this...
You could activate this design by changing the pointerType property in the Clock component to eu.hansolo.steelseries.tools.PointerType.TYPE2. In addition i've added the ability to let the second pointer move continuously by calling secondMovesContinuous(true).
Because it's derived from AbstractRadial you could use all the frameDesigns, backgroundColors, pointerColors (except the SecondPointer which is always red) and foregroundTypes to customize this clock.
Additional frame designs...
So now that i mentioned frameDesigns it's time to talk about some new frameDesigns too. I have added three new frameDesigns to the lib that are looking like this...
It's again nothing special but i thought you could never have to much designs to choose from. Of course this designs are available for the linear gauges too. Because we are talking about the frames already i extended the effect feature of the frames.
Frame effects...
In the former version you only could activate one frameEffect but i found that there too many possibilities that might make sense too, so i added a property named frameEffect and you could choose between four different effects as overlay for your frame, here they are...
These frameEffects will work on all frameDesigns and on the radial and linear gauges. They won't work on the Radial2Top and Radial1Square component right now (but i'm working on a new ContourGradientPaint which hopefuly will make it possible to use it on these gauges too).
Instead of adding a new ContourGradientPaint class i have added a class to scale convex polygons which makes it possible to apply the frame effects also to the Radial2Top and Radial1Square component.
Additional foregrounds...
But not only the backgrounds and frames got something new, i've also added two new foregroundTypes to the radial gauges, check them out...
The left one (TYPE4) has a more unobtrusive look where the right one (TYPE5) stays more present in the foreground.
Number systems in lcd...
So far so good but that was not the end right now...i've got the request if i could add a hexdecimal numberformat to the lcd component and you know i always try to do my best to make your wishes come true, so i added it to the lcd in general which means it's now available in all gauges and in the standalone lcd displays too.
Right now the decimal, hexadecimal and octal number system is supported.
Additional lcd design...
Well there are some color schemes for the lcd but from time to time i find something new to implement and so i added another LcdColor named STANDARD_GREEN which looks like this...
Like all the other things nothing special but it looks nice doesn't it...?
Additional pointer type...
And talking about little new things i also want to mention the new pointerType in the radial gauges named TYPE9 that i found on a car...
This pointerType is a bit special, because it won't change it's color if you set the pointerColor but it will only change the little rectangle at it's end to the given pointerColor which means this pointer is best used on bright backgrounds.
Additional threshold indicator...
And now the smallest new add on (and it might change in the next release because i'm not 100% satisfied with it), another thresholdType named ARROW which comes in addition to the former thresholdType that is now named TRIANGLE. The color of the threshold indicator could now be modified too.
Additional center knob...
Another tiny thing i've added to the library is a new type of center knob which is available for all radial components. Here's how it looks like...
KnobStyles...
After i finished the new center knob i figured out that it might be a good idea to have knobs with adjustable colors because if you have a brass colored frame the silver center knob won't fit very well to the design. Long story short...here they are...
You might have figured out that the standard knob also got a little polish and looks more shiny now. By the way, the MinMax alignment posts do change their color too... :-)
Additional pointers for the compass...
Oh what's this...how does the compass pointer look like...? Ahh...yes i gave some love to the compass component and added two additional pointer types, so here is an image of the three available types of pointers in the compass component...
So far so good, now i just have another little modification which might be usefull for one or the other of you...the ability to save an image of a component.
Save component as image...
Each component now has a method named getAsImage() which will return a buffered image of the current state of the component. In addition i've added another helper method to the Util class in the package eu.hansolo.steelseries.tools which will save the given buffered image as a png image with the given name. Here's a small example on how to use it...
// the component we would like to save as image is named radial
SwingUtilities.invokeLater(new Runnable()
{
@Override
public void run()
{
// store the radial component as radial.png
Util.INSTANCE.savePngImage(radial.getAsImage(), "radial.png");
}
});
New battery component...
Man that's a long post with lots of pictures again and to give you some eyecandy at the end i've added a battery component to the SteelSeries lib that takes integer values from 0 to 100 and looks like this...
So...i think it's done for today, i hope some of these modifications will be of use for you and please do me a favour and let me know if you have the need for a special component and i'll see what i can do for you...
Keep coding...