Icedtea-web splashscreen implementation

Jiri Vanek jvanek at redhat.com
Tue Aug 7 01:50:32 PDT 2012


On 08/01/2012 09:30 PM, Omair Majid wrote:

Hi! You are an tormentor and I'm starting to bleed from my eyes ;)

Anyway most of below faithfully fixed

> Hi Jiri,
>
> Lots of nits below.
>
> On 08/01/2012 09:55 AM, Jiri Vanek wrote:
>>
>> on 07/31/2012 03:33 AM, Omair Majid wrote:
>>
...snip...
>
> Oh, I agree. But should another class be able to tell it when to paint?
> I see below that you want to make it a self-contained MVC (more on that
> later), so external classes have no need for telling it when to paint
> itself. The implementation of this interface needs to have paint
> methods, but it need not be part of the interface.

hmhm... I do not wont to get rid of this. I have renamed paint(g) to paintTo(g) to avoid confusion 
with classical paint  but to still to be publicly paintable.
Can you survive this?
(say no and it will be deleted next time - I'm out of arguments :)
>
>> Get percentage  was kept, and other getters moved to package private for
>> testing. Is it ok for you?
>
> Package-private sounds fine. Is getPercentage used by something?

no - but can be useful when implementing DownloadServiceListener
>
>> I have also renamed those *12 clases to 2012 classes. My intention was
>> to name it differently then
>> "Default*" for case that in future new splashcreen will be implemented.
>
> What if you implement a better splash screen this year ;)

omg - noooo:)
>
>> I'm not fan of adapters, but as you wish :)
>
> This is more or less completely off-topic, but why?
>
The aggregator -  I dont like too O:) - can sometimes not be avoided.
But aggregator which is dedicated to have just one member == adapter is considered be me as error in 
design. However after this example when it saves a lot of duplicated code it is forcing me to 
reconsider.

and still code like

void method(){
variable.doTheMethod();
}

blah,looks nasty.


>>>
>>>>> +    @Override
>>>>> +    public void paintComponent(Graphics g) {
>>>>> +        paint(g);
>>>>> +    }
>>>>> +
>>>>> +    @Override
>>>>> +    public void paint(Graphics g) {
>>>>> +        painter.paint(g);
>>>
...
> I am not sure if that's a good idea. paint(Graphics) will invoke
> paintComponent(Graphics) at the right time (and in the right order). By
> overriding paint(Graphics) and not calling super.paint(Graphics), you
> may cause issues later on (if you decide to replace a jpanel with
> something else, for example).
>


ok

>>>
>>>>> +    //waving of water and position of shhadowed WEB
>>>>> +    private int level2 = 0;
>>>>> +    private int l2inc = 15; //how quickly is greyed web moving
>>> Likewise ;)
>>>
>>>>> +    //inidivdual sizes, all converging to ZERO!!
>>>>> +    private final int WEB_TOP_ALIGMENT = 324;
>>>>> +    private final int WEB_LEFT_ALIGMENT = 84;
>>> How did you drive these numbers.
>>
>> :))) I was trying, measuring and testing until the splash looked well.
>> (and was zooming correctly)
>
> Okay, so we should somehow clarify that in the file itself. A comment
> saying how these values were "measured" would be good.
done
>
>>>
>>>>> +    public final void startAnimationThreads() {
>>> ...
>>>>> +        };
>>>>> +        tt.setDaemon(true);
>>>>> +        return tt;
>>>>> +    }
>>> My first instic would be to have the animator thread in the controller.
>>> The controller would signal when it's time for the view to update, and
>> I would rather those threads encapsualted inside painter. Look at it
>> like to MVC micro-environment;)
>
> MVC micro-environment? So not mvc, then? ;) Please consider not mixing
> multiple responsibilities into the view class. It should not have timing
> logic in it.

grr :) Very well. Replaced with observer/observable with repaint in update. It should satisfy yours 
mvc needs;)

>
>>> the view would repaint itself. What shuts this thread down?
>>
>> Two stops by themselves, and the last (of main animation) is stopped by
>> stopAnimation method when
>> spalsh is about to be removed or repalced.
>
> Please do not call setDaemon, then. It strongly implies that the threads
> do not shut down.

done. I hvae just commented them out , as I had suspicion longer ago that there can be error 
circumstances which can make the threads not-stop. But after today testing they did not occur.

>
>>> Could you clarify this bit? Is this code copied from NatCubic?
>>
>> The only main computation is. As there is no licence and I have spoken
>> (and got approve) with author
>> it should be ok.
>
> Okay, the comment was not very clear. How about something like this:
>

done

> """
> This class is part of the NatCubic implementation (<url to natcubic>)
> which does not have a license. The author (<Author name>) has agreed to
> license this under GPL+Classpath (<link to the author saying yes>). The
> NatCubic implementation was inspired by http://www.cse.unsw.edu.au/~lambert/
> """
>
> Also, please fix the copyrights on the file. The copyrights are owned by
> the original author. If you have modified it, then you need to add a Red
> Hat copyright too. Please do this for all the NatCubic files.

Done - added mr. Lamber to header
>
>>>
>>>>> diff -r 01544fb82384
>>>> netx/net/sourceforge/jnlp/splashscreen/impls/defaultspalshscreen12/ErrorPainter.java
>>>>
>>>>> --- /dev/null    Thu Jan 01 00:00:00 1970 +0000
>>>>> +++
>>>> b/netx/net/sourceforge/jnlp/splashscreen/impls/defaultspalshscreen12/ErrorPainter.java
>>>> Mon Jul 23 14:52:44 2012 +0200
>>>>> +    private Thread getErrorScreamThread() {
>>>>> +        // Create a new thread to screem error  when failure
>>> I am not sure I follow. Could you explain the purpose?
>>
>> When error occurs, big red ERROR fly through splash, but just for
>> momnet. And then it is here no
>> longer. This is what I have called ErrorScream:) During it fly  the
>> splash interpolate from normal
>> state to greyed one with button to show stacktrace.
>
> Sorry if this is nitpicking, but I think ErrorScream should be renamed.
> The scream-bit is kind of misleading (it doesn't play any sound). How
> about calling it ErrorIndicator

ok.  Renamed to FlyingError* - and you must confess you have not seen animation;)

