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.22 by ajm, Wed Feb 21 23:45:16 2001 UTC vs.
Revision 1.33 by tdb, Sat May 18 18:15:56 2002 UTC

# Line 1 | Line 1
1 + /*
2 + * i-scream central monitoring system
3 + * Copyright (C) 2000-2002 i-scream
4 + *
5 + * This program is free software; you can redistribute it and/or
6 + * modify it under the terms of the GNU General Public License
7 + * as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * This program is distributed in the hope that it will be useful,
11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 + * GNU General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU General Public License
16 + * along with this program; if not, write to the Free Software
17 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18 + */
19 +
20   //---PACKAGE DECLARATION---
21 < package uk.ac.ukc.iscream.conient;
21 > package uk.org.iscream.cms.conient;
22  
23   //---IMPORTS---
24   import javax.swing.*;
# Line 28 | Line 47 | public class Conient extends JFrame {
47      /**
48       * The initial width of the window
49       */        
50 <    private final int DEFAULT_WIDTH = 600;
50 >    private final int DEFAULT_WIDTH = 700;
51      
52      /**
53       * The initial height of the window
# Line 74 | Line 93 | public class Conient extends JFrame {
93          
94          // the main frame (passed the two panels)
95          Conient client = new Conient(data, control);
96 <        Conient.addMessage("Conient {an i-scream Client} © 2001 University of Kent & Project i-scream");
96 >        conientFrame = (Frame) client;
97 >        Conient.addMessage("Conient {an i-scream Client} (c) 2001 The i-scream Project (http://www.i-scream.org.uk)");
98  
99          Conient.addMessage("Conient ready.");
100          
101      }
82
102      
103 +    /**
104 +     * A static accessor, allowing components of the system
105 +     * to get hold of the root frame of the system.
106 +     *
107 +     * see conientFrame attribute for details.
108 +     *
109 +     * @return the root Conient frame
110 +     */
111 +    public static Frame getFrame() {
112 +        return conientFrame;
113 +    }
114 +    
115   //---CONSTRUCTORS---
116  
117      /**
118       * Creates a new Swing Client Frame
119       */
120 <    private Conient(JPanel data, JPanel control) {
120 >    private Conient(JSplitPane data, ControlPanel control) {
121          // set up the Frame
122          super("Conient {an i-scream Client}");
123          setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
124 <
124 >        setJMenuBar(control.getMenuBar());
125 >        
126          // set what happens when the X in the corner is clicked        
127          addWindowListener(new WindowAdapter() {
128              public void windowClosing(WindowEvent e) {System.exit(0);}
# Line 98 | Line 130 | public class Conient extends JFrame {
130  
131          // add the control pane to the top border
132          getContentPane().add(control, "North");
133 <        
134 <        // create a scrollable pane for the data in the centre
103 <        JScrollPane scrollPane = new JScrollPane(data);
104 <        getContentPane().add(scrollPane, "Center");
133 >        // add the data pane to the centre        
134 >        getContentPane().add(data);
135  
136          // setup the status panel        
137          JPanel bottom = new JPanel();
# Line 125 | Line 155 | public class Conient extends JFrame {
155          getContentPane().add(bottom, "South");
156          
157          // a nice icon for the window
158 <        setIconImage((new ImageIcon("./uk/ac/ukc/iscream/conient/server.gif")).getImage());
158 >        setIconImage((new ImageIcon("./resources/server.gif")).getImage());
159  
160          // and just because we can, a silly splash screen
161 <        // of the dudes that did this funky gibble
161 >        // of the dudes that did this funky jibble
162          Splash splash = new Splash();
163          splash.show();
164          // wait
# Line 226 | Line 256 | public class Conient extends JFrame {
256          _messages.setLineWrap(true);
257      }
258      
259 +    /**
260 +     * Holds a reference to the root frame for Conient
261 +     * This is only used by dialogs (specifically the configurationn
262 +     * dialog) so that it can be modal, please use the accessor.
263 +     */
264 +    private static Frame conientFrame;
265 +    
266   //---INNER CLASSES----
267  
268      /**
# Line 240 | Line 277 | public class Conient extends JFrame {
277              setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
278              JPanel splash = new JPanel();
279              splash.setBackground(Color.black);
280 <            JLabel image = new JLabel((new ImageIcon("./uk/ac/ukc/iscream/conient/i-scream-splash.gif")));
280 >            JLabel image = new JLabel((new ImageIcon("./resources/i-scream-splash.gif")));
281              splash.add(image);
282              setContentPane(splash);
283              Dimension screen = getToolkit().getScreenSize();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines