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.9 by ajm, Sun Jan 21 03:30:00 2001 UTC vs.
Revision 1.14 by tdb, Mon Jan 22 19:35:36 2001 UTC

# Line 3 | Line 3
3   //---IMPORTS---
4   import javax.swing.*;
5   import javax.swing.border.*;
6 import java.awt.Color;
7 import uk.ac.ukc.iscream.util.*;
8
6   import java.awt.*;
7   import java.awt.event.*;
11 import java.net.*;
12 import java.io.*;
13 import java.util.Date;
14 import java.text.DateFormat;
15 import java.util.Locale;
16 import java.util.HashMap;
17 import javax.swing.border.*;
8  
9   /**
10 < * NASTY AND BASIC, PLEASE DON'T COMPLAIN
10 > * Root for the SwingClient...starts the whole show off...
11   *
12   * @author  $Author$
13   * @version $Id$
# Line 30 | Line 20 | public class SwingClient extends JFrame {
20       * The current CVS revision of this class
21       */
22      public final String REVISION = "$Revision$";
23 <    
23 >        
24      private final int width = 600;
25      private final int height = 600;
26      
# Line 55 | Line 45 | public class SwingClient extends JFrame {
45          // the main frame (passed the two panels)
46          SwingClient client = new SwingClient(data, control);
47          SwingClient.addMessage("Client started");
58        SwingClient.setStatus("Disconnected");
48      }
49  
50      
# Line 73 | Line 62 | public class SwingClient extends JFrame {
62              public void windowClosing(WindowEvent e) {System.exit(0);}
63          });
64  
76        
77        // build the frame
65          getContentPane().add(control, "North");
79        getContentPane().add(data, "Center");
66          
67 +        JScrollPane scrollPane = new JScrollPane(data);
68 +        getContentPane().add(scrollPane, "Center");
69 +        
70 +        
71          JPanel bottom = new JPanel();
72          bottom.setLayout(new BorderLayout());
73          _messages.setEditable(false);
# Line 86 | Line 76 | public class SwingClient extends JFrame {
76          messagesPane.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 102)), " Messages "));
77  
78          bottom.add(messagesPane, "Center");
79 <        bottom.add(_status, "South");
79 >        JPanel statusPanel = new JPanel();
80 >        JPanel linkPanel = new JPanel();
81 >        linkPanel.setLayout(new GridLayout(2,1));
82 >        linkPanel.add(_controlStatus);
83 >        linkPanel.add(_dataStatus);
84 >        statusPanel.setLayout(new GridLayout(1,3));
85 >        statusPanel.add(linkPanel);
86 >        statusPanel.add(_queueStatus);
87 >        
88 >        bottom.add(statusPanel, "South");
89          getContentPane().add(bottom, "South");
90          
91          // show the window
# Line 99 | Line 98 | public class SwingClient extends JFrame {
98  
99   //---ACCESSOR/MUTATOR METHODS---
100  
101 <    public static void setStatus(String status) {
102 <        _status.setText(status);
103 <        _status.repaint();
101 >    public static void setControlStatus(String status) {
102 >        _controlStatus.setText("Control Link: " + status);
103 >        _controlStatus.repaint();
104      }
105 +    
106 +    public static void setDataStatus(String status) {
107 +        _dataStatus.setText("Data Link: " + status);
108 +        _dataStatus.repaint();
109 +    }
110  
111 +    public static void setQueueStatus(int currentQueue, int numElements) {
112 +        _queueStatus.setText("Data Queue : " + currentQueue + " Packets Recieved : " + numElements);
113 +        _queueStatus.repaint();
114 +    }
115 +
116      public static void addMessage(String message) {
117          _messages.insert(message + "\n", 0);
118      }
110 //---ATTRIBUTES---
119  
120 <    static JLabel _status = new JLabel("Initialising", JLabel.LEFT);
113 <    {
114 <        _status.setBorder(new EtchedBorder(EtchedBorder.LOWERED));
115 <    }      
120 > //---ATTRIBUTES---
121      
122      ImageIcon _serverIcon = new ImageIcon("server.gif");
123      JLabel _serverCountLabel;
124      int _serverCount = 0;
120    static JTextArea _messages = new JTextArea();
125      
126   //---STATIC ATTRIBUTES---
127      
128 +    static JLabel _controlStatus = new JLabel("Control Link: Disconnected", JLabel.LEFT);
129 +    {
130 +        _controlStatus.setBorder(new EtchedBorder(EtchedBorder.LOWERED));
131 +    }
132 +    
133 +    static JLabel _dataStatus = new JLabel("Data Link: Disconnected", JLabel.LEFT);
134 +    {
135 +        _dataStatus.setBorder(new EtchedBorder(EtchedBorder.LOWERED));
136 +    }
137 +    
138 +    static JLabel _queueStatus = new JLabel(" ", JLabel.LEFT);
139 +    {
140 +        _queueStatus.setBorder(new EtchedBorder(EtchedBorder.LOWERED));
141 +    }
142 +    static JTextArea _messages = new JTextArea();
143   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines