📄 marshalscreen.java
字号:
/* * ==================================================================== * The Vovida Software License, Version 1.0 * * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The names "VOCAL", "Vovida Open Communication Application Library", * and "Vovida Open Communication Application Library (VOCAL)" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact vocal@vovida.org. * * 4. Products derived from this software may not be called "VOCAL", nor * may "VOCAL" appear in their name, without prior written * permission of Vovida Networks, Inc. * * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * ==================================================================== * * This software consists of voluntary contributions made by Vovida * Networks, Inc. and many individuals on behalf of Vovida Networks, * Inc. For more information on Vovida Networks, Inc., please see * <http://www.vovida.org/>. * *//** * Title: <p> * Description: <p> * Copyright: Copyright (c) <p> * Company: <p> * @author * @version 1.0 */package vocal.ui;import java.awt.*;import javax.swing.*;import vocal.data.MarshalData;import vocal.data.InvalidRequestException;import javax.swing.table.TableColumn;import java.awt.event.*;import javax.swing.border.*;/** * $RCSfile$ * * @author $Author$, $Date$ * @version $Revision$ */public class MarshalScreen extends FormPanelScreen{ // manual additions BasicTableModel tableModel = new BasicTableModel(); TableColumn tableColumn = new TableColumn(); // generated by Jbuilder JPanel jPanel1 = new JPanel(); JScrollPane jScrollPane1 = new JScrollPane(); JPanel jPanel2 = new JPanel(); BorderLayout borderLayout1 = new BorderLayout(); BorderLayout borderLayout2 = new BorderLayout(); MarshalData dataManager; ConfigureServers mainScreen; vocal.data.ConfigTree configTree1; JPanel jPanel3 = new JPanel(); JPanel jPanel4 = new JPanel(); FlowLayout flowLayout1 = new FlowLayout(); BorderLayout borderLayout4 = new BorderLayout(); Box outerBox; WholeNumberField portTextField = new WholeNumberField("Port"); JLabel hostNameLabel = new JLabel(); JLabel typeDescriptionLabel = new JLabel(); JLabel groupLabel = new JLabel(); WholeNumberField noResponseTimerTextField = new WholeNumberField("No Response Time"); LabelFieldPanel generalLabelFieldPanel = new LabelFieldPanel(); JLabel portLabel = new JLabel(); JLabel typeLabel = new JLabel(); JLabel noResponseTimerLabel = new JLabel(); JLabel groupDescriptionLabel = new JLabel(); HostNameField hostTextField = new HostNameField("Host Name"); JLabel serverNameLabel = new JLabel(); FlowLayout flowLayout4 = new FlowLayout(); LabelFieldPanel gatewayLabelFieldPanel = new LabelFieldPanel(); JLabel gatewayHostLabel = new JLabel(); HostNameField gatewayHostTextField = new HostNameField("Gateway Host Name"); JLabel gatewayPortLabel = new JLabel(); WholeNumberField gatewayPortTextField = new WholeNumberField("Gateway Port"); Border border1; TitledBorder titledBorder1; TitledBorder titledBorder2; Border GatewayBorder; Border border3; TitledBorder titledGatewayBorder; Border PSTNGatewayBorder; private Border border2; private JPanel conferencePanel = new JPanel(); private LabelFieldPanel conferenceFieldPanel = new LabelFieldPanel(); private JScrollPane jScrollPane2 = new JScrollPane(); private JPanel accessNumberPanel = new JPanel(); private FlowLayout flowLayout3 = new FlowLayout(); private FlowLayout flowLayout2 = new FlowLayout(); private InternalClipboardField bridgeNumberTextField = new InternalClipboardField(); private Box conferenceBox; private JPanel tableLabelPanel = new JPanel(); private JPanel buttonGridPanel = new JPanel(); private JLabel bridgeNumberLabel = new JLabel(); private GridLayout gridLayout2 = new GridLayout(); private JPanel buttonFlowPanel = new JPanel(); private BorderLayout borderLayout3 = new BorderLayout(); private JButton tableAddButton = new JButton(); private JLabel jLabel1 = new JLabel(); private JTable jTable1 = new JTable(); private JButton tableDeleteButton = new JButton(); private Border border4; private TitledBorder titledBorder3; private Border border5; private Component gatewayConferenceStrut; private Component generalGatewayStrut1; protected JLabel allowUnbillableLabel = new JLabel(); protected JComboBox allowUnbillableComboBox = new JComboBox(new String[] { "true", "false" }); protected JLabel allowUnknownCallersLabel = new JLabel(); protected JComboBox allowUnknownComboBox = new JComboBox(new String[] { "true", "false" }); /** * * @param screen */ public MarshalScreen(ConfigureServers screen) { mainScreen = screen; try { jbInit(); } catch (Exception e) { e.printStackTrace(); } initMarshal(); } /** */ private void initMarshal() { jTable1.setModel(tableModel); tableColumn.setPreferredWidth(180); jTable1.addColumn(tableColumn); jTable1.setCellSelectionEnabled(true); jTable1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); // set up the combo box } /** * * @throws Exception */ private void jbInit() throws Exception { outerBox = Box.createVerticalBox(); border1 = BorderFactory.createLineBorder(Color.gray, 1); titledBorder1 = new TitledBorder(border1, "Gateway"); GatewayBorder = BorderFactory.createCompoundBorder(titledBorder1, BorderFactory.createEmptyBorder(5, 20, 5, 20)); border3 = BorderFactory.createLineBorder(Color.gray, 1); titledBorder2 = new TitledBorder(border3, "PSTN Gateway"); PSTNGatewayBorder = BorderFactory.createCompoundBorder(titledBorder2, BorderFactory.createEmptyBorder(5, 20, 5, 20)); border2 = BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.gray, 1), BorderFactory.createEmptyBorder(20, 5, 20, 5)); conferenceBox = Box.createVerticalBox(); border4 = BorderFactory.createLineBorder(Color.gray, 1); titledBorder3 = new TitledBorder(border4, "Conference"); border5 = BorderFactory.createCompoundBorder(new TitledBorder(BorderFactory.createLineBorder(Color.gray, 1), "Conference"), BorderFactory.createEmptyBorder(5, 20, 5, 20)); gatewayConferenceStrut = Box.createVerticalStrut(20); generalGatewayStrut1 = Box.createVerticalStrut(20); this.setLayout(borderLayout2); jPanel1.setLayout(borderLayout1); jPanel2.setLayout(borderLayout4); jScrollPane1.setBorder(null); jPanel3.setLayout(flowLayout4); jPanel4.setLayout(flowLayout1); flowLayout1.setVgap(10); borderLayout4.setVgap(20); borderLayout1.setVgap(20); hostNameLabel.setForeground(Color.black); hostNameLabel.setText("Host Name:"); typeDescriptionLabel.setForeground(Color.black); typeDescriptionLabel.setText("Unknown"); groupLabel.setForeground(Color.black); groupLabel.setText("Group: "); generalLabelFieldPanel.setPreferredSize(new Dimension(300, 270)); generalLabelFieldPanel.setHorizontalGap(15); generalLabelFieldPanel.setVerticalGap(20); portLabel.setForeground(Color.black); portLabel.setText("Port:"); typeLabel.setForeground(Color.black); typeLabel.setText("Type:"); noResponseTimerLabel.setForeground(Color.black); noResponseTimerLabel.setToolTipText(""); noResponseTimerLabel.setText("No Response Time (ms):"); groupDescriptionLabel.setForeground(Color.black); groupDescriptionLabel.setText("Unknown"); this.setToolTipText(""); serverNameLabel.setForeground(Color.black); serverNameLabel.setHorizontalAlignment(SwingConstants.CENTER); serverNameLabel.setText("Marshal Server"); flowLayout4.setVgap(10); gatewayHostLabel.setForeground(Color.black); gatewayHostLabel.setText("Host Name:"); gatewayPortLabel.setForeground(Color.black); gatewayPortLabel.setText("Port:"); gatewayLabelFieldPanel.setBorder(PSTNGatewayBorder); gatewayLabelFieldPanel.setPreferredSize(new Dimension(300, 100)); gatewayLabelFieldPanel.setVerticalGap(20); conferenceFieldPanel.setPreferredSize(new Dimension(300, 25)); jScrollPane2.setPreferredSize(new Dimension(300, 80)); jScrollPane2.setToolTipText("list of numbers that can be assigned to individual conferences"); accessNumberPanel.setLayout(borderLayout3); flowLayout3.setHgap(0); flowLayout3.setVgap(2); flowLayout2.setAlignment(FlowLayout.LEFT); tableLabelPanel.setLayout(flowLayout2); buttonGridPanel.setLayout(gridLayout2); bridgeNumberLabel.setForeground(Color.black); bridgeNumberLabel.setText("Bridge Number:"); gridLayout2.setColumns(2); gridLayout2.setHgap(5); buttonFlowPanel.setLayout(flowLayout3); buttonFlowPanel.setPreferredSize(new Dimension(300, 30)); borderLayout3.setVgap(2); tableAddButton.setToolTipText("add a new number to the list"); tableAddButton.setText("Add"); tableAddButton.addActionListener(new java.awt.event.ActionListener() { /** * * @param e */ public void actionPerformed(ActionEvent e) { tableAddButton_actionPerformed(e); } }); jLabel1.setForeground(Color.black); jLabel1.setText("Access Numbers:"); tableDeleteButton.setToolTipText("delete selected number from the list"); tableDeleteButton.setText("Delete"); tableDeleteButton.addActionListener(new java.awt.event.ActionListener() { /** * * @param e */ public void actionPerformed(ActionEvent e) { tableDeleteButton_actionPerformed(e);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -