/*
* StartMainFrame.java
*
* Created on 2005年7月30日, 上午10:38
*/
import javax.media.*;
import java.util.Vector;
import javax.media.format.*;
import java.awt.*;
import javax.swing.Timer;
import javax.swing.*;
/**
*
* @author Administrator
*/
public class StartMainFrame extends javax.swing.JFrame {
//*******Accessing Capture Devices********
// CaptureDeviceInfo cdi = null;
/** Creates new form StartMainFrame */
public StartMainFrame() {
//manually added variables from outside
ctlCard = new ControlCard();
cardStartStatus = false;
imageSendStatus = false;
mainPlayer = null; // 播放器类对象
rtpTransmit = null;
initComponents();
/* cdi = CaptureDeviceManager.getDevice("deviceName");
if(cdi != null)
existCards.addItem(cdi.getName());
Vector dl = CaptureDeviceManager.getDeviceList(null);
if(dl.size() > 0){
for(int i=0;i< dl.size();i++)
cdi = (CaptureDeviceInfo)dl.elementAt(i);
existCards.addItem(cdi.toString());
}
*/
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc=" 生成的代码 ">//GEN-BEGIN:initComponents
private void initComponents() {
buttonGroup1 = new javax.swing.ButtonGroup();
imageColorTypeGroup = new javax.swing.ButtonGroup();
testButton = new javax.swing.JButton();
startSend = new javax.swing.JButton();
endSend = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
receiverAdrress = new javax.swing.JLabel();
addrField1 = new javax.swing.JTextField();
addrField2 = new javax.swing.JTextField();
addrField3 = new javax.swing.JTextField();
addrField4 = new javax.swing.JTextField();
port1Label = new javax.swing.JLabel();
port1Int = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
startCaptureCard = new javax.swing.JButton();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
frameFreq = new javax.swing.JComboBox();
imageScale1 = new javax.swing.JRadioButton();
imageScale2 = new javax.swing.JRadioButton();
imageScale3 = new javax.swing.JRadioButton();
black8bit = new javax.swing.JRadioButton();
colorRGB24 = new javax.swing.JRadioButton();
jLabel6 = new javax.swing.JLabel();
getContentPane().setLayout(null);
setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
setTitle("\u5b9e\u65f6\u56fe\u50cf\u4f20\u8f93\u4e3b\u754c\u9762");
setResizable(false);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
mainFrameWindowClosing(evt);
}
});
testButton.setText("\u6d4b\u8bd5\u91c7\u96c6");
testButton.setEnabled(false);
testButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
TestActionPerformed(evt);
}
});
getContentPane().add(testButton);
testButton.setBounds(450, 340, 90, 20);
startSend.setText("\u542f\u52a8\u53d1\u9001");
startSend.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
startSendActionPerformed(evt);
}
});
getContentPane().add(startSend);
startSend.setBounds(150, 390, 90, 20);
endSend.setText("\u505c\u6b62\u53d1\u9001");
endSend.setEnabled(false);
endSend.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
endSendActionPerformed(evt);
}
});
getContentPane().add(endSend);
endSend.setBounds(450, 390, 100, 25);
jLabel1.setBorder(new javax.swing.border.EtchedBorder());
getContentPane().add(jLabel1);
jLabel1.setBounds(20, 330, 600, 100);
receiverAdrress.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
receiverAdrress.setText("\u8fdc\u7a0b\u63a5\u6536\u5730\u5740\uff1a");
getContentPane().add(receiverAdrress);
receiverAdrress.setBounds(30, 280, 100, 20);
addrField1.setHorizontalAlignment(javax.swing.JTextField.CENTER);
addrField1.setText("125");
addrField1.setInputVerifier(addrField1.getInputVerifier());
getContentPane().add(addrField1);
addrField1.setBounds(140, 280, 50, 20);
addrField2.setHorizontalAlignment(javax.swing.JTextField.CENTER);
addrField2.setText("125");
addrField2.setInputVerifier(addrField2.getInputVerifier());
getContentPane().add(addrField2);
addrField2.setBounds(210, 280, 60, 21);
addrField3.setText("125");
addrField3.setInputVerifier(addrField3.getInputVerifier());
getContentPane().add(addrField3);
addrField3.setBounds(280, 280, 60, 21);
addrField4.setText("65");
addrField4.setInputVerifier(addrField4.getInputVerifier());
getContentPane().add(addrField4);
addrField4.setBounds(360, 280, 60, 21);
port1Label.setText("\u7aef\u53e3\u53f7:");
getContentPane().add(port1Label);
port1Label.setBounds(440, 280, 50, 20);
port1Int.setText("10");
port1Int.setInputVerifier(port1Int.getInputVerifier());
getContentPane().add(port1Int);
port1Int.setBounds(500, 280, 70, 21);
jLabel2.setBorder(new javax.swing.border.EtchedBorder());
getContentPane().add(jLabel2);
jLabel2.setBounds(20, 270, 600, 40);
startCaptureCard.setText("\u542f\u52a8\u91c7\u96c6\u5361");
startCaptureCard.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
startCaptureCardActionPerformed(evt);
}
});
getContentPane().add(startCaptureCard);
startCaptureCard.setBounds(150, 340, 100, 25);
jLabel3.setText("\u56fe\u50cf\u5927\u5c0f:");
getContentPane().add(jLabel3);
jLabel3.setBounds(30, 30, 60, 15);
jLabel4.setText("\u56fe\u50cf\u989c\u8272:");
getContentPane().add(jLabel4);
jLabel4.setBounds(30, 110, 70, 15);
jLabel5.setText("\u91c7\u6837\u5e40\u9891:");
getContentPane().add(jLabel5);
jLabel5.setBounds(30, 180, 70, 15);
frameFreq.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "10", "15", "20", "25" }));
getContentPane().add(frameFreq);
frameFreq.setBounds(30, 200, 90, 23);
buttonGroup1.add(imageScale1);
imageScale1.setSelected(true);
imageScale1.setActionCommand("352X288");
imageScale1.setLabel("352 X 288");
getContentPane().add(imageScale1);
imageScale1.setBounds(30, 47, 100, 23);
buttonGroup1.add(imageScale2);
imageScale2.setActionCommand("176X144");
imageScale2.setEnabled(false);
imageScale2.setLabel("176 X 144");
buttonGroup1.add(imageScale2);
getContentPane().add(imageScale2);
imageScale2.setBounds(30, 70, 100, 20);
buttonGroup1.add(imageScale3);
imageScale3.setActionCommand("128X96");
imageScale3.setEnabled(false);
imageScale3.setLabel("128 X 96");
buttonGroup1.add(imageScale3);
getContentPane().add(imageScale