Normand Briere
2018-07-07 09ddd38fd4a8a7100c834a5e976f4796fae53541
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package timeflow.app;
 
import timeflow.model.*;
 
import java.awt.*;
import java.io.File;
import java.util.*;
import javax.imageio.*;
 
public class AboutWindow extends Window {
   
   Image image;
   Display display;
   int w=640, h=380;
   
   public AboutWindow(Frame owner, Display display) {
       super(owner);
       this.display=display;
       
       try
       {
                    // image=ImageIO.read(getClass().getClassLoader().getResourceAsStream("images/splash.jpg"));
           image=ImageIO.read(new File("images/splash.jpg"));
           w=image.getWidth(null);
           h=image.getHeight(null);
       }
       catch (Exception e)
       {
           e.printStackTrace(System.out);
       }
       Dimension size = Toolkit.getDefaultToolkit().getScreenSize();
       setBounds((size.width-w)/2, (size.height-h)/2, w,h);
       
   }
   
   public void paint(Graphics g)
   {
       if (image!=null)
       {
           g.drawImage(image,0,0,null);
           return;
       }
       int lx=15;
       ((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
       g.setColor(display.getColor("splash.background"));
       g.fillRect(0,0,w,h);
       g.setFont(display.huge());
       g.setColor(display.getColor("splash.text"));
       g.drawString(Display.version(), lx, 35);
       g.setFont(display.plain());
       g.drawString("Prototype version",lx,60);
   }
}