
com.coherentlogic.coherent.data.model.demo.application.SplashComponent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of demo-application Show documentation
Show all versions of demo-application Show documentation
This is the foundation for several data model demonstration
applications.
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