/* * SerialNetworkServicesView.java * * Copyright (c) 2003-2004 Digi International * This program and the information contained in it is confidential and * proprietary to Digi International and may not be used, copied, or re- * produced without the prior written permission of Digi International. * */ package com.digi.config.ui; import com.digi.config.core.*; import com.digi.config.util.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.tree.*; import javax.swing.border.*; import java.awt.*; import java.awt.event.*; import java.util.*; import java.io.*; import java.net.*; /** * This class is a view panel that shows the network services * available for a serial port of the Digi Connect device. * * This view can be embedded in other panels as desired. */ public class SerialNetworkServicesView extends ConfigViewImpl { /** A KvpNode that holds just the fields used in this view */ KvpNode viewSettingTree; /** listens to the device for changes to settings */ DeviceChangeListener settingChangeListener; /** Panel that holds the view content */ GridContentPanel content; String serviceName[] = { "tcp", "ssl", "udp", "rp", "srp", "telnet", "lpd" }; String serviceSettingName[] = { "tcp_server", "securesocket", "udp_server", "realport", "secure_realport", "telnet_server", "lpd" }; // Data Fields currently used in this view KvpField serverEnabledKvpField[] = new KvpField[serviceName.length]; KvpField serverPortKvpField[] = new KvpField[serviceName.length]; // UI Controls for each field JCheckBox serverEnabled_UIC[] = new JCheckBox[serviceName.length]; JTextField serverPort_UIC[] = new JTextField[serviceName.length]; /** * Constructor. Sets up the view controls */ public SerialNetworkServicesView() throws Exception { // create the KvpNode and the change listener viewSettingTree = new KvpNode(); settingChangeListener = new DeviceChangeListener() { public void deviceChanged(DeviceChangeEvent e) { //SystemLog.debug("SerialNetworkServicesView was notified that device kvpGroup changed"); refreshViewKvpNode(); refreshViewControls(); } }; // Create the panel that will hold the view controls content = new GridContentPanel(this.getName(),1); // create a listener that will detect when a user edits the field values ControlChangeAdapter fieldListener = new ControlChangeAdapter() { public void changePerformed(Object source, ActionEvent ae, FocusEvent fe) { //SystemLog.debug("SerialNetworkServicesView was notified that field "+source.toString()+" changed."); for (int i=0; i