From e1e781bb2135ef78592226f1a3eaba4925702f1f Mon Sep 17 00:00:00 2001 From: Fuwn Date: Mon, 3 May 2021 16:38:41 -0700 Subject: :star: --- NET/worlds/console/SplashScreen.java | 86 ++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 NET/worlds/console/SplashScreen.java (limited to 'NET/worlds/console/SplashScreen.java') diff --git a/NET/worlds/console/SplashScreen.java b/NET/worlds/console/SplashScreen.java new file mode 100644 index 0000000..9b13f1d --- /dev/null +++ b/NET/worlds/console/SplashScreen.java @@ -0,0 +1,86 @@ +/* */ package NET.worlds.console; +/* */ +/* */ import java.awt.Dimension; +/* */ import java.awt.Frame; +/* */ import java.awt.Toolkit; +/* */ import java.awt.Window; +/* */ import java.io.PrintStream; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class SplashScreen +/* */ extends Window +/* */ { +/* */ private static final long serialVersionUID = 4848128412139723543L; +/* 32 */ private SplashCanvas sc = null; +/* */ +/* */ public SplashScreen(String appname, String imagename) { +/* 35 */ super(new Frame(appname)); +/* 36 */ this.sc = new SplashCanvas(imagename); +/* 37 */ add(this.sc); +/* */ +/* 39 */ pack(); +/* 40 */ center(); +/* */ } +/* */ +/* */ public void setImageName(String imagename) { +/* 44 */ this.sc.setImage(imagename); +/* 45 */ pack(); +/* 46 */ center(); +/* */ +/* 48 */ this.sc.repaint(); +/* */ } +/* */ +/* */ public void addOverlay(String name, int x, int y) { +/* 52 */ this.sc.addOverlay(name, x, y); +/* 53 */ center(); +/* */ } +/* */ +/* */ public void removeOverlay(String name, int x, int y) { +/* 57 */ this.sc.removeOverlay(name, x, y); +/* */ } +/* */ +/* */ public void center() +/* */ { +/* 62 */ Dimension dim = getSize(); +/* 63 */ Dimension scrdim = Toolkit.getDefaultToolkit().getScreenSize(); +/* 64 */ int x = scrdim.width >= dim.width ? (scrdim.width - dim.width) / 2 : +/* 65 */ 0; +/* 66 */ int y = scrdim.height >= dim.height ? (scrdim.height - dim.height) / 2 : +/* 67 */ 0; +/* 68 */ setLocation(x, y); +/* */ } +/* */ +/* */ public void dispose() +/* */ { +/* 73 */ super.dispose(); +/* */ try { +/* 75 */ this.sc.flush(); +/* */ } catch (NullPointerException e) { +/* 77 */ System.out.println("Flushing went bad!"); +/* */ } +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\SplashScreen.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */ \ No newline at end of file -- cgit v1.2.3