Java Reference
In-Depth Information
/** Set buttons for restart. **/
void setDisconnected () {
fStartButton.setText ("Start");
fStatusLabel.setText ("Disconnected");
fStatusLabel.setForeground (Color.RED);
} // setDisconnected
/**
* The DataClientWorker passes the data array from the
* server here. Display the data set by packing a
* histogram.
*
* Also, plot the distribution of one of
* the channels of the data. The channel number is
* given in the text field.
**/
void setData (int[] data) {
// Display each data set
fHistData.pack (data, 0, 0, 0.0, (double)
(data.length));
fHistDataPanel.getScaling ();
// Plot the distribution of one of the channels in the
// data.
if (fChannelToMonitor >= 0&&fChannelToMonitor <
data.length) {
fHistChan.setTitle ("Channel " +
fChannelToMonitor);
fHistChan.add ((double)data[fChannelToMonitor]);
// Adapt since data varies from channel to channel.
fHistChan.rebin ();
// Now rescale and draw.
fHistChanPanel.getScaling ();
}
repaint ();
} // setData
/** Convenience method for sending messages to the text
* area. **/
public void println (String str) {
fMessageArea.append (str + " \ n " );
repaint ();
} // println
... Continue class DataClient...
 
Search WWH ::




Custom Search