MCPcopy Create free account
hub / github.com/beanshell/beanshell / startSplashScreen

Method startSplashScreen

src/bsh/util/Util.java:56–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54 However we'd like to get it on the screen as quickly as possible.
55 */
56 public static void startSplashScreen()
57 {
58 int width=275,height=148;
59 Window win=new Window( new Frame() );
60 win.pack();
61 BshCanvas can=new BshCanvas();
62 can.setSize( width, height ); // why is this necessary?
63 Toolkit tk=Toolkit.getDefaultToolkit();
64 Dimension dim=tk.getScreenSize();
65 win.setBounds(
66 dim.width/2-width/2, dim.height/2-height/2, width, height );
67 win.add("Center", can);
68 Image img=tk.getImage(
69 Interpreter.class.getResource("/bsh/util/lib/splash.gif") );
70 MediaTracker mt=new MediaTracker(can);
71 mt.addImage(img,0);
72 try { mt.waitForAll(); } catch ( Exception e ) { }
73 Graphics gr=can.getBufferedGraphics();
74 gr.drawImage(img, 0, 0, can);
75 win.setVisible(true);
76 win.toFront();
77 splashScreen = win;
78 }
79
80 public static void endSplashScreen() {
81 if ( splashScreen != null )

Callers 1

mainMethod · 0.80

Calls 5

getBufferedGraphicsMethod · 0.95
setBoundsMethod · 0.80
toFrontMethod · 0.80
addMethod · 0.45
getResourceMethod · 0.45

Tested by

no test coverage detected