>
>>>>> diff -r 01544fb82384
>>>> netx/net/sourceforge/jnlp/splashscreen/impls/defaultspalshscreen12/ImageFontCutter.java
>>>>
>>>>> --- /dev/null    Thu Jan 01 00:00:00 1970 +0000
>>>>> +++
>>>> b/netx/net/sourceforge/jnlp/splashscreen/impls/defaultspalshscreen12/ImageFontCutter.java
>>>> Mon Jul 23 14:52:44 2012 +0200
>>>>> +public class ImageFontCutter {
>>>   From what I can tell, this is supposed to draw strings. Why the font
>>> cutter name? Maybe something like TextRenderer might be more
>>> appropriate? With a method named render:
>>> render (Image image, String text, Font font) { .... }
>>
>> Actually not - it is really taking image and cut from this image shape
>> in  shapes of letters.
>
> Okay. I don't know how this class is supposed to be used. You say it's
> for getting the text outline, but the cutTo method (going by the class
> name, it must by the focus of this class) returns void. In fact, by
> calling setTextOutline, I can assign the outline.
>
>>>
>>>>> +    @Override
>>>>> +    public String toXml() {
>>>>> +        if (kind==null){
>>>>> +            return super.toXml();
>>>>> +        }
>>>>> +        return "<"+type+" kind=\""+kind+"\">"+value+"</"+type+">";
>>>>> +    }
>>> Hm.. what's this for? Do we ever output anything in XML?
>>
>> I'm using it in tests to generate jnlps on the  fly.
>
> I admit I cant figure out a use case for this. What are you trying to do?
I'm  generating jnlps and then reading them and testing resoults of InformationElement - especially 
of descriptions and theirs kinds. It sounded to me like more typo-proof then write the descriptions 
again and again.
I agree that this is little bit in bad file. Unless you find it usefull, I have moved it to inner 
class in unittests.  to  just-for-testing descendants.

>
>>> Hm... is this code running with full privileges? Can it access the
>>> clipboard?
>>
>> it is funny, but this works both with signed and unsigned applets
>> (because of package
>> net.sourceforge.jnpl?).
>
> No, that wouldnt matter. I guess this code is always run without any
> non-jdk and non-icedtea-web code on the stack.

hmmm Can this be somehow harmful?
>
>> diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/SplashPanel.java
>> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
>> +++ b/netx/net/sourceforge/jnlp/splashscreen/SplashPanel.java	Wed Aug 01 13:25:15 2012 +0200
>> @@ -0,0 +1,124 @@
>
>> +public interface SplashPanel {
>
>> +    /**
>> +     * javaws should provide content of <information> tag. Those informations hould be passed by this method
>> +     */
>> +    public void setInformationElement(InformationElement content);
>
> You can leave out the comment here. It isn't helping. Perhaps it should
> be part of the InformationElement class?
done
>
>> +    public InformationElement getInformationContent();
>
> I guess you wanted to rename this to getInfomrationElement().

sorry for not do in last round. Done now.

>
>> +    /** Width of the plugin window */
>> +    public void setPluginWidth(int pluginWidth);
>> +
>> +    /** Height of the plugin window */
>> +    public void setPluginHeight(int pluginHeight);
>> +
>> +    /** Width of the plugin window */
>> +    public int getPluginWidth();
>> +
>> +    /** Height of the plugin window */
>> +    public int getPluginHeight();
>> +
>> +    public void adjustForSize();
>
> You said this was fixed, but I am not sure it is.
>
> First, why the 'plugin' in the names? Is getWidth/setWidth not sufficient?
>
nope - getwidth/height can overwrite the ones with same name in swing.
However i have renamed them to set/getSplashWidth/Height

> Why is adjustForSize a separate method. Why not just have a single
> method called setSize(int width, int height) that does the work of
> setPluginWidth, setPluginHeight and adjustForSize. Please understand I
> am only asking for this in the interface. The implementation is free to
> have a separate adjustForSize method.

This was of course my first idea. But then I came to cases when was better to setSize and then do 
something else and at the end recalcualte rest.
I got inspired by pack/validate.

>
>> +    /**
>> +     * Methods to start the animation in the splash panel.
>> +     *
>> +     * This method exits after starting a new thread to do the animation. It
>> +     * is synchronized to prevent multiple startAnimation threads from being created.
>
> This second paragraph sounds like implementation details leaking. Is
> there a reason the caller has to know about this?

Sure removed.
>
>> +     */
>> +    public void startAnimation();
>> +
>> +    /**
>> +     * Stops the animation
>> +     */
>> +    public void stopAnimation();
>
> This comment doesnt help. Please remove it :)
>
done

>> +    public void paint(Graphics g);
>> +
>> +    /**
>> +     * Decide wather to show icedtea-web plugin or just icedtea-web
>> +     * @param splashReason
>> +     */
>
> Please remove this. This is the details about the SplashReason class. It
> probably belongs in SplashReason.
done
>
>> +    public void setSplashReason(SplashReason splashReason);
>> +
>> +    SplashReason getSplashReason();
>
> public, please.
done

>
>> +    String getVersion();
>
> Will any callers need to read this after setting it?
hard to say. I'm used to have getter, unless there is  strong reason to not have. But I agree with 
you approach  of as thin interface as possible.
To thin interface can however cause hard testablity or adding of necessary methods later.
>
>> +    /**
>> +     * how mny percentage loaded  is shown in progress bar (if any)
>> +     * @param done
>> +     */
>> +    public void setPercentage(int done);
>
> Could you add the expected values the comment the? Something like:
> "@param done must be between 0 and 100, inclusive".
done
>
>> +    /**
>> +     * returns state of loading progress bar
>> +     * @return
>> +     */
>> +    public int getPercentage();
>
> I am still curious what object needs to read this. Maybe that object
> needs to talk to the controller instead of this view.
>
>> diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/SplashUtils.java
>> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
>> +++ b/netx/net/sourceforge/jnlp/splashscreen/SplashUtils.java	Wed Aug 01 13:25:15 2012 +0200
>
>> +public class SplashUtils {
>
>> +    public static void showError(Throwable ex, AppletEnvironment ae) {
>> +        if (ae == null) {
>> +            return;
>> +        }
>> +        SplashController p = ((SplashController) (ae.getAppletFrame()));
>
> I dont like this cast. It's not obvious. Maybe you can add a method
> called getSplashScreen to AppletEnvironment instead?

done, true, it was really not obvious.

>
>> +    static SplashPanel getSplashScreen(int width, int height, SplashUtils.SplashReason splashReason, Throwable loadingException, boolean isError) {
>
> Can't we figure out the value of isError based on loadingException being
> null or not?

No. I had this longer ago, but there was causes when no exception arrived. then I tought it is 
better to have some text with "no exception"  rather then to sent some dummy exception.

If you insists I can solve this by some custom exception which will just replace null-state and will 
be handled little bit differently in error dialogue.

>
>> +//            if ("circle".equals(splashEnvironmetVar)) {
>> +//                sp = new CircleSplashScreen(width, height, splashReason);
>> +//            }
>> +//            if ("dummy".equals(splashEnvironmetVar)) {
>> +//                sp = new DummySplashScreen(width, height, splashReason);
>> +//            }
>
>> +//            if ("circle".equals(pluginSplashEnvironmetVar)) {
>> +//                sp = new CircleSplashScreen(width, height, splashReason);
>> +//            }
>> +//            if ("dummy".equals(pluginSplashEnvironmetVar)) {
>> +//                sp = new DummySplashScreen(width, height, splashReason);
>> +//            }
>
> Please remove this.
Done:( Although I have hard heart leaving it out :((

>
>> +            if (DEFAULT.equals(pluginSplashEnvironmetVar)) {
>
> Do we really need to use environment variables for this?
We have already discuses this in original thread and we agree on this approach. (???or not??)
>
>> +        //if (sp==null)  sp=new DummySplashScreen(width, height,splashReason);
>> +        //if (sp==null)  sp=new CircleSplashScreen(width, height,splashReason);
>
> Please remove this too.

With deep sorrow..done
>
>
>> diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java
>> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
>> +++ b/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java	Wed Aug 01 13:25:15 2012 +0200
>
>> +    private Thread getMoovingTextThread() {
>
> Moving
sorry, done,

>
>> +        Thread tt = new Thread() {
>> +
>> +            @Override
>> +            public void run() {
>> +                while (master.isAnimationRunning()) {
>> +                    try {
>> +                        SwingUtilities.invokeAndWait(new Runnable() {
>> +                            @Override
>> +                            public void run() {
>> +                                animationsPosition += greyTextIncrment;
>> +                                if (animationsPosition > 10000) {
>> +                                    animationsPosition = 1;
>> +                                }
>
> Hey, magic numbers!

extracted to constants.
>
>> +                                // Force repaint
>> +                                master.repaint();
>> +                            }
>> +                        });
>> +                        Thread.sleep(150);
>> +                    } catch (Exception e) {
>> +                        e.printStackTrace();
>> +                    }
>> +                }
>> +            }
>> +        };
>> +        tt.setDaemon(true);
>> +        return tt;
>> +    }
>> +
>> +    private Thread getWatterLevelThread() {
>
> getWaterLevelThread.
sorry, yup

>
>> +        // Create a new thread to increment spinFactor and repaint
>> +        Thread t = new Thread() {
>> +
>> +            @Override
...;
>> +                    } catch (Exception e) {
>> +                        e.printStackTrace();
>> +                    }
>
extracted to constants.
> More magic numbers :(
>
>> +                }
>> +            }
>> +        };
>> +        t.setDaemon(true);
>> +        return t;
>> +    }
>> +
>> +    private String getAlternativeProduktName() {
>
> getAlternativeProductName()
>
> But I would prefer if this method was just getProductName() and would
> return the entire name.
>
>> +    public int getWaterLevel() {
>> +        return waterLevel;
>> +    }
>> +
>> +    public void setWaterLevel(int level) {
>> +        this.waterLevel = level;
>> +    }
>> +
>> +    public int getAnimationsPosition() {
>> +        return animationsPosition;
>> +    }
>
> What do these numbers (level and position) represent?

What they say - the rising water in letters and position of secondary animation (grey waiving text) 
:) -brm brm brm..animation? :D

>
>> diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainter.java
>> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
>> +++ b/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainter.java	Wed Aug 01 13:25:15 2012 +0200
>
>> +public final class ErrorPainter extends BasePainter {
>> +
>> +    //colors
>> +    private static final Color teaDeadColor = Color.darkGray;
>> +    private static final Color backgroundDeadColor = Color.gray;
...
>> +    private static final String errorScreamMessageKey = "SPLASH_ERROR";
>> +    private static final Color errorScreamColor = Color.red;
>
> Please not "scream".

->screem->fly ; uppercased
>
> Also, please use UPPER_CASE for constants.
>
>> +    //for clicking ot error message
>> +    private Point errorCorner = null;
>> +    private boolean errorIsScreamed = false;
>> +    private int errorScreamedPercentage = 100;
>> +
>> +    public static Color interpolColor(double origSize, double currentSize, Color from, Color to) {
>
> Should be named interpolateColor. Unless it is actually related to
> Interpol ;)

:DD I did not realized. Done.
>
>> +    private void interpoleColors(int origSize, int currentSize) {
>
> Likewise.
>
>> +    private Thread getErrorScreamThread() {
...
>> +                            canWave = false;
>> +                        }
>> +                    }
>
> There are lots of magic constants here :(
extracted to constants.
>
>> diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ImageFontCutter.java
>> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
>> +++ b/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ImageFontCutter.java	Wed Aug 01 13:25:15 2012 +0200
>
>> +public class ImageFontCutter {
>
> I still think the name is misleading. It renders text onto a graphics
> object using a clipped image rather than a solid color, right? How about
> renaming to TextOutlineRenderer?

Ugh. As you wish, faithfully renamed.
>
> Looking at how TextWithWaterLevel uses this, it looks a bit muddled.
> Though after staring at it for a while, it is starting to make a lot of
> sense.
>
> My recommendation is to not extend this class in TextWithWaterLevel (or
> any other place where this is used). Use composition rather than
> inheritance.
nnnnnnn:(( If it is recommendation -  can you live with inheritance?
>
>> +    public ImageFontCutter(Font f, String s, Color textOutline) {
>
> s/textOutline/outlineColor/
>
>> +    /**
>> +     * @return the textOutline
>> +     */
>
> The javadoc is meaning to the caller. textOutline is not public.
>
>> +    public Color getTextOutline() {
>> +        return textOutline;
>> +    }
>> +
>> +    /**
>> +     * @param textOutline the textOutline to set
>> +     */
>
> Same here; the javadoc is meaningless.

ok.
>
>> +    public void setTextOutline(Color textOutline) {
>> +        this.textOutline = textOutline;
>> +    }
>> +
>
>> diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/parts/InfoItem.java
>> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
>> +++ b/netx/net/sourceforge/jnlp/splashscreen/parts/InfoItem.java	Wed Aug 01 13:25:15 2012 +0200
>
>> +/**
>> + *The optional kind="splash" attribute may be used in an icon element to indicate that the image is to be used as a "splash" screen during the launch of an application. If the JNLP file does not contain an icon element with kind="splash" attribute, Java Web Start will construct a splash screen using other items from the information Element.
>> + *If the JNLP file does not contain any icon images, the splash image will consist of the application's title and vendor, as taken from the JNLP file.
>> + *
>> + * items not used inside
>> + */
>
> Maybe wrap this to 80 chars or so?

Arg. Sure. Sorry for not to do in last round.
>
>
>> diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/parts/InformationElement.java
>> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
>> +++ b/netx/net/sourceforge/jnlp/splashscreen/parts/InformationElement.java	Wed Aug 01 13:25:15 2012 +0200
>
>> +/**
>> +http://docs.oracle.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html
>> + */
>
> If you really want to use everything from the link why not use
> InformationDesc?
>
>> diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java
>> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
...
>> +        s.append(t);
>> +        s.append("</body></html>");
>> +        return s.toString();
>
> Just a heads up. This is probably not going to work out too well for
> i18n. It may be other languages would read much better with reordered
> text and building strings using + doesn't allow us to do that. Can you,
> perhaps, use a single string for one message?

Nice catch :) Fixed.
>
> Thanks,
> Omair
>

-------------- next part --------------
diff -r 01544fb82384 Makefile.am
--- a/Makefile.am	Wed Jul 11 16:18:58 2012 +0200
+++ b/Makefile.am	Tue Aug 07 10:38:13 2012 +0200
@@ -174,6 +174,7 @@
 edit_launcher_script = sed \
   -e 's|[@]LAUNCHER_BOOTCLASSPATH[@]|$(LAUNCHER_BOOTCLASSPATH)|g' \
   -e 's|[@]JAVAWS_BIN_LOCATION[@]|$(bindir)/$(javaws)|g' \
+  -e 's|[@]JAVAWS_SPLASH_LOCATION[@]|$(datadir)/$(PACKAGE_NAME)/javaws_splash.png|g' \
   -e 's|[@]ITWEB_SETTINGS_BIN_LOCATION[@]|$(bindir)/$(itweb_settings)|g' \
   -e 's|[@]JAVA[@]|$(JAVA)|g' \
   -e 's|[@]JRE[@]|$(SYSTEM_JRE_DIR)|g'
@@ -204,6 +205,7 @@
 	${INSTALL_DATA} $(abs_top_builddir)/liveconnect/lib/classes.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar
 endif
 	${INSTALL_DATA} $(NETX_DIR)/lib/classes.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar
+	${INSTALL_DATA} $(NETX_SRCDIR)/javaws_splash.png $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/javaws_splash.png
 	${INSTALL_PROGRAM} launcher.build/$(javaws) $(DESTDIR)$(bindir)
 	${INSTALL_DATA} extra-lib/about.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/about.jar
 	${INSTALL_PROGRAM} launcher.build/$(itweb_settings) $(DESTDIR)$(bindir)
diff -r 01544fb82384 NEWS
--- a/NEWS	Wed Jul 11 16:18:58 2012 +0200
+++ b/NEWS	Tue Aug 07 10:38:13 2012 +0200
@@ -9,6 +9,7 @@
 CVE-XXXX-YYYY: http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY
 
 New in release 1.3 (2012-XX-XX):
+* Splash screen for javaws and plugin
 * NetX
   - PR898: signed applications with big jnlp-file doesn't start (webstart affect like "frozen")
   - PR811: javaws is not handling urls with spaces (and other characters needing encoding) correctly
diff -r 01544fb82384 launcher/javaws.in
--- a/launcher/javaws.in	Wed Jul 11 16:18:58 2012 +0200
+++ b/launcher/javaws.in	Tue Aug 07 10:38:13 2012 +0200
@@ -5,6 +5,7 @@
 LAUNCHER_FLAGS=-Xms8m
 CLASSNAME=net.sourceforge.jnlp.runtime.Boot
 BINARY_LOCATION=@JAVAWS_BIN_LOCATION@
+SPLASH_LOCATION=@JAVAWS_SPLASH_LOCATION@
 PROGRAM_NAME=javaws
 CP=@JRE@/lib/rt.jar
 
@@ -15,6 +16,10 @@
 i=0
 j=0
 
+SPLASH="false"
+if [ "x$ICEDTEA_WEB_SPLASH" = "x" ] ; then
+SPLASH="true"
+fi;
 while [ "$#" -gt "0" ]; do
   case "$1" in
     -J*)
@@ -24,6 +29,9 @@
     *)
       ARGS[$j]="$1"
       j=$((j+1))
+      if [ "$1" = "-headless" ] ; then
+        SPLASH="false"
+      fi
       ;;
   esac
   shift
@@ -32,6 +40,10 @@
 k=0
 COMMAND[k]="${JAVA}"
 k=$((k+1))
+if [ "$SPLASH" = "true" ] ; then
+COMMAND[k]="-splash:${SPLASH_LOCATION}"
+k=$((k+1))
+fi;
 COMMAND[k]="${LAUNCHER_BOOTCLASSPATH}"
 k=$((k+1))
 COMMAND[k]="${LAUNCHER_FLAGS}"
diff -r 01544fb82384 netx/javaws_splash.png
Binary file netx/javaws_splash.png has changed
diff -r 01544fb82384 netx/net/sourceforge/jnlp/GuiLaunchHandler.java
--- a/netx/net/sourceforge/jnlp/GuiLaunchHandler.java	Wed Jul 11 16:18:58 2012 +0200
+++ b/netx/net/sourceforge/jnlp/GuiLaunchHandler.java	Tue Aug 07 10:38:13 2012 +0200
@@ -1,5 +1,5 @@
 /* GuiLaunchHandler.java
-   Copyright (C) 2011 Red Hat, Inc.
+   Copyright (C) 2012 Red Hat, Inc.
 
 This file is part of IcedTea.
 
@@ -54,7 +54,7 @@
  */
 public class GuiLaunchHandler extends AbstractLaunchHandler {
 
-    private JNLPSplashScreen splashScreen = null;
+    private volatile JNLPSplashScreen splashScreen = null;
     private final Object mutex = new Object();
     private UpdatePolicy policy = UpdatePolicy.ALWAYS;
 
@@ -80,10 +80,13 @@
     }
 
     private void closeSplashScreen() {
-        synchronized(mutex) {
+        synchronized (mutex) {
             if (splashScreen != null) {
                 if (splashScreen.isSplashScreenValid()) {
                     splashScreen.setVisible(false);
+                    if (splashScreen.isCustomSplashscreen()) {
+                        splashScreen.stopAnimation();
+                    }
                 }
                 splashScreen.dispose();
             }
@@ -102,40 +105,56 @@
 
     @Override
     public void launchInitialized(final JNLPFile file) {
-        
+
         int preferredWidth = 500;
         int preferredHeight = 400;
 
         final URL splashImageURL = file.getInformation().getIconLocation(
                 IconDesc.SPLASH, preferredWidth, preferredHeight);
 
+        final ResourceTracker resourceTracker = new ResourceTracker(true);
         if (splashImageURL != null) {
-            final ResourceTracker resourceTracker = new ResourceTracker(true);
             resourceTracker.addResource(splashImageURL, file.getFileVersion(), null, policy);
-            synchronized(mutex) {
-                try {
-                    SwingUtilities.invokeAndWait(new Runnable() {
-                        @Override
-                        public void run() {
-                            splashScreen = new JNLPSplashScreen(resourceTracker, null, null);
-                        }
-                    });
-                } catch (InterruptedException ie) {
-                    // Wait till splash screen is created
-                    while (splashScreen == null);
-                } catch (InvocationTargetException ite) {
-                    ite.printStackTrace();
-                }
+        }
+        synchronized (mutex) {
+            try {
+                SwingUtilities.invokeAndWait(new Runnable() {
 
-                splashScreen.setSplashImageURL(splashImageURL);
+                    @Override
+                    public void run() {
+                        splashScreen = new JNLPSplashScreen(resourceTracker, file);
+                    }
+                });
+            } catch (InterruptedException ie) {
+                // Wait till splash screen is created
+                while (splashScreen == null);
+            } catch (InvocationTargetException ite) {
+                ite.printStackTrace();
             }
+            try {
+                SwingUtilities.invokeAndWait(new Runnable() {
+
+                    @Override
+                    public void run() {
+                        splashScreen.setSplashImageURL(splashImageURL);
+                    }
+                });
+            } catch (InterruptedException ie) {
+                // Wait till splash screen is created
+                while (splashScreen == null);
+            } catch (InvocationTargetException ite) {
+                ite.printStackTrace();
+            }
+
+
         }
-        
+
         SwingUtilities.invokeLater(new Runnable() {
+
             @Override
             public void run() {
-                if (splashImageURL != null) {
-                    synchronized(mutex) {
+                if (splashScreen != null) {
+                    synchronized (mutex) {
                         if (splashScreen.isSplashScreenValid()) {
                             splashScreen.setVisible(true);
                         }
diff -r 01544fb82384 netx/net/sourceforge/jnlp/InformationDesc.java
--- a/netx/net/sourceforge/jnlp/InformationDesc.java	Wed Jul 11 16:18:58 2012 +0200
+++ b/netx/net/sourceforge/jnlp/InformationDesc.java	Tue Aug 07 10:38:13 2012 +0200
@@ -34,7 +34,8 @@
     // specification name.
 
     /** one-line description */
-    public static final Object ONE_LINE = "oneline";
+    /**http://docs.oracle.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html**/
+    public static final Object ONE_LINE = "one-line";
 
     /** short description */
     public static final Object SHORT = "short";
@@ -110,13 +111,24 @@
      * Information.TOOLTIP, Information.DEFAULT
      */
     public String getDescription(Object kind) {
-        String result = (String) getItem("description-" + kind);
+        String result = getDescriptionStrict(kind);
         if (result == null)
             return (String) getItem("description-" + DEFAULT);
         else
             return result;
     }
 
+      /**
+     * Returns the application's description of the specified type.
+     *
+     * @param kind one of Information.SHORT, Information.ONE_LINE,
+     * Information.TOOLTIP, Information.DEFAULT
+     */
+    public String getDescriptionStrict(Object kind) {
+        return (String) getItem("description-" + kind);
+        
+    }
+
     /**
      * Returns the icons specified by the JNLP file.
      *
diff -r 01544fb82384 netx/net/sourceforge/jnlp/JNLPSplashScreen.java
--- a/netx/net/sourceforge/jnlp/JNLPSplashScreen.java	Wed Jul 11 16:18:58 2012 +0200
+++ b/netx/net/sourceforge/jnlp/JNLPSplashScreen.java	Tue Aug 07 10:38:13 2012 +0200
@@ -1,5 +1,43 @@
+/* JNLPSplashScreen.java
+   Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
 package net.sourceforge.jnlp;
 
+import java.awt.BorderLayout;
 import java.awt.Dimension;
 import java.awt.Graphics;
 import java.awt.Graphics2D;
@@ -15,19 +53,23 @@
 import net.sourceforge.jnlp.cache.ResourceTracker;
 import net.sourceforge.jnlp.runtime.JNLPRuntime;
 import net.sourceforge.jnlp.util.ImageResources;
+import net.sourceforge.jnlp.splashscreen.SplashPanel;
+import net.sourceforge.jnlp.splashscreen.SplashUtils;
+import net.sourceforge.jnlp.splashscreen.parts.InformationElement;
 
 public class JNLPSplashScreen extends JDialog {
 
-    String applicationTitle;
-    String applicationVendor;
 
     ResourceTracker resourceTracker;
 
     URL splashImageUrl;
     Image splashImage;
+    private final JNLPFile file;
+    public static final  int DEF_WIDTH=635;
+    public static final  int DEF_HEIGHT=480;
+    private SplashPanel componetSplash;
 
-    public JNLPSplashScreen(ResourceTracker resourceTracker,
-            String applicationTitle, String applicationVendor) {
+    public JNLPSplashScreen(ResourceTracker resourceTracker, final JNLPFile file) {
 
         setIconImages(ImageResources.INSTANCE.getApplicationImages());
 
@@ -36,61 +78,82 @@
         // JNLP file.
 
         this.resourceTracker = resourceTracker;
-        this.applicationTitle = applicationTitle;
-        this.applicationVendor = applicationVendor;
+        this.file=file;
 
     }
 
     public void setSplashImageURL(URL url) {
-        splashImageUrl = url;
-        splashImage = null;
-        try {
-            splashImage = ImageIO.read(resourceTracker
-                    .getCacheFile(splashImageUrl));
-            if (splashImage == null) {
+        if (url != null) {
+            splashImageUrl = url;
+            splashImage = null;
+            try {
+                splashImage = ImageIO.read(resourceTracker.getCacheFile(splashImageUrl));
+                if (splashImage == null) {
+                    if (JNLPRuntime.isDebug()) {
+                        System.err.println("Error loading splash image: " + url);
+                    }
+
+                }
+            } catch (IOException e) {
                 if (JNLPRuntime.isDebug()) {
                     System.err.println("Error loading splash image: " + url);
                 }
-                return;
+                splashImage = null;
+
+            } catch (IllegalArgumentException argumentException) {
+                if (JNLPRuntime.isDebug()) {
+                    System.err.println("Error loading splash image: " + url);
+                }
+                splashImage = null;
+
             }
-        } catch (IOException e) {
-            if (JNLPRuntime.isDebug()) {
-                System.err.println("Error loading splash image: " + url);
-            }
-            splashImage = null;
-            return;
-        } catch (IllegalArgumentException argumentException) {
-            if (JNLPRuntime.isDebug()) {
-                System.err.println("Error loading splash image: " + url);
-            }
-            splashImage = null;
-            return;
         }
 
+        if (splashImage == null) {
+            this.setLayout(new BorderLayout());
+            SplashPanel splash = SplashUtils.getSplashScreen(DEF_WIDTH, DEF_HEIGHT);
+            if (splash != null) {
+                splash.startAnimation();
+                splash.setInformationElement(InformationElement.createFromJNLP(file));
+                this.add(splash.getSplashComponent());
+                this.componetSplash = splash;
+            }
+        }
         correctSize();
     }
 
     public boolean isSplashScreenValid() {
-        return (splashImage != null);
+        return (splashImage != null) || (componetSplash != null);
+
     }
 
     private void correctSize() {
+        int minimumWidth = DEF_WIDTH;
+        int minimumHeight = DEF_HEIGHT;
+        if (splashImage != null) {
+            Insets insets = getInsets();
+            minimumWidth = splashImage.getWidth(null) + insets.left
+                    + insets.right;
+            minimumHeight = splashImage.getHeight(null) + insets.top
+                    + insets.bottom;
+        }
+        setMinimumSize(new Dimension(0, 0));
+        setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
+        setSize(new Dimension(minimumWidth, minimumHeight));
+        setPreferredSize(new Dimension(minimumWidth, minimumHeight));
 
-        Insets insets = getInsets();
-        int minimumWidth = splashImage.getWidth(null) + insets.left
-                + insets.right;
-        int minimumHeight = splashImage.getHeight(null) + insets.top
-                + insets.bottom;
-        setMinimumSize(new Dimension(minimumWidth, minimumHeight));
-
-        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
-        setLocation((screenSize.width - minimumWidth) / 2,
-                (screenSize.height - minimumHeight) / 2);
+        // Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
+        // setLocation((screenSize.width - minimumWidth) / 2,
+        // (screenSize.height - minimumHeight) / 2);
+        //Above works always, but center only to middle of all monitors
+        //below works on 1.4 and higher, and center to middle of primary monmtor
+        setLocationRelativeTo(null);
     }
 
     @Override
     public void paint(Graphics g) {
         if (splashImage == null) {
+            super.paint(g);
             return;
         }
 
@@ -99,4 +162,12 @@
         g2.drawImage(splashImage, getInsets().left, getInsets().top, null);
 
     }
+
+    boolean isCustomSplashscreen() {
+       return (componetSplash!=null);
+    }
+
+    void stopAnimation() {
+        if (isCustomSplashscreen()) componetSplash.stopAnimation();
+    }
 }
diff -r 01544fb82384 netx/net/sourceforge/jnlp/Launcher.java
--- a/netx/net/sourceforge/jnlp/Launcher.java	Wed Jul 11 16:18:58 2012 +0200
+++ b/netx/net/sourceforge/jnlp/Launcher.java	Tue Aug 07 10:38:13 2012 +0200
@@ -20,6 +20,7 @@
 
 import java.applet.Applet;
 import java.awt.Container;
+import java.awt.SplashScreen;
 import java.io.File;
 import java.lang.reflect.Method;
 import java.net.InetAddress;
@@ -42,6 +43,8 @@
 
 import javax.swing.SwingUtilities;
 import javax.swing.text.html.parser.ParserDelegator;
+import net.sourceforge.jnlp.runtime.AppletEnvironment;
+import net.sourceforge.jnlp.splashscreen.SplashUtils;
 
 import sun.awt.SunToolkit;
 
@@ -540,6 +543,12 @@
             }
 
             if (JNLPRuntime.getForksAllowed() && file.needsNewVM()) {
+                if (!JNLPRuntime.isHeadless()){
+                    SplashScreen sp = SplashScreen.getSplashScreen();
+                    if (sp!=null) {
+                        sp.close();
+                    }
+                }
                 List<String> netxArguments = new LinkedList<String>();
                 netxArguments.add("-Xnofork");
                 netxArguments.addAll(JNLPRuntime.getInitialArguments());
@@ -649,18 +658,22 @@
      * @param enableCodeBase whether to add the codebase URL to the classloader
      */
     protected ApplicationInstance launchApplet(JNLPFile file, boolean enableCodeBase, Container cont) throws LaunchException {
-        if (!file.isApplet())
+        if (!file.isApplet()) {
             throw launchError(new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LNotApplet"), R("LNotAppletInfo")));
+        }
 
+        AppletInstance applet = null;
         try {
-            AppletInstance applet = createApplet(file, enableCodeBase, cont);
+            applet = createApplet(file, enableCodeBase, cont);
             applet.initialize();
 
             applet.getAppletEnvironment().startApplet(); // this should be a direct call to applet instance
             return applet;
         } catch (LaunchException lex) {
+            SplashUtils.showErrorCaught(lex, applet);
             throw launchError(lex);
         } catch (Exception ex) {
+            SplashUtils.showErrorCaught(ex, applet);
             throw launchError(new LaunchException(file, ex, R("LSFatal"), R("LCLaunching"), R("LCouldNotLaunch"), R("LCouldNotLaunchInfo")));
         }
     }
@@ -669,16 +682,19 @@
      * Gets an ApplicationInstance, but does not launch the applet.
      */
     protected ApplicationInstance getApplet(JNLPFile file, boolean enableCodeBase, Container cont) throws LaunchException {
-        if (!file.isApplet())
+        if (!file.isApplet()) {
             throw launchError(new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LNotApplet"), R("LNotAppletInfo")));
-
+        }
+        AppletInstance applet = null;
         try {
-            AppletInstance applet = createApplet(file, enableCodeBase, cont);
+            applet = createApplet(file, enableCodeBase, cont);
             applet.initialize();
             return applet;
         } catch (LaunchException lex) {
+            SplashUtils.showErrorCaught(lex, applet);
             throw launchError(lex);
         } catch (Exception ex) {
+            SplashUtils.showErrorCaught(ex, applet);
             throw launchError(new LaunchException(file, ex, R("LSFatal"), R("LCLaunching"), R("LCouldNotLaunch"), R("LCouldNotLaunchInfo")));
         }
     }
@@ -696,22 +712,30 @@
      *
      * @param enableCodeBase whether to add the code base URL to the classloader
      */
-    protected AppletInstance createApplet(JNLPFile file, boolean enableCodeBase, Container cont) throws LaunchException {
+    protected  synchronized  AppletInstance createApplet(JNLPFile file, boolean enableCodeBase, Container cont) throws LaunchException {
+            // appletInstance is needed by ServiceManager when looking up
+            // services. This could potentially be done in applet constructor
+            // so initialize appletInstance before creating applet.
+        AppletInstance appletInstance = null;
+        ThreadGroup group = Thread.currentThread().getThreadGroup();
         try {
             JNLPClassLoader loader = JNLPClassLoader.getInstance(file, updatePolicy);
 
             if (enableCodeBase) {
                 loader.enableCodeBase();
             } else if (file.getResources().getJARs().length == 0) {
-                throw new ClassNotFoundException("Can't do a codebase look up and there are no jars. Failing sooner rather than later");
+                Exception ex = new ClassNotFoundException("Can't do a codebase look up and there are no jars. Failing sooner rather than later");
+                try {
+                    SplashUtils.showError(ex, new AppletEnvironment(file, new AppletInstance(file, group, new ClassLoader() {
+                    }, null)));
+                } catch (Exception exx) {
+                    if (JNLPRuntime.isDebug()) {
+                        exx.printStackTrace();
+                    }
+                }
+                throw ex;
             }
 
-            ThreadGroup group = Thread.currentThread().getThreadGroup();
-
-            // appletInstance is needed by ServiceManager when looking up 
-            // services. This could potentially be done in applet constructor
-            // so initialize appletInstance before creating applet.
-            AppletInstance appletInstance;
             if (cont == null)
                 appletInstance = new AppletInstance(file, group, loader, null);
             else
@@ -732,6 +756,7 @@
 
             return appletInstance;
         } catch (Exception ex) {
+            SplashUtils.showErrorCaught(ex, appletInstance);
             throw launchError(new LaunchException(file, ex, R("LSFatal"), R("LCInit"), R("LInitApplet"), R("LInitAppletInfo")));
         }
     }
@@ -842,7 +867,7 @@
         new ParserDelegator();
     }
 
-    /**
+       /**
      * This runnable is used to call the appropriate launch method
      * for the application, applet, or installer in its thread group.
      */
diff -r 01544fb82384 netx/net/sourceforge/jnlp/NetxPanel.java
--- a/netx/net/sourceforge/jnlp/NetxPanel.java	Wed Jul 11 16:18:58 2012 +0200
+++ b/netx/net/sourceforge/jnlp/NetxPanel.java	Tue Aug 07 10:38:13 2012 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007 Red Hat, Inc.
+ * Copyright 2012 Red Hat, Inc.
  * This file is part of IcedTea, http://icedtea.classpath.org
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -22,7 +22,6 @@
 
 package net.sourceforge.jnlp;
 
-import net.sourceforge.jnlp.AppletLog;
 import net.sourceforge.jnlp.runtime.AppletInstance;
 import net.sourceforge.jnlp.runtime.JNLPRuntime;
 
@@ -32,6 +31,8 @@
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
+import net.sourceforge.jnlp.splashscreen.SplashController;
+import net.sourceforge.jnlp.splashscreen.SplashPanel;
 
 import sun.applet.AppletViewerPanel;
 import sun.awt.SunToolkit;
@@ -42,10 +43,11 @@
  *
  * @author      Francis Kung <fkung at redhat.com>
  */
-public class NetxPanel extends AppletViewerPanel {
+public class NetxPanel extends AppletViewerPanel implements SplashController {
     private PluginBridge bridge = null;
     private boolean exitOnFailure = true;
     private AppletInstance appInst = null;
+    private SplashController appletViewerFrame;
     private boolean appletAlive;
     private final String uKey;
 
@@ -232,4 +234,32 @@
             SunToolkit.createNewAppContext();
         }
     }
+
+    
+   
+
+    public void setAppletViewerFrame(SplashController framePanel) {
+        appletViewerFrame=framePanel;
+    }
+
+    @Override
+    public void removeSplash() {
+        appletViewerFrame.removeSplash();
+    }
+
+    @Override
+    public void replaceSplash(SplashPanel r) {
+        appletViewerFrame.replaceSplash(r);
+    }
+
+    @Override
+    public int getSplashWidth() {
+        return appletViewerFrame.getSplashWidth();
+    }
+
+    @Override
+    public int getSplashHeigth() {
+        return appletViewerFrame.getSplashHeigth();
+    }
+
 }
diff -r 01544fb82384 netx/net/sourceforge/jnlp/resources/Messages.properties
--- a/netx/net/sourceforge/jnlp/resources/Messages.properties	Wed Jul 11 16:18:58 2012 +0200
+++ b/netx/net/sourceforge/jnlp/resources/Messages.properties	Tue Aug 07 10:38:13 2012 +0200
@@ -438,3 +438,27 @@
 CLInfoDescription=Shows more information about the given property
 CLCheckDescription=Shows any properties that have been defined but are not recognized by IcedTea Web
 CLHelpDescription=The itweb-settings tool allows a user to modify, view and check configuration. \nTo use the GUI, do not pass any arguments. To use the CLI mode, pass in the approrpiate command and parameters. For help with a particular command, try: {0} command help
+
+#  splash screen related
+SPLASHerror = Click here for details. Serious exception occcured.
+SPLASH_ERROR = ERROR
+SPLASHtitle = Title
+SPLASHvendor = Vendor
+SPLASHhomepage = Homepage
+SPLASHdescription = Description
+SPLASHClose= Close
+SPLASHclosewAndCopyException = Close and copy StackTrace to clipboard
+SPLASHexOccured = Sorry, an serious exception have occured...
+SPLASHHome = Home
+SPLASHcantCopyEx = Can not copy exception
+SPLASHnoExRecorded = No exception recorded
+SPLASHmainL1 = For even more  inforamtion you can visit {0} and follow the steps to obtain information and fill bug
+SPLASHurl = http://icedtea.classpath.org/wiki/IcedTea-Web#Filing_bugs
+SPLASHurlLooks = http://icedtea.classpath.org/wiki/IcedTea-Web
+SPLASHmainL3 = Sorry no more informations avaiable, try to launch browser from commandline and watch output.
+SPLASHcloseAndCopyShorter = Close and copy to clipboard
+SPLASHmainL4 = We have noticed exception written below, for even more information try to launch browser from commandline and watch output
+SPLASHexWas = Exception was:
+SPLASHcfl = Can't follow link to
+SPLASHvendorsInfo = Information from vendor of your application
+SPLASHanotherInfo = Another avaiable info
\ No newline at end of file
diff -r 01544fb82384 netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java
--- a/netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java	Wed Jul 11 16:18:58 2012 +0200
+++ b/netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java	Tue Aug 07 10:38:13 2012 +0200
@@ -27,6 +27,7 @@
 import javax.swing.*;
 
 import net.sourceforge.jnlp.*;
+import net.sourceforge.jnlp.splashscreen.SplashController;
 import net.sourceforge.jnlp.util.*;
 
 /**
@@ -130,6 +131,15 @@
         return cont;
     }
 
+     /**
+     * Returns the frame that contains the applet.  Disposing this
+     * frame will destroy the applet.
+     */
+    public SplashController getSplashControler() {
+        // TODO: rename this method to getAppletContainer ?
+        return (SplashController)cont;
+    }
+
     /**
      * Initialize, start, and show the applet.
      */
diff -r 01544fb82384 netx/net/sourceforge/jnlp/runtime/Boot.java
--- a/netx/net/sourceforge/jnlp/runtime/Boot.java	Wed Jul 11 16:18:58 2012 +0200
+++ b/netx/net/sourceforge/jnlp/runtime/Boot.java	Tue Aug 07 10:38:13 2012 +0200
@@ -53,8 +53,8 @@
     // todo: decide whether a spawned netx (external launch)
     // should inherit the same options as this instance (store argv?)
 
-    private static final String name = Boot.class.getPackage().getImplementationTitle();
-    private static final String version = Boot.class.getPackage().getImplementationVersion();
+    public static final String name = Boot.class.getPackage().getImplementationTitle();
+    public static final String version = Boot.class.getPackage().getImplementationVersion();
 
     /** the text to display before launching the about link */
     private static final String aboutMessage = ""
diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/SplashController.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/splashscreen/SplashController.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,48 @@
+/* SplashController.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen;
+
+public interface SplashController {
+
+    public void removeSplash();
+
+    public void replaceSplash(SplashPanel r);
+
+    public int getSplashWidth();
+
+    public int getSplashHeigth();
+}
diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/SplashErrorPanel.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/splashscreen/SplashErrorPanel.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,47 @@
+/* SplashErrorPanel.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen;
+
+public interface SplashErrorPanel extends SplashPanel {
+
+    /**
+     * When applet loading fails, then dying stacktrace can be set, and is then shown to user on demand.
+     */
+    public Throwable getLoadingException();
+
+    public void setLoadingException(Throwable loadingException);
+}
diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/SplashPanel.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/splashscreen/SplashPanel.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,115 @@
+/* SplashPanel.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen;
+
+import java.awt.Graphics;
+import java.awt.event.ComponentListener;
+
+import javax.swing.JComponent;
+import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason;
+import net.sourceforge.jnlp.splashscreen.parts.InformationElement;
+
+public interface SplashPanel {
+
+    /**
+     * The plugin splashscreens must be placed into another containers,
+     * So must return themselves as JComponent.
+     * Mostly your SplashScreen will extend some JComponent, so this method will
+     * just return "this"
+     */
+    public JComponent getSplashComponent();
+
+  
+    public void setInformationElement(InformationElement content);
+
+    public InformationElement getInformationElement();
+
+    /** Width of the plugin window */
+    public void setSplashWidth(int pluginWidth);
+
+    /** Height of the plugin window */
+    public void setSplashHeight(int pluginHeight);
+
+    /** Width of the plugin window */
+    public int getSplashWidth();
+
+    /** Height of the plugin window */
+    public int getSplashHeight();
+
+    public void adjustForSize();
+
+    // Add a new listener for resizes
+    public void addComponentListener(ComponentListener cl);
+
+    public boolean isAnimationRunning();
+
+    /**
+     * Methods to start the animation in the splash panel.
+     *
+     * This method exits after starting a new thread to do the animation. It
+     * is synchronized to prevent multiple startAnimation threads from being created.
+     */
+    public void startAnimation();
+
+    public void stopAnimation();
+
+    void paintTo(Graphics g);
+
+    public void setSplashReason(SplashReason splashReason);
+
+    public SplashReason getSplashReason();
+
+    /**
+     * Version can be printed in splash window
+     * @param version
+     */
+    public void setVersion(String version);
+
+    String getVersion();
+
+    /**
+     * how mny percentage loaded  is shown in progress bar (if any)
+     * @param done - should be in 0-100 inclusinve
+     */
+    public void setPercentage(int done);
+
+    /**
+     * returns state of loading progress bar
+     * @return percentage showed in possible progress bar  - should be in 0-100
+     */
+    public int getPercentage();
+}
diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/SplashUtils.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/splashscreen/SplashUtils.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,212 @@
+/* SplashUtils.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen;
+
+import net.sourceforge.jnlp.runtime.AppletEnvironment;
+import net.sourceforge.jnlp.runtime.AppletInstance;
+import net.sourceforge.jnlp.runtime.Boot;
+import net.sourceforge.jnlp.runtime.JNLPRuntime;
+import net.sourceforge.jnlp.splashscreen.impls.*;
+
+public class SplashUtils {
+
+    static final String ICEDTEA_WEB_PLUGIN_SPLASH = "ICEDTEA_WEB_PLUGIN_SPLASH";
+    static final String ICEDTEA_WEB_SPLASH = "ICEDTEA_WEB_SPLASH";
+    static final String NONE = "none";
+    static final String DEFAULT = "default";
+
+
+    /**
+     *
+     * Indicator whether to show icedtea-web plugin or just icedtea-web
+     * For "just icedtea-web" will be done  an attempt to show content of
+     * information element 
+     *
+     */
+    public static enum SplashReason {
+
+        APPLET, JAVAWS;
+
+        @Override
+        public String toString() {
+            switch (this) {
+                case APPLET:
+                    return "IcedTea-Web Plugin";
+                case JAVAWS:
+                    return "IcedTea-Web";
+            }
+            return "unknown";
+        }
+    }
+
+    public static void showErrorCaught(Throwable ex, AppletInstance appletInstance) {
+        try {
+            showError(ex, appletInstance);
+        } catch (Throwable t) {
+            if (JNLPRuntime.isDebug()) {
+                // prinitng this exception is discutable. I have let it in for case that
+                //some retyping will fail
+                t.printStackTrace();
+            }
+        }
+    }
+
+    public static void showError(Throwable ex, AppletInstance appletInstance) {
+        if (appletInstance == null) {
+            return;
+        }
+        AppletEnvironment ae = appletInstance.getAppletEnvironment();
+        showError(ex, ae);
+    }
+
+    public static void showError(Throwable ex, AppletEnvironment ae) {
+        if (ae == null) {
+            return;
+        }
+        SplashController p = ae.getSplashControler();
+        showError(ex, p);
+    }
+
+    public static void showError(Throwable ex, SplashController f) {
+        if (f == null) {
+            return;
+        }
+
+        f.replaceSplash(getErrorSplashScreen(f.getSplashWidth(), f.getSplashHeigth(), ex));
+    }
+
+    
+    private static SplashReason getReason() {
+        if (JNLPRuntime.isWebstartApplication()){
+            return SplashReason.JAVAWS;
+        }else{
+            return SplashReason.APPLET;
+        }
+        
+    }
+    
+
+    /**
+     * Warrning - splash should have recieve width and height without borders.
+     * plugin's window have NO border, but javaws window HAVE border. This msut be calcualted prior calling this method
+     * @param width
+     * @param height
+     * @return
+     */
+    public static SplashPanel getSplashScreen(int width, int height) {
+        return getSplashScreen(width, height, getReason());
+    }
+
+    /**
+     * Warrning - splash should have recieve width and height without borders.
+     * plugin's window have NO border, but javaws window HAVE border. This msut be calcualted prior calling this method
+     * @param width
+     * @param height
+     * @param  ex - exception to be shown if any
+     * @return
+     */
+    public static SplashErrorPanel getErrorSplashScreen(int width, int height, Throwable ex) {
+        return getErrorSplashScreen(width, height, getReason(), ex);
+    }
+
+    /**
+     * Warrning - splash should have recieve width and height without borders.
+     * plugin's window have NO border, but javaws window HAVE border. This msut be calcualted prior calling this method
+     * @param width
+     * @param height
+     * @param splashReason
+     * @return
+     */
+    static SplashPanel getSplashScreen(int width, int height, SplashUtils.SplashReason splashReason) {
+        return getSplashScreen(width, height, splashReason, null, false);
+    }
+
+    /**
+     * Warrning - splash should have recieve width and height without borders.
+     * plugin's window have NO border, but javaws window HAVE border. This msut be calcualted prior calling this method
+     * @param width
+     * @param height
+     * @param splashReason
+     * @return
+     */
+    static SplashErrorPanel getErrorSplashScreen(int width, int height, SplashUtils.SplashReason splashReason, Throwable ex) {
+        return (SplashErrorPanel) getSplashScreen(width, height, splashReason, ex, true);
+    }
+
+    static SplashPanel getSplashScreen(int width, int height, SplashUtils.SplashReason splashReason, Throwable loadingException, boolean isError) {
+        String splashEnvironmetVar = null;
+        String pluginSplashEnvironmetVar = null;
+        try {
+            pluginSplashEnvironmetVar = System.getenv(ICEDTEA_WEB_PLUGIN_SPLASH);
+            splashEnvironmetVar = System.getenv(ICEDTEA_WEB_SPLASH);
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+        SplashPanel sp = null;
+        if (SplashReason.JAVAWS.equals(splashReason)) {
+            if (NONE.equals(splashEnvironmetVar)) {
+                return null;
+            }
+            if (DEFAULT.equals(splashEnvironmetVar)) {
+                if (isError) {
+                    sp = new DefaultErrorSplashScreen2012(width, height, splashReason, loadingException);
+                } else {
+                    sp = new DefaultSplashScreen2012(width, height, splashReason);
+                }
+            }
+        }
+        if (SplashReason.APPLET.equals(splashReason)) {
+            if (NONE.equals(pluginSplashEnvironmetVar)) {
+                return null;
+            }
+            if (DEFAULT.equals(pluginSplashEnvironmetVar)) {
+                if (isError) {
+                    sp = new DefaultErrorSplashScreen2012(width, height, splashReason, loadingException);
+                } else {
+                    sp = new DefaultSplashScreen2012(width, height, splashReason);
+                }
+            }
+        }
+        if (isError) {
+            sp = new DefaultErrorSplashScreen2012(width, height, splashReason, loadingException);
+        } else {
+            sp = new DefaultSplashScreen2012(width, height, splashReason);
+        }
+        sp.setVersion(Boot.version);
+        return sp;
+    }
+}
diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/impls/DefaultErrorSplashScreen2012.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/splashscreen/impls/DefaultErrorSplashScreen2012.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,118 @@
+/* DefaultErrorSplashScreen12.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.impls;
+
+import java.awt.Graphics;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+
+import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason;
+import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.ErrorPainter;
+import net.sourceforge.jnlp.splashscreen.parts.BasicComponentErrorSplashScreen;
+
+public final class DefaultErrorSplashScreen2012 extends BasicComponentErrorSplashScreen {
+
+    private final DefaultErrorSplashScreen2012 self;
+    private final ErrorPainter painter;
+    private final DefaultSplashScreens2012Commons commons;
+
+    public DefaultErrorSplashScreen2012(int width, int height, SplashReason splashReason, Throwable ex) {
+        //setting width and height now is causing  unnecessary blinking
+        //setSplashHeight(height);
+        //setSplashWidth(width);
+        //to have this in inner classes
+        self = this;
+        setLoadingException(ex);
+        setSplashReason(splashReason);
+        painter = new ErrorPainter(self, true);
+        addMouseListener(new MouseAdapter() {
+
+            @Override
+            public void mouseClicked(MouseEvent e) {
+                if (((ErrorPainter) painter).getErrorCorner() != null
+                        && e.getX() > ((ErrorPainter) painter).getErrorCorner().x
+                        && e.getY() > ((ErrorPainter) painter).getErrorCorner().y) {
+                    raiseExceptionDialog();
+                }
+            }
+        });
+        commons = new DefaultSplashScreens2012Commons(painter, self);
+    }
+
+    @Override
+    public void paintComponent(Graphics g) {
+        paintTo(g);
+    }
+
+    @Override
+    public void paintTo(Graphics g) {
+        commons.paintTo(g);
+
+
+    }
+
+    @Override
+    public void adjustForSize() {
+        commons.adjustForSize();
+    }
+
+    @Override
+    public void stopAnimation() {
+        commons.stopAnimation();
+    }
+
+    /**
+     * Methods to start the animation in the splash panel.
+     *
+     * This method exits after starting a new thread to do the animation. It
+     * is synchronized to prevent multiple startAnimation threads from being created.
+     */
+    @Override
+    public void startAnimation() {
+        commons.startAnimation();
+    }
+
+    @Override
+    public void setPercentage(int done) {
+       commons.setPercentage(done);
+    }
+
+    @Override
+    public int getPercentage() {
+        return commons.getPercentage();
+    }
+}
diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/impls/DefaultSplashScreen2012.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/splashscreen/impls/DefaultSplashScreen2012.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,105 @@
+/* DefaultSplashScreen12.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.impls;
+
+import java.awt.Graphics;
+
+
+import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason;
+import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.BasePainter;
+import net.sourceforge.jnlp.splashscreen.parts.BasicComponentSplashScreen;
+
+public final class DefaultSplashScreen2012 extends BasicComponentSplashScreen  {
+
+    private final DefaultSplashScreen2012 self;
+    private final BasePainter painter;
+    private final DefaultSplashScreens2012Commons commons;
+
+    public DefaultSplashScreen2012(int width, int height, SplashReason splashReason) {
+        //setting width and height now is causing  unnecessary blinking
+        //setSplashHeight(height);
+        //setSplashWidth(width);
+        //to have this in inner classes
+        self = this;
+        setSplashReason(splashReason);
+        painter = new BasePainter(this);
+        commons = new DefaultSplashScreens2012Commons(painter, self);
+    }
+
+    @Override
+    public void paintComponent(Graphics g) {
+        paintTo(g);
+    }
+
+    @Override
+    public void paintTo(Graphics g) {
+        commons.paintTo(g);
+
+
+    }
+
+    @Override
+    public void adjustForSize() {
+        commons.adjustForSize();
+    }
+
+    @Override
+    public void stopAnimation() {
+        commons.stopAnimation();
+    }
+
+    /**
+     * Methods to start the animation in the splash panel.
+     *
+     * This method exits after starting a new thread to do the animation. It
+     * is synchronized to prevent multiple startAnimation threads from being created.
+     */
+    @Override
+    public void startAnimation() {
+        commons.startAnimation();
+    }
+
+    @Override
+    public void setPercentage(int done) {
+        commons.setPercentage(done);
+    }
+
+    @Override
+    public int getPercentage() {
+        return commons.getPercentage();
+    }
+}
diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/impls/DefaultSplashScreens2012Commons.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/splashscreen/impls/DefaultSplashScreens2012Commons.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,119 @@
+/* DefaultSplashScreensCommons2012.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.impls;
+
+import java.awt.Graphics;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.Observable;
+
+import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.BasePainter;
+import net.sourceforge.jnlp.splashscreen.parts.BasicComponentSplashScreen;
+
+public final class DefaultSplashScreens2012Commons {
+
+    private final BasicComponentSplashScreen parent;
+    private final BasePainter painter;
+   
+
+    public DefaultSplashScreens2012Commons(BasePainter painterr, BasicComponentSplashScreen parentt) {
+        this.painter = painterr;
+        this.parent = parentt;
+        parent.addMouseListener(new MouseAdapter() {
+
+            @Override
+            public void mouseClicked(MouseEvent e) {
+                painter.increaseAnimationPosition();
+                parent.repaint();
+            }
+        });
+        // Add a new listener for resizes
+        parent.addComponentListener(new ComponentAdapter() {
+            // Re-adjust variables based on size
+
+            @Override
+            public void componentResized(ComponentEvent e) {
+                parent.setSplashWidth(parent.getWidth());
+                parent.setSplashHeight(parent.getHeight());
+                parent.adjustForSize();
+                parent.repaint();
+            }
+        });
+    }
+
+    public void paintTo(Graphics g) {
+        painter.paint(g);
+
+
+    }
+
+    public void adjustForSize() {
+        painter.adjustForSize(parent.getSplashWidth(), parent.getSplashHeight());
+    }
+
+    public void stopAnimation() {
+        parent.setAnimationRunning(false);
+    }
+
+    /**
+     * Methods to start the animation in the splash panel.
+     *
+     * This method exits after starting a new thread to do the animation. It
+     * is synchronized to prevent multiple startAnimation threads from being created.
+     */
+    public void startAnimation() {
+        if (parent.isAnimationRunning()) {
+            return;
+        }
+        parent.setAnimationRunning(true);
+        painter.startAnimationThreads();
+
+    }
+
+    public void setPercentage(int done) {
+        painter.clearCachedWaterTextImage();
+        painter.setWaterLevel(done);
+    }
+
+    public int getPercentage() {
+        return painter.getWaterLevel();
+    }
+
+   
+}
diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,540 @@
+/* BasePainter.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012;
+
+import net.sourceforge.jnlp.splashscreen.impls.*;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.Toolkit;
+import java.awt.font.TextAttribute;
+import java.awt.image.BufferedImage;
+import java.util.HashMap;
+import java.util.List;
+
+import java.util.Map;
+import java.util.Observable;
+import java.util.Observer;
+
+import javax.swing.SwingUtilities;
+import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason;
+import net.sourceforge.jnlp.splashscreen.parts.BasicComponentSplashScreen;
+import net.sourceforge.jnlp.splashscreen.parts.InfoItem;
+import net.sourceforge.jnlp.splashscreen.parts.InformationElement;
+
+public class BasePainter implements Observer {
+
+    protected final BasicComponentSplashScreen master;
+    //animations
+    //waterLevel of water (0-100%)
+    private int waterLevel = 0;
+    //waving of water and position of shhadowed WEB
+    private int animationsPosition = 0;
+    private int greyTextIncrment = 15; //how quickly is greyed web moving
+    //colors
+    protected static final Color TEA_LIVE_COLOR = new Color(205, 1, 3);
+    protected static final Color BACKGROUND_LIVE_COLOR = Color.white;
+    protected static final Color TEA_LEAFS_STALKS_LIVE_COLOR = Color.black;
+    protected static final Color PLUGIN_LIVE_COLOR = Color.black;
+    protected static final Color WATER_LIVE_COLOR = new Color(80, 131, 160);
+    protected static final Color PLAIN_TEXT_LIVE_COLOR = Color.black;
+    protected Color teaColor;
+    protected Color backgroundColor;
+    protected Color teaLeafsStalksColor;
+    protected Color pluginColor;
+    protected Color waterColor;
+    protected Color plainTextColor;
+    //BufferedImage tmpBackround; //testingBackground for fitting
+    protected BufferedImage prerenderedStuff;
+    private Font teaFont;
+    private Font icedFont;
+    private Font webFont;
+    private Font pluginFont;
+    private Font plainTextsFont;
+    private Font alternativeTextFont;
+    //those spaces are meaningful for centering the text.. thats why alternative;)
+    private static final String alternativeICED = "Iced    ";
+    private static final String alternativeWeb = "Web  ";
+    private static final String alternativeTtea = "    Tea";
+    private static final String alternativePlugin = "plugin ";
+    private static final String ICED = "Iced";
+    private static final String web = "web";
+    private static final String tea = "Tea";
+    private static final String plugin = "plugin  ";
+    //inidivdual sizes, all converging to ZERO!!
+    /**
+     * Experimentaly meassured best top position for painted parts of vectros
+     */
+    private final int WEB_TOP_ALIGMENT = 324;
+    /**
+     * Experimentaly meassured best left position for painted parts of vectors
+     */
+    private final int WEB_LEFT_ALIGMENT = 84;
+    //enabling
+    protected boolean showNiceTexts = true;
+    private boolean showLeaf = true;
+    private boolean showInfo = true;
+    protected TextWithWaterLevel twl;
+    protected TextWithWaterLevel oldTwl;
+    protected boolean canWave = true;
+
+    protected void paintNiceTexts(Graphics2D g2d) {
+        //the only animated stuff
+        oldTwl = twl;
+        twl = new TextWithWaterLevel(ICED, icedFont);
+        if (oldTwl != null && !canWave) {
+            twl.setCachedPolygon(oldTwl.getCachedPolygon());
+        }
+        twl.setPercentageOfWater(waterLevel);
+        twl.setBgColor(backgroundColor);
+        twl.setWaterColor(waterColor);
+        twl.cutTo(g2d, scaleX(42), scaleY(278));
+        MovingText mt = new MovingText(web, webFont);
+        mt.setPercentageOfWater(animationsPosition);
+        mt.cutTo(g2d, scaleX(WEB_LEFT_ALIGMENT), scaleY(WEB_TOP_ALIGMENT));
+    }
+
+    protected void paintPlainTexts(Graphics2D g2d) {
+        g2d.setFont(alternativeTextFont);
+        g2d.setColor(waterColor);
+        drawTextAroundCenter(g2d, -0.6d, alternativeICED);
+        g2d.setColor(teaColor);
+        drawTextAroundCenter(g2d, -0.6d, alternativeTtea);
+        g2d.setColor(pluginColor);
+        String s = getAlternativeProductName();
+        int sub = animationsPosition / greyTextIncrment;
+        sub = sub % s.length();
+        if (!master.isAnimationRunning()) {
+            sub = s.length();
+        }
+        drawTextAroundCenter(g2d, 0.3d, s.substring(0, sub));
+    }
+    //enabling end
+
+    private int scaleAvarage(double origValue) {
+        return (int) (avarageRatio() * origValue);
+    }
+
+    private int scaleMax(double origValue) {
+        return (int) (maxRatio() * origValue);
+    }
+
+    private int scaleMin(double origValue) {
+        return (int) (minRatio() * origValue);
+    }
+
+    private double avarageRatio() {
+        return (getRatioX() + getRatioY()) / 2d;
+    }
+
+    private double minRatio() {
+        return Math.min(getRatioX(), getRatioY());
+    }
+
+    private double maxRatio() {
+        return Math.max(getRatioX(), getRatioY());
+    }
+
+    private int scaleY(double origValue) {
+        return (int) scaleY(master.getSplashHeight(), origValue);
+    }
+
+    private int scaleX(double origValue) {
+        return (int) scaleX(master.getSplashWidth(), origValue);
+    }
+
+    private double getRatioY() {
+        return getRatio(DefaultSplashScreen2012.ORIGINAL_H, master.getSplashHeight());
+    }
+
+    private double getRatioX() {
+        return getRatio(DefaultSplashScreen2012.ORIGINAL_W, master.getSplashWidth());
+    }
+
+    private static double scaleY(double currentSize, double origValue) {
+        return scale(DefaultSplashScreen2012.ORIGINAL_H, currentSize, origValue);
+    }
+
+    private static double scaleX(double currentSize, double origValue) {
+        return scale(DefaultSplashScreen2012.ORIGINAL_W, currentSize, origValue);
+    }
+
+    private static double getRatioY(double currentSize) {
+        return getRatio(DefaultSplashScreen2012.ORIGINAL_H, currentSize);
+    }
+
+    private static double getRatioX(double currentSize) {
+        return getRatio(DefaultSplashScreen2012.ORIGINAL_W, currentSize);
+    }
+
+    public static double scale(double origSize, double currentSize, double origValue) {
+        return getRatio(origSize, currentSize) * origValue;
+    }
+
+    public static double getRatio(double origSize, double currentSize) {
+        return (currentSize / origSize);
+    }
+    //size is considered from 0-origsize as 0-1.
+
+    //scaling end
+    public BasePainter(BasicComponentSplashScreen master) {
+        this(master, false);
+    }
+
+    public BasePainter(BasicComponentSplashScreen master, boolean startAnimation) {
+        //to have this in inner classes
+        this.master = master;
+        setColors();
+        adjustForSize(master.getSplashWidth(), master.getSplashHeight());
+        if (startAnimation) {
+            startAnimationThreads();
+        }
+
+    }
+
+    public void increaseAnimationPosition() {
+        animationsPosition += greyTextIncrment;
+    }
+
+    protected void ensurePrerenderedStuff() {
+        if (this.prerenderedStuff == null) {
+            this.prerenderedStuff = prerenderStill();
+        }
+    }
+
+    public void paint(Graphics g) {
+        Graphics2D g2d = (Graphics2D) g;
+        ensurePrerenderedStuff();
+        if (prerenderedStuff != null) {
+            g2d.drawImage(prerenderedStuff, 0, 0, null);
+        }
+
+        if (showNiceTexts) {
+            paintNiceTexts(g2d);
+        } else {
+            paintPlainTexts(g2d);
+        }
+
+
+
+    }
+
+    public final void adjustForSize(int width, int height) {
+        prepareFonts(width, height);
+        //enablings depends on fonts
+        setEnablings(width, height, master.getVersion(), master.getInformationElement(), (Graphics2D) (master.getGraphics()));
+        prerenderedStuff = prerenderStill();
+    }
+
+    private void setEnablings(int w, int h, String version, InformationElement ic, Graphics2D g2d) {
+        showLeaf = true;
+        if (w > 0 && h > 0) {
+            //leaf stretch much better to wide then to high
+            if (h / w > 2 || w / h > 6) {
+                showLeaf = false;
+            }
+        }
+        showInfo = true;
+        if (version != null && g2d != null && ic != null && ic.getHeader() != null && ic.getHeader().size() > 0) {
+            String s = ic.getHeader().get(0);
+            FontMetrics fm = g2d.getFontMetrics(plainTextsFont);
+            int versionLength = fm.stringWidth(version);
+            int firsDescLineLengthg = fm.stringWidth(s);
+            if (firsDescLineLengthg > w - versionLength - 10) {
+                showInfo = false;
+            }
+        }
+        if (Math.min(h, w) < Toolkit.getDefaultToolkit().getScreenSize().getHeight() / 10) {
+            showNiceTexts = false;
+        } else {
+            showNiceTexts = true;
+        }
+    }
+
+    public final void startAnimationThreads() {
+        Thread tt = getMovingTextThread();
+        tt.start();
+        Thread t = getWaterLevelThread();
+        t.start();
+    }
+
+    private void prepareFonts(int w, int h) {
+        master.setSplashHeight(h);
+        master.setSplashWidth(w);
+        Map<TextAttribute, Object> teaFontAttributes = new HashMap<TextAttribute, Object>();
+        teaFontAttributes.put(TextAttribute.SIZE, new Integer(scaleMin(84)));
+        teaFontAttributes.put(TextAttribute.WIDTH, new Double((0.95)));
+        teaFontAttributes.put(TextAttribute.FAMILY, "Serif");
+        teaFont = new Font(teaFontAttributes);
+        Map<TextAttribute, Object> icedFontAttributes = new HashMap<TextAttribute, Object>();
+        icedFontAttributes.put(TextAttribute.SIZE, new Integer(scaleMin(82)));
+        icedFontAttributes.put(TextAttribute.WIDTH, new Double((0.80)));
+        icedFontAttributes.put(TextAttribute.FAMILY, "Serif");
+        icedFont = new Font(icedFontAttributes);
+        Map<TextAttribute, Object> webFontAttributes = new HashMap<TextAttribute, Object>();
+        webFontAttributes.put(TextAttribute.SIZE, new Integer(scaleMin(41)));
+        webFontAttributes.put(TextAttribute.WIDTH, new Double((2)));
+        webFontAttributes.put(TextAttribute.FAMILY, "Serif");
+        webFont = new Font(webFontAttributes);
+        Map<TextAttribute, Object> pluginFontAttributes = new HashMap<TextAttribute, Object>();
+        pluginFontAttributes.put(TextAttribute.SIZE, new Integer(scaleMin(32)));
+        pluginFontAttributes.put(TextAttribute.WEIGHT, new Double((5d)));
+        pluginFontAttributes.put(TextAttribute.WIDTH, new Double((0.9)));
+        pluginFontAttributes.put(TextAttribute.FAMILY, "Serif");
+        pluginFont = new Font(pluginFontAttributes);
+        Map<TextAttribute, Object> plainFontAttributes = new HashMap<TextAttribute, Object>();
+        plainFontAttributes.put(TextAttribute.SIZE, new Integer(12));
+        plainFontAttributes.put(TextAttribute.FAMILY, "Monospaced");
+        plainTextsFont = new Font(plainFontAttributes);
+        Map<TextAttribute, Object> alternativeTextFontAttributes = new HashMap<TextAttribute, Object>();
+        alternativeTextFontAttributes.put(TextAttribute.SIZE, Math.min(w, h) / 5);
+        alternativeTextFontAttributes.put(TextAttribute.WIDTH, new Double((0.7)));
+        alternativeTextFontAttributes.put(TextAttribute.FAMILY, "Monospaced");
+        alternativeTextFont = new Font(alternativeTextFontAttributes);
+
+    }
+
+    private void setColors() {
+
+        teaColor = TEA_LIVE_COLOR;
+        backgroundColor = BACKGROUND_LIVE_COLOR;
+        teaLeafsStalksColor = TEA_LEAFS_STALKS_LIVE_COLOR;
+        pluginColor = PLUGIN_LIVE_COLOR;
+        waterColor = WATER_LIVE_COLOR;
+        plainTextColor = PLAIN_TEXT_LIVE_COLOR;
+
+    }
+
+    protected BufferedImage prerenderStill() {
+        if (master.getSplashWidth() <= 0 || master.getSplashHeight() <= 0) {
+            return null;
+        }
+        BufferedImage bi = new BufferedImage(master.getSplashWidth(), master.getSplashHeight(), BufferedImage.TYPE_INT_ARGB);
+        paintStillTo(bi.createGraphics(), master.getInformationElement(), master.getVersion());
+        return bi;
+    }
+
+    protected void paintStillTo(Graphics2D g2d, InformationElement ic, String version) {
+        RenderingHints r = g2d.getRenderingHints();
+        drawBase(g2d, ic, version);
+        g2d.setRenderingHints(r);
+    }
+
+    protected void drawTextAroundCenter(Graphics2D g2d, double heightOffset, String msg) {
+
+        int y = (master.getSplashHeight() / 2) + (g2d.getFontMetrics().getHeight() / 2 + (int) (heightOffset * g2d.getFontMetrics().getHeight()));
+        int x = (master.getSplashWidth() / 2) - (g2d.getFontMetrics().stringWidth(msg) / 2);
+        g2d.drawString(msg, x, y);
+    }
+
+    private Thread getMovingTextThread() {
+        Thread tt = new Thread(new MovingTextRunner(this));
+        //tt.setDaemon(true);
+        return tt;
+    }
+
+    private final class MovingTextRunner extends Observable implements Runnable {
+
+        private static final int MAX_ANIMATION_VALUE = 10000;
+        private static final int ANIMATION_RESTART_VALUE = 1;
+        private static final long MOOVING_TEXT_DELAY = 150;
+
+        public MovingTextRunner(Observer o) {
+            this.addObserver(o);
+        }
+
+        @Override
+        public void run() {
+            while (master.isAnimationRunning()) {
+                try {
+                    animationsPosition += greyTextIncrment;
+                    if (animationsPosition > MAX_ANIMATION_VALUE) {
+                        animationsPosition = ANIMATION_RESTART_VALUE;
+                    }
+                    this.setChanged();
+                    this.notifyObservers();
+                    Thread.sleep(MOOVING_TEXT_DELAY);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    };
+
+    private Thread getWaterLevelThread() {
+        Thread t = new Thread(new WaterLevelThread(this));
+        //t.setDaemon(true);
+        return t;
+    }
+
+    private final class WaterLevelThread extends Observable implements Runnable {
+
+        private static final int MAX_WATERLEVEL_VALUE = 120;
+        private static final int WATER_LEVEL_INCREMENT = 2;
+
+        private WaterLevelThread(BasePainter o) {
+            this.addObserver(o);
+        }
+
+        @Override
+        public void run() {
+            while (master.isAnimationRunning()) {
+                if (waterLevel > MAX_WATERLEVEL_VALUE) {
+                    break;
+                }
+                try {
+                    waterLevel += WATER_LEVEL_INCREMENT;
+                    this.setChanged();
+                    this.notifyObservers();
+                    //it is risinfg slower and slower
+                    Thread.sleep((waterLevel / 4) * 30);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    };
+
+    private String getAlternativeProductName() {
+        if (SplashReason.JAVAWS.equals(master.getSplashReason())) {
+            return alternativeWeb;
+        } else if (SplashReason.APPLET.equals(master.getSplashReason())) {
+            return alternativeWeb + alternativePlugin;
+        } else {
+            return "....";
+        }
+    }
+
+    protected FontMetrics drawBase(Graphics2D g2d, InformationElement ic, String version) {
+        g2d.setColor(backgroundColor);
+        g2d.fillRect(0, 0, master.getSplashWidth() + 5, master.getSplashHeight() + 5);
+        if (showNiceTexts) {
+            //g2d.drawImage(tmpBackround, 0, 0, null);
+            g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+            g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
+            g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+            g2d.setFont(teaFont);
+            g2d.setColor(teaColor);
+            g2d.drawString(tea, scaleX(42) + g2d.getFontMetrics(icedFont).stringWidth(ICED), scaleY(278));
+            g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
+            if (showLeaf) {
+                g2d.fillPolygon(SplinesDefs.getMainLeafCurve(getRatioX(), getRatioY()));
+            }
+            if (showLeaf) {
+                g2d.fillPolygon(SplinesDefs.getSecondLeafCurve(getRatioX(), getRatioY()));
+            }
+            g2d.setColor(teaLeafsStalksColor);
+            if (showLeaf) {
+                g2d.fillPolygon(SplinesDefs.getMainLeafStalkCurve(getRatioX(), getRatioY()));
+            }
+            if (showLeaf) {
+                g2d.fillPolygon(SplinesDefs.getSecondLeafStalkCurve(getRatioX(), getRatioY()));
+            }
+            g2d.setFont(pluginFont);
+            g2d.setColor(pluginColor);
+            if (SplashReason.APPLET.equals(master.getSplashReason())) {
+                if (showLeaf) {
+                    g2d.drawString(plugin, scaleX(404), scaleY(145));
+                } else {
+                    FontMetrics wfm = g2d.getFontMetrics(webFont);
+                    g2d.drawString(plugin, wfm.stringWidth(web) + scaleX(WEB_LEFT_ALIGMENT) + 10, scaleY(WEB_TOP_ALIGMENT));
+                }
+            }
+            g2d.setFont(plainTextsFont);
+            g2d.setColor(plainTextColor);
+            FontMetrics fm = g2d.getFontMetrics();
+            if (ic != null) {
+                InfoItem des = ic.getBestMatchingDescriptionForSplash();
+                List<String> head = ic.getHeader();
+                if (head != null && showInfo) {
+                    for (int i = 0; i < head.size(); i++) {
+                        String string = head.get(i);
+                        g2d.drawString(string, 5, (i + 1) * fm.getHeight());
+                    }
+                }
+                if (des != null && des.getValue() != null) {
+                    g2d.drawString(des.getValue(), 5, master.getSplashHeight() - fm.getHeight());
+                }
+            }
+        }
+        g2d.setFont(plainTextsFont);
+        g2d.setColor(plainTextColor);
+        FontMetrics fm = g2d.getFontMetrics();
+        if (version != null) {
+            int y = master.getSplashWidth() - fm.stringWidth(version + " ");
+            if (y < 0) {
+                y = 0;
+            }
+            g2d.drawString(version, y, fm.getHeight());
+        }
+        return fm;
+    }
+
+    public int getWaterLevel() {
+        return waterLevel;
+    }
+
+    public void setWaterLevel(int level) {
+        this.waterLevel = level;
+    }
+
+    public int getAnimationsPosition() {
+        return animationsPosition;
+    }
+
+    public void clearCachedWaterTextImage() {
+        oldTwl = null;
+    }
+
+    @Override
+    public void update(Observable o, Object arg) {
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+
+                @Override
+                public void run() {
+                    master.repaint();
+                }
+            });
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+    }
+}
diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ControlCurve.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ControlCurve.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,190 @@
+/* ControlCurve.java
+Copyright (C) 2012 Tim Lambert, Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012;
+
+/** This class represents a curve defined by a sequence of control points */
+
+/*
+ * This class is part of the NatCubic implementation (http://www.cse.unsw.edu.au/~lambert/)
+ * which does not have a license. The author (Tim Lambert) has agreed to
+ * license this under GPL+Classpath by email
+ *
+ */
+import java.awt.*;
+
+public class ControlCurve {
+
+    protected Polygon pts;
+    protected Polygon result;
+    protected boolean withPoints = true;
+    protected int selection = -1;
+
+    public ControlCurve() {
+        pts = new Polygon();
+    }
+
+    public ControlCurve(Polygon p) {
+        pts = p;
+    }
+
+    public Polygon getSourcePolygon() {
+        return pts;
+    }
+
+    public void setSourcePolygon(Polygon pts) {
+        this.pts = pts;
+    }
+    static Font f = new Font("Courier", Font.PLAIN, 12);
+
+    /**
+     * to be overwriten
+     */
+    public Polygon calcualteResult() {
+        return null;
+    }
+
+    public void calcualteAndSaveResult() {
+        result = calcualteResult();
+    }
+
+    /** paint this curve into g.*/
+    public void paint(Graphics g) {
+        if (isWithPoints()) {
+            FontMetrics fm = g.getFontMetrics(f);
+            g.setFont(f);
+            int h = fm.getAscent() / 2;
+
+            for (int i = 0; i < pts.npoints; i++) {
+                String s = Integer.toString(i);
+                int w = fm.stringWidth(s) / 2;
+                g.drawString(Integer.toString(i), pts.xpoints[i] - w, pts.ypoints[i] + h);
+            }
+        }
+    }
+    static final int EPSILON = 36;  /* square of distance for picking */
+
+
+    /** return index of control point near to (x,y) or -1 if nothing near */
+    public int selectPoint(int x, int y) {
+        int mind = Integer.MAX_VALUE;
+        selection = -1;
+        for (int i = 0; i < pts.npoints; i++) {
+            int d = sqr(pts.xpoints[i] - x) + sqr(pts.ypoints[i] - y);
+            if (d < mind && d < EPSILON) {
+                mind = d;
+                selection = i;
+            }
+        }
+        return selection;
+    }
+
+    // square of an int
+    static int sqr(int x) {
+        return x * x;
+    }
+
+    public Polygon getResult() {
+        return result;
+    }
+
+    public void resetResult() {
+        this.result = null;
+    }
+
+    /** add a control point, return index of new control point */
+    public int addPoint(int x, int y) {
+        pts.addPoint(x, y);
+        resetResult();
+        return selection = pts.npoints - 1;
+    }
+
+    /** set selected control point */
+    public void setPoint(int x, int y) {
+        setPoint(selection, x, y);
+    }
+
+    /** set selected control point */
+    public void setPoint(int index, int x, int y) {
+        if (index >= 0 && index < pts.npoints) {
+            pts.xpoints[index] = x;
+            pts.ypoints[index] = y;
+            resetResult();
+        }
+    }
+
+    /** remove selected control point */
+    public void removePoint(int index) {
+        if (index >= 0 && index < pts.npoints) {
+            pts.npoints--;
+            for (int i = index; i < pts.npoints; i++) {
+                pts.xpoints[i] = pts.xpoints[i + 1];
+                pts.ypoints[i] = pts.ypoints[i + 1];
+            }
+            resetResult();
+        }
+    }
+
+    /** remove selected control point */
+    public void removePoint() {
+        removePoint(selection);
+    }
+
+    public boolean isWithPoints() {
+        return withPoints;
+    }
+
+    public void setWithPoints(boolean withPoints) {
+        this.withPoints = withPoints;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder r = new StringBuilder();
+        for (int i = 0; i < pts.npoints; i++) {
+            r.append(" ").append(pts.xpoints[i]).append(" ").append(pts.ypoints[i]);
+        }
+        return r.toString();
+    }
+
+    /**
+     * for testing purposes
+     * @param selection
+     */
+    void setSelection(int selection) {
+        this.selection = selection;
+    }
+}
diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Cubic.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Cubic.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,63 @@
+/* Cubic.java
+Copyright (C) 2012 Tim Lambert, Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012;
+
+/** this class represents a cubic polynomial */
+
+/*
+ * This class is part of the NatCubic implementation (http://www.cse.unsw.edu.au/~lambert/)
+ * which does not have a license. The author (Tim Lambert) has agreed to
+ * license this under GPL+Classpath by email
+ *
+ */
+public class Cubic {
+
+    float a, b, c, d;         /* a + b*u + c*u^2 +d*u^3 */
+
+
+    public Cubic(float a, float b, float c, float d) {
+        this.a = a;
+        this.b = b;
+        this.c = c;
+        this.d = d;
+    }
+
+    /** evaluate cubic */
+    public float eval(float u) {
+        return (((d * u) + c) * u + b) * u + a;
+    }
+}
diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainter.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainter.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,260 @@
+/* ErrorPainter.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Point;
+import java.awt.RenderingHints;
+import java.util.Observable;
+
+import net.sourceforge.jnlp.runtime.Translator;
+import net.sourceforge.jnlp.splashscreen.parts.BasicComponentSplashScreen;
+import net.sourceforge.jnlp.splashscreen.parts.InformationElement;
+
+public final class ErrorPainter extends BasePainter {
+
+    //colors
+    private static final Color TEA_DEAD_COLOR = Color.darkGray;
+    private static final Color BACKGROUND_DEAD_COLOR = Color.gray;
+    private static final Color TEA_LEAFS_STALKS_DEAD_COLOR = new Color(100, 100, 100);
+    private static final Color PLUGIN_DEAD_COLOR = Color.darkGray;
+    private static final Color WATER_DEAD_COLOR = Color.darkGray;
+    private static final Color PLAIN_TEXT_DEAD_COLOR = Color.white;
+    private static final String ERROR_MESSAGE_KEY = "SPLASHerror";
+    private static final String ERROR_FLY_MESSAGE_KEY = "SPLASH_ERROR";
+    private static final Color ERROR_FLY_COLOR = Color.red;
+    //for clicking ot error message
+    private Point errorCorner = null;
+    private boolean errorIsFlying = false;
+    private int errorFlyPercentage = 100;
+
+    /**
+     * Interpolation is root ratior is r= (currentSize / origSize)
+     * then value to-from is interpolaed from to to from accroding to ratio
+     *
+     * @param origSize
+     * @param currentSize
+     * @param from
+     * @param to
+     * @return
+     */
+    public static double interpol(double origSize, double currentSize, double from, double to) {
+        return getRatio(origSize, currentSize) * (to - from) + from;
+    }
+
+    /**
+     * is interpolating one color to another based on ration current/orig
+     * Each (r,g,b,a) part of color is interpolated separately
+     * resturned is new color composed form new r,g,b,a
+     * @param origSize
+     * @param currentSize
+     * @param from
+     * @param to
+     * @return
+     */
+    public static Color interpolateColor(double origSize, double currentSize, Color from, Color to) {
+        double r = interpol(origSize, currentSize, to.getRed(), from.getRed());
+        double g = interpol(origSize, currentSize, to.getGreen(), from.getGreen());
+        double b = interpol(origSize, currentSize, to.getBlue(), from.getBlue());
+        double a = interpol(origSize, currentSize, to.getAlpha(), from.getAlpha());
+        return new Color((int) r, (int) g, (int) b, (int) a);
+    }
+    //scaling end
+
+    public ErrorPainter(BasicComponentSplashScreen master) {
+        this(master, false);
+    }
+
+    public ErrorPainter(BasicComponentSplashScreen master, boolean startScream) {
+        super(master);
+        if (startScream) {
+            startErrorScream();
+        }
+
+    }
+
+    public void startErrorScream() {
+        errorIsFlying = true;
+        getFlyingRedErrorTextThread().start();
+    }
+
+    @Override
+    public void paint(Graphics g) {
+        Graphics2D g2d = (Graphics2D) g;
+        ensurePrerenderedStuff();
+        if (errorIsFlying) {
+            paintStillTo(g2d, master.getInformationElement(), master.getVersion());
+        } else {
+            if (prerenderedStuff != null) {
+                g2d.drawImage(prerenderedStuff, 0, 0, null);
+            }
+        }
+
+        if (super.showNiceTexts) {
+            paintNiceTexts(g2d);
+        } else {
+            paintPlainTexts(g2d);
+        }
+
+        if (errorIsFlying) {
+            g2d.setClip(0, 0, master.getSplashWidth(), master.getSplashHeight());
+            drawBigError(g2d);
+        }
+
+
+    }
+
+    private void drawBigError(Graphics2D g2d) {
+        Font f = new Font("Serif", Font.PLAIN, (int) scale(100, errorFlyPercentage, master.getSplashHeight()));
+        g2d.setColor(ERROR_FLY_COLOR);
+        g2d.setFont(f);
+        drawTextAroundCenter(g2d, 0, geFlyingErrorMessage());
+    }
+
+    public Point getErrorCorner() {
+        return errorCorner;
+    }
+
+    private void setColors() {
+
+        teaColor = TEA_DEAD_COLOR;
+        backgroundColor = BACKGROUND_DEAD_COLOR;
+        teaLeafsStalksColor = TEA_LEAFS_STALKS_DEAD_COLOR;
+        pluginColor = PLUGIN_DEAD_COLOR;
+        waterColor = WATER_DEAD_COLOR;
+
+    }
+
+    private void interpolateColor(int origSize, int currentSize) {
+        teaColor = interpolateColor(origSize, currentSize, TEA_LIVE_COLOR, TEA_DEAD_COLOR);
+        backgroundColor = interpolateColor(origSize, currentSize, BACKGROUND_LIVE_COLOR, BACKGROUND_DEAD_COLOR);
+        teaLeafsStalksColor = interpolateColor(origSize, currentSize, TEA_LEAFS_STALKS_LIVE_COLOR, TEA_LEAFS_STALKS_DEAD_COLOR);
+        pluginColor = interpolateColor(origSize, currentSize, PLUGIN_LIVE_COLOR, PLUGIN_DEAD_COLOR);
+        waterColor = interpolateColor(origSize, currentSize, WATER_LIVE_COLOR, WATER_DEAD_COLOR);
+        plainTextColor = interpolateColor(origSize, currentSize, PLAIN_TEXT_LIVE_COLOR, PLAIN_TEXT_DEAD_COLOR);
+    }
+
+    @Override
+    protected void paintStillTo(Graphics2D g2d, InformationElement ic, String version) {
+        RenderingHints r = g2d.getRenderingHints();
+        FontMetrics fm = drawBase(g2d, ic, version);
+        drawError(g2d, ic, version, fm);
+        g2d.setRenderingHints(r);
+    }
+
+    private String getErrorMessage() {
+        String localised = Translator.R(ERROR_MESSAGE_KEY);
+        //if (localised==null)return errorMessage;
+        return localised;
+    }
+
+    private String geFlyingErrorMessage() {
+        String localised = Translator.R(ERROR_FLY_MESSAGE_KEY);
+        return localised;
+    }
+
+    private Thread getFlyingRedErrorTextThread() {
+        // Create a new thread to draw big flying error in case of failure
+        Thread t = new Thread(new FlyingRedErrorTextRunner(this));
+        //t.setDaemon(true);
+        return t;
+    }
+
+    private final class FlyingRedErrorTextRunner extends Observable implements Runnable {
+
+        private static final int FLYING_ERROR_PERCENTAGE_INCREMENT = -3;
+        private static final int FLYING_ERROR_PERCENTAGE_MINIMUM = 5;
+        private static final int FLYING_ERROR_PERCENTAGE_LOWER_BOUND = 80;
+        private static final int FLYING_ERROR_PERCENTAGE_UPPER_BOUND = 90;
+        private static final int FLYING_ERROR_DELAY = 75;
+
+        private FlyingRedErrorTextRunner(ErrorPainter o) {
+            this.addObserver(o);
+        }
+
+        @Override
+        public void run() {
+            try {
+                while (errorIsFlying) {
+                    errorFlyPercentage += FLYING_ERROR_PERCENTAGE_INCREMENT;
+                    interpolateColor(100, errorFlyPercentage);
+                    if (errorFlyPercentage <= FLYING_ERROR_PERCENTAGE_MINIMUM) {
+                        errorIsFlying = false;
+                        setColors();
+                        prerenderedStuff = null;
+                    }
+                    this.setChanged();
+                    this.notifyObservers();
+                    Thread.sleep(FLYING_ERROR_DELAY);
+                    if (errorFlyPercentage < FLYING_ERROR_PERCENTAGE_UPPER_BOUND
+                            && errorFlyPercentage > FLYING_ERROR_PERCENTAGE_LOWER_BOUND) {
+                        clearCachedWaterTextImage();
+                        canWave = false;
+                    }
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            } finally {
+                canWave = true;
+                errorIsFlying = false;
+                setColors();
+                prerenderedStuff = null;
+                master.repaint();
+
+            }
+        }
+    };
+
+    private void drawError(Graphics2D g2d, InformationElement ic, String version, FontMetrics fm) {
+        int minh = fm.getHeight();
+        int minw = fm.stringWidth(getErrorMessage());
+        int space = 5;
+        g2d.setColor(backgroundColor);
+        errorCorner = new Point(master.getSplashWidth() - space * 4 - minw, master.getSplashHeight() - space * 4 - minh);
+        if (errorCorner.x < 0) {
+            errorCorner.x = 0;
+        }
+        g2d.fillRect(errorCorner.x, errorCorner.y, space * 4 + minw, space * 4 + minh);
+        g2d.setColor(plainTextColor);
+        g2d.drawRect(errorCorner.x + space, errorCorner.y + space, space * 2 + minw, space * 2 + minh);
+        g2d.drawString(getErrorMessage(), errorCorner.x + 2 * space, errorCorner.y + 5 * space);
+    }
+}
diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/MovingText.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/MovingText.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,77 @@
+/* MovingText.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.GradientPaint;
+import java.awt.Graphics2D;
+import java.awt.Point;
+import java.awt.image.BufferedImage;
+
+public class MovingText extends TextWithWaterLevel {
+
+    public MovingText(String s, Font f) {
+        super(s, f);
+
+    }
+
+    @Override
+    public BufferedImage getBackground() {
+        Point p = getFutureSize();
+        int w = p.x;
+        int h = p.y;
+        if (w <= 0 || h <= 0) {
+            return null;
+        }
+        BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
+        Graphics2D g2d = bi.createGraphics();
+
+        Color e1 = Color.gray;
+        Color s1 = Color.white;
+        int level = getPercentageOfWater() % (2 * w);
+        GradientPaint gradient = new GradientPaint(level - w, h / 2, s1, level, h / 2, e1, true);
+        g2d.setPaint(gradient);
+        g2d.fillRect(100, 100, 200, 120);
+
+        g2d.fillRect(0, 0, w, h);
+
+
+
+        return bi;
+    }
+}
diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubic.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubic.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,127 @@
+/* NatCubic.java
+Copyright (C) 2012 Tim Lambert, Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012;
+
+import java.awt.*;
+
+public class NatCubic extends ControlCurve {
+
+    /*
+     * This class is part of the NatCubic implementation (http://www.cse.unsw.edu.au/~lambert/)
+     * which does not have a license. The author (Tim Lambert) has agreed to
+     * license this under GPL+Classpath by email
+     *
+     */
+    /*
+    NatCubic calcualtion
+    calculates the natural cubic spline that interpolates
+    y[0], y[1], ... y[n]
+    The first segment is returned as
+    C[0].a + C[0].b*u + C[0].c*u^2 + C[0].d*u^3 0<=u <1
+    the other segments are in C[1], C[2], ...  C[n-1] */
+    Cubic[] calcNaturalCubic(int n, int[] x) {
+        float[] gamma = new float[n + 1];
+        float[] delta = new float[n + 1];
+        float[] D = new float[n + 1];
+        int i;
+        /* We solve the equation
+        [2 1       ] [D[0]]   [3(x[1] - x[0])  ]
+        |1 4 1     | |D[1]|   |3(x[2] - x[0])  |
+        |  1 4 1   | | .  | = |      .         |
+        |    ..... | | .  |   |      .         |
+        |     1 4 1| | .  |   |3(x[n] - x[n-2])|
+        [       1 2] [D[n]]   [3(x[n] - x[n-1])]
+
+        by using row operations to convert the matrix to upper triangular
+        and then back sustitution.  The D[i] are the derivatives at the knots.
+         */
+
+        gamma[0] = 1.0f / 2.0f;
+        for (i = 1; i < n; i++) {
+            gamma[i] = 1 / (4 - gamma[i - 1]);
+        }
+        gamma[n] = 1 / (2 - gamma[n - 1]);
+
+        delta[0] = 3 * (x[1] - x[0]) * gamma[0];
+        for (i = 1; i < n; i++) {
+            delta[i] = (3 * (x[i + 1] - x[i - 1]) - delta[i - 1]) * gamma[i];
+        }
+        delta[n] = (3 * (x[n] - x[n - 1]) - delta[n - 1]) * gamma[n];
+
+        D[n] = delta[n];
+        for (i = n - 1; i >= 0; i--) {
+            D[i] = delta[i] - gamma[i] * D[i + 1];
+        }
+
+        /* now compute the coefficients of the cubics */
+        Cubic[] C = new Cubic[n];
+        for (i = 0; i < n; i++) {
+            C[i] = new Cubic((float) x[i], D[i], 3 * (x[i + 1] - x[i]) - 2 * D[i] - D[i + 1],
+                    2 * (x[i] - x[i + 1]) + D[i] + D[i + 1]);
+        }
+        return C;
+    }
+    final int STEPS = 12;
+
+    /* draw a cubic spline */
+    @Override
+    public void paint(Graphics g) {
+        super.paint(g);
+        if (pts.npoints >= 2) {
+            if (getResult() == null) {
+                calcualteAndSaveResult();
+            }
+            g.drawPolyline(result.xpoints, result.ypoints, result.npoints);
+        }
+    }
+
+    @Override
+    public Polygon calcualteResult() {
+        Cubic[] X = calcNaturalCubic(pts.npoints - 1, pts.xpoints);
+        Cubic[] Y = calcNaturalCubic(pts.npoints - 1, pts.ypoints);
+        /* very crude technique - just break each segment up into steps lines */
+        Polygon p = new Polygon();
+        p.addPoint((int) Math.round(X[0].eval(0)), (int) Math.round(Y[0].eval(0)));
+        for (int i = 0; i < X.length; i++) {
+            for (int j = 1; j <= STEPS; j++) {
+                float u = j / (float) STEPS;
+                p.addPoint(Math.round(X[i].eval(u)), Math.round(Y[i].eval(u)));
+            }
+        }
+        return p;
+    }
+}
diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicClosed.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicClosed.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,107 @@
+/* NatCubicClosed.java
+Copyright (C) 2012 Tim Lambert, Red Hat, Inc.,
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012;
+
+public class NatCubicClosed extends NatCubic {
+
+    /*
+     * This class is part of the NatCubic implementation (http://www.cse.unsw.edu.au/~lambert/)
+     * which does not have a license. The author (Tim Lambert) has agreed to
+     * license this under GPL+Classpath by email
+     *
+     */
+    /*
+    NatCubic calcualtion
+    calculates the closed natural cubic spline that interpolates
+    x[0], x[1], ... x[n]
+    The first segment is returned as
+    C[0].a + C[0].b*u + C[0].c*u^2 + C[0].d*u^3 0<=u <1
+    the other segments are in C[1], C[2], ...  C[n] */
+    @Override
+    Cubic[] calcNaturalCubic(int n, int[] x) {
+        float[] w = new float[n + 1];
+        float[] v = new float[n + 1];
+        float[] y = new float[n + 1];
+        float[] D = new float[n + 1];
+        float z, F, G, H;
+        int k;
+        /* We solve the equation
+        [4 1      1] [D[0]]   [3(x[1] - x[n])  ]
+        |1 4 1     | |D[1]|   |3(x[2] - x[0])  |
+        |  1 4 1   | | .  | = |      .         |
+        |    ..... | | .  |   |      .         |
+        |     1 4 1| | .  |   |3(x[n] - x[n-2])|
+        [1      1 4] [D[n]]   [3(x[0] - x[n-1])]
+
+        by decomposing the matrix into upper triangular and lower matrices
+        and then back sustitution.  See Spath "Spline Algorithms for Curves
+        and Surfaces" pp 19--21. The D[i] are the derivatives at the knots.
+         */
+        w[1] = v[1] = z = 1.0f / 4.0f;
+        y[0] = z * 3 * (x[1] - x[n]);
+        H = 4;
+        F = 3 * (x[0] - x[n - 1]);
+        G = 1;
+        for (k = 1; k < n; k++) {
+            v[k + 1] = z = 1 / (4 - v[k]);
+            w[k + 1] = -z * w[k];
+            y[k] = z * (3 * (x[k + 1] - x[k - 1]) - y[k - 1]);
+            H = H - G * w[k];
+            F = F - G * y[k - 1];
+            G = -v[k] * G;
+        }
+        H = H - (G + 1) * (v[n] + w[n]);
+        y[n] = F - (G + 1) * y[n - 1];
+
+        D[n] = y[n] / H;
+        D[n - 1] = y[n - 1] - (v[n] + w[n]) * D[n]; /* This equation is WRONG! in my copy of Spath */
+        for (k = n - 2; k >= 0; k--) {
+            D[k] = y[k] - v[k + 1] * D[k + 1] - w[k + 1] * D[n];
+        }
+
+
+        /* now compute the coefficients of the cubics */
+        Cubic[] C = new Cubic[n + 1];
+        for (k = 0; k < n; k++) {
+            C[k] = new Cubic((float) x[k], D[k], 3 * (x[k + 1] - x[k]) - 2 * D[k] - D[k + 1],
+                    2 * (x[k] - x[k + 1]) + D[k] + D[k + 1]);
+        }
+        C[n] = new Cubic((float) x[n], D[n], 3 * (x[0] - x[n]) - 2 * D[n] - D[0],
+                2 * (x[n] - x[0]) + D[n] + D[0]);
+        return C;
+    }
+}
diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/SplinesDefs.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/SplinesDefs.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,198 @@
+/* SplinesDefs.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012;
+
+import java.awt.Point;
+import java.awt.Polygon;
+
+public class SplinesDefs {
+
+    private final static Point[] mainLeafArray = {
+        new Point(268, 307),
+        new Point(274, 326),
+        new Point(289, 337),
+        new Point(317, 349),
+        new Point(362, 350),
+        new Point(413, 334),
+        new Point(428, 326),
+        new Point(453, 309),
+        new Point(469, 292),
+        new Point(496, 264),
+        new Point(516, 236),
+        new Point(531, 215),
+        new Point(550, 185),
+        new Point(567, 155),
+        new Point(580, 130),
+        new Point(571, 139),
+        new Point(555, 148),
+        new Point(540, 157),
+        new Point(521, 167),
+        new Point(502, 174),
+        new Point(477, 183),
+        new Point(443, 193),
+        new Point(413, 201),
+        new Point(392, 209),
+        new Point(376, 218),
+        new Point(363, 228),
+        new Point(356, 250),
+        new Point(372, 231),
+        new Point(398, 218),
+        new Point(420, 209),
+        new Point(446, 200),
+        new Point(479, 192),
+        new Point(505, 182),
+        new Point(547, 168),
+        new Point(539, 182),
+        new Point(526, 204),
+        new Point(509, 227),
+        new Point(498, 244),
+        new Point(486, 257),
+        new Point(469, 272),
+        new Point(460, 281),
+        new Point(449, 293),
+        new Point(436, 303),
+        new Point(418, 315),
+        new Point(400, 323),
+        new Point(383, 332),
+        new Point(367, 334),
+        new Point(343, 338),
+        new Point(322, 335),
+        new Point(304, 330),
+        new Point(288, 322)
+    };
+    private final static Point[] mainLeafStalkArray = {
+        new Point(353, 287),
+        new Point(366, 295),
+        new Point(376, 291),
+        new Point(392, 283),
+        new Point(428, 251),
+        new Point(441, 233),
+        new Point(462, 217),
+        new Point(446, 225),
+        new Point(434, 236),
+        new Point(428, 242),
+        new Point(408, 261),
+        new Point(392, 275),
+        new Point(373, 284),
+        new Point(363, 289)
+    };
+    private final static Point[] smallLeafArray = {
+        new Point(342, 207),
+        new Point(352, 213),
+        new Point(360, 218),
+        new Point(374, 217),
+        new Point(389, 202),
+        new Point(397, 175),
+        new Point(396, 143),
+        new Point(397, 113),
+        new Point(380, 127),
+        new Point(350, 145),
+        new Point(327, 155),
+        new Point(313, 166),
+        new Point(297, 182),
+        new Point(293, 196),
+        new Point(308, 183),
+        new Point(332, 167),
+        new Point(364, 150),
+        new Point(385, 137),
+        new Point(384, 158),
+        new Point(382, 187),
+        new Point(371, 204)
+    };
+    private final static Point[] smallLeafStalkArray = {
+        new Point(320, 203),
+        new Point(331, 191),
+        new Point(345, 185),
+        new Point(356, 183),
+        new Point(365, 177),
+        new Point(368, 171),
+        new Point(368, 165),
+        new Point(360, 173),
+        new Point(354, 176),
+        new Point(341, 180),
+        new Point(334, 184),
+        new Point(321, 194)
+    };
+
+    public static Polygon getMainLeaf(Double scalex, double scaley) {
+
+        return polygonizeControlPoints(mainLeafArray, scalex, scaley);
+    }
+
+    static Polygon polygonizeControlPoints(Point[] pp, Double scalex, double scaley) {
+        Polygon r = new Polygon();
+        for (int i = 0; i < pp.length; i++) {
+            Point p = pp[i];
+            r.addPoint((int) ((double) p.x * (double) scalex), (int) ((double) p.y * (double) scaley));
+        }
+        return r;
+    }
+
+    public static Polygon getSecondLeaf(Double scalex, double scaley) {
+        return polygonizeControlPoints(smallLeafArray, scalex, scaley);
+    }
+
+    public static Polygon getSecondLeafStalk(Double scalex, double scaley) {
+        return polygonizeControlPoints(smallLeafStalkArray, scalex, scaley);
+    }
+
+    public static Polygon getMainLeafStalk(Double scalex, double scaley) {
+        return polygonizeControlPoints(mainLeafStalkArray, scalex, scaley);
+    }
+
+    public static Polygon getMainLeafCurve(Double scalex, double scaley) {
+        return getNatCubicClosed(getMainLeaf(scalex, scaley));
+    }
+
+    public static Polygon getMainLeafStalkCurve(Double scalex, double scaley) {
+        return getNatCubicClosed(getMainLeafStalk(scalex, scaley));
+    }
+
+    public static Polygon getSecondLeafCurve(Double scalex, double scaley) {
+        return getNatCubicClosed(getSecondLeaf(scalex, scaley));
+    }
+
+    public static Polygon getSecondLeafStalkCurve(Double scalex, double scaley) {
+        return getNatCubicClosed(getSecondLeafStalk(scalex, scaley));
+    }
+
+    static Polygon getNatCubicClosed(Polygon p) {
+        NatCubicClosed c = new NatCubicClosed();
+        c.setSourcePolygon(p);
+        return c.calcualteResult();
+    }
+}
diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextOutlineRenderer.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextOutlineRenderer.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,152 @@
+/* TextOutlineRenderer.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.Rectangle;
+import java.awt.RenderingHints;
+import java.awt.Shape;
+import java.awt.font.FontRenderContext;
+import java.awt.font.TextLayout;
+import java.awt.geom.AffineTransform;
+
+public class TextOutlineRenderer {
+
+    private Image img;
+    private Font font;
+    private Color outlineColor;
+    private final String text;
+
+    public TextOutlineRenderer(Font f, String s) {
+        this.font = f;
+        outlineColor = Color.black;
+        this.text = s;
+
+    }
+
+    public TextOutlineRenderer(Font f, String s, Color textOutline) {
+        this(f, s);
+        this.outlineColor = textOutline;
+    }
+
+    public int getWidth() {
+        if (img == null) {
+            return -1;
+        }
+        return img.getWidth(null);
+    }
+
+    public int getHeight() {
+        if (img == null) {
+            return -1;
+        }
+        return img.getHeight(null);
+    }
+
+    public void cutTo(Graphics2D g2, int x, int y) {
+        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+                RenderingHints.VALUE_ANTIALIAS_ON);
+
+        g2.setRenderingHint(RenderingHints.KEY_RENDERING,
+                RenderingHints.VALUE_RENDER_QUALITY);
+
+        FontRenderContext frc = g2.getFontRenderContext();
+        TextLayout tl = new TextLayout(getText(), getFont(), frc);
+        float sw = (float) tl.getBounds().getWidth();
+        AffineTransform transform = new AffineTransform();
+        transform.setToTranslation(x, y);
+        Shape shape = tl.getOutline(transform);
+        Rectangle r = shape.getBounds();
+        g2.setColor(getTextOutline());
+        g2.draw(shape);
+        g2.setClip(shape);
+        g2.drawImage(getImg(), r.x, r.y, r.width, r.height, null);
+
+    }
+
+    /**
+     * @return the img
+     */
+    public Image getImg() {
+        return img;
+    }
+
+    /**
+     * @param img the img to set
+     */
+    public void setImg(Image img) {
+        this.img = img;
+    }
+
+    /**
+     * @return the font
+     */
+    public Font getFont() {
+        return font;
+    }
+
+    /**
+     * @param font the font to set
+     */
+    public void setFont(Font font) {
+        this.font = font;
+    }
+
+    /**
+     * @return the color of outline
+     */
+    public Color getTextOutline() {
+        return outlineColor;
+    }
+
+    /**
+     * @param outlineColor the color of outline
+     */
+    public void setTextOutline(Color textOutline) {
+        this.outlineColor = textOutline;
+    }
+
+    /**
+     * @return the text
+     */
+    public String getText() {
+        return text;
+    }
+}
diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextWithWaterLevel.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextWithWaterLevel.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,179 @@
+/* TextWithWaterLevel.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012;
+
+import java.awt.Polygon;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics2D;
+import java.awt.Point;
+import java.awt.RenderingHints;
+import java.awt.image.BufferedImage;
+import java.util.Random;
+
+public class TextWithWaterLevel extends TextOutlineRenderer {
+
+    private Color waterColor;
+    private Color bgColor;
+    private int percentageOfWater;
+    private Random sea = new Random();
+    //set to null befor getBackground if waving is needed
+    //or create new TWL ;)
+    private Polygon cachedPolygon;
+
+    public TextWithWaterLevel(String s, Font f) {
+        super(f, s);
+        waterColor = Color.BLUE;
+        bgColor = Color.white;
+
+    }
+
+    protected Point getFutureSize() {
+        BufferedImage bi = new BufferedImage(10, 10, BufferedImage.TYPE_INT_ARGB);
+        FontMetrics fm = bi.createGraphics().getFontMetrics(getFont());
+        int w = fm.stringWidth(getText());
+        int h = fm.getHeight();
+        return new Point(w, h);
+    }
+
+    public BufferedImage getBackground() {
+        Point p = getFutureSize();
+        int w = p.x;
+        int h = p.y;
+        if (w <= 0 || h <= 0) {
+            return null;
+        }
+        BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
+        Graphics2D g2d = bi.createGraphics();
+        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+        g2d.setColor(bgColor);
+        g2d.fillRect(0, 0, w, h);
+        if (cachedPolygon == null) {
+            int level = (h * percentageOfWater) / 100;
+            int waveHeight = 10;
+            int waveLength = 20;
+            if (level > waveHeight / 2 + 1) {
+                NatCubic line = new NatCubic();
+                int x = 0;
+                while (x < w + 2 * waveLength) {
+                    line.addPoint(x, h - level - waveHeight / 2 - sea.nextInt(waveHeight));
+                    x = x + waveLength;
+                }
+                cachedPolygon = line.calcualteResult();
+                cachedPolygon.addPoint(w, h);
+                cachedPolygon.addPoint(0, h);
+            }
+        }
+        g2d.setColor(waterColor);
+        if (cachedPolygon != null) {
+            g2d.fillPolygon(cachedPolygon);
+        }
+        //line.paint(g2d);
+        //FlodFill.floodFill(bi, waterColor, new Point(1, h - 1));
+        return bi;
+    }
+
+    public Polygon getCachedPolygon() {
+        return cachedPolygon;
+    }
+
+    public void setCachedPolygon(Polygon cachedPolygon) {
+        this.cachedPolygon = cachedPolygon;
+    }
+
+    @Override
+    public void cutTo(Graphics2D g2, int x, int y) {
+        if (this.getImg() == null) {
+            this.setImg(getBackground());
+        }
+        if (this.getImg() == null) {
+            return;
+        }
+        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+        g2.setFont(getFont());
+        g2.setColor(getTextOutline());
+        g2.drawString(getText(), x, y - 2);
+        g2.drawString(getText(), x, y + 2);
+        g2.drawString(getText(), x - 2, y);
+        g2.drawString(getText(), x + 2, y);
+        //sorry, cuted text have disturbed borders
+        super.cutTo(g2, x, y);
+    }
+
+    /**
+     * @return the waterColor
+     */
+    public Color getWaterColor() {
+        return waterColor;
+    }
+
+    /**
+     * @param waterColor the waterColor to set
+     */
+    public void setWaterColor(Color waterColor) {
+        this.waterColor = waterColor;
+    }
+
+    /**
+     * @return the bgColor
+     */
+    public Color getBgColor() {
+        return bgColor;
+    }
+
+    /**
+     * @param bgColor the bgColor to set
+     */
+    public void setBgColor(Color bgColor) {
+        this.bgColor = bgColor;
+    }
+
+    /**
+     * @return the percentageOfWater
+     */
+    public int getPercentageOfWater() {
+        return percentageOfWater;
+    }
+
+    /**
+     * @param percentageOfWater the percentageOfWater to set
+     */
+    public void setPercentageOfWater(int percentageOfWater) {
+        this.percentageOfWater = percentageOfWater;
+    }
+}
diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/parts/BasicComponentErrorSplashScreen.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/splashscreen/parts/BasicComponentErrorSplashScreen.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,85 @@
+/* BasicComponentSplashScreen.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.parts;
+
+import net.sourceforge.jnlp.splashscreen.SplashErrorPanel;
+
+public abstract class BasicComponentErrorSplashScreen extends BasicComponentSplashScreen implements SplashErrorPanel {
+
+    /**
+     * When applet loading fails, then dying stacktrace can be stted, and is then shown to user on demand.
+     */
+    private Throwable loadingException;
+   
+
+    /**
+     * @return the loadingException
+     */
+    @Override
+    public Throwable getLoadingException() {
+        return loadingException;
+    }
+
+    /**
+     * @param loadingException the loadingException to set
+     */
+    @Override
+    public void setLoadingException(Throwable loadingException) {
+        this.loadingException = loadingException;
+    }
+
+   
+
+    protected void raiseExceptionDialogNOW() {
+        JEditorPaneBasedExceptionDialog dialog = new JEditorPaneBasedExceptionDialog(null, true, getLoadingException(), getInformationElement(), createAditionalInfo());
+        dialog.setVisible(true);
+    }
+
+    protected void raiseExceptionDialogQUEUED() {
+        java.awt.EventQueue.invokeLater(new Runnable() {
+
+            @Override
+            public void run() {
+                raiseExceptionDialogNOW();
+            }
+        });
+    }
+
+    protected void raiseExceptionDialog() {
+        raiseExceptionDialogQUEUED();
+    }
+}
diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/parts/BasicComponentSplashScreen.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/splashscreen/parts/BasicComponentSplashScreen.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,156 @@
+/* BasicComponentSplashScreen.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.parts;
+
+import javax.swing.JComponent;
+import net.sourceforge.jnlp.splashscreen.SplashPanel;
+import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason;
+
+public abstract class BasicComponentSplashScreen extends JComponent implements SplashPanel {
+    //scaling 100%
+    public static final double ORIGINAL_W = 635;
+    public static final double ORIGINAL_H = 480;
+       /** Width of the plugin window */
+    protected int pluginWidth;
+    /** Height of the plugin window */
+    protected int pluginHeight;
+    /** The project name to display */
+    private SplashReason splashReason;
+    private boolean animationRunning = false;
+    private InformationElement content;
+    private String version;
+
+    @Override
+    public JComponent getSplashComponent() {
+        return this;
+    }
+
+    @Override
+    public boolean isAnimationRunning() {
+        return animationRunning;
+    }
+
+    public void setAnimationRunning(boolean b){
+        animationRunning=b;
+    }
+
+    @Override
+    public void setInformationElement(InformationElement content) {
+        this.content = content;
+    }
+
+    @Override
+    public InformationElement getInformationElement() {
+        return content;
+    }
+
+   
+    /**
+     * @return the pluginWidth
+     */
+    @Override
+    public int getSplashWidth() {
+        return pluginWidth;
+    }
+
+    /**
+     * @param pluginWidth the pluginWidth to set
+     */
+    @Override
+    public void setSplashWidth(int pluginWidth) {
+        this.pluginWidth = pluginWidth;
+    }
+
+    /**
+     * @return the pluginHeight
+     */
+    @Override
+    public int getSplashHeight() {
+        return pluginHeight;
+    }
+
+    /**
+     * @param pluginHeight the pluginHeight to set
+     */
+    @Override
+    public void setSplashHeight(int pluginHeight) {
+        this.pluginHeight = pluginHeight;
+    }
+
+    /**
+     * @return the splashReason
+     */
+    @Override
+    public SplashReason getSplashReason() {
+        return splashReason;
+    }
+
+    /**
+     * @param splashReason the splashReason to set
+     */
+    @Override
+    public void setSplashReason(SplashReason splashReason) {
+        this.splashReason = splashReason;
+    }
+
+    /**
+     * @return the version
+     */
+    @Override
+    public String getVersion() {
+        return version;
+    }
+
+    /**
+     * @param version the version to set
+     */
+    @Override
+    public void setVersion(String version) {
+        this.version = version;
+    }
+
+   
+    protected String createAditionalInfo() {
+        if (getVersion() != null) {
+            return getSplashReason().toString() + " version: " + getVersion();
+        } else {
+            return null;
+        }
+    }
+
+   
+}
diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItem.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItem.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,126 @@
+/* DescriptionInfoItem.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.parts;
+
+/**
+ *description element: A short statement about the application. Description 
+ * elements are optional. The kind attribute defines how the description should
+ * be used. It can have one of the following values:
+ *
+ *   * one-line: If a reference to the application is going to appear on one row
+ *     in a list or a table, this description will be used.
+ *   * short: If a reference to the application is going to be displayed in a
+ *     situation where there is room for a paragraph, this description is used.
+ *   * tooltip: If a reference to the application is going to appear in a
+ *     tooltip, this description is used.
+ *
+ * Only one description element of each kind can be specified. A description
+ *  element without a kind is used as a default value. Thus, if Java Web Start
+ *  needs a description of kind short, and it is not specified in the JNLP file,
+ *  then the text from the description without an attribute is used.
+ *
+ * All descriptions contain plain text. No formatting, such as with HTML tags,
+ *  is supported.
+ */
+public class DescriptionInfoItem extends InfoItem {
+
+    protected String kind;
+
+    public DescriptionInfoItem(String value, String kind) {
+        super(InfoItem.description, value);
+        this.kind = kind;
+    }
+
+    public String getKind() {
+        return kind;
+    }
+
+    public void setKind(String kind) {
+        this.kind = kind;
+    }
+
+    public boolean isOfSameKind(DescriptionInfoItem o) {
+        if (o.getKind() == null && getKind() == null) {
+            return true;
+        }
+        if (o.getKind() == null && getKind() != null) {
+            return false;
+        }
+        if (o.getKind() != null && getKind() == null) {
+            return false;
+        }
+        return (o.getKind().equals(getKind()));
+    }
+
+    public boolean isSame(DescriptionInfoItem o) {
+        return isOfSameKind(o) && isofSameType(o);
+
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (!(obj instanceof DescriptionInfoItem)) {
+            return false;
+        }
+        DescriptionInfoItem o = (DescriptionInfoItem) obj;
+        return super.equals(o) && isOfSameKind(o);
+
+
+    }
+
+    @Override
+    public int hashCode() {
+        int hash = 7;
+        hash = 59 * hash + (this.kind != null ? this.kind.hashCode() : 0);
+        hash = 59 * hash + (this.getType() != null ? this.getType().hashCode() : 0);
+        hash = 59 * hash + (this.getValue() != null ? this.getValue().hashCode() : 0);
+        return hash;
+    }
+
+    @Override
+    public String toString() {
+        return super.toString() + " (" + getKind() + ")";
+    }
+
+  
+
+    @Override
+    public String toNiceString() {
+        return super.toNiceString();
+    }
+
+}
diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/parts/InfoItem.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/splashscreen/parts/InfoItem.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,145 @@
+/* InfoItem.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.parts;
+
+import net.sourceforge.jnlp.InformationDesc;
+import net.sourceforge.jnlp.runtime.Translator;
+
+/**
+ * The optional kind="splash" attribute may be used in an icon element to
+ * indicate that the image is to be used as a "splash" screen during the launch
+ * of an application. If the JNLP file does not contain an icon element with
+ * kind="splash" attribute, Java Web Start will construct a splash screen using
+ * other items from the information Element.
+ * If the JNLP file does not contain any icon images, the splash image will
+ * consist of the application's title and vendor, as taken from the JNLP file.
+ *
+ * items not used inside
+ */
+public class InfoItem {
+
+    public static final String SPLASH = "SPLASH";
+    public static final String title = "title";
+    public static final String vendor = "vendor";
+    public static final String homepage = "homepage";
+    public static final String homepageHref = "href";
+    public static final String description = "description";
+    public static final String descriptionKind = "kind";
+    public static final String descriptionKindOneLine = (String) InformationDesc.ONE_LINE;
+    //when no kind is specified, then it should behave as short
+    public static final String descriptionKindShort = (String) InformationDesc.SHORT;
+    public static final String descriptionKindToolTip = (String) InformationDesc.TOOLTIP;
+    protected String type;
+    protected String value;
+
+
+    public InfoItem(String type, String value) {
+        this.type = type;
+        this.value = value;
+    }
+
+    /**
+     * @return the type
+     */
+    public String getType() {
+        return type;
+    }
+
+    /**
+     * @param type the type to set
+     */
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    /**
+     * @return the value
+     */
+    public String getValue() {
+        return value;
+    }
+
+    /**
+     * @param value the value to set
+     */
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public boolean isofSameType(InfoItem o) {
+        return ((getType().equals(o.getType())));
+
+
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (!(obj instanceof InfoItem)) {
+            return false;
+        }
+        InfoItem o = (InfoItem) obj;
+        return isofSameType(o) && (getValue().equals(o.getValue()));
+
+
+
+    }
+
+    @Override
+    public String toString() {
+        return type + ": " + value;
+    }
+
+
+    
+
+    public String toNiceString() {
+        String key = SPLASH + type;
+        return localise(key, value);
+    }
+
+    public static String localise(String key, String s) {
+        return Translator.R(key) + ": " + s;
+    }
+
+    @Override
+    public int hashCode() {
+        int hash = 7;
+        hash = 59 * hash + (this.getType() != null ? this.getType().hashCode() : 0);
+        hash = 59 * hash + (this.getValue() != null ? this.getValue().hashCode() : 0);
+        return hash;
+    }
+}
diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/parts/InformationElement.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/splashscreen/parts/InformationElement.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,214 @@
+/* InformationElement.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+/**
+http://docs.oracle.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html
+ */
+package net.sourceforge.jnlp.splashscreen.parts;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import net.sourceforge.jnlp.InformationDesc;
+import net.sourceforge.jnlp.JNLPFile;
+
+/**
+ * This class is wrapper arround <information> tag which should
+ * javaws provide from source jnlp file
+ */
+public class InformationElement {
+
+    private InfoItem title;
+    private InfoItem vendor;
+    private InfoItem homepage;
+    private List<DescriptionInfoItem> descriptions = new ArrayList<DescriptionInfoItem>(5);
+
+    public void setTitle(String title) {
+        if (title == null) {
+            return;
+        }
+        this.title = new InfoItem(InfoItem.title, title);
+    }
+
+    public void setvendor(String vendor) {
+        if (vendor == null) {
+            return;
+        }
+        this.vendor = new InfoItem(InfoItem.vendor, vendor);
+    }
+
+    public void setHomepage(String homepage) {
+        if (homepage == null) {
+            return;
+        }
+        this.homepage = new InfoItem(InfoItem.homepage, homepage);
+    }
+
+    public void addDescription(String description) {
+        addDescription(description, null);
+    }
+
+    /**
+     * Just one description of each kind (4 including null)  are  allowed in information element.
+     * This method should throw exception when trying to add second description of same kind
+     * But I do not consider it as good idea to force this behaviour for somesing like psalsh screen,
+     * so I jsut replace the previous one with new one. without any warning
+     */
+    public void addDescription(String description, String kind) {
+        if (description == null) {
+            return;
+        }
+        DescriptionInfoItem d = new DescriptionInfoItem(description, kind);
+        for (DescriptionInfoItem descriptionInfoItem : descriptions) {
+            if (descriptionInfoItem.isOfSameKind(d)) {
+                descriptions.remove(descriptionInfoItem);
+                descriptions.add(d);
+                return;
+            }
+        }
+        descriptions.add(d);
+
+    }
+
+    public InfoItem getBestMatchingDescriptionForSplash() {
+        for (DescriptionInfoItem d : descriptions) {
+            if (InfoItem.descriptionKindOneLine.equals(d.getKind())) {
+                return d;
+            }
+        }
+        for (DescriptionInfoItem d : descriptions) {
+            if (d.getKind() == null) {
+                return d;
+            }
+        }
+        return null;
+    }
+
+    public InfoItem getLongestDescriptionForSplash() {
+        for (DescriptionInfoItem d : descriptions) {
+            if (InfoItem.descriptionKindShort.equals(d.getKind())) {
+                return d;
+            }
+        }
+        for (DescriptionInfoItem d : descriptions) {
+            if (d.getKind() == null) {
+                return d;
+            }
+        }
+        for (DescriptionInfoItem d : descriptions) {
+            if (InfoItem.descriptionKindOneLine.equals(d.getKind())) {
+                return d;
+            }
+        }
+        for (DescriptionInfoItem d : descriptions) {
+            if (InfoItem.descriptionKindToolTip.equals(d.getKind())) {
+                return d;
+            }
+        }
+        return null;
+    }
+
+    public String getTitle() {
+        if (title == null) {
+            return null;
+        }
+        return title.toNiceString();
+    }
+
+    public String getVendor() {
+        if (vendor == null) {
+            return null;
+        }
+        return vendor.toNiceString();
+    }
+
+    public String getHomepage() {
+        if (homepage == null) {
+            return null;
+        }
+        return homepage.toNiceString();
+    }
+
+    List<DescriptionInfoItem> getDescriptions() {
+        return Collections.unmodifiableList(descriptions);
+    }
+
+    public String getDescription() {
+        InfoItem i = getBestMatchingDescriptionForSplash();
+        if (i == null) {
+            return null;
+        }
+        return i.toNiceString();
+    }
+
+    public List<String> getHeader() {
+        List<String> r = new ArrayList<String>(4);
+        String t = getTitle();
+        String v = getVendor();
+        String h = getHomepage();
+        if (t != null) {
+            r.add(t);
+        }
+        if (v != null) {
+            r.add(v);
+        }
+        if (h != null) {
+            r.add(h);
+        }
+
+        return r;
+    }
+
+    public static InformationElement createFromJNLP(JNLPFile file) {
+        if (file == null) {
+            return null;
+        }
+        try {
+            InformationElement ie = new InformationElement();
+            ie.setHomepage(file.getInformation().getHomepage().toString());
+            ie.setTitle(file.getInformation().getTitle());
+            ie.setvendor(file.getInformation().getVendor());
+            ie.addDescription(file.getInformation().getDescriptionStrict((String) (InformationDesc.DEFAULT)));
+            ie.addDescription(file.getInformation().getDescriptionStrict(InfoItem.descriptionKindOneLine), InfoItem.descriptionKindOneLine);
+            ie.addDescription(file.getInformation().getDescriptionStrict(InfoItem.descriptionKindShort), InfoItem.descriptionKindShort);
+            ie.addDescription(file.getInformation().getDescriptionStrict(InfoItem.descriptionKindToolTip), InfoItem.descriptionKindToolTip);
+            return ie;
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            return null;
+        }
+    }
+}
diff -r 01544fb82384 netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,357 @@
+/* JeditorPaneBasedExceptionDialog.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.parts;
+
+import java.awt.Toolkit;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.StringSelection;
+import java.awt.event.WindowEvent;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.List;
+import javax.swing.BorderFactory;
+import javax.swing.GroupLayout;
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JEditorPane;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.LayoutStyle;
+import javax.swing.SwingConstants;
+import javax.swing.WindowConstants;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkListener;
+import net.sourceforge.jnlp.runtime.Translator;
+
+public class JEditorPaneBasedExceptionDialog extends JDialog implements HyperlinkListener {
+
+    // components
+    private JButton closeButton;
+    private JButton closeAndCopyButton;
+    private JButton homeButton;
+    private JEditorPane htmlErrorAndHelpPanel;
+    private JLabel exceptionLabel;
+    private JLabel iconLabel;
+    private JPanel mainPanel;
+    private JPanel topPanel;
+    private JPanel bottomPanel;
+    private JScrollPane htmlPaneScroller;
+    // End of components declaration
+    private final String message;
+    private final Throwable exception;
+
+    /** Creates new form JEditorPaneBasedExceptionDialog */
+    public JEditorPaneBasedExceptionDialog(java.awt.Frame parent, boolean modal, Throwable ex, InformationElement information, String anotherInfo) {
+        super(parent, modal);
+        initComponents();
+        htmlErrorAndHelpPanel.setContentType("text/html");
+        htmlErrorAndHelpPanel.setEditable(false);
+        List<String> l = infoElementToList(information);
+        this.message = getText(ex, l, anotherInfo);
+        this.exception = ex;
+        if (exception == null) {
+            closeAndCopyButton.setVisible(false);
+        }
+        htmlErrorAndHelpPanel.setText(message);
+        //htmlPaneScroller.getVerticalScrollBar().setValue(1);
+        htmlErrorAndHelpPanel.setCaretPosition(0);
+        try {
+            Icon icon = new ImageIcon(this.getClass().getResource("/net/sourceforge/jnlp/resources/warning.png"));
+            iconLabel.setIcon(icon);
+        } catch (Exception lex) {
+            lex.printStackTrace();
+        }
+        htmlErrorAndHelpPanel.addHyperlinkListener(this);
+        homeButton.setVisible(false);
+        this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+
+
+    }
+
+    static List<String> infoElementToList(InformationElement information) {
+        List<String> l = null;
+        if (information != null) {
+            l = information.getHeader();
+            InfoItem ii = information.getLongestDescriptionForSplash();
+            if (ii != null) {
+                l.add(ii.toNiceString());
+            }
+        }
+        return l;
+    }
+
+    private void initComponents() {
+
+        topPanel = new JPanel();
+        closeButton = new JButton();
+        closeAndCopyButton = new JButton();
+        mainPanel = new JPanel();
+        exceptionLabel = new JLabel();
+        iconLabel = new JLabel();
+        bottomPanel = new JPanel();
+        htmlPaneScroller = new JScrollPane();
+        htmlErrorAndHelpPanel = new JEditorPane();
+        homeButton = new JButton();
+
+        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+
+        closeButton.setText(Translator.R(InfoItem.SPLASH + "Close"));
+        closeButton.addActionListener(new java.awt.event.ActionListener() {
+
+            @Override
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                closeWindowButtonActionPerformed(evt);
+            }
+        });
+
+        closeAndCopyButton.setText(Translator.R(InfoItem.SPLASH + "closewAndCopyException"));
+        closeAndCopyButton.addActionListener(new java.awt.event.ActionListener() {
+
+            @Override
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                copyAndCloseButtonActionPerformed(evt);
+            }
+        });
+
+        GroupLayout jPanel2Layout = new GroupLayout(topPanel);
+        topPanel.setLayout(jPanel2Layout);
+        jPanel2Layout.setHorizontalGroup(
+                jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(jPanel2Layout.createSequentialGroup().addContainerGap().addComponent(closeButton).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 314, Short.MAX_VALUE).addComponent(closeAndCopyButton).addContainerGap()));
+        jPanel2Layout.setVerticalGroup(
+                jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup().addContainerGap(24, Short.MAX_VALUE).addGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(closeButton).addComponent(closeAndCopyButton)).addContainerGap()));
+
+        exceptionLabel.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
+        exceptionLabel.setHorizontalAlignment(SwingConstants.CENTER);
+        exceptionLabel.setText(Translator.R(InfoItem.SPLASH + "exOccured"));
+
+        bottomPanel.setBorder(BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
+        bottomPanel.setLayout(new java.awt.BorderLayout());
+
+        htmlPaneScroller.setViewportView(htmlErrorAndHelpPanel);
+
+        bottomPanel.add(htmlPaneScroller, java.awt.BorderLayout.CENTER);
+
+        homeButton.setText(Translator.R(InfoItem.SPLASH + "Home"));
+        homeButton.addActionListener(new java.awt.event.ActionListener() {
+
+            @Override
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                homeButtonActionPerformed(evt);
+            }
+        });
+
+        GroupLayout jPanel1Layout = new GroupLayout(mainPanel);
+        mainPanel.setLayout(jPanel1Layout);
+        jPanel1Layout.setHorizontalGroup(
+                jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addComponent(iconLabel, GroupLayout.PREFERRED_SIZE, 71, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(exceptionLabel, GroupLayout.DEFAULT_SIZE, 503, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(homeButton, GroupLayout.PREFERRED_SIZE, 101, GroupLayout.PREFERRED_SIZE).addContainerGap()).addComponent(bottomPanel, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 723, Short.MAX_VALUE));
+        jPanel1Layout.setVerticalGroup(
+                jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(iconLabel, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE).addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(exceptionLabel, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE).addComponent(homeButton, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE))).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(bottomPanel, GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE)));
+
+        GroupLayout layout = new GroupLayout(getContentPane());
+        getContentPane().setLayout(layout);
+        layout.setHorizontalGroup(
+                layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING).addComponent(mainPanel, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(topPanel, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)).addContainerGap()));
+        layout.setVerticalGroup(
+                layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap().addComponent(mainPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(topPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addContainerGap()));
+
+        pack();
+    }
+
+    private void copyAndCloseButtonActionPerformed(java.awt.event.ActionEvent evt) {
+        if (exception != null) {
+            try {
+                StringSelection data = new StringSelection(getExceptionStackTraceAsString(exception));
+                Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
+                clipboard.setContents(data, data);
+            } catch (Exception ex) {
+                JOptionPane.showMessageDialog(this, Translator.R(InfoItem.SPLASH + "cantCopyEx"));
+                ex.printStackTrace();
+            }
+        } else {
+            JOptionPane.showMessageDialog(this, Translator.R(InfoItem.SPLASH + "noExRecorded"));
+        }
+        close();
+    }
+
+    private void homeButtonActionPerformed(java.awt.event.ActionEvent evt) {
+        htmlErrorAndHelpPanel.setText(message);
+        homeButton.setVisible(false);
+    }
+
+    private void closeWindowButtonActionPerformed(java.awt.event.ActionEvent evt) {
+        close();
+    }
+
+    /**
+     * @param args the command line arguments
+     */
+    public static void main(String args[]) {
+        java.awt.EventQueue.invokeLater(new Runnable() {
+
+            public void run() {
+                Exception ex = new RuntimeException("dsgsfdg");
+                JEditorPaneBasedExceptionDialog dialog = new JEditorPaneBasedExceptionDialog(new JFrame(), true, ex, null, "uaaa: aaa\nwqdeweq:sdsds");
+                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
+
+                    public void windowClosing(java.awt.event.WindowEvent e) {
+                        System.exit(0);
+                    }
+                });
+                dialog.setVisible(true);
+            }
+        });
+    }
+
+    static String getText(Throwable ex, List<String> l, String anotherInfo) {
+        StringBuilder s = new StringBuilder("<html><body>");
+        String info = "<p>"
+                + Translator.R(InfoItem.SPLASH + "mainL1", createLink())
+                + " </p> \n";
+        String t = "<p>"
+                + Translator.R(InfoItem.SPLASH + "mainL3")
+                + "</p> \n"
+                + info + formatListInfoList(l) + formatInfo(anotherInfo);
+        Object[] options = new String[2];
+        options[0] = Translator.R(InfoItem.SPLASH + "Close");
+        options[1] = Translator.R(InfoItem.SPLASH + "closeAndCopyShorter");
+        if (ex != null) {
+            t = "<p>"
+                    + Translator.R(InfoItem.SPLASH + "mainL4")
+                    + " </p>\n"
+                    + info + formatListInfoList(l) + formatInfo(anotherInfo)
+                    + "<p>"
+                    + Translator.R(InfoItem.SPLASH + "exWas")
+                    + " <br/>\n" + "<pre>" + getExceptionStackTraceAsString(ex) + "</pre>";
+
+
+        } else {
+            t += formatListInfoList(l);
+        }
+        s.append(t);
+        s.append("</body></html>");
+        return s.toString();
+    }
+
+    public static String getExceptionStackTraceAsString(Throwable exception) {
+        if (exception == null) {
+            return "";
+        }
+        StringWriter sw = new StringWriter();
+        exception.printStackTrace(new PrintWriter(sw));
+        return sw.toString();
+    }
+
+    public static String[] getExceptionStackTraceAsStrings(Throwable exception) {
+        if (exception == null) {
+            return new String[0];
+        }
+        StringWriter sw = new StringWriter();
+        exception.printStackTrace(new PrintWriter(sw));
+        return sw.toString().split("\n");
+    }
+
+    @Override
+    public void hyperlinkUpdate(HyperlinkEvent event) {
+        if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
+            try {
+                htmlErrorAndHelpPanel.setPage(event.getURL());
+                homeButton.setVisible(true);
+
+            } catch (Exception ioe) {
+                JOptionPane.showMessageDialog(this, Translator.R(InfoItem.SPLASH + "cfl") + " "
+                        + event.getURL().toExternalForm() + ": " + ioe);
+            }
+        }
+    }
+
+    private void close() {
+        processWindowEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING));
+    }
+
+    static String formatListInfoList(List<String> l) {
+        if (l == null) {
+            return "";
+        }
+        StringBuilder sb = new StringBuilder();
+        sb.append("<p>");
+        sb.append("<h3>").
+                append(Translator.R(InfoItem.SPLASH + "vendorsInfo")).append(":</h3>");
+        sb.append("<pre>");
+        for (int i = 0; i < l.size(); i++) {
+            String string = l.get(i);
+            sb.append(string).append("\n");
+        }
+        sb.append("</pre>");
+        sb.append("</p>");
+        return sb.toString();
+    }
+
+    static String formatInfo(String l) {
+        if (l == null) {
+            return "";
+        }
+        StringBuilder sb = new StringBuilder();
+        sb.append("<p>");
+        sb.append("<h3>").
+                append(Translator.R(InfoItem.SPLASH + "anotherInfo")).append(": </h3>");
+        sb.append("<pre>");
+        sb.append(l);
+        sb.append("</pre>");
+        sb.append("</p>");
+        return sb.toString();
+    }
+
+    Throwable getException() {
+        return exception;
+    }
+
+    String getMessage() {
+        return message;
+   }
+
+   private static String createLink() {
+        return "<a href=\"" + Translator.R(InfoItem.SPLASH + "url") + "\">" +
+                Translator.R(InfoItem.SPLASH + "urlLooks") + "</a>";
+    }
+
+
+}
diff -r 01544fb82384 plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
--- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java	Wed Jul 11 16:18:58 2012 +0200
+++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java	Tue Aug 07 10:38:13 2012 +0200
@@ -76,6 +76,7 @@
 import java.awt.event.WindowListener;
 import java.awt.print.PageFormat;
 import java.awt.print.Printable;
