All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.coherentlogic.coherent.data.model.demo.application.SplashComponent Maven / Gradle / Ivy

The newest version!
package com.coherentlogic.coherent.data.model.demo.application;

import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.SplashScreen;

public class SplashComponent {

    private final SplashScreen splashScreen;

    private final Graphics2D graphics;

    public SplashComponent() {
        this (SplashScreen.getSplashScreen());
    }

    public SplashComponent(SplashScreen splashScreen) {
        this (splashScreen, splashScreen.createGraphics());
    }

    public SplashComponent(SplashScreen splashScreen, Graphics2D graphics) {
        this.splashScreen = splashScreen;
        this.graphics = graphics;
    }

    public void show () {
        int frame = 20;
        final String[] comps = {"foo", "bar", "baz"};
        graphics.setComposite(AlphaComposite.Clear);
        graphics.fillRect(120,140,200,40);
        graphics.setPaintMode();
        graphics.setColor(Color.BLACK);
        graphics.drawString("Loading "+comps[(frame/5)%3]+"...", 120, 150);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy