Search in sources :

Example 1 with SplashScreen

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);
}
Also used : SplashScreen(java.awt.SplashScreen) IOException(java.io.IOException) File(java.io.File)

Example 2 with SplashScreen

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);
}
Also used : SplashScreen(java.awt.SplashScreen) IOException(java.io.IOException) File(java.io.File)

Example 3 with SplashScreen

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!");
    }
}
Also used : Color(java.awt.Color) Rectangle(java.awt.Rectangle) SplashScreen(java.awt.SplashScreen) Robot(java.awt.Robot) Graphics2D(java.awt.Graphics2D) SunGraphics2D(sun.java2d.SunGraphics2D)

Aggregations

SplashScreen (java.awt.SplashScreen)3 File (java.io.File)2 IOException (java.io.IOException)2 Color (java.awt.Color)1 Graphics2D (java.awt.Graphics2D)1 Rectangle (java.awt.Rectangle)1 Robot (java.awt.Robot)1 SunGraphics2D (sun.java2d.SunGraphics2D)1