+import java.awt.Component;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.PrintStream;
@@ -93,10 +94,8 @@
 import java.security.PrivilegedExceptionAction;
 import java.util.Enumeration;
 import java.util.HashMap;
-import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.Vector;
 
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
@@ -115,6 +114,11 @@
 import sun.misc.Ref;
 
 import com.sun.jndi.toolkit.url.UrlUtil;
+import java.util.Hashtable;
+import java.util.Vector;
+import net.sourceforge.jnlp.splashscreen.SplashController;
+import net.sourceforge.jnlp.splashscreen.SplashPanel;
+import net.sourceforge.jnlp.splashscreen.SplashUtils;
 
 /**
  * Lets us construct one using unix-style one shot behaviors
@@ -145,7 +149,12 @@
             @Override public void run() {
                 panel.createNewAppContext();
                 // create the frame.
-                PluginAppletViewer.framePanel(identifier, handle, panel);
+                int width = Integer.parseInt(atts.get("width"));
+                int height = Integer.parseInt(atts.get("height"));
+
+                PluginDebug.debug("X and Y are: " + width + " " + height);
+                panel.setAppletViewerFrame(PluginAppletViewer.framePanel(identifier,handle, width, height, panel));
+
                 panel.init();
                 // Start the applet
                 initEventQueue(panel);
@@ -198,6 +207,8 @@
             ie.printStackTrace();
         }
 
+        panel.removeSplash();
+
         AppletSecurityContextManager.getSecurityContext(0).associateSrc(panel.getAppletClassLoader(), doc);
         AppletSecurityContextManager.getSecurityContext(0).associateInstance(identifier, panel.getAppletClassLoader());
 
@@ -271,7 +282,7 @@
 // FIXME: declare JSProxy implementation
 @SuppressWarnings("serial")
 public class PluginAppletViewer extends XEmbeddedFrame
-        implements AppletContext, Printable {
+        implements AppletContext, Printable, SplashController {
 
     /**
      *  Enumerates the current status of an applet
@@ -323,26 +334,32 @@
     private Image bufFrameImg;
     private Graphics bufFrameImgGraphics;
 
+
+    private SplashPanel splashPanel;
+ 
     /**
      * Null constructor to allow instantiation via newInstance()
      */
     public PluginAppletViewer() {
     }
 
-    public static void framePanel(int identifier, long handle, NetxPanel panel) {
+     public static synchronized  PluginAppletViewer framePanel(int identifier,long handle, int width, int height, NetxPanel panel) {
 
         PluginDebug.debug("Framing ", panel);
-
-        // SecurityManager MUST be set, and only privileged code may call reFrame()
+ 
+        // SecurityManager MUST be set, and only privileged code may call framePanel()
         System.getSecurityManager().checkPermission(new AllPermission());
 
         PluginAppletViewer appletFrame = new PluginAppletViewer(handle, identifier, panel);
-
-        appletFrame.add("Center", panel);
-        appletFrame.pack();
-
+        
         appletFrame.appletEventListener = new AppletEventListener(appletFrame, appletFrame);
         panel.addAppletListener(appletFrame.appletEventListener);
+         // Clear bindings, if any
+        if (applets.containsKey(identifier)) {
+            PluginAppletViewer oldFrame = applets.get(identifier);            
+            oldFrame.remove(panel);
+            panel.removeAppletListener(oldFrame.appletEventListener);
+        }
 
         appletsLock.lock();
         applets.put(identifier, appletFrame);
@@ -350,6 +367,7 @@
         appletsLock.unlock();
 
         PluginDebug.debug(panel, " framed");
+               return appletFrame;
     }
 
     /**
@@ -383,9 +401,107 @@
         };
 
         addWindowListener(windowEventListener);
+        final AppletPanel fPanel = panel;
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+
+                public void run() {
+                    add("Center", fPanel);
+                    fPanel.setVisible(false);
+
+                    splashPanel = SplashUtils.getSplashScreen(fPanel.getWidth(), fPanel.getHeight());
+                    if (splashPanel != null) {
+                        splashPanel.startAnimation();
+                        PluginDebug.debug("Added splash " + splashPanel);
+                        add("Center", splashPanel.getSplashComponent());
+                    }
+                    pack();
+                }
+            });
+        } catch (Exception e) {
+            e.printStackTrace(); // Not much we can do other and print
+        }
 
     }
 
+    public void replaceSplash(final SplashPanel newSplash) {
+        // Loading done. Remove splash screen.
+        if (splashPanel == null) {
+            return;
+        }
+        if (newSplash == null) {
+            removeSplash();
+            return;
+        }
+        splashPanel.stopAnimation();
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+
+                public void run() {
+                    splashPanel.getSplashComponent().setVisible(false);
+                    splashPanel.stopAnimation();
+                    remove(splashPanel.getSplashComponent());
+                    newSplash.setPercentage(splashPanel.getPercentage());
+                    newSplash.setSplashWidth(splashPanel.getSplashWidth());
+                    newSplash.setSplashHeight(splashPanel.getSplashHeight());
+                    newSplash.adjustForSize();
+                    splashPanel = newSplash;
+                    add("Center", splashPanel.getSplashComponent());
+                    pack();
+                }
+            });
+        } catch (Exception e) {
+            e.printStackTrace(); // Not much we can do other and print
+        }
+    }
+
+    @Override
+    public void removeSplash() {
+
+        // Loading done. Remove splash screen.
+        if (splashPanel == null) {
+            return;
+        }
+        splashPanel.stopAnimation();
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+
+                public void run() {
+                    splashPanel.getSplashComponent().setVisible(false);
+                    splashPanel.stopAnimation();
+                    remove(splashPanel.getSplashComponent());
+                    splashPanel = null;
+                    // Re-add the applet
+                    remove(panel);
+                    add(panel);
+                    panel.setVisible(true);
+                    pack();
+                }
+            });
+        } catch (Exception e) {
+            e.printStackTrace(); // Not much we can do other and print
+        }
+    }
+
+    @Override
+    public int getSplashWidth() {
+        if (splashPanel != null) {
+            return splashPanel.getSplashWidth();
+        } else {
+            return -1;
+        }
+    }
+
+    @Override
+    public int getSplashHeigth() {
+        if (splashPanel != null) {
+            return splashPanel.getSplashHeight();
+        } else {
+            return -1;
+        }
+    }
+   
+
     private static class AppletEventListener implements AppletListener {
         final Frame frame;
         final PluginAppletViewer appletViewer;
@@ -401,7 +517,6 @@
             panelLock.lock();
             panelLive.signalAll();
             panelLock.unlock();
-
             switch (evt.getID()) {
                 case AppletPanel.APPLET_RESIZE: {
                     if (src != null) {
@@ -436,6 +551,23 @@
 
                     break;
                 }
+                case AppletPanel.APPLET_START: {
+                    String s="Error1 detected";
+                    PluginDebug.debug(s);
+                    if (src.status != AppletPanel.APPLET_INIT && src.status != AppletPanel.APPLET_STOP) {
+                        SplashPanel sp=SplashUtils.getErrorSplashScreen(appletViewer.panel.getWidth(), appletViewer.panel.getHeight(), new Exception(s));
+                        appletViewer.replaceSplash(sp);
+                    }
+
+                    break;
+                }
+                case AppletPanel.APPLET_ERROR: {
+                    String s="Error2 detected";
+                    PluginDebug.debug(s);
+                        SplashPanel sp=SplashUtils.getErrorSplashScreen(appletViewer.panel.getWidth(), appletViewer.panel.getHeight(), new Exception(s));
+                        appletViewer.replaceSplash(sp);
+                    break;
+                }
             }
         }
     }
@@ -517,6 +649,8 @@
                 waitForAppletInit(applets.get(identifier).panel);
 
                 // Should we proceed with reframing?
+                 PluginDebug.debug("Init complete");
+
                 if (updateStatus(identifier, PAV_INIT_STATUS.REFRAME_COMPLETE).equals(PAV_INIT_STATUS.INACTIVE)) {
                     destroyApplet(identifier);
                     return;
@@ -656,6 +790,8 @@
      */
     public static void waitForAppletInit(NetxPanel panel) {
 
+        System.err.println("Waiting for applet init");
+
         // Wait till initialization finishes
         long maxTimeToSleep = APPLET_TIMEOUT;
 
@@ -2094,7 +2230,7 @@
      * the parent class's update() just does a couple of checks (both of
      * which are accounted for) and then calls paint anyway.
      */
-    public void update(Graphics g) {
+    public void paint(Graphics g) {
 
         // If the image or the graphics don't exist, create new ones
         if (bufFrameImg == null || bufFrameImgGraphics == null) {
@@ -2103,11 +2239,18 @@
         }
 
         // Paint off-screen
-        paint(bufFrameImgGraphics);
+        for (Component c: this.getComponents()) {
+                c.update(bufFrameImgGraphics);
+        }
 
         // Draw the painted image
         g.drawImage(bufFrameImg, 0, 0, this);
     }
+  
+    public void update(Graphics g) {
+        paint(g);
+    }
+
 
     /**
      * Waits on a given condition queue until timeout.
-------------- next part --------------
diff -r 01544fb82384 tests/netx/unit/net/sourceforge/jnlp/splashscreen/ErrorSplashScreenTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/ErrorSplashScreenTest.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,167 @@
+/* SplashScreenTest.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen;
+
+import java.awt.BorderLayout;
+import java.awt.event.ComponentEvent;
+import java.awt.event.ComponentListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.image.BufferedImage;
+import javax.swing.JDialog;
+
+import net.sourceforge.jnlp.JNLPSplashScreen;
+import net.sourceforge.jnlp.splashscreen.parts.InfoItem;
+import net.sourceforge.jnlp.splashscreen.parts.InformationElement;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class ErrorSplashScreenTest extends JDialog {
+
+    static int width = JNLPSplashScreen.DEF_WIDTH;
+    static int height = JNLPSplashScreen.DEF_HEIGHT;
+    static SplashErrorPanel panel;
+
+    public ErrorSplashScreenTest() {
+
+        setSize(width - getInsets().left - getInsets().right, height - getInsets().bottom - getInsets().top);
+//   Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
+//    int x = (int) ((dimension.getWidth() - getWidth()) / 2);
+//    int y = (int) ((dimension.getHeight() - getHeight()) / 2);
+        //setLocation(x, y);
+        setLocationRelativeTo(null);
+        this.pack();
+        Exception ex = new Exception("Hi there");
+        panel = SplashUtils.getErrorSplashScreen(width, height, SplashUtils.SplashReason.JAVAWS, ex);
+        InformationElement ie = new InformationElement();
+        ie.setHomepage("http://someones.org/amazing?page");
+        ie.setTitle("Testing information title");
+        ie.setvendor("IcedTea-Web team");
+        ie.addDescription("Testing null description");
+        ie.addDescription("tsting twoline des ...break\ncription of kind short", InfoItem.descriptionKindShort);
+        panel.setInformationElement(ie);
+        panel.setVersion("1.2-re45fdg");
+        setLayout(new BorderLayout());
+        getContentPane().add(panel.getSplashComponent(), BorderLayout.CENTER);
+        addComponentListener(new ComponentListener() {
+
+            @Override
+            public void componentShown(ComponentEvent e) {
+            }
+
+            @Override
+            public void componentResized(ComponentEvent e) {
+                //panel.getSplashComponent().setSize(getWidth(), getHeight());
+                //panel.adjustForSize(getWidth(), getHeight());
+            }
+
+            @Override
+            public void componentMoved(ComponentEvent e) {
+            }
+
+            @Override
+            public void componentHidden(ComponentEvent e) {
+            }
+        });
+    }
+
+    @Test
+    public void splashScreenTestsExists() {
+        //to silence junit,and test is that thsi class was instantiated ;)
+        Assert.assertTrue(true);
+    }
+
+    @Test
+    public void splashScreenTestsPaint0() {
+        //to silence junit,and test is that thsi class was instantiated ;)
+        panel.setSplashWidth(width);
+        panel.setSplashHeight(height);
+        panel.adjustForSize();
+        BufferedImage buf = new BufferedImage(panel.getSplashWidth(), panel.getSplashHeight(), BufferedImage.TYPE_INT_ARGB);
+        panel.setPercentage(0);
+        panel.paintTo(buf.createGraphics());
+        //ImageFontCutterTest.save(buf,"e0");
+    }
+
+    @Test
+    public void splashScreenTestsPaint50() {
+        //to silence junit,and test is that thsi class was instantiated ;)
+        panel.setSplashWidth(width);
+        panel.setSplashHeight(height);
+        panel.adjustForSize();
+        BufferedImage buf = new BufferedImage(panel.getSplashWidth(), panel.getSplashHeight(), BufferedImage.TYPE_INT_ARGB);
+        panel.setPercentage(50);
+        panel.paintTo(buf.createGraphics());
+        // ImageFontCutterTest.save(buf,"e50");
+    }
+
+    @Test
+    public void splashScreenTestsPaint100() {
+        //to silence junit,and test is that thsi class was instantiated ;)
+        panel.setSplashWidth(width);
+        panel.setSplashHeight(height);
+        panel.adjustForSize();
+        BufferedImage buf = new BufferedImage(panel.getSplashWidth(), panel.getSplashHeight(), BufferedImage.TYPE_INT_ARGB);
+        panel.setPercentage(100);
+        panel.paintTo(buf.createGraphics());
+        //  ImageFontCutterTest.save(buf,"e100");
+    }
+
+    public static void main(String args[]) {
+        ErrorSplashScreenTest app = new ErrorSplashScreenTest();
+        app.setVisible(true);
+        app.addWindowListener(
+                new WindowAdapter() {
+
+                    @Override
+                    public void windowClosing(WindowEvent e) {
+                        System.exit(0);
+                    }
+                });
+        panel.setPercentage(30);
+        //panel.startAnimation();
+
+        try {
+            Thread.sleep(10000);
+        } catch (Exception e) {
+        }
+
+        panel.stopAnimation();
+
+
+    }
+}
diff -r 01544fb82384 tests/netx/unit/net/sourceforge/jnlp/splashscreen/ErrorSplashUtilsTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/ErrorSplashUtilsTest.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,213 @@
+/* SplashUtils.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen;
+
+import java.util.HashMap;
+import java.util.Map;
+import net.sourceforge.jnlp.splashscreen.impls.*;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class ErrorSplashUtilsTest {
+
+    private void fakeEnvironment(Map original) throws Exception {
+        SplashUtilsTest.fakeEnvironment(original);
+    }
+
+    private Map getEnvironment() throws Exception {
+        return SplashUtilsTest.getEnvironment();
+    }
+
+    @Test
+    public void determineCallerTest() {
+        SplashUtilsTest.modifyRuntime(false);
+        SplashPanel p1 = SplashUtils.getErrorSplashScreen(100, 100,null);
+        Assert.assertEquals(SplashUtils.SplashReason.APPLET, p1.getSplashReason());
+        SplashUtilsTest.modifyRuntime(true);
+        SplashPanel p2 = SplashUtils.getErrorSplashScreen(100, 100,null);
+        Assert.assertEquals(SplashUtils.SplashReason.JAVAWS, p2.getSplashReason());
+    }
+
+    @Test
+    public void testgetErrorSplashScreen1() throws Exception {
+        Map fake1 = new HashMap();
+        Map original = getEnvironment();
+        Assert.assertNotNull(original);
+        try {
+            fakeEnvironment(fake1);
+            SplashPanel sa = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.APPLET, null);
+            Assert.assertTrue(sa instanceof DefaultErrorSplashScreen2012);
+            Assert.assertTrue(sa.getSplashReason() == SplashUtils.SplashReason.APPLET);
+            SplashPanel sw = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS, new Exception("oj"));
+            Assert.assertTrue(sw instanceof DefaultErrorSplashScreen2012);
+            Assert.assertTrue(sw.getSplashReason() == SplashUtils.SplashReason.JAVAWS);
+        } finally {
+            fakeEnvironment(original);
+        }
+
+
+
+    }
+
+    @Test
+    public void testgetErrorSplashScreen2() throws Exception {
+        Map fake1 = new HashMap();
+        fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.DEFAULT);
+        fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.DEFAULT);
+        Map original = getEnvironment();
+        Assert.assertNotNull(original);
+        try {
+            fakeEnvironment(fake1);
+            SplashPanel sa = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.APPLET, new Exception("oj"));
+            Assert.assertTrue(sa instanceof DefaultErrorSplashScreen2012);
+            Assert.assertTrue(sa.getSplashReason() == SplashUtils.SplashReason.APPLET);
+            SplashPanel sw = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS, null);
+            Assert.assertTrue(sw instanceof DefaultErrorSplashScreen2012);
+            Assert.assertTrue(sw.getSplashReason() == SplashUtils.SplashReason.JAVAWS);
+        } finally {
+            fakeEnvironment(original);
+        }
+
+
+    }
+
+    @Test
+    public void testgetErrorSplashScreen3() throws Exception {
+        Map fake1 = new HashMap();
+        fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.NONE);
+        fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.DEFAULT);
+        Map original = getEnvironment();
+        Assert.assertNotNull(original);
+        try {
+            fakeEnvironment(fake1);
+            SplashPanel sa = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.APPLET, null);
+            Assert.assertTrue(sa instanceof DefaultErrorSplashScreen2012);
+            Assert.assertTrue(sa.getSplashReason() == SplashUtils.SplashReason.APPLET);
+            SplashPanel sw = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS, new Exception("oj"));
+            Assert.assertTrue(sw == null);
+        } finally {
+            fakeEnvironment(original);
+        }
+
+
+
+    }
+
+    @Test
+    public void testgetErrorSplashScreen4() throws Exception {
+        Map fake1 = new HashMap();
+        fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.DEFAULT);
+        fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.NONE);
+        Map original = getEnvironment();
+        Assert.assertNotNull(original);
+        try {
+            fakeEnvironment(fake1);
+            SplashPanel sa = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.APPLET, new Exception("oj"));
+            Assert.assertTrue(sa == null);
+            SplashPanel sw = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS, new Exception("oj"));
+            Assert.assertTrue(sw instanceof DefaultErrorSplashScreen2012);
+            Assert.assertTrue(sw.getSplashReason() == SplashUtils.SplashReason.JAVAWS);
+        } finally {
+            fakeEnvironment(original);
+        }
+
+
+
+    }
+
+    @Test
+    public void testgetErrorSplashScreen5() throws Exception {
+        Map fake1 = new HashMap();
+        fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.NONE);
+        fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.NONE);
+        Map original = getEnvironment();
+        Assert.assertNotNull(original);
+        try {
+            fakeEnvironment(fake1);
+            SplashPanel sa = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.APPLET, null);
+            Assert.assertTrue(sa == null);
+            SplashPanel sw = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS, null);
+            Assert.assertTrue(sw == null);
+        } finally {
+            fakeEnvironment(original);
+        }
+
+    }
+
+    @Test
+    public void testgetErrorSplashScreen6() throws Exception {
+        Map fake1 = new HashMap();
+        fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.DEFAULT);
+        fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, "fgdthyfjtuk");
+        Map original = getEnvironment();
+        Assert.assertNotNull(original);
+        try {
+            fakeEnvironment(fake1);
+            SplashPanel sa = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.APPLET, new Exception("oj"));
+            Assert.assertTrue(sa instanceof DefaultErrorSplashScreen2012);
+            Assert.assertTrue(sa.getSplashReason() == SplashUtils.SplashReason.APPLET);
+            SplashPanel sw = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS, new Exception("oj"));
+            Assert.assertTrue(sw instanceof DefaultErrorSplashScreen2012);
+            Assert.assertTrue(sw.getSplashReason() == SplashUtils.SplashReason.JAVAWS);
+        } finally {
+            fakeEnvironment(original);
+        }
+
+
+    }
+
+    @Test
+    public void testgetErrorSplashScreen7() throws Exception {
+        Map fake1 = new HashMap();
+        fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, "egtrutkyukl");
+        Map original = getEnvironment();
+        Assert.assertNotNull(original);
+        try {
+            fakeEnvironment(fake1);
+            SplashPanel sa = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.APPLET, null);
+            Assert.assertTrue(sa instanceof DefaultErrorSplashScreen2012);
+            Assert.assertTrue(sa.getSplashReason() == SplashUtils.SplashReason.APPLET);
+            SplashPanel sw = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS, null);
+            Assert.assertTrue(sw instanceof DefaultErrorSplashScreen2012);
+            Assert.assertTrue(sw.getSplashReason() == SplashUtils.SplashReason.JAVAWS);
+        } finally {
+            fakeEnvironment(original);
+        }
+
+
+    }
+}
diff -r 01544fb82384 tests/netx/unit/net/sourceforge/jnlp/splashscreen/SplashScreenTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/SplashScreenTest.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,185 @@
+/* SplashScreenTest.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen;
+
+import java.awt.BorderLayout;
+import java.awt.event.ComponentEvent;
+import java.awt.event.ComponentListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.image.BufferedImage;
+import javax.swing.JDialog;
+
+import net.sourceforge.jnlp.JNLPSplashScreen;
+import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.TextOutlineRendererTest;
+import net.sourceforge.jnlp.splashscreen.parts.InfoItem;
+import net.sourceforge.jnlp.splashscreen.parts.InformationElement;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class SplashScreenTest extends JDialog {
+
+    static int width = JNLPSplashScreen.DEF_WIDTH;
+    static int height = JNLPSplashScreen.DEF_HEIGHT;
+    static SplashPanel panel;
+    private static boolean swap = true;
+
+    public SplashScreenTest() {
+
+        setSize(width - getInsets().left - getInsets().right, height - getInsets().bottom - getInsets().top);
+//   Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
+//    int x = (int) ((dimension.getWidth() - getWidth()) / 2);
+//    int y = (int) ((dimension.getHeight() - getHeight()) / 2);
+        //setLocation(x, y);
+        setLocationRelativeTo(null);
+        this.pack();
+        panel = SplashUtils.getSplashScreen(width, height, SplashUtils.SplashReason.JAVAWS);
+        InformationElement ie = new InformationElement();
+        ie.setHomepage("http://someones.org/amazing?page");
+        ie.setTitle("Testing information title");
+        ie.setvendor("IcedTea-Web team");
+        ie.addDescription("Testing null description");
+        ie.addDescription("tsting twoline des ...break\ncription of kind short", InfoItem.descriptionKindShort);
+        //panel.setInformationElement(ie);
+        //panel.setVersion("1.2-re45fdg");
+        setLayout(new BorderLayout());
+        getContentPane().add(panel.getSplashComponent(), BorderLayout.CENTER);
+
+        addComponentListener(new ComponentListener() {
+
+            @Override
+            public void componentShown(ComponentEvent e) {
+            }
+
+            @Override
+            public void componentResized(ComponentEvent e) {
+                //panel.getSplashComponent().setSize(getWidth(), getHeight());
+                //panel.adjustForSize(getWidth(), getHeight());
+            }
+
+            @Override
+            public void componentMoved(ComponentEvent e) {
+            }
+
+            @Override
+            public void componentHidden(ComponentEvent e) {
+            }
+        });
+    }
+
+    @Test
+    public void splashScreenTestsExists() {
+        //to silence junit,and test is that thsi class was instantiated ;)
+        Assert.assertTrue(true);
+    }
+
+    @Test
+    public void splashScreenTestsPaint0() {
+        //to silence junit,and test is that thsi class was instantiated ;)
+        panel.setSplashWidth(width);
+        panel.setSplashHeight(height);
+        panel.adjustForSize();
+        BufferedImage buf = new BufferedImage(panel.getSplashWidth(), panel.getSplashHeight(), BufferedImage.TYPE_INT_ARGB);
+        panel.setPercentage(0);
+        panel.paintTo(buf.createGraphics());
+        //   TextOutlineRendererTest.save(buf,"s0");
+    }
+
+    @Test
+    public void splashScreenTestsPaint50() {
+        //to silence junit,and test is that thsi class was instantiated ;)
+        panel.setSplashWidth(width);
+        panel.setSplashHeight(height);
+        panel.adjustForSize();
+        BufferedImage buf = new BufferedImage(panel.getSplashWidth(), panel.getSplashHeight(), BufferedImage.TYPE_INT_ARGB);
+        panel.setPercentage(50);
+        panel.paintTo(buf.createGraphics());
+        //  TextOutlineRendererTest.save(buf,"s50");
+    }
+
+    @Test
+    public void splashScreenTestsPaint100() {
+        //to silence junit,and test is that thsi class was instantiated ;)
+        panel.setSplashWidth(width);
+        panel.setSplashHeight(height);
+        panel.adjustForSize();
+        BufferedImage buf = new BufferedImage(panel.getSplashWidth(), panel.getSplashHeight(), BufferedImage.TYPE_INT_ARGB);
+        panel.setPercentage(100);
+        panel.paintTo(buf.createGraphics());
+        // TextOutlineRendererTest.save(buf,"s100");
+    }
+
+    public static void main(String args[]) {
+        SplashScreenTest app = new SplashScreenTest();
+        app.setVisible(true);
+
+        app.addWindowListener(
+                new WindowAdapter() {
+
+                    @Override
+                    public void windowClosing(WindowEvent e) {
+                        System.exit(0);
+                    }
+                });
+
+        panel.startAnimation();
+
+        try {
+            Thread.sleep(5000);
+        } catch (Exception e) {
+        }
+        //not needed
+        //panel.stopAnimation();
+        if (swap) {
+            SplashErrorPanel r = SplashUtils.getErrorSplashScreen(panel.getSplashWidth(), panel.getSplashHeight(), SplashUtils.SplashReason.JAVAWS, null);
+            app.remove(panel.getSplashComponent());
+            r.setPercentage(panel.getPercentage());
+            r.adjustForSize();
+            panel = r;
+            app.add(panel.getSplashComponent());
+            app.validateTree();
+            //app.pack();
+            //app.setVisible(true);
+            try {
+                Thread.sleep(10000);
+            } catch (Exception e) {
+            }
+        }
+
+
+    }
+}
diff -r 01544fb82384 tests/netx/unit/net/sourceforge/jnlp/splashscreen/SplashUtilsTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/SplashUtilsTest.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,253 @@
+/* SplashUtils.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen;
+
+import java.lang.reflect.Field;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import net.sourceforge.jnlp.runtime.JNLPRuntime;
+import net.sourceforge.jnlp.splashscreen.impls.*;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class SplashUtilsTest {
+
+
+
+    @Test
+    public void determineCallerTest() {
+        modifyRuntime(false);
+        SplashPanel p1 = SplashUtils.getSplashScreen(100, 100);
+        Assert.assertEquals(SplashUtils.SplashReason.APPLET, p1.getSplashReason());
+        modifyRuntime(true);
+        SplashPanel p2 = SplashUtils.getSplashScreen(100, 100);
+        Assert.assertEquals(SplashUtils.SplashReason.JAVAWS, p2.getSplashReason());
+    }
+
+    public static Map<String, String> getEnvironment() throws Exception {
+        Class[] classes = Collections.class.getDeclaredClasses();
+        Map<String, String> env = System.getenv();
+        for (Class cl : classes) {
+            if ("java.util.Collections$UnmodifiableMap".equals(cl.getName())) {
+                Field field = cl.getDeclaredField("m");
+                field.setAccessible(true);
+                Object obj = field.get(env);
+                Map<String, String> map = (Map<String, String>) obj;
+                return map;
+            }
+        }
+        return null;
+    }
+
+    public static void fakeEnvironment(Map<String, String> newenv) throws Exception {
+        Class[] classes = Collections.class.getDeclaredClasses();
+        Map<String, String> env = System.getenv();
+        for (Class cl : classes) {
+            if ("java.util.Collections$UnmodifiableMap".equals(cl.getName())) {
+                Field field = cl.getDeclaredField("m");
+                field.setAccessible(true);
+                Object obj = field.get(env);
+                Map<String, String> map = (Map<String, String>) obj;
+                map.clear();
+                map.putAll(newenv);
+            }
+        }
+    }
+
+    @Test
+    public void testGetSplashScreen1() throws Exception {
+        Map fake1 = new HashMap();
+        Map original = getEnvironment();
+        Assert.assertNotNull(original);
+        try {
+            fakeEnvironment(fake1);
+            SplashPanel sa = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.APPLET);
+            Assert.assertTrue(sa instanceof DefaultSplashScreen2012);
+            Assert.assertTrue(sa.getSplashReason() == SplashUtils.SplashReason.APPLET);
+            SplashPanel sw = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS);
+            Assert.assertTrue(sw instanceof DefaultSplashScreen2012);
+            Assert.assertTrue(sw.getSplashReason() == SplashUtils.SplashReason.JAVAWS);
+        } finally {
+            fakeEnvironment(original);
+        }
+
+
+
+    }
+
+    @Test
+    public void testGetSplashScreen2() throws Exception {
+        Map fake1 = new HashMap();
+        fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.DEFAULT);
+        fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.DEFAULT);
+        Map original = getEnvironment();
+        Assert.assertNotNull(original);
+        try {
+            fakeEnvironment(fake1);
+            SplashPanel sa = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.APPLET);
+            Assert.assertTrue(sa instanceof DefaultSplashScreen2012);
+            Assert.assertTrue(sa.getSplashReason() == SplashUtils.SplashReason.APPLET);
+            SplashPanel sw = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS);
+            Assert.assertTrue(sw instanceof DefaultSplashScreen2012);
+            Assert.assertTrue(sw.getSplashReason() == SplashUtils.SplashReason.JAVAWS);
+        } finally {
+            fakeEnvironment(original);
+        }
+
+
+    }
+
+    @Test
+    public void testGetSplashScreen3() throws Exception {
+        Map fake1 = new HashMap();
+        fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.NONE);
+        fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.DEFAULT);
+        Map original = getEnvironment();
+        Assert.assertNotNull(original);
+        try {
+            fakeEnvironment(fake1);
+            SplashPanel sa = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.APPLET);
+            Assert.assertTrue(sa instanceof DefaultSplashScreen2012);
+            Assert.assertTrue(sa.getSplashReason() == SplashUtils.SplashReason.APPLET);
+            SplashPanel sw = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS);
+            Assert.assertTrue(sw == null);
+        } finally {
+            fakeEnvironment(original);
+        }
+
+
+
+    }
+
+    @Test
+    public void testGetSplashScreen4() throws Exception {
+        Map fake1 = new HashMap();
+        fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.DEFAULT);
+        fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.NONE);
+        Map original = getEnvironment();
+        Assert.assertNotNull(original);
+        try {
+            fakeEnvironment(fake1);
+            SplashPanel sa = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.APPLET);
+            Assert.assertTrue(sa == null);
+            SplashPanel sw = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS);
+            Assert.assertTrue(sw instanceof DefaultSplashScreen2012);
+            Assert.assertTrue(sw.getSplashReason() == SplashUtils.SplashReason.JAVAWS);
+        } finally {
+            fakeEnvironment(original);
+        }
+
+
+
+    }
+
+    @Test
+    public void testGetSplashScreen5() throws Exception {
+        Map fake1 = new HashMap();
+        fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.NONE);
+        fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.NONE);
+        Map original = getEnvironment();
+        Assert.assertNotNull(original);
+        try {
+            fakeEnvironment(fake1);
+            SplashPanel sa = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.APPLET);
+            Assert.assertTrue(sa == null);
+            SplashPanel sw = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS);
+            Assert.assertTrue(sw == null);
+        } finally {
+            fakeEnvironment(original);
+        }
+
+    }
+
+    @Test
+    public void testGetSplashScreen6() throws Exception {
+        Map fake1 = new HashMap();
+        fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.DEFAULT);
+        fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, "fgdthyfjtuk");
+        Map original = getEnvironment();
+        Assert.assertNotNull(original);
+        try {
+            fakeEnvironment(fake1);
+            SplashPanel sa = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.APPLET);
+            Assert.assertTrue(sa instanceof DefaultSplashScreen2012);
+            Assert.assertTrue(sa.getSplashReason() == SplashUtils.SplashReason.APPLET);
+            SplashPanel sw = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS);
+            Assert.assertTrue(sw instanceof DefaultSplashScreen2012);
+            Assert.assertTrue(sw.getSplashReason() == SplashUtils.SplashReason.JAVAWS);
+        } finally {
+            fakeEnvironment(original);
+        }
+
+
+    }
+
+    @Test
+    public void testGetSplashScreen7() throws Exception {
+        Map fake1 = new HashMap();
+        fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, "egtrutkyukl");
+        Map original = getEnvironment();
+        Assert.assertNotNull(original);
+        try {
+            fakeEnvironment(fake1);
+            SplashPanel sa = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.APPLET);
+            Assert.assertTrue(sa instanceof DefaultSplashScreen2012);
+            Assert.assertTrue(sa.getSplashReason() == SplashUtils.SplashReason.APPLET);
+            SplashPanel sw = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS);
+            Assert.assertTrue(sw instanceof DefaultSplashScreen2012);
+            Assert.assertTrue(sw.getSplashReason() == SplashUtils.SplashReason.JAVAWS);
+        } finally {
+            fakeEnvironment(original);
+        }
+
+
+    }
+
+     static void modifyRuntime(boolean b) {
+        try{
+        setStatic(JNLPRuntime.class.getDeclaredField("isWebstartApplication"), b);
+        }catch(Exception ex){
+            throw new RuntimeException(ex);
+        }
+    }
+     static void setStatic(Field field, Object newValue) throws Exception {
+      field.setAccessible(true);
+      field.set(null, newValue);
+   }
+
+}
diff -r 01544fb82384 tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainterTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainterTest.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,108 @@
+/* BasePainterTest.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012;
+
+import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.BasePainter;
+import java.awt.image.BufferedImage;
+import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason;
+import net.sourceforge.jnlp.splashscreen.impls.DefaultSplashScreen2012;
+import org.junit.Assert;
+
+
+import org.junit.Test;
+
+public class BasePainterTest {
+
+    @Test
+    public void scaleTest() {
+        Assert.assertEquals(10, BasePainter.scale(2, 4, 5), 0.1d);
+        Assert.assertEquals(4, BasePainter.scale(4, 2, 8), 0.1d);
+    }
+
+    @Test
+    public void getRatioTest() {
+        Assert.assertEquals(2, BasePainter.getRatio(2, 4), 0.1d);
+        Assert.assertEquals(0.5, BasePainter.getRatio(4, 2), 0.1d);
+    }
+
+    @Test
+    public void incLevel2Test() {
+        BasePainter bp = new BasePainter(new DefaultSplashScreen2012(100, 100, SplashReason.APPLET));
+        int l1 = bp.getWaterLevel();
+        int l2 = bp.getAnimationsPosition();
+        bp.increaseAnimationPosition();
+        Assert.assertFalse(l2 == bp.getAnimationsPosition());
+        Assert.assertTrue(l1 == bp.getWaterLevel());
+    }
+
+    @Test
+    public void adjustForSizeTest() {
+        BasePainter bp = new BasePainter(new DefaultSplashScreen2012(100, 100, SplashReason.APPLET));
+        bp.adjustForSize(100, 100);
+        Assert.assertNotNull(bp.prerenderedStuff);
+        BufferedImage i1 = bp.prerenderStill();
+        Assert.assertEquals(100, i1.getWidth());
+        Assert.assertEquals(100, i1.getHeight());
+        bp.adjustForSize(20, 20);
+        Assert.assertNotNull(bp.prerenderedStuff);
+        Assert.assertEquals(20, bp.prerenderedStuff.getWidth());
+        Assert.assertEquals(20, bp.prerenderedStuff.getHeight());
+        Assert.assertFalse(i1.getWidth() == bp.prerenderedStuff.getWidth());
+        Assert.assertFalse(i1.getHeight() == bp.prerenderedStuff.getHeight());
+
+
+    }
+
+    @Test
+    public void adjustForSizeTest2() {
+        BasePainter bp = new BasePainter(new DefaultSplashScreen2012(0, 0, SplashReason.APPLET), false);
+        Assert.assertNull(bp.prerenderedStuff);
+        bp.master.setSplashHeight(10);
+        bp.master.setSplashWidth(10);
+        BufferedImage i1 = bp.prerenderStill();
+        Assert.assertEquals(10, i1.getWidth());
+        Assert.assertEquals(10, i1.getHeight());
+        bp.adjustForSize(20, 20);
+        Assert.assertNotNull(bp.prerenderedStuff);
+        Assert.assertEquals(20, bp.prerenderedStuff.getWidth());
+        Assert.assertEquals(20, bp.prerenderedStuff.getHeight());
+        Assert.assertFalse(i1.getWidth() == bp.prerenderedStuff.getWidth());
+        Assert.assertFalse(i1.getHeight() == bp.prerenderedStuff.getHeight());
+
+
+    }
+}
diff -r 01544fb82384 tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ControlCurveTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ControlCurveTest.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,307 @@
+/* ControlCurveTest.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012;
+
+/** This class represents a curve defined by a sequence of control points */
+/*  Part of NatCubic implementation, inspire by http://www.cse.unsw.edu.au/~lambert/*/
+import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.ControlCurve;
+import java.awt.*;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class ControlCurveTest {
+
+    @Test
+    public void setGetTests() {
+        Polygon p1 = new Polygon();
+        Polygon p2 = new Polygon();
+        Polygon p3 = new Polygon();
+        ControlCurve cc = new ControlCurve();
+        Assert.assertNotNull(cc.getSourcePolygon());
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNull(cc.getResult());
+        Assert.assertTrue(cc.isWithPoints());
+        cc.setSourcePolygon(p1);
+        Assert.assertNotNull(cc.getSourcePolygon());
+        Assert.assertEquals(p1, cc.getSourcePolygon());
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNull(cc.getResult());
+        Assert.assertTrue(cc.isWithPoints());
+        cc.setWithPoints(false);
+        Assert.assertFalse(cc.isWithPoints());
+
+        cc = new ControlCurve(p2);
+        Assert.assertNotNull(cc.getSourcePolygon());
+        Assert.assertEquals(p2, cc.getSourcePolygon());
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNull(cc.getResult());
+        cc.setWithPoints(false);
+        Assert.assertFalse(cc.isWithPoints());
+        cc.setSourcePolygon(p3);
+        Assert.assertNotNull(cc.getSourcePolygon());
+        Assert.assertEquals(p3, cc.getSourcePolygon());
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNull(cc.getResult());
+        cc.setWithPoints(false);
+        Assert.assertFalse(cc.isWithPoints());
+        cc.setWithPoints(true);
+        Assert.assertTrue(cc.isWithPoints());
+
+    }
+
+    @Test
+    public void sqrTest() {
+        Assert.assertEquals(25, ControlCurve.sqr(5));
+    }
+    static int[] xs = {0, 100, 100, 0};
+    static int[] ys = {0, 0, 100, 1000};
+
+    static ControlCurve getTestInstance() {
+        ControlCurve cc = new ControlCurve();
+        cc.addPoint(xs[0], ys[0]);
+        cc.addPoint(xs[1], ys[1]);
+        cc.addPoint(xs[2], ys[2]);
+        cc.addPoint(xs[3], ys[3]);
+        return cc;
+
+    }
+
+    @Test
+    public void selectPointTest() {
+        ControlCurve cc = getTestInstance();
+        int i = cc.selectPoint(-50, -50);
+        Assert.assertEquals(-1, i);
+        i = cc.selectPoint(-3, 3);
+        Assert.assertEquals(0, i);
+        i = cc.selectPoint(97, 97);
+        Assert.assertEquals(2, i);
+        i = cc.selectPoint(100, 50);
+        Assert.assertEquals(-1, i);
+    }
+
+    @Test
+    public void addPoint() {
+        ControlCurve cc = new ControlCurve();
+        Assert.assertEquals(0, cc.getSourcePolygon().npoints);
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNull(cc.getResult());
+        cc.addPoint(10, 10);
+        Assert.assertEquals(1, cc.getSourcePolygon().npoints);
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNull(cc.getResult());
+        cc.addPoint(10, 10);
+        Assert.assertEquals(2, cc.getSourcePolygon().npoints);
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNull(cc.getResult());
+        cc.addPoint(100, 100);
+        Assert.assertEquals(3, cc.getSourcePolygon().npoints);
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNull(cc.getResult());
+    }
+
+    @Test
+    public void setPointTest1() {
+        ControlCurve cc = getTestInstance();
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNull(cc.getResult());
+        cc.setSelection(-1);
+        cc.setPoint(10, 10);
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.setSelection(4);
+        cc.setPoint(10, 10);
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.setSelection(3);
+        cc.setPoint(10, 20);
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 3; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNull(cc.getResult());
+        Assert.assertEquals(20, cc.getSourcePolygon().ypoints[3]);
+        Assert.assertEquals(10, cc.getSourcePolygon().xpoints[3]);
+    }
+
+    @Test
+    public void setPointTest2() {
+        ControlCurve cc = getTestInstance();
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNull(cc.getResult());
+        cc.setPoint(-1, 10, 10);
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.setPoint(4, 10, 10);
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.setPoint(3, 10, 20);
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 3; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNull(cc.getResult());
+        Assert.assertEquals(20, cc.getSourcePolygon().ypoints[3]);
+        Assert.assertEquals(10, cc.getSourcePolygon().xpoints[3]);
+
+    }
+
+    @Test
+    public void removePoint2() {
+        ControlCurve cc = getTestInstance();
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNull(cc.getResult());
+        cc.removePoint(-1);
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNull(cc.getResult());
+        cc.removePoint(4);
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNull(cc.getResult());
+        cc.removePoint(3);
+        Assert.assertEquals(3, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 3; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNull(cc.getResult());
+
+    }
+
+    public void removePoint1() {
+        ControlCurve cc = getTestInstance();
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNull(cc.getResult());
+        cc.setSelection(-1);
+        cc.removePoint();
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNull(cc.getResult());
+        cc.setSelection(4);
+        cc.removePoint();
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNull(cc.getResult());
+        cc.setSelection(0);
+        cc.removePoint();
+        Assert.assertEquals(3, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 3; i++) {
+            Assert.assertEquals(ys[i + 1], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i + 1], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNull(cc.getResult());
+
+    }
+}
diff -r 01544fb82384 tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/CubicTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/CubicTest.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,57 @@
+/* CubicTest.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012;
+
+import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.Cubic;
+import org.junit.Assert;
+import org.junit.Test;
+
+/** this class represents a cubic polynomial */
+/*  Part of NatCubic implementation, inspire by http://www.cse.unsw.edu.au/~lambert/*/
+public class CubicTest {
+
+    @Test
+    public void cubicTest() {
+        Cubic c1 = new Cubic(1, 2, 3, 4);
+        Assert.assertTrue(new Float(1).equals(c1.a));
+        Assert.assertTrue(new Float(2).equals(c1.b));
+        Assert.assertTrue(new Float(3).equals(c1.c));
+        Assert.assertTrue(new Float(4).equals(c1.d));
+        Assert.assertTrue(new Float(586).equals(c1.eval(5)));
+
+    }
+}
diff -r 01544fb82384 tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainterTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainterTest.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,113 @@
+/* ErrorPainterTest.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012;
+
+import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.ErrorPainter;
+import java.awt.Color;
+import java.awt.image.BufferedImage;
+import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason;
+import net.sourceforge.jnlp.splashscreen.impls.DefaultSplashScreen2012;
+import org.junit.Assert;
+import org.junit.Test;
+
+public final class ErrorPainterTest {
+
+    @Test
+    public void interpolTest() {
+        Assert.assertEquals(15, ErrorPainter.interpol(4, 2, 10, 20), 0.1d);
+        Assert.assertEquals(-15, ErrorPainter.interpol(4, 2, -20, -10), 0.1d);
+        Assert.assertEquals(30, ErrorPainter.interpol(2, 4, 10, 20), 0.1d);
+    }
+
+    @Test
+    public void interpolColorTest() {
+        Color c1 = new Color(0, 0, 0);
+        Color c2 = new Color(200, 200, 200);
+        Color c3 = new Color(100, 100, 100);
+        Color c4 = ErrorPainter.interpolateColor(4, 2, c1, c2);
+        Assert.assertEquals(c3, c4);
+
+    }
+
+//    public static void main(String[] a) {
+//        Color c1 = new Color(250, 50, 0, 50);
+//        Color c2 = new Color(0, 0, 250, 100);
+//        for (int i = 0; i < 21; i++) {
+//            Color q = ErrorPainter.interpolateColor(20, i, c1, c2);
+//            System.out.println(q.toString());
+//            System.out.println(q.getAlpha());
+//        }
+//    }
+    @Test
+    public void adjustForSizeTest() {
+        ErrorPainter bp = new ErrorPainter(new DefaultSplashScreen2012(100, 100, SplashReason.APPLET));
+        bp.master.setSplashHeight(100);
+        bp.master.setSplashWidth(100);
+        bp.adjustForSize(100, 100);
+        Assert.assertNotNull(bp.prerenderedStuff);
+        BufferedImage i1 = bp.prerenderStill();
+        Assert.assertEquals(100, i1.getWidth());
+        Assert.assertEquals(100, i1.getHeight());
+        bp.adjustForSize(20, 20);
+        Assert.assertNotNull(bp.prerenderedStuff);
+        Assert.assertEquals(20, bp.prerenderedStuff.getWidth());
+        Assert.assertEquals(20, bp.prerenderedStuff.getHeight());
+        Assert.assertFalse(i1.getWidth() == bp.prerenderedStuff.getWidth());
+        Assert.assertFalse(i1.getHeight() == bp.prerenderedStuff.getHeight());
+
+
+    }
+
+    @Test
+    public void adjustForSizeTest2() {
+        ErrorPainter bp = new ErrorPainter(new DefaultSplashScreen2012(0, 0, SplashReason.APPLET), false);
+        Assert.assertNull(bp.prerenderedStuff);
+        bp.master.setSplashHeight(10);
+        bp.master.setSplashWidth(10);
+        BufferedImage i1 = bp.prerenderStill();
+        Assert.assertEquals(10, i1.getWidth());
+        Assert.assertEquals(10, i1.getHeight());
+        bp.adjustForSize(20, 20);
+        Assert.assertNotNull(bp.prerenderedStuff);
+        Assert.assertEquals(20, bp.prerenderedStuff.getWidth());
+        Assert.assertEquals(20, bp.prerenderedStuff.getHeight());
+        Assert.assertFalse(i1.getWidth() == bp.prerenderedStuff.getWidth());
+        Assert.assertFalse(i1.getHeight() == bp.prerenderedStuff.getHeight());
+
+
+    }
+}
diff -r 01544fb82384 tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/MovingTextTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/MovingTextTest.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,151 @@
+/* MovingTextTest.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012;
+
+import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.MovingText;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class MovingTextTest {
+
+    @Test
+    public void setGetTest() {
+        BufferedImage bi = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
+        Graphics2D g2d = bi.createGraphics();
+        Font f1 = g2d.getFont().deriveFont(Font.ITALIC);
+        Font f2 = g2d.getFont().deriveFont(Font.BOLD);
+        String s = "Watter";
+        MovingText tw = new MovingText(s, f1);
+        Assert.assertEquals(-1, tw.getHeight());
+        Assert.assertEquals(-1, tw.getWidth());
+        Assert.assertEquals(f1, tw.getFont());
+        Assert.assertNull(tw.getImg());
+        Assert.assertEquals(s, tw.getText());
+        Assert.assertEquals(Color.BLACK, tw.getTextOutline());
+        Assert.assertEquals(Color.blue, tw.getWaterColor());
+        Assert.assertEquals(Color.white, tw.getBgColor());
+        Assert.assertEquals(0, tw.getPercentageOfWater());
+        tw.setBgColor(Color.yellow);
+        tw.setWaterColor(Color.orange);
+        tw.setPercentageOfWater(20);
+        Assert.assertEquals(Color.orange, tw.getWaterColor());
+        Assert.assertEquals(Color.yellow, tw.getBgColor());
+        Assert.assertEquals(20, tw.getPercentageOfWater());
+
+    }
+
+    private static int getAvgColor(Color c) {
+        Assert.assertEquals(c.getRed(), c.getBlue());
+        Assert.assertEquals(c.getRed(), c.getGreen());
+        return c.getRed();
+    }
+
+    private static int getAvgColor(int i) {
+        return getAvgColor(new Color(i));
+    }
+
+    private static int getAvgColor(BufferedImage m, int x, int y) {
+        return getAvgColor(m.getRGB(x, y));
+    }
+
+    @Test
+    public void getBackground() {
+        MovingText ifc = getInstance();
+        BufferedImage bic = ifc.getBackground();
+        int w = bic.getWidth();
+        int h = bic.getHeight();
+        ifc.setPercentageOfWater(0);
+        bic = ifc.getBackground();
+        Assert.assertTrue(getAvgColor(bic, 3 * w / 4, h / 2) > getAvgColor(bic, 2 * w / 4, h / 2));
+        Assert.assertTrue(getAvgColor(bic, w / 4, h / 2) < getAvgColor(bic, 2 * w / 4, h / 2));
+        Assert.assertEquals(new Color(bic.getRGB(w - w / 4, 2 * h / 3)), new Color(bic.getRGB(w - w / 4, h / 3)));
+        ifc.setPercentageOfWater(w / 2);
+        bic = ifc.getBackground();
+        Assert.assertTrue(getAvgColor(bic, 3 * w / 4, h / 2) > getAvgColor(bic, 2 * w / 4, h / 2));
+        Assert.assertTrue(getAvgColor(bic, w / 4, h / 2) > getAvgColor(bic, 2 * w / 4, h / 2));
+        Assert.assertEquals(new Color(bic.getRGB(w - w / 3, 2 * h / 3)), new Color(bic.getRGB(w - w / 3, h / 3)));
+        ifc.setPercentageOfWater(w);
+        bic = ifc.getBackground();
+        Assert.assertTrue(getAvgColor(bic, 3 * w / 4, h / 2) < getAvgColor(bic, 2 * w / 4, h / 2));
+        Assert.assertTrue(getAvgColor(bic, w / 4, h / 2) > getAvgColor(bic, 2 * w / 4, h / 2));
+        Assert.assertEquals(new Color(bic.getRGB(w - w / 4, h / 3)), new Color(bic.getRGB(w - w / 4, h / 2)));
+
+
+
+    }
+
+    private MovingText getInstance() {
+        BufferedImage bi1 = new BufferedImage(10, 10, BufferedImage.TYPE_INT_ARGB);
+        Font f = bi1.createGraphics().getFont().deriveFont(Font.BOLD, 130);
+        MovingText ifc = new MovingText("O O", f);
+        return ifc;
+    }
+
+    private static void assertNotEquals(Object o1, Object o2) {
+        Assert.assertFalse(o1.equals(o2));
+
+    }
+
+    @Test
+    public void cutToTest() {
+        MovingText ifc = getInstance();
+        BufferedImage bic = ifc.getBackground();
+        int w = bic.getWidth();
+        int h = bic.getHeight();
+        bic = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
+        ifc.cutTo(bic.createGraphics(), 0, h);
+        Color cc = new Color(0, 0, 0);
+        assertNotEquals(cc, new Color(bic.getRGB(52, 142)));
+        assertNotEquals(cc, new Color(bic.getRGB(170, 110)));
+        assertNotEquals(cc, new Color(bic.getRGB(52, 62)));
+        assertNotEquals(cc, new Color(bic.getRGB(245, 85)));
+
+        //well this should be acctually rgba 0,0,0,0 but somehow this was no passig
+        //you can confirm with:
+        //ImageFontCutterTest.save(bic, "halfFiledOus")
+        Assert.assertEquals(cc, new Color(bic.getRGB(137, 127)));
+        Assert.assertEquals(cc, new Color(bic.getRGB(137, 2)));
+
+
+
+
+    }
+}
diff -r 01544fb82384 tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicClosedTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicClosedTest.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,264 @@
+/* NatCubicClosedTest.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012;
+
+import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.NatCubicClosed;
+import java.awt.Polygon;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class NatCubicClosedTest {
+
+    @Test
+    public void setGetTests() {
+        Polygon p1 = new Polygon();
+        p1.addPoint(10, 23);
+        p1.addPoint(12, -31);
+        NatCubicClosed cc = new NatCubicClosed();
+        Assert.assertNotNull(cc.getSourcePolygon());
+        Assert.assertNull(cc.getResult());
+        Exception ex = null;
+        try {
+            cc.calcualteAndSaveResult();
+        } catch (Exception eex) {
+            ex = eex;
+        }
+        Assert.assertNotNull(ex);
+        Assert.assertNull(cc.getResult());
+        Assert.assertTrue(cc.isWithPoints());
+        cc.setSourcePolygon(p1);
+        Assert.assertNotNull(cc.getSourcePolygon());
+        Assert.assertEquals(p1, cc.getSourcePolygon());
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+        Assert.assertTrue(cc.isWithPoints());
+        cc.setWithPoints(false);
+        Assert.assertFalse(cc.isWithPoints());
+        cc.resetResult();
+        Assert.assertNull(cc.getResult());
+
+
+
+    }
+    static int[] xs = {0, 100, 100, 0};
+    static int[] ys = {0, 0, 100, 1000};
+
+    static NatCubicClosed getTestInstance() {
+        NatCubicClosed cc = new NatCubicClosed();
+        cc.addPoint(xs[0], ys[0]);
+        cc.addPoint(xs[1], ys[1]);
+        cc.addPoint(xs[2], ys[2]);
+        cc.addPoint(xs[3], ys[3]);
+        return cc;
+
+    }
+
+    @Test
+    public void basicComputation() {
+        NatCubicClosed b = new NatCubicClosed();
+        b.addPoint(10, 10);
+        b.addPoint(50, 20);
+        b.addPoint(-10, -10);
+        b.calcualteAndSaveResult();
+        Assert.assertTrue(b.pts.npoints < b.result.npoints / 5);
+        Assert.assertEquals(b.result.xpoints[0], b.result.xpoints[b.result.npoints - 1]);
+        Assert.assertEquals(b.result.ypoints[0], b.result.ypoints[b.result.npoints - 1]);
+
+    }
+
+    @Test
+    public void addPoint() {
+        NatCubicClosed cc = new NatCubicClosed();
+        Assert.assertEquals(0, cc.getSourcePolygon().npoints);
+        Assert.assertNull(cc.getResult());
+        Exception ex = null;
+        try {
+            cc.calcualteAndSaveResult();
+        } catch (Exception eex) {
+            ex = eex;
+        }
+        Assert.assertNotNull(ex);
+        Assert.assertNull(cc.getResult());
+        cc.addPoint(10, 10);
+        Assert.assertEquals(1, cc.getSourcePolygon().npoints);
+        Assert.assertNull(cc.getResult());
+        ex = null;
+        try {
+            cc.calcualteAndSaveResult();
+        } catch (Exception eex) {
+            ex = eex;
+        }
+        Assert.assertNotNull(ex);
+        Assert.assertNull(cc.getResult());
+        cc.addPoint(10, 10);
+        Assert.assertEquals(2, cc.getSourcePolygon().npoints);
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+        cc.addPoint(100, 100);
+        Assert.assertEquals(3, cc.getSourcePolygon().npoints);
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+    }
+
+    @Test
+    public void setPointTest1() {
+        NatCubicClosed cc = getTestInstance();
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+        cc.setSelection(-1);
+        cc.setPoint(10, 10);
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNotNull(cc.getResult());
+        cc.setSelection(4);
+        cc.setPoint(10, 10);
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNotNull(cc.getResult());
+        cc.setSelection(3);
+        cc.setPoint(10, 20);
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 3; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+        Assert.assertEquals(20, cc.getSourcePolygon().ypoints[3]);
+        Assert.assertEquals(10, cc.getSourcePolygon().xpoints[3]);
+    }
+
+    @Test
+    public void removePoint2() {
+        NatCubicClosed cc = getTestInstance();
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+        cc.removePoint(-1);
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNotNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+        cc.removePoint(4);
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNotNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+        cc.removePoint(3);
+        Assert.assertEquals(3, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 3; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+
+    }
+
+    public void removePoint1() {
+        NatCubicClosed cc = getTestInstance();
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+        cc.setSelection(-1);
+        cc.removePoint();
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNotNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+        cc.setSelection(4);
+        cc.removePoint();
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNotNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+        cc.setSelection(0);
+        cc.removePoint();
+        Assert.assertEquals(3, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 3; i++) {
+            Assert.assertEquals(ys[i + 1], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i + 1], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+
+    }
+}
diff -r 01544fb82384 tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicTest.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,264 @@
+/* NatCubicTest.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012;
+
+import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.NatCubic;
+import java.awt.Polygon;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class NatCubicTest {
+
+    @Test
+    public void setGetTests() {
+        Polygon p1 = new Polygon();
+        p1.addPoint(10, 23);
+        p1.addPoint(12, -31);
+        NatCubic cc = new NatCubic();
+        Assert.assertNotNull(cc.getSourcePolygon());
+        Assert.assertNull(cc.getResult());
+        Exception ex = null;
+        try {
+            cc.calcualteAndSaveResult();
+        } catch (Exception eex) {
+            ex = eex;
+        }
+        Assert.assertNotNull(ex);
+        Assert.assertNull(cc.getResult());
+        Assert.assertTrue(cc.isWithPoints());
+        cc.setSourcePolygon(p1);
+        Assert.assertNotNull(cc.getSourcePolygon());
+        Assert.assertEquals(p1, cc.getSourcePolygon());
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+        Assert.assertTrue(cc.isWithPoints());
+        cc.setWithPoints(false);
+        Assert.assertFalse(cc.isWithPoints());
+        cc.resetResult();
+        Assert.assertNull(cc.getResult());
+
+
+
+    }
+    static int[] xs = {0, 100, 100, 0};
+    static int[] ys = {0, 0, 100, 1000};
+
+    static NatCubic getTestInstance() {
+        NatCubic cc = new NatCubic();
+        cc.addPoint(xs[0], ys[0]);
+        cc.addPoint(xs[1], ys[1]);
+        cc.addPoint(xs[2], ys[2]);
+        cc.addPoint(xs[3], ys[3]);
+        return cc;
+
+    }
+
+    @Test
+    public void basicComputation() {
+        NatCubic b = new NatCubic();
+        b.addPoint(10, 10);
+        b.addPoint(50, 20);
+        b.addPoint(-10, -10);
+        b.calcualteAndSaveResult();
+        Assert.assertTrue(b.pts.npoints < b.result.npoints / 5);
+        Assert.assertFalse(b.result.xpoints[0] == b.result.xpoints[b.result.npoints - 1]);
+        Assert.assertFalse(b.result.ypoints[0] == b.result.ypoints[b.result.npoints - 1]);
+
+    }
+
+    @Test
+    public void addPoint() {
+        NatCubic cc = new NatCubic();
+        Assert.assertEquals(0, cc.getSourcePolygon().npoints);
+        Assert.assertNull(cc.getResult());
+        Exception ex = null;
+        try {
+            cc.calcualteAndSaveResult();
+        } catch (Exception eex) {
+            ex = eex;
+        }
+        Assert.assertNotNull(ex);
+        Assert.assertNull(cc.getResult());
+        cc.addPoint(10, 10);
+        Assert.assertEquals(1, cc.getSourcePolygon().npoints);
+        Assert.assertNull(cc.getResult());
+        ex = null;
+        try {
+            cc.calcualteAndSaveResult();
+        } catch (Exception eex) {
+            ex = eex;
+        }
+        Assert.assertNotNull(ex);
+        Assert.assertNull(cc.getResult());
+        cc.addPoint(10, 10);
+        Assert.assertEquals(2, cc.getSourcePolygon().npoints);
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+        cc.addPoint(100, 100);
+        Assert.assertEquals(3, cc.getSourcePolygon().npoints);
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+    }
+
+    @Test
+    public void setPointTest1() {
+        NatCubic cc = getTestInstance();
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+        cc.setSelection(-1);
+        cc.setPoint(10, 10);
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNotNull(cc.getResult());
+        cc.setSelection(4);
+        cc.setPoint(10, 10);
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNotNull(cc.getResult());
+        cc.setSelection(3);
+        cc.setPoint(10, 20);
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 3; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+        Assert.assertEquals(20, cc.getSourcePolygon().ypoints[3]);
+        Assert.assertEquals(10, cc.getSourcePolygon().xpoints[3]);
+    }
+
+    @Test
+    public void removePoint2() {
+        NatCubic cc = getTestInstance();
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+        cc.removePoint(-1);
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNotNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+        cc.removePoint(4);
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNotNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+        cc.removePoint(3);
+        Assert.assertEquals(3, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 3; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+
+    }
+
+    public void removePoint1() {
+        NatCubic cc = getTestInstance();
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+        cc.setSelection(-1);
+        cc.removePoint();
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNotNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+        cc.setSelection(4);
+        cc.removePoint();
+        Assert.assertEquals(4, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 4; i++) {
+            Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNotNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+        cc.setSelection(0);
+        cc.removePoint();
+        Assert.assertEquals(3, cc.getSourcePolygon().npoints);
+        for (int i = 0; i < 3; i++) {
+            Assert.assertEquals(ys[i + 1], cc.getSourcePolygon().ypoints[i]);
+            Assert.assertEquals(xs[i + 1], cc.getSourcePolygon().xpoints[i]);
+        }
+        Assert.assertNull(cc.getResult());
+        cc.calcualteAndSaveResult();
+        Assert.assertNotNull(cc.getResult());
+
+    }
+}
diff -r 01544fb82384 tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/SplinesDefsTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/SplinesDefsTest.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,91 @@
+/* SplinesDefsTest.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012;
+
+import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.SplinesDefs;
+import java.awt.Point;
+import java.awt.Polygon;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class SplinesDefsTest {
+
+    private static Point[] testArray = {
+        new Point(0, 0),
+        new Point(100, 0),
+        new Point(100, 100),
+        new Point(0, 100)
+    };
+
+    @Test
+    public void polygonizeControlPointsTest() {
+
+        Polygon p = SplinesDefs.polygonizeControlPoints(testArray, 1d, 1d);
+        Assert.assertTrue(p.contains(50, 50));
+        Assert.assertFalse(p.contains(150, 150));
+        Assert.assertFalse(p.contains(-50, -50));
+        p = SplinesDefs.polygonizeControlPoints(testArray, 0.5d, 0.5d);
+        Assert.assertTrue(p.contains(20, 20));
+        Assert.assertFalse(p.contains(75, 75));
+        Assert.assertFalse(p.contains(-25, -25));
+        p = SplinesDefs.polygonizeControlPoints(testArray, 2d, 2d);
+        Assert.assertTrue(p.contains(150, 150));
+        Assert.assertFalse(p.contains(250, 250));
+        Assert.assertFalse(p.contains(-50, -50));
+
+
+    }
+
+    @Test
+    public void testApi() {
+        double x = 1d;
+        Polygon[] p = {SplinesDefs.getMainLeaf(x, x),
+            SplinesDefs.getMainLeafCurve(x, x),
+            SplinesDefs.getMainLeafStalk(x, x),
+            SplinesDefs.getMainLeafStalkCurve(x, x),
+            SplinesDefs.getSecondLeaf(x, x),
+            SplinesDefs.getSecondLeafCurve(x, x),
+            SplinesDefs.getSecondLeafStalk(x, x),
+            SplinesDefs.getSecondLeafStalkCurve(x, x)};
+        for (Polygon polygon : p) {
+            Assert.assertNotNull(polygon);
+            Assert.assertTrue(polygon.npoints > 5);
+
+        }
+
+    }
+}
diff -r 01544fb82384 tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextOutlineRendererTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextOutlineRendererTest.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,127 @@
+/* TextOutlineRendererTest.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import javax.imageio.ImageIO;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TextOutlineRendererTest {
+
+    @Test
+    public void getSetTest() {
+        BufferedImage bi = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
+        Graphics2D g2d = bi.createGraphics();
+        Font f1 = g2d.getFont().deriveFont(Font.ITALIC);
+        Font f2 = g2d.getFont().deriveFont(Font.BOLD);
+        String s = "Hello";
+        TextOutlineRenderer ifc = new TextOutlineRenderer(f1, s);
+        Assert.assertEquals(-1, ifc.getHeight());
+        Assert.assertEquals(-1, ifc.getWidth());
+        Assert.assertEquals(f1, ifc.getFont());
+        Assert.assertNull(ifc.getImg());
+        Assert.assertEquals(s, ifc.getText());
+        Assert.assertEquals(Color.BLACK, ifc.getTextOutline());
+        ifc.setImg(bi);
+        Assert.assertEquals(100, ifc.getHeight());
+        Assert.assertEquals(100, ifc.getWidth());
+        Assert.assertEquals(f1, ifc.getFont());
+        Assert.assertEquals(bi, ifc.getImg());
+        Assert.assertEquals(s, ifc.getText());
+        Assert.assertEquals(Color.BLACK, ifc.getTextOutline());
+
+        TextOutlineRenderer xfc = new TextOutlineRenderer(f1, s, Color.red);
+        xfc.setImg(bi);
+        xfc.setFont(f2);
+        String ss = "HelloHello";
+        Assert.assertEquals(100, xfc.getHeight());
+        Assert.assertEquals(100, xfc.getWidth());
+        Assert.assertEquals(f2, xfc.getFont());
+        Assert.assertEquals(bi, xfc.getImg());
+        Assert.assertEquals(s, xfc.getText());
+        Assert.assertEquals(Color.red, xfc.getTextOutline());
+        xfc.setTextOutline(Color.white);
+        Assert.assertEquals(Color.white, xfc.getTextOutline());
+
+    }
+
+    @Test
+    public void cutToTest() {
+        BufferedImage bi1 = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
+        Graphics2D g2d1 = bi1.createGraphics();
+        g2d1.setColor(Color.red);
+        g2d1.fillRect(0, 0, 100, 100);
+
+
+        BufferedImage bi2 = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
+        Graphics2D g2d2 = bi2.createGraphics();
+        g2d2.setColor(Color.blue);
+        g2d2.fillRect(0, 0, 100, 100);
+        TextOutlineRenderer ifc = new TextOutlineRenderer(g2d1.getFont().deriveFont(Font.BOLD, 130), "O");
+        ifc.setImg(bi1);
+        ifc.cutTo(g2d2, -5, 100);
+        Color c1 = new Color(bi2.getRGB(1, 1));
+        Assert.assertEquals(Color.blue, c1);
+        Color c2 = new Color(bi2.getRGB(50, 50));
+        Assert.assertEquals(Color.blue, c2);
+        Color c3 = new Color(bi2.getRGB(30, 30));
+        Assert.assertEquals(Color.red, c3);
+        Color c4 = new Color(bi2.getRGB(70, 70));
+        Assert.assertEquals(Color.red, c4);
+        Color c5 = new Color(bi2.getRGB(26, 52));
+        Assert.assertEquals(Color.black, c5);
+
+
+    }
+
+    public static void save(BufferedImage bi1, String string) {
+        try {
+            String name = string;
+            if (name == null || name.trim().length() <= 0) {
+                name = "testImage";
+            }
+            ImageIO.write(bi1, "png", new File(System.getProperty("user.home") + "/Desktop/" + name + ".png"));
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+    }
+}
diff -r 01544fb82384 tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextWithWaterLevelTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextWithWaterLevelTest.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,131 @@
+/* TextWithWaterLevelTest.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012;
+
+import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.TextWithWaterLevel;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TextWithWaterLevelTest {
+
+    @Test
+    public void setGetTest() {
+        BufferedImage bi = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
+        Graphics2D g2d = bi.createGraphics();
+        Font f1 = g2d.getFont().deriveFont(Font.ITALIC);
+        Font f2 = g2d.getFont().deriveFont(Font.BOLD);
+        String s = "Watter";
+        TextWithWaterLevel tw = new TextWithWaterLevel(s, f1);
+        Assert.assertEquals(-1, tw.getHeight());
+        Assert.assertEquals(-1, tw.getWidth());
+        Assert.assertEquals(f1, tw.getFont());
+        Assert.assertNull(tw.getImg());
+        Assert.assertEquals(s, tw.getText());
+        Assert.assertEquals(Color.BLACK, tw.getTextOutline());
+        Assert.assertEquals(Color.blue, tw.getWaterColor());
+        Assert.assertEquals(Color.white, tw.getBgColor());
+        Assert.assertEquals(0, tw.getPercentageOfWater());
+        tw.setBgColor(Color.yellow);
+        tw.setWaterColor(Color.orange);
+        tw.setPercentageOfWater(20);
+        Assert.assertEquals(Color.orange, tw.getWaterColor());
+        Assert.assertEquals(Color.yellow, tw.getBgColor());
+        Assert.assertEquals(20, tw.getPercentageOfWater());
+
+    }
+
+    @Test
+    public void getBackground() {
+        TextWithWaterLevel ifc = getInstance();
+        ifc.setCachedPolygon(null);
+        ifc.setPercentageOfWater(50);
+        BufferedImage bic = ifc.getBackground();
+        int w = bic.getWidth();
+        int h = bic.getHeight();
+        Assert.assertEquals(Color.blue, new Color(bic.getRGB(w / 2, 2 * h / 3)));
+        Assert.assertEquals(Color.white, new Color(bic.getRGB(w / 2, h / 3)));
+        ifc.setCachedPolygon(null);
+        ifc.setPercentageOfWater(5);
+        bic = ifc.getBackground();
+        Assert.assertEquals(Color.white, new Color(bic.getRGB(w / 2, 2 * h / 3)));
+        Assert.assertEquals(Color.white, new Color(bic.getRGB(w / 2, h / 3)));
+        ifc.setCachedPolygon(null);
+        ifc.setPercentageOfWater(95);
+        bic = ifc.getBackground();
+        Assert.assertEquals(Color.blue, new Color(bic.getRGB(w / 2, 2 * h / 3)));
+        Assert.assertEquals(Color.blue, new Color(bic.getRGB(w / 2, h / 3)));
+
+
+
+    }
+
+    private TextWithWaterLevel getInstance() {
+        BufferedImage bi1 = new BufferedImage(10, 10, BufferedImage.TYPE_INT_ARGB);
+        Font f = bi1.createGraphics().getFont().deriveFont(Font.BOLD, 130);
+        TextWithWaterLevel ifc = new TextWithWaterLevel("O O", f);
+        return ifc;
+    }
+
+    @Test
+    public void cutToTest() {
+        TextWithWaterLevel ifc = getInstance();
+        ifc.setPercentageOfWater(50);
+        BufferedImage bic = ifc.getBackground();
+        int w = bic.getWidth();
+        int h = bic.getHeight();
+        bic = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
+        ifc.cutTo(bic.createGraphics(), 0, h);
+        Assert.assertEquals(Color.blue, new Color(bic.getRGB(52, 142)));
+        Assert.assertEquals(Color.blue, new Color(bic.getRGB(170, 110)));
+        Assert.assertEquals(Color.white, new Color(bic.getRGB(52, 62)));
+        Assert.assertEquals(Color.white, new Color(bic.getRGB(245, 85)));
+
+        //well this should be acctually rgba 0,0,0,0 but somehow this was no passig
+        //you can confirm with:
+        //ImageFontCutterTest.save(bic, "halfFiledOus")
+        Assert.assertEquals(new Color(0, 0, 0), new Color(bic.getRGB(137, 127)));
+        Assert.assertEquals(new Color(0, 0, 0), new Color(bic.getRGB(137, 2)));
+
+
+
+
+    }
+}
diff -r 01544fb82384 tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/BasicComponentErrorSplashScreenTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/BasicComponentErrorSplashScreenTest.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,127 @@
+/* BasicComponentSplashScreenTest.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.parts;
+
+import java.awt.Graphics;
+import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class BasicComponentErrorSplashScreenTest {
+
+    @Test
+    public void createAditionalInfoTest() {
+        BasicComponentSplashScreenImpl tested = new BasicComponentSplashScreenImpl();
+        String v = "2.118x08";
+        tested.setVersion(v);
+        tested.setSplashReason(SplashReason.APPLET);
+        String s1 = tested.createAditionalInfoTest();
+        Assert.assertNotNull("Not null input must result to something", s1);
+        Assert.assertTrue("Not null input must have version value", s1.contains(v));
+        Assert.assertTrue("Not null input must have version string", s1.contains("version"));
+        Assert.assertTrue("Not null input must have version string", s1.contains(SplashReason.APPLET.toString()));
+        tested.setVersion(null);
+        tested.setSplashReason(null);
+        String s2 = tested.createAditionalInfoTest();
+        Assert.assertNull("Not null input must result to something", s2);
+        tested.setSplashReason(null);
+        tested.setVersion(v);
+        Exception ex = null;
+        try {
+            String s3 = tested.createAditionalInfoTest();
+        } catch (Exception exx) {
+            ex = exx;
+        }
+        Assert.assertNotNull("Null reason vith set version must causes exception", ex);
+
+
+    }
+
+    @Test
+    public void setGetError() {
+        BasicComponentSplashScreenImpl tested = new BasicComponentSplashScreenImpl();
+        Exception ex = new Exception("ujuj");
+        tested.setLoadingException(ex);
+        Assert.assertEquals(ex, tested.getLoadingException());
+
+    }
+
+    private class BasicComponentSplashScreenImpl extends BasicComponentErrorSplashScreen {
+
+        public BasicComponentSplashScreenImpl() {
+        }
+
+        @Override
+        public void paintComponent(Graphics g) {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public void paintTo(Graphics g) {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public void adjustForSize() {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public void startAnimation() {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public void stopAnimation() {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        public String createAditionalInfoTest() {
+            return super.createAditionalInfo();
+        }
+
+        @Override
+        public void setPercentage(int done) {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public int getPercentage() {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+    }
+}
diff -r 01544fb82384 tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/BasicComponentSplashScreenTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/BasicComponentSplashScreenTest.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,118 @@
+/* BasicComponentSplashScreenTest.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.parts;
+
+import java.awt.Graphics;
+import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class BasicComponentSplashScreenTest {
+
+    @Test
+    public void createAditionalInfoTest() {
+        BasicComponentSplashScreenImpl tested = new BasicComponentSplashScreenImpl();
+        String v = "2.118x08";
+        tested.setVersion(v);
+        tested.setSplashReason(SplashReason.APPLET);
+        String s1 = tested.createAditionalInfoTest();
+        Assert.assertNotNull("Not null input must result to something", s1);
+        Assert.assertTrue("Not null input must have version value", s1.contains(v));
+        Assert.assertTrue("Not null input must have version string", s1.contains("version"));
+        Assert.assertTrue("Not null input must have version string", s1.contains(SplashReason.APPLET.toString()));
+        tested.setVersion(null);
+        tested.setSplashReason(null);
+        String s2 = tested.createAditionalInfoTest();
+        Assert.assertNull("Not null input must result to something", s2);
+        tested.setSplashReason(null);
+        tested.setVersion(v);
+        Exception ex = null;
+        try {
+            String s3 = tested.createAditionalInfoTest();
+        } catch (Exception exx) {
+            ex = exx;
+        }
+        Assert.assertNotNull("Null reason vith set version must causes exception", ex);
+
+
+    }
+
+    private class BasicComponentSplashScreenImpl extends BasicComponentSplashScreen {
+
+        public BasicComponentSplashScreenImpl() {
+        }
+
+        @Override
+        public void paintComponent(Graphics g) {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public void paintTo(Graphics g) {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public void adjustForSize() {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public void startAnimation() {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public void stopAnimation() {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        public String createAditionalInfoTest() {
+            return super.createAditionalInfo();
+        }
+
+        @Override
+        public void setPercentage(int done) {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public int getPercentage() {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+    }
+}
diff -r 01544fb82384 tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItemTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItemTest.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,138 @@
+/* DescriptionInfoItemTest.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.parts;
+
+import junit.framework.Assert;
+import net.sourceforge.jnlp.ServerAccess;
+import org.junit.Test;
+
+public class DescriptionInfoItemTest {
+
+    private static final DescriptionInfoItem[] d = {new DescriptionInfoItem("Firm 1", null),
+        new DescriptionInfoItem("Firm 2", null),
+        new DescriptionInfoItem("Firm 3", "k1"),
+        new DescriptionInfoItem("Firm 4", "k2"),
+        new DescriptionInfoItem("Firm 6", "k1")};
+
+    @Test
+    public void setGetTest() {
+        DescriptionInfoItem di = new DescriptionInfoItem("a", "b");
+        Assert.assertEquals("a", di.getValue());
+        Assert.assertEquals("b", di.getKind());
+        Assert.assertEquals(InfoItem.description, di.getType());
+        di.setKind("q");
+        Assert.assertEquals("q", di.getKind());
+
+    }
+
+    @Test
+    public void isOfSameKindTests() {
+        boolean[] results = new boolean[]{true, true, false, false, false, true, true, false, false, false, false, false, true, false, true, false, false, false, true, false, false, false, true, false, true};
+        int x = -1;
+        for (int i = 0; i < d.length; i++) {
+            DescriptionInfoItem d1 = d[i];
+            for (int j = 0; j < d.length; j++) {
+                x++;
+                DescriptionInfoItem d2 = d[j];
+                ServerAccess.logOutputReprint(x + ": " + i + "x" + j + " " + d1.toString() + "x" + d2.toString() + "- same kind - " + d1.isOfSameKind(d2));
+                Assert.assertEquals(results[x], d1.isOfSameKind(d2));
+            }
+
+        }
+    }
+
+    @Test
+    public void isSameTest() {
+        boolean[] results = new boolean[]{true, true, false, false, false, true, true, false, false, false, false, false, true, false, true, false, false, false, true, false, false, false, true, false, true
+        };
+        int x = -1;
+        for (int i = 0; i < d.length; i++) {
+            DescriptionInfoItem d1 = d[i];
+            for (int j = 0; j < d.length; j++) {
+                x++;
+                DescriptionInfoItem d2 = d[j];
+                ServerAccess.logOutputReprint(x + ": " + i + "x" + j + " " + d1.toString() + "x" + d2.toString() + "- same  - " + d1.isSame(d2));
+                Assert.assertEquals(results[x], d1.isSame(d2));
+            }
+
+        }
+
+    }
+
+    @Test
+    public void equalsTest() {
+        boolean[] results = new boolean[]{true, false, false, false, false, false, true, false, false, false, false, false, true, false, false, false, false, false, true, false, false, false, false, false, true
+        };
+        int x = -1;
+        for (int i = 0; i < d.length; i++) {
+            DescriptionInfoItem d1 = d[i];
+            for (int j = 0; j < d.length; j++) {
+                x++;
+                DescriptionInfoItem d2 = d[j];
+                ServerAccess.logOutputReprint(x + ": " + i + "x" + j + ", " + d1.toString() + " x " + d2.toString() + "- equals  - " + d1.equals(d2));
+                Assert.assertEquals(results[x], d1.equals(d2));
+            }
+
+        }
+
+
+    }
+
+    @Test
+    public void toStringTest() {
+        DescriptionInfoItem d1 = new DescriptionInfoItem("Firm 3", null);
+        Assert.assertTrue(d1.toString().contains(d1.getValue()));
+        Assert.assertTrue(d1.toString().contains(d1.getType()));
+        Assert.assertTrue(d1.toString().contains("null"));
+        DescriptionInfoItem dd = new DescriptionInfoItem("Firm 3", "k1");
+        Assert.assertTrue(dd.toString().contains(dd.getValue()));
+        Assert.assertTrue(dd.toString().contains(dd.getType()));
+        Assert.assertTrue(dd.toString().contains(dd.getKind()));
+
+    }
+
+    @Test
+    public void toNiceStringTest() {
+        DescriptionInfoItem d1 = new DescriptionInfoItem("Firm 3", null);
+        Assert.assertTrue(d1.toNiceString().contains(d1.getValue()));
+        Assert.assertTrue(d1.toNiceString().contains(InfoItem.SPLASH + d1.getType()) || !d1.toNiceString().contains(InfoItem.SPLASH));
+        DescriptionInfoItem dd = new DescriptionInfoItem("Firm 3", "k1");
+        Assert.assertTrue(dd.toNiceString().contains(dd.getValue()));
+        Assert.assertTrue(dd.toNiceString().contains(InfoItem.SPLASH + dd.getType()) || !d1.toNiceString().contains(InfoItem.SPLASH));
+
+    }
+}
diff -r 01544fb82384 tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InfoItemTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InfoItemTest.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,111 @@
+/* InfoItemTest.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.parts;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ *The optional kind="splash" attribute may be used in an icon element to indicate that the image is to be used as a "splash" screen during the launch of an application. If the JNLP file does not contain an icon element with kind="splash" attribute, Java Web Start will construct a splash screen using other items from the information Element.
+ *If the JNLP file does not contain any icon images, the splash image will consist of the application's title and vendor, as taken from the JNLP file.
+ *
+ * items not used inside
+ */
+public class InfoItemTest {
+
+    @Test
+    public void testGettersSetters() {
+        InfoItem ii = new InfoItem("a", "b");
+        Assert.assertEquals("a", ii.getType());
+        Assert.assertEquals("b", ii.getValue());
+        ii.setType("c");
+        Assert.assertEquals("c", ii.getType());
+        ii.setValue("d");
+        Assert.assertEquals("d", ii.getValue());
+
+    }
+
+    @Test
+    public void TestIsOfSameType() {
+        InfoItem i1 = new InfoItem("a", "b");
+        InfoItem i2 = new InfoItem("a", "c");
+        InfoItem i3 = new InfoItem("b", "a");
+        Assert.assertTrue(i1.isofSameType(i2));
+        Assert.assertFalse(i1.isofSameType(i3));
+        Assert.assertFalse(i2.isofSameType(i3));
+
+        DescriptionInfoItem d1 = new DescriptionInfoItem("a", InfoItem.descriptionKindToolTip);
+        InfoItem id1 = new InfoItem(InfoItem.description, "a");
+        Assert.assertTrue(id1.isofSameType(d1));
+
+    }
+
+    @Test
+    public void testEquals() {
+        InfoItem i1 = new InfoItem("a", "b");
+        InfoItem i11 = new InfoItem("a", "b");
+        InfoItem i2 = new InfoItem("a", "c");
+        InfoItem i3 = new InfoItem("b", "a");
+        Assert.assertFalse(i1.equals(i2));
+        Assert.assertFalse(i1.equals(i3));
+        Assert.assertFalse(i2.equals(i3));
+        Assert.assertTrue(i1.equals(i11));
+        DescriptionInfoItem d1 = new DescriptionInfoItem("a", InfoItem.descriptionKindToolTip);
+        InfoItem id1 = new InfoItem(InfoItem.description, "a");
+        Assert.assertTrue(id1.equals(d1));
+
+
+    }
+
+    @Test
+    public void toStringTest() {
+        InfoItem i1 = new InfoItem("aa", "bb");
+        Assert.assertTrue(i1.toString().contains("aa"));
+        Assert.assertTrue(i1.toString().contains("bb"));
+        Assert.assertTrue(i1.toString().length() > 4);
+
+    }
+
+    @Test
+    public void toNiceString() {
+        InfoItem i1 = new InfoItem("aaa", "bbb");
+        Assert.assertTrue(i1.toNiceString().contains(InfoItem.SPLASH + "aaa") || !i1.toNiceString().contains(InfoItem.SPLASH));
+        Assert.assertTrue(i1.toNiceString().contains("bbb"));
+        Assert.assertFalse(i1.toNiceString().equals(i1.toString()));
+    }
+
+}
diff -r 01544fb82384 tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InformationElementTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InformationElementTest.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,279 @@
+/* InformationElementTest.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+/**
+http://docs.oracle.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html
+ */
+package net.sourceforge.jnlp.splashscreen.parts;
+
+import java.io.ByteArrayInputStream;
+import java.io.UnsupportedEncodingException;
+import net.sourceforge.jnlp.JNLPFile;
+import net.sourceforge.jnlp.ParseException;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ *
+ */
+public class InformationElementTest {
+
+    private static class TestDescriptionInfoItem extends DescriptionInfoItem {
+
+        public TestDescriptionInfoItem(String value, String kind) {
+            super(value, kind);
+        }
+
+        public String toXml() {
+            if (kind == null) {
+                return new TestInfoItem(type, value).toXml();
+            }
+            return "<" + type + " kind=\"" + kind + "\">" + value + "</" + type + ">";
+        }
+    }
+
+    private static class TestInfoItem extends InfoItem {
+
+        public TestInfoItem(String type, String value) {
+            super(type, value);
+        }
+
+        public String toXml() {
+            if (type.equals(homepage)) {
+                return "<" + type + " " + homepageHref + "=\"" + value + "\"/>";
+            }
+            return "<" + type + ">" + value + "</" + type + ">";
+        }
+    }
+    private final static TestInfoItem title = new TestInfoItem(InfoItem.title, "title exp");
+    private final static TestInfoItem vendor = new TestInfoItem(InfoItem.vendor, "vendor exp");
+    private final static TestInfoItem homepage = new TestInfoItem(InfoItem.homepage, "http://homepage.exp");
+    private final static TestDescriptionInfoItem oneLineD = new TestDescriptionInfoItem("One Line", DescriptionInfoItem.descriptionKindOneLine);
+    private final static TestDescriptionInfoItem toolTipD = new TestDescriptionInfoItem("Tooltip", DescriptionInfoItem.descriptionKindToolTip);
+    private final static TestDescriptionInfoItem short1D = new TestDescriptionInfoItem("short1", DescriptionInfoItem.descriptionKindShort);
+    private final static TestDescriptionInfoItem short2D = new TestDescriptionInfoItem("short2", DescriptionInfoItem.descriptionKindShort);
+    private final static TestDescriptionInfoItem noKindD = new TestDescriptionInfoItem("noKind", null);
+    private static final String testJnlpheader =
+            "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
+            + "<jnlp spec=\"1.0\" href=\"http://somehref.jnlp\" codebase=\"http://some.code.base\">\n"
+            + "  <information>\n";
+    private static final String testJnlpFooter = "    <offline/>\n"
+            + "  </information>\n"
+            + "  <resources>\n"
+            + "    <j2se version=\"1.6+\"/>\n"
+            + "    <jar href=\"somejar\"/>\n"
+            + "  </resources>\n"
+            + "  <application-desc main-class=\"someMainClass\">\n"
+            + "  </application-desc>\n"
+            + "</jnlp>";
+
+    @Test
+    public void testSetGetTitle() {
+
+        InformationElement ie = new InformationElement();
+        Assert.assertNull("After creation value must be null", ie.getTitle());
+        ie.setTitle(title.getValue());
+        Assert.assertNotNull("After assigmentvalue must NOT be null", ie.getTitle());
+        Assert.assertTrue("After assigment value must be included in output", ie.getTitle().contains(title.getValue()));
+    }
+
+    @Test
+    public void testSetGetvendor() {
+        InformationElement ie = new InformationElement();
+        Assert.assertNull("After creation value must be null", ie.getVendor());
+        ie.setvendor(vendor.getValue());
+        Assert.assertNotNull("After assigmentvalue must NOT be null", ie.getVendor());
+        Assert.assertTrue("After assigment value must be included in output", ie.getVendor().contains(vendor.getValue()));
+    }
+
+    @Test
+    public void testSetGetHomepage() {
+        InformationElement ie = new InformationElement();
+        Assert.assertNull("After creation value must be null", ie.getHomepage());
+        ie.setHomepage(homepage.getValue());
+        Assert.assertNotNull("After assigmentvalue must NOT be null", ie.getHomepage());
+        Assert.assertTrue("After assigment value must be included in output", ie.getHomepage().contains(homepage.getValue()));
+    }
+
+    @Test
+    public void addDescriptionTest() {
+        InformationElement ie = new InformationElement();
+        Assert.assertNotNull("Descriptions should never be null", ie.getDescriptions());
+        Assert.assertEquals("Descriptions should be empty", 0, ie.getDescriptions().size());
+        ie.addDescription(toolTipD.getValue(), toolTipD.getKind());
+        Assert.assertNotNull("Descriptions should never be null", ie.getDescriptions());
+        Assert.assertEquals("Descriptions should be empty", 1, ie.getDescriptions().size());
+        ie.addDescription(short1D.getValue(), short1D.getKind());
+        Assert.assertNotNull("Descriptions should never be null", ie.getDescriptions());
+        Assert.assertEquals("Descriptions should be empty", 2, ie.getDescriptions().size());
+        ie.addDescription(short2D.getValue(), short2D.getKind());
+        Assert.assertNotNull("Descriptions should never be null", ie.getDescriptions());
+        Assert.assertEquals("Descriptions should reamin same", 2, ie.getDescriptions().size());
+        ie.addDescription(oneLineD.getValue(), oneLineD.getKind());
+        Assert.assertNotNull("Descriptions should never be null", ie.getDescriptions());
+        Assert.assertEquals("Descriptions should be ", 3, ie.getDescriptions().size());
+        ie.addDescription(noKindD.getValue(), noKindD.getKind());
+        Assert.assertNotNull("Descriptions should never be null", ie.getDescriptions());
+        Assert.assertEquals("Descriptions should be ", 4, ie.getDescriptions().size());
+
+
+    }
+
+    public void getBestMatchingDescriptionForSplashTest() {
+        InformationElement ie = new InformationElement();
+        Assert.assertNull(ie.getBestMatchingDescriptionForSplash());
+        ie.addDescription(toolTipD.getValue(), toolTipD.getKind());
+        Assert.assertNull(ie.getBestMatchingDescriptionForSplash());
+        ie.addDescription(short1D.getValue(), short1D.getKind());
+        Assert.assertNull(ie.getBestMatchingDescriptionForSplash());
+        ie.addDescription(noKindD.getValue(), noKindD.getKind());
+        Assert.assertNotNull(ie.getBestMatchingDescriptionForSplash());
+        Assert.assertEquals(ie.getBestMatchingDescriptionForSplash().getValue(), (noKindD.getValue()));
+        ie.addDescription(oneLineD.getValue(), oneLineD.getKind());
+        Assert.assertNotNull(ie.getBestMatchingDescriptionForSplash());
+        Assert.assertEquals(ie.getBestMatchingDescriptionForSplash().getValue(), (oneLineD.getValue()));
+        ie.addDescription(short2D.getValue(), short2D.getKind());
+        Assert.assertNotNull(ie.getBestMatchingDescriptionForSplash());
+        Assert.assertEquals(ie.getBestMatchingDescriptionForSplash().getValue(), (oneLineD.getValue()));
+
+
+    }
+
+    public void getLongestDescriptionForSplashTest() {
+        InformationElement ie = new InformationElement();
+        Assert.assertNull(ie.getLongestDescriptionForSplash());
+        ie.addDescription(toolTipD.getValue(), toolTipD.getKind());
+        Assert.assertNotNull(ie.getLongestDescriptionForSplash());
+        Assert.assertEquals(ie.getLongestDescriptionForSplash().getValue(), (toolTipD.getValue()));
+        ie.addDescription(oneLineD.getValue(), oneLineD.getKind());
+        Assert.assertNotNull(ie.getLongestDescriptionForSplash());
+        Assert.assertEquals(ie.getLongestDescriptionForSplash().getValue(), (oneLineD.getValue()));
+        ie.addDescription(noKindD.getValue(), noKindD.getKind());
+        ie.addDescription(oneLineD.getValue(), oneLineD.getKind());//disturb
+        Assert.assertNotNull(ie.getLongestDescriptionForSplash());
+        Assert.assertEquals(ie.getLongestDescriptionForSplash().getValue(), (noKindD.getValue()));
+        ie.addDescription(short1D.getValue(), short1D.getKind());
+        ie.addDescription(toolTipD.getValue(), toolTipD.getKind());//disturb
+        Assert.assertNotNull(ie.getLongestDescriptionForSplash());
+        Assert.assertEquals(ie.getLongestDescriptionForSplash().getValue(), (short1D.getValue()));
+
+    }
+
+    @Test
+    public void getDescriptionTest() {
+        getBestMatchingDescriptionForSplashTest();
+
+    }
+
+    @Test
+    public void getHeaderTest() {
+        InformationElement ie = new InformationElement();
+        Assert.assertNotNull("Header should never be null", ie.getHeader());
+        Assert.assertEquals(0, ie.getHeader().size());
+        ie.setvendor(vendor.getValue());
+        Assert.assertEquals(1, ie.getHeader().size());
+        ie.setTitle(title.getValue());
+        Assert.assertEquals(2, ie.getHeader().size());
+        ie.setHomepage(homepage.getValue());
+        Assert.assertEquals(3, ie.getHeader().size());
+        ie.setTitle(homepage.getValue());
+        Assert.assertEquals(3, ie.getHeader().size());
+        ie.addDescription(toolTipD.getValue());
+        Assert.assertEquals(3, ie.getHeader().size());
+        ie.addDescription(oneLineD.getValue());
+        Assert.assertEquals(3, ie.getHeader().size());
+    }
+
+    @Test
+    public void createFromJNLP() throws UnsupportedEncodingException, ParseException {
+        JNLPFile jnlpFile0 = null;
+        InformationElement ie0 = InformationElement.createFromJNLP(jnlpFile0);
+        Assert.assertNull(ie0);
+        String exJnlp1 = "<jnlp>this is invalid jnlp<jnlp>";
+        Exception ex = null;
+        JNLPFile jnlpFile1 = null;
+        try {
+            jnlpFile1 = new JNLPFile(new ByteArrayInputStream(exJnlp1.getBytes("utf-8")), true);
+        } catch (Exception eex) {
+            ex = eex;
+        }
+        Assert.assertNotNull(ex);
+        InformationElement ie1 = InformationElement.createFromJNLP(jnlpFile1);
+        Assert.assertNull(ie1);
+
+        //title, vendor and homepage are obligatory.. not so much to test
+        String exJnlp2 = testJnlpheader + title.toXml() + "\n" + homepage.toXml() + "\n" + vendor.toXml() + "\n" + testJnlpFooter;
+        JNLPFile jnlpFile2 = new JNLPFile(new ByteArrayInputStream(exJnlp2.getBytes("utf-8")), true);
+        InformationElement ie2 = InformationElement.createFromJNLP(jnlpFile2);
+        Assert.assertNotNull(ie2);
+        Assert.assertEquals(3, ie2.getHeader().size());
+        Assert.assertEquals(0, ie2.getDescriptions().size());
+
+        String exJnlp3 = testJnlpheader + title.toXml() + "\n" + homepage.toXml() + "\n" + vendor.toXml() + "\n" + toolTipD.toXml() + "\n" + testJnlpFooter;
+        JNLPFile jnlpFile3 = new JNLPFile(new ByteArrayInputStream(exJnlp3.getBytes("utf-8")), true);
+        InformationElement ie3 = InformationElement.createFromJNLP(jnlpFile3);
+        Assert.assertNotNull(ie3);
+        Assert.assertEquals(3, ie3.getHeader().size());
+        Assert.assertEquals(1, ie3.getDescriptions().size());
+
+        String exJnlp4 = testJnlpheader + title.toXml() + "\n" + homepage.toXml() + "\n" + vendor.toXml() + "\n" + noKindD.toXml() + "\n" + testJnlpFooter;
+        JNLPFile jnlpFile4 = new JNLPFile(new ByteArrayInputStream(exJnlp4.getBytes("utf-8")), true);
+        InformationElement ie4 = InformationElement.createFromJNLP(jnlpFile4);
+        Assert.assertNotNull(ie4);
+        Assert.assertEquals(3, ie4.getHeader().size());
+        Assert.assertEquals(1, ie4.getDescriptions().size());
+
+        String exJnlp5 = testJnlpheader + title.toXml() + "\n" + homepage.toXml() + "\n" + vendor.toXml() + "\n" + noKindD.toXml() + "\n" + toolTipD.toXml() + "\n" + testJnlpFooter;
+        JNLPFile jnlpFile5 = new JNLPFile(new ByteArrayInputStream(exJnlp5.getBytes("utf-8")), true);
+        InformationElement ie5 = InformationElement.createFromJNLP(jnlpFile5);
+        Assert.assertNotNull(ie5);
+        Assert.assertEquals(3, ie5.getHeader().size());
+        Assert.assertEquals(2, ie5.getDescriptions().size());
+
+
+    }
+
+
+    @Test
+    public void toXml() {
+        TestInfoItem i1 = new TestInfoItem("aa", "bb");
+        Assert.assertTrue(i1.toXml().contains("aa"));
+        Assert.assertTrue(i1.toXml().contains("bb"));
+        Assert.assertTrue(i1.toXml().length() > 4);
+        JEditorPaneBasedExceptionDialogTest.assertMarkup(i1.toXml());
+
+    }
+}
diff -r 01544fb82384 tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialogTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialogTest.java	Tue Aug 07 10:38:13 2012 +0200
@@ -0,0 +1,190 @@
+/* JeditorPaneBasedExceptionDialog.java
+Copyright (C) 2012 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+package net.sourceforge.jnlp.splashscreen.parts;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import net.sourceforge.jnlp.runtime.Translator;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class JEditorPaneBasedExceptionDialogTest {
+
+    private static RuntimeException eex = new RuntimeException("ex2");
+    private static Exception ex = new Exception("ex1", eex);
+    private static String ai = "Another info";
+    private static InformationElement ec = new InformationElement();
+    private static List<String> l = new ArrayList<String>(3);
+
+    @BeforeClass
+    public static void fillLists() {
+        ec.setHomepage("item 1");
+        ec.setTitle("item 2");
+        ec.setvendor("item 3");
+        ec.addDescription("item 4");
+        l = JEditorPaneBasedExceptionDialog.infoElementToList(ec);
+
+    }
+
+    static void assertHtml(String s) {
+        Assert.assertTrue("result of getText must be marked html", s.contains("html"));
+        Assert.assertTrue("result of getText must be marked html", s.contains("body"));
+        assertMarkup(s);
+    }
+
+    static void assertMarkup(String s) {
+        Assert.assertTrue("result of getText must be marked in by  html markup", s.contains("<") && s.contains(">"));
+        Assert.assertTrue("result of getText must be marked in by  html markup", s.contains("</") || s.contains("/>"));
+    }
+
+    private void assertAI(String s, boolean b) {
+        if (b) {
+            Assert.assertTrue("result of getText must contains annother info", s.contains(ai));
+        } else {
+            Assert.assertFalse("result of getText must NOT contains annother info", s.contains(ai));
+        }
+    }
+
+    private void assertLL(String s, boolean b) {
+        for (String i : l) {
+
+            if (b) {
+                Assert.assertTrue("result of getText must contains  info list", s.contains(i));
+            } else {
+                Assert.assertFalse("result of getText must NOT contains info list", s.contains(i));
+            }
+        }
+    }
+
+    private void assertFullException(String s, boolean b) {
+        if (b) {
+            Assert.assertTrue("result of getText must contains  complete exception", s.contains(ex.getMessage()));
+            Assert.assertTrue("result of getText must contains  complete exception", s.contains(eex.getMessage()));
+        } else {
+            Assert.assertFalse("result of getText must contains not  complete exception", s.contains(ex.getMessage()));
+            Assert.assertFalse("result of getText must contains  not complete exception", s.contains(eex.getMessage()));
+
+        }
+    }
+
+    @Test
+    public void getTextTest() {
+        String s1 = JEditorPaneBasedExceptionDialog.getText(ex, l, ai);
+        String s2 = JEditorPaneBasedExceptionDialog.getText(ex, l, null);
+        String s3 = JEditorPaneBasedExceptionDialog.getText(ex, null, ai);
+        String s4 = JEditorPaneBasedExceptionDialog.getText(null, l, ai);
+        assertHtml(s1);
+        assertHtml(s2);
+        assertHtml(s3);
+        assertHtml(s4);
+        assertAI(s1, true);
+        assertAI(s2, false);
+        assertAI(s3, true);
+        assertAI(s4, true);
+        assertLL(s1, true);
+        assertLL(s2, true);
+        assertLL(s3, false);
+        assertLL(s4, true);
+        assertFullException(s1, true);
+        assertFullException(s2, true);
+        assertFullException(s3, true);
+        assertFullException(s4, false);
+        JEditorPaneBasedExceptionDialog d1 = new JEditorPaneBasedExceptionDialog(null, false, ex, ec, ai);
+        JEditorPaneBasedExceptionDialog d2 = new JEditorPaneBasedExceptionDialog(null, false, ex, ec, null);
+        JEditorPaneBasedExceptionDialog d3 = new JEditorPaneBasedExceptionDialog(null, false, ex, null, ai);
+        JEditorPaneBasedExceptionDialog d4 = new JEditorPaneBasedExceptionDialog(null, false, null, ec, ai);
+        Assert.assertTrue("message from dialog mus be same as pattern", d1.getMessage().equals(s1));
+        Assert.assertTrue("message from dialog mus be same as pattern", d2.getMessage().equals(s2));
+        Assert.assertTrue("message from dialog mus be same as pattern", d3.getMessage().equals(s3));
+        Assert.assertTrue("message from dialog mus be same as pattern", d4.getMessage().equals(s4));
+
+    }
+
+    @Test
+    public void getExceptionStackTraceAsString() {
+        String t1 = JEditorPaneBasedExceptionDialog.getExceptionStackTraceAsString(ex);
+        assertFullException(t1, true);
+        String t2 = JEditorPaneBasedExceptionDialog.getExceptionStackTraceAsString(null);
+        Assert.assertNotNull("For null empty result must not be null", t2);
+        Assert.assertEquals("null input must result to empty string", "", t2);
+    }
+
+    @Test
+    public void getExceptionStackTraceAsStrings() {
+        String[] t1 = JEditorPaneBasedExceptionDialog.getExceptionStackTraceAsStrings(ex);
+        assertFullException(Arrays.toString(t1), true);
+        String[] t2 = JEditorPaneBasedExceptionDialog.getExceptionStackTraceAsStrings(null);
+        Assert.assertNotNull("For null empty result must not be null", t2);
+        Assert.assertArrayEquals("null input must result to empty array", new String[0], t2);
+    }
+
+    @Test
+    public void formatListInfoList() {
+        String t1 = JEditorPaneBasedExceptionDialog.formatListInfoList(l);
+        assertMarkup(t1);
+        assertLL(t1, true);
+        String t2 = JEditorPaneBasedExceptionDialog.formatInfo(null);
+        Assert.assertNotNull("For null empty result must not be null", t2);
+        Assert.assertEquals("null input must result to empty string", "", t2);
+    }
+
+    @Test
+    public void formatInfo() {
+        String s = "SOME STRING";
+        String t1 = JEditorPaneBasedExceptionDialog.formatInfo(s);
+        assertMarkup(t1);
+        Assert.assertTrue("Marked text must contains source", t1.contains(s));
+        String t2 = JEditorPaneBasedExceptionDialog.formatInfo(null);
+        Assert.assertNotNull("For null empty result must not be null", t2);
+        Assert.assertEquals("null input must result to empty string", "", t2);
+
+    }
+
+    @Test
+    public void infoElementToListTets() {
+
+        List<String> tl = JEditorPaneBasedExceptionDialog.infoElementToList(ec);
+        Assert.assertTrue("Transformed elemetn must contains all items ", tl.contains(l.get(0)));
+        Assert.assertTrue("Transformed elemetn must contains all items ", tl.contains(l.get(1)));
+        Assert.assertTrue("Transformed elemetn must contains all items ", tl.contains(l.get(2)));
+        Assert.assertTrue("Transformed elemetn must contains all items ", tl.contains(l.get(3)));
+    }
+}
diff -r 01544fb82384 tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java
--- a/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java	Wed Jul 11 16:18:58 2012 +0200
+++ b/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java	Tue Aug 07 10:38:13 2012 +0200
@@ -54,9 +54,7 @@
 import java.net.ServerSocket;
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 import net.sourceforge.jnlp.browsertesting.Browser;
 import net.sourceforge.jnlp.browsertesting.BrowserFactory;
 import net.sourceforge.jnlp.browsertesting.Browsers;


More information about the distro-pkg-dev mailing list