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.11 by ajm, Mon Jan 22 04:45:58 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 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 87 | Line 77 | public class SwingClient extends JFrame {
77  
78          bottom.add(messagesPane, "Center");
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(_status);
92 <        statusPanel.add(_dataLinkStatus);
85 >        statusPanel.add(linkPanel);
86          statusPanel.add(_queueStatus);
87          
88          bottom.add(statusPanel, "South");
# Line 105 | 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);
# Line 118 | Line 116 | public class SwingClient extends JFrame {
116      public static void addMessage(String message) {
117          _messages.insert(message + "\n", 0);
118      }
121 //---ATTRIBUTES---
119  
120 <    static JLabel _status = new JLabel("Initialising", JLabel.LEFT);
120 > //---ATTRIBUTES---
121 >    
122 >    ImageIcon _serverIcon = new ImageIcon("server.gif");
123 >    JLabel _serverCountLabel;
124 >    int _serverCount = 0;
125 >    
126 > //---STATIC ATTRIBUTES---
127 >    
128 >    static JLabel _controlStatus = new JLabel("Control Link: Disconnected", JLabel.LEFT);
129      {
130 <        _status.setBorder(new EtchedBorder(EtchedBorder.LOWERED));
130 >        _controlStatus.setBorder(new EtchedBorder(EtchedBorder.LOWERED));
131      }
132      
133 <    static JLabel _dataLinkStatus = new JLabel("Data Link Status here soon", JLabel.LEFT);
133 >    static JLabel _dataStatus = new JLabel("Data Link: Disconnected", JLabel.LEFT);
134      {
135 <        _dataLinkStatus.setBorder(new EtchedBorder(EtchedBorder.LOWERED));
135 >        _dataStatus.setBorder(new EtchedBorder(EtchedBorder.LOWERED));
136      }
137      
138 <    static JLabel _queueStatus = new JLabel("-", JLabel.LEFT);
138 >    static JLabel _queueStatus = new JLabel(" ", JLabel.LEFT);
139      {
140          _queueStatus.setBorder(new EtchedBorder(EtchedBorder.LOWERED));
141      }
137    
138    ImageIcon _serverIcon = new ImageIcon("server.gif");
139    JLabel _serverCountLabel;
140    int _serverCount = 0;
142      static JTextArea _messages = new JTextArea();
142    
143 //---STATIC ATTRIBUTES---
144    
143   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines