55 |
|
// the main frame (passed the two panels) |
56 |
|
SwingClient client = new SwingClient(data, control); |
57 |
|
SwingClient.addMessage("Client started"); |
58 |
– |
SwingClient.setStatus("Disconnected"); |
58 |
|
} |
59 |
|
|
60 |
|
|
86 |
|
|
87 |
|
bottom.add(messagesPane, "Center"); |
88 |
|
JPanel statusPanel = new JPanel(); |
89 |
+ |
JPanel linkPanel = new JPanel(); |
90 |
+ |
linkPanel.setLayout(new GridLayout(2,1)); |
91 |
+ |
linkPanel.add(_controlStatus); |
92 |
+ |
linkPanel.add(_dataStatus); |
93 |
|
statusPanel.setLayout(new GridLayout(1,3)); |
94 |
< |
statusPanel.add(_status); |
92 |
< |
statusPanel.add(_dataLinkStatus); |
94 |
> |
statusPanel.add(linkPanel); |
95 |
|
statusPanel.add(_queueStatus); |
96 |
|
|
97 |
|
bottom.add(statusPanel, "South"); |
107 |
|
|
108 |
|
//---ACCESSOR/MUTATOR METHODS--- |
109 |
|
|
110 |
< |
public static void setStatus(String status) { |
111 |
< |
_status.setText(status); |
112 |
< |
_status.repaint(); |
110 |
> |
public static void setControlStatus(String status) { |
111 |
> |
_controlStatus.setText("Control Link: " + status); |
112 |
> |
_controlStatus.repaint(); |
113 |
|
} |
114 |
+ |
|
115 |
+ |
public static void setDataStatus(String status) { |
116 |
+ |
_dataStatus.setText("Data Link: " + status); |
117 |
+ |
_dataStatus.repaint(); |
118 |
+ |
} |
119 |
|
|
120 |
|
public static void setQueueStatus(int currentQueue, int numElements) { |
121 |
|
_queueStatus.setText("Data Queue : " + currentQueue + " Packets Recieved : " + numElements); |
127 |
|
} |
128 |
|
//---ATTRIBUTES--- |
129 |
|
|
130 |
< |
static JLabel _status = new JLabel("Initialising", JLabel.LEFT); |
130 |
> |
static JLabel _controlStatus = new JLabel("Control Link: Disconnected", JLabel.LEFT); |
131 |
|
{ |
132 |
< |
_status.setBorder(new EtchedBorder(EtchedBorder.LOWERED)); |
132 |
> |
_controlStatus.setBorder(new EtchedBorder(EtchedBorder.LOWERED)); |
133 |
|
} |
134 |
|
|
135 |
< |
static JLabel _dataLinkStatus = new JLabel("Data Link Status here soon", JLabel.LEFT); |
135 |
> |
static JLabel _dataStatus = new JLabel("Data Link: Disconnected", JLabel.LEFT); |
136 |
|
{ |
137 |
< |
_dataLinkStatus.setBorder(new EtchedBorder(EtchedBorder.LOWERED)); |
137 |
> |
_dataStatus.setBorder(new EtchedBorder(EtchedBorder.LOWERED)); |
138 |
|
} |
139 |
|
|
140 |
|
static JLabel _queueStatus = new JLabel("-", JLabel.LEFT); |