[fedora-java] JAVA Native Splash Screen Guidance

mray271 mray271 at gmail.com
Fri Sep 6 15:06:11 UTC 2013


There doesn't seem to be any official guidance on how to show splash 
images for Java applications packaged for Fedora in 
<http://fedoraproject.org/wiki/Packaging:Java> . I am hoping the 
following with lead to discussion and ultimately to a standard approach. 
In short, I believe the issue can be addressed through Fedora packaging 
guidelines without violating canonical JPackage guidelines. Indeed, the 
JPackage guidelines http://www.jpackage.org don't seem to address splash 
images at all.

BACKGROUND:
According to 
http://docs.oracle.com/javase/tutorial/uiswing/misc/splashscreen.html

"...the main purpose of a splash screen is to provide the user with 
feedback about the application's startup, the delay between the 
application's startup and the moment when the splash screen pops up 
should be minimal" [1]

Currently, JAVA supports only the 2 following mechanisms to display such 
a splash screen:

1) Command-line argument
2) Java™ Archive (JAR) file with the specified manifest option

For JAVA applications packaged in Fedora, 2) is not possible since 
executable .jar files are not allowed according to guidelines 
http://fedoraproject.org/wiki/Packaging:Java. In Fedora, the 
/usr/share/java-utils/java-functions are used. In contrast, for 1) to 
work, a path to an image file residing on the file system must be given. 
This differs sharply from 2) where the splash image must be a resource 
packaged in the application jar file and indicated as the 
SplashScreen-Image in the jar's manifest.


PROPOSAL:
The following work-around convention is suggested and is open for 
discussion:

Fedora Java packages that wish to show a splash screen prior to their 
package's main class running, should place an image in the directory 
/usr/share/splash following the convention <fedora-package-name>.<ext> 
where ext is one of the standard splash image file types (e.g. .png, 
.gif, .jpg).

For applications wishing to show a splash screen, package maintainers 
should then put a line in the package's JPackage launch script similar to:

BASE_FLAGS="-splash:/usr/share/splash/<fedora-package-name>.<ext>"

RPM/SPEC CONSIDERATIONS:
A reasonably common situation will be that a jar resource spash image 
will already exist within the sources of JAVA applications wanting to 
show a splash image. Fedora package maintainers can easily use maven or 
ant build tactics to 1) copy the image from RPM sources or 2) extract 
image resource from the packaged jar file and rename to 
/usr/share/splash/<fedora-package-name>.<ext> during Fedora package 
%build and/or %install etc.

[1] Some applications currently packaged in Fedora (e.g. Jabref) go to 
some lengths to circumvent the issue altogether and use custom 
undecorated JFrame or Window class instances to programmatically show a 
"splash screen" followed by a timed delay prior to making their main 
application window visible to the user. However such forced "splash 
screens" are only shown after the JVM has already fully started and must 
then impose a further delay by showing the splash for some predetermined 
time (e.g. 2 seconds). This circumvents the "main purpose of a splash 
screen" mentioned in 
http://docs.oracle.com/javase/tutorial/uiswing/misc/splashscreen.html

--
Dan Dougherty





More information about the java-devel mailing list