Sun公司rtp的Java程序

  • O9_366885
    了解作者
  • 12.6KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-13 09:50
    上传日期
Sun公司rtp的Java程序
rtp from sun.rar
  • rtp from sun
  • Config.java
    4.1KB
  • Tx.java
    17.2KB
  • Target.java
    1.8KB
  • AVTransmitter.java
    14.8KB
  • RTCPViewer.java
    6.6KB
内容介绍
/* * @(#)Tx.java 1.1 01/03/12 * * Copyright (c) 2001 Sun Microsystems, Inc. All Rights Reserved. * * Sun grants you ("Licensee") a non-exclusive, royalty free, license to use, * modify and redistribute this software in source and binary code form, * provided that i) this copyright notice and license appear on all copies of * the software; and ii) Licensee does not utilize the software in a manner * which is disparaging to Sun. * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY * IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR * NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE * LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS * LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, * INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF * OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * * This software is not designed or intended for use in on-line control of * aircraft, air traffic, aircraft navigation or aircraft communications; or in * the design, construction, operation or maintenance of any nuclear * facility. Licensee represents and warrants that it will not use or * redistribute the Software for such purposes. */ import java.io.*; import java.awt.*; import java.awt.event.*; import java.net.*; import java.util.*; import javax.media.rtp.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.border.*; public class Tx extends JFrame implements ActionListener, KeyListener, MouseListener, WindowListener { Vector targets; JList list; JButton startXmit; JButton rtcp; JButton update; JButton expiration; JButton statistics; JButton addTarget; JButton removeTarget; JTextField tf_remote_address; JTextField tf_remote_data_port; JTextField tf_media_file; JTextField tf_data_port; TargetListModel listModel; AVTransmitter avTransmitter; RTCPViewer rtcpViewer; JCheckBox cb_loop; Config config; public Tx() { setTitle( "JMF/RTP Transmitter"); config= new Config(); GridBagLayout gridBagLayout= new GridBagLayout(); GridBagConstraints gbc; JPanel p= new JPanel(); p.setLayout( gridBagLayout); JPanel localPanel= createLocalPanel(); gbc= new GridBagConstraints(); gbc.gridx= 0; gbc.gridy= 0; gbc.gridwidth= 2; gbc.anchor= GridBagConstraints.CENTER; gbc.fill= GridBagConstraints.BOTH; gbc.insets= new Insets( 10, 5, 0, 0); ((GridBagLayout)p.getLayout()).setConstraints( localPanel, gbc); p.add( localPanel); JPanel targetPanel= createTargetPanel(); gbc= new GridBagConstraints(); gbc.gridx= 1; gbc.gridy= 1; gbc.weightx= 1.0; gbc.weighty= 1.0; gbc.anchor= GridBagConstraints.CENTER; gbc.fill= GridBagConstraints.BOTH; gbc.insets= new Insets( 10, 5, 0, 0); ((GridBagLayout)p.getLayout()).setConstraints( targetPanel, gbc); p.add( targetPanel); JPanel mediaPanel= createMediaPanel(); gbc= new GridBagConstraints(); gbc.gridx= 1; gbc.gridy= 2; gbc.weightx= 1.0; gbc.weighty= 1.0; gbc.anchor= GridBagConstraints.CENTER; gbc.fill= GridBagConstraints.BOTH; gbc.insets= new Insets( 10, 5, 0, 0); ((GridBagLayout)p.getLayout()).setConstraints( mediaPanel, gbc); p.add( mediaPanel); JPanel buttonPanel= new JPanel(); rtcp= new JButton( "RTCP Monitor"); update= new JButton( "Transmission Status"); update.setEnabled( false); rtcp.addActionListener( this); update.addActionListener( this); buttonPanel.add( rtcp); buttonPanel.add( update); gbc= new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 3; gbc.gridwidth= 2; gbc.weightx = 1.0; gbc.weighty = 0.0; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets( 5,5,10,5); ((GridBagLayout)p.getLayout()).setConstraints( buttonPanel, gbc); p.add( buttonPanel); getContentPane().add( p); list.addMouseListener( this); addWindowListener( this); pack(); setVisible( true); } private JPanel createMediaPanel() { JPanel p= new JPanel(); GridBagLayout gridBagLayout= new GridBagLayout(); GridBagConstraints gbc; p.setLayout( gridBagLayout); JLabel label= new JLabel( "Media Locator:"); gbc= new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.weightx = 0.0; gbc.weighty = 0.0; gbc.anchor = GridBagConstraints.EAST; gbc.fill = GridBagConstraints.NONE; gbc.insets = new Insets( 5,5,10,5); ((GridBagLayout)p.getLayout()).setConstraints( label, gbc); p.add( label); tf_media_file= new JTextField( 35); gbc= new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 0; gbc.weightx = 1.0; gbc.weighty = 0.0; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets( 5,5,10,5); ((GridBagLayout)p.getLayout()).setConstraints( tf_media_file, gbc); p.add( tf_media_file); tf_media_file.setText( config.media_locator); cb_loop= new JCheckBox( "loop"); startXmit= new JButton( "Start Transmission"); startXmit.setEnabled( true); startXmit.addActionListener( this); gbc= new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 0; gbc.weightx = 0.0; gbc.weighty = 0.0; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.NONE; gbc.insets = new Insets( 5,5,10,5); ((GridBagLayout)p.getLayout()).setConstraints( cb_loop, gbc); p.add( cb_loop); cb_loop.setSelected( true); cb_loop.addActionListener( this); gbc= new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 1; gbc.weightx = 0.0; gbc.weighty = 0.0; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.NONE; gbc.insets = new Insets( 5,5,10,5); ((GridBagLayout)p.getLayout()).setConstraints( startXmit, gbc); p.add( startXmit); TitledBorder titledBorder= new TitledBorder( new EtchedBorder(), "Source"); p.setBorder( titledBorder); return p; } private JPanel createTargetPanel() { JPanel p= new JPanel(); GridBagLayout gridBagLayout= new GridBagLayout(); GridBagConstraints gbc; p.setLayout( gridBagLayout); targets= new Vector(); for( int i= 0; i < config.targets.size(); i++) { targets.addElement( config.targets.elementAt( i)); } listModel= new TargetListModel( targets); list= new JList( listModel); list.addKeyListener( this); list.setPrototypeCellValue( "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); JScrollPane scrollPane= new JScrollPane( list, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); gbc= new GridBagConstraints(); gbc.gridx= 0; gbc.gridy= 0; gbc.weightx= 1.0; gbc.weighty= 1.0; gbc.anchor= GridBagConstraints.CENTER; gbc.fill= GridBagConstraints.BOTH; gbc.insets= new Insets( 10, 5, 0, 0); ((GridBagLayout)p.getLayout()).setConstraints( scrollPane, gbc); p.add( scrollPane); JPanel p1= new JPanel(); p1.setLayout( gridBagLayout); JLabel label= new JLabel( "IP Address:"); gbc= new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.weightx = 0.0; gbc.weighty = 0.0; gbc.anchor = GridBagConstraints.EAST; gbc.fill = GridBagConstraints.NONE; gbc.insets = new Insets( 5,5,0,5); ((GridBagLayout)p1.getLayout()).setConstraints( label, gbc); p1.add( label); tf_remote_address= new JTextField( 15); gbc= new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 0; gbc.weightx = 0.0; gbc.weighty = 0.0; gbc.anch
评论
    相关推荐
    • Java
      Java 对于Java练习
    • java
      Java Java基础
    • Java
      Java 我创建的Java项目
    • JAVA教程
      一本非常不错的清华大学java教程,讲解非常详细,看了就知道。
    • Java Cipher
      Java Cipher 加密和解密工具 附带源码 Java Cipher 加密和解密工具 附带源码 Java Cipher 加密和解密工具 附带源码 Java Cipher 加密和解密工具 附带源码
    • javabank
      Java银行 Java com的模拟操作将在bancárias上发布! 要求:Java 8。
    • java 李兴华
      java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java 李兴华 java ...
    • Java204
      支持中文,支持动态注释的超强Java语言反编译器。 注意:Java204的工作目录中不能包含中文字符!! 支持现有所有Java环境产生的Class代码,而最重要的是它生成的源代码可读性极好,又充分考虑了国人的Java编码习惯,...
    • java程序
      java程序-吃点点java程序-吃点点java程序-吃点点java程序-吃点点java程序-吃点点java程序-吃点点
    • Java
      Java 2021/02/19 .java Main.java 学生.java Bmi.java 。班级 Bmi类 主类 MyBmi.class 学生班 学生样本类 2021/02/20 .java DeleteFile.java WriteFile.java MyDataPrint.java 。班级 DeleteFile.class ...