use of java.awt.SplashScreen in project gitblit by gitblit.
the class Launcher method main.
public static void main(String[] args) {
final SplashScreen splash = SplashScreen.getSplashScreen();
File libFolder = new File("ext");
List<File> jars = findJars(libFolder.getAbsoluteFile());
// sort the jars by name and then reverse the order so the newer version
// of the library gets loaded in the event that this is an upgrade
Collections.sort(jars);
Collections.reverse(jars);
for (File jar : jars) {
try {
updateSplash(splash, Translation.get("gb.loading") + " " + jar.getName() + "...");
addJarFile(jar);
} catch (IOException e) {
}
}
updateSplash(splash, Translation.get("gb.starting") + " Gitblit Authority...");
GitblitAuthority.main(args);
}
use of java.awt.SplashScreen in project gitblit by gitblit.
the class GitblitManagerLauncher method main.
public static void main(String[] args) {
final SplashScreen splash = SplashScreen.getSplashScreen();
File libFolder = new File("ext");
List<File> jars = findJars(libFolder.getAbsoluteFile());
// sort the jars by name and then reverse the order so the newer version
// of the library gets loaded in the event that this is an upgrade
Collections.sort(jars);
Collections.reverse(jars);
for (File jar : jars) {
try {
updateSplash(splash, Translation.get("gb.loading") + " " + jar.getName() + "...");
addJarFile(jar);
} catch (IOException e) {
}
}
updateSplash(splash, Translation.get("gb.starting") + " Gitblit Manager...");
GitblitManager.main(args);
}
use of java.awt.SplashScreen in project jdk8u_jdk by JetBrains.
the class MultiResolutionSplashTest method testSplash.
static void testSplash(ImageInfo test) throws Exception {
SplashScreen splashScreen = SplashScreen.getSplashScreen();
if (splashScreen == null) {
throw new RuntimeException("Splash screen is not shown!");
}
Graphics2D g = splashScreen.createGraphics();
Rectangle splashBounds = splashScreen.getBounds();
int screenX = (int) splashBounds.getCenterX();
int screenY = (int) splashBounds.getCenterY();
if (splashBounds.width != IMAGE_WIDTH) {
throw new RuntimeException("SplashScreen#getBounds has wrong width");
}
if (splashBounds.height != IMAGE_HEIGHT) {
throw new RuntimeException("SplashScreen#getBounds has wrong height");
}
Robot robot = new Robot();
Color splashScreenColor = robot.getPixelColor(screenX, screenY);
float scaleFactor = getScaleFactor();
Color testColor = (1 < scaleFactor) ? test.color2x : test.color1x;
if (!compare(testColor, splashScreenColor)) {
throw new RuntimeException("Image with wrong resolution is used for splash screen!");
}
}
Aggregations