多媒体技术课程设计报告doc.docx
- 文档编号:12578088
- 上传时间:2023-04-20
- 格式:DOCX
- 页数:25
- 大小:305KB
多媒体技术课程设计报告doc.docx
《多媒体技术课程设计报告doc.docx》由会员分享,可在线阅读,更多相关《多媒体技术课程设计报告doc.docx(25页珍藏版)》请在冰豆网上搜索。
多媒体技术课程设计报告doc
二○○九~二○一○学年第二学期
应用技术学院
课程设计报告书
课程名称:
多媒体技术
班级:
09级网络工程
学号:
姓名:
指导教师:
二○一○年六月
1.需求分析
1.1课程设计题目
信源与信道编/解码练习。
1.2课程设计要求
1)要求利用程序设计软件(如VC、Java、Matlab)制作一个能完成信道编/解码(海明/CRC码),信源编/解码(如行程编码)软件。
2)基本要求为编制软件至少能根据所输入的数据完成信源、信道编解码,其中信道编码要求能产生1-2位随机错误,且能纠1位错,最后是能读取txt文件,或者直接读取图片来完成,如能对视频完成则更佳。
3)编写的软件编译后能直接运行,验证编/解码效果,否则无效。
1.3系统功能需求分析
Ø操作环境(软件、硬件及条件)
Windws9x/NT/2000/XP/2003
NetBeansIDE6.8
Ø系统功能
此软件是在JAVA平台下编写的,能根据所输入的数据完成信道(海明码)、信源编解码(行程编码),其中信道编码(海明码)能产生1位随机错误,且能纠1位错,最后是能直接读取图片或txt文件来完成。
Ø用户操作流程
编码:
解码:
2.概要设计
系统总体框架:
3.详细设计
本次课程设计中我主要负责界面设计和行程编码,故作以下详细介绍。
3.1界面设计
界面设计如图3-1所示:
图3-1
界面设计代码如下:
packageDMTcode;
importjava.io.File;
importjavax.swing.JFileChooser;
importjavax.swing.JOptionPane;
publicclassNewJFrameextendsjavax.swing.JFrame{
intrndChooser;
bytetargetBit;
privateinti;
Filef1,f2;
byte[]mybyte1,mybyte2;
publicNewJFrame(){
initComponents();
this.setTitle("重庆大学09网络工程尹力沈小波多媒体课程设计");
}
@SuppressWarnings("unchecked");
privatevoidinitComponents(){
jPanel1=newjavax.swing.JPanel();
jButton1=newjavax.swing.JButton();
jLabel1=newjavax.swing.JLabel();
jTextField1=newjavax.swing.JTextField();
jLabel2=newjavax.swing.JLabel();
jTextField2=newjavax.swing.JTextField();
jButton2=newjavax.swing.JButton();
jButton4=newjavax.swing.JButton();
jButton5=newjavax.swing.JButton();
jPanel2=newjavax.swing.JPanel();
jLabel3=newjavax.swing.JLabel();
jLabel4=newjavax.swing.JLabel();
jPanel3=newjavax.swing.JPanel();
jLabel5=newjavax.swing.JLabel();
jLabel6=newjavax.swing.JLabel();
jLabel7=newjavax.swing.JLabel();
jLabel8=newjavax.swing.JLabel();
jButton3=newjavax.swing.JButton();
jLabel9=newjavax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("行程编码文件"));
jButton1.setText("打开");
jButton1.addActionListener(newjava.awt.event.ActionListener(){
publicvoidactionPerformed(java.awt.event.ActionEventevt){
jButton1ActionPerformed(evt);
}
});
jLabel1.setText("源文件:
");
jTextField1.setEnabled(false);
jLabel2.setText("目标文件:
");
jTextField2.setEnabled(false);
jButton2.setText("保存");
jButton2.addActionListener(newjava.awt.event.ActionListener(){
publicvoidactionPerformed(java.awt.event.ActionEventevt){
jButton2ActionPerformed(evt);
}
});
jButton4.setText("开始编码");
jButton4.addActionListener(newjava.awt.event.ActionListener(){
publicvoidactionPerformed(java.awt.event.ActionEventevt){
jButton4ActionPerformed(evt);
}
});
jButton5.setText("开始解码");
jButton5.addActionListener(newjava.awt.event.ActionListener(){
publicvoidactionPerformed(java.awt.event.ActionEventevt){
jButton5ActionPerformed(evt);
}
});
javax.swing.GroupLayoutjPanel1Layout=newjavax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);jPanel1Layout.setHorizontalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(38,38,38)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,false)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,jPanel1Layout.createSequentialGroup()
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextField2))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextField1,javax.swing.GroupLayout.PREFERRED_SIZE,174,javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,103,Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jButton2)
.addComponent(jButton1))
.addGap(50,50,50)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton5)
.addComponent(jButton4))
.addContainerGap(98,Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(17,17,17)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jTextField1,javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(7,7,7)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(jTextField2,javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton1)
.addComponent(jButton4))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton5)
.addComponent(jButton2))))
.addContainerGap(11,Short.MAX_VALUE))
);
getContentPane().add(jPanel1,java.awt.BorderLayout.PAGE_START);
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("文件信息"));
jPanel2.setPreferredSize(newjava.awt.Dimension(442,40));
jLabel3.setText("源文件大小:
");
jLabel4.setText("目标文件大小:
");
javax.swing.GroupLayoutjPanel2Layout=newjavax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);jPanel2Layout.setHorizontalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(29,29,29)
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,268,Short.MAX_VALUE)
.addComponent(jLabel4)
.addGap(200,200,200))
);jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(jLabel4))
.addContainerGap(17,Short.MAX_VALUE))
);
getContentPane().add(jPanel2,java.awt.BorderLayout.CENTER);
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("海明编码信息"));
jLabel6.setText("字节二进制编码:
");
jLabel7.setText("字节海明编码:
");
jLabel8.setText("随机出错:
");
jButton3.setText("校验");
jButton3.addActionListener(newjava.awt.event.ActionListener(){
publicvoidactionPerformed(java.awt.event.ActionEventevt){
jButton3ActionPerformed(evt);
}
});
jLabel9.setText("纠正:
");
javax.swing.GroupLayoutjPanel3Layout=newjavax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(26,26,26)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(jLabel7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,321,Short.MAX_VALUE)
.addComponent(jLabel9)
.addGap(186,186,186))
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(jLabel8)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,278,Short.MAX_VALUE)
.addComponent(jButton3)
.addGap(232,232,232))
.addGroup(jPanel3Layout.createSequentialGroup()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel6)
.addComponent(jLabel5))
.addContainerGap(531,Short.MAX_VALUE))))
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7)
.addComponent(jLabel9))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel8)
.addComponent(jButton3))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,Short.MAX_VALUE))
);
getContentPane().add(jPanel3,java.awt.BorderLayout.SOUTH);
pack();
}//
privatevoidjButton1ActionPerformed(java.awt.event.ActionEventevt){
//TODOaddyourhandlingcodehere:
JFileChooserchooser=newJFileChooser();
chooser.showOpenDialog(jLabel1);
jTextField1.setText(chooser.getSelectedFile().getPath().toString());
jLabel3.setText("源文件大小:
"+chooser.getSelectedFile().length()+"字节");
f1=chooser.getSelectedFile();
}
privatevoidjButton2ActionPerformed(java.awt.event.ActionEventevt){
//TODOaddyourhandlingcodehere:
JFileChooserchooser1=newJFileChooser();
chooser1.showSaveDialog(jLabel1);
f2=chooser1.getSelectedFile();
jTextField2.setText(chooser1.getSelectedFile().getPath().toString());
jLabel4.setText("目标文件大小:
"+chooser1.getSelectedFile().length()+"字节");
}
privatevoidjButton3ActionPerformed(java.awt.event.ActionEventevt){
jLabel8.setText("随机出错:
"+myOp.revertAndCheckhammingCode()[0]);
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 多媒体技术 课程设计 报告 doc
![提示](https://static.bdocx.com/images/bang_tan.gif)