ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/conient/uk/org/iscream/cms/conient/Conient.java
(Generate patch)

Comparing projects/cms/source/conient/uk/org/iscream/cms/conient/Conient.java (file contents):
Revision 1.21 by ajm, Mon Feb 5 01:26:04 2001 UTC vs.
Revision 1.22 by ajm, Wed Feb 21 23:45:16 2001 UTC

# Line 41 | Line 41 | public class Conient extends JFrame {
41       */
42      public static final String DEFAULT_CONFIG_FILE = "./etc/default.conf";
43      
44 +    /**
45 +     * The time in seconds to display the splash
46 +     * screen for
47 +     */
48 +    public static final int DISPLAY_SPLASH_TIME_SECONDS = 3;
49 +    
50   //---STATIC METHODS---
51  
52      /**
# Line 71 | Line 77 | public class Conient extends JFrame {
77          Conient.addMessage("Conient {an i-scream Client} © 2001 University of Kent & Project i-scream");
78  
79          Conient.addMessage("Conient ready.");
80 +        
81      }
82  
83      
# Line 119 | Line 126 | public class Conient extends JFrame {
126          
127          // a nice icon for the window
128          setIconImage((new ImageIcon("./uk/ac/ukc/iscream/conient/server.gif")).getImage());
129 <        // show the window
129 >
130 >        // and just because we can, a silly splash screen
131 >        // of the dudes that did this funky gibble
132 >        Splash splash = new Splash();
133 >        splash.show();
134 >        // wait
135 >        try {
136 >            Thread.sleep(DISPLAY_SPLASH_TIME_SECONDS * 1000);
137 >        } catch (InterruptedException e) {
138 >            // don't do anything, we don't care
139 >        }
140 >        //loose the window
141 >        splash.dispose();
142 >        splash = null;        
143 >        // show the main window
144          show();
145      }
146  
# Line 203 | Line 224 | public class Conient extends JFrame {
224      static JTextArea _messages = new JTextArea();
225      {
226          _messages.setLineWrap(true);
227 +    }
228 +    
229 + //---INNER CLASSES----
230 +
231 +    /**
232 +     * An inner class to display a splash screen
233 +     */
234 +    private class Splash extends JWindow {
235 +        
236 +        /**
237 +         * Constructs a new splash screen
238 +         */
239 +        public Splash() {
240 +            setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
241 +            JPanel splash = new JPanel();
242 +            splash.setBackground(Color.black);
243 +            JLabel image = new JLabel((new ImageIcon("./uk/ac/ukc/iscream/conient/i-scream-splash.gif")));
244 +            splash.add(image);
245 +            setContentPane(splash);
246 +            Dimension screen = getToolkit().getScreenSize();
247 +            pack();
248 +            setLocation((screen.width - getSize().width) / 2,
249 +                        (screen.height - getSize().height) / 2);
250 +            
251 +            
252 +        }
253      }
254   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines