收藏 分销(赏)

基于文字水印的谈判系统设计与实现-毕设论文.doc

上传人:胜**** 文档编号:2147643 上传时间:2024-05-20 格式:DOC 页数:33 大小:489KB
下载 相关 举报
基于文字水印的谈判系统设计与实现-毕设论文.doc_第1页
第1页 / 共33页
基于文字水印的谈判系统设计与实现-毕设论文.doc_第2页
第2页 / 共33页
基于文字水印的谈判系统设计与实现-毕设论文.doc_第3页
第3页 / 共33页
基于文字水印的谈判系统设计与实现-毕设论文.doc_第4页
第4页 / 共33页
基于文字水印的谈判系统设计与实现-毕设论文.doc_第5页
第5页 / 共33页
点击查看更多>>
资源描述

1、毕 业 论 文学生姓名学 号学院 计算机科学与技术学院专 业软件工程题 目基于文字水印的谈判系统设计与实现指导教师 (姓 名) (专业技术职称/学位) (姓 名) (专业技术职称/学位)年月淮阴师范学院毕业论文(设计)摘 要:随着社会节奏越来越快,各种信息化网络工具越来越多,例如:腾讯QQ。鉴于网络的流行,社会的生活节奏加快,人们的矛盾日益趋于突显,但限于地域和时间的紧迫,一些谈判和协商及相互沟通更加需要网络软件的支持。因此,网络谈判系统势在必行,本系统基于文字水印的谈判系统设计与实现,主要采用C/S模式开发,采用MVC三层架构:Model View Controller,是模型(model)

2、视图(view)控制器(controller)。1.模型层:数据的存储主要使用的是SQL Server 2005,以数据库的形式存储数据,以便于数据的增删查改和后期维护。2.视图层:采用的是Java Swing技术来开发并以命名以UI结尾。3.控制器:用Java代码来实现,主要用于业务和数据处理的函数实现。采用MVC之后,可以使编程条理更加清晰,各个层之间相互独立并相互合作,有利于系统的健壮性和后期维护扩展。开发语言Java;开发工具为Myeclipse,数据库SQL Server 2005。主要的技术为:接口技术(Interface),多态技术,类的封装和继承以及重写和重载技术,并且使用文字

3、水印来维护版权信息。关键字:网络谈判,文字水印,聊天谈判,Java,C/S,SQL Server 2005Abstract:Along with the social rhythm faster and faster, all kinds of information networking tools more and more, such as tencent QQ. Given the popularity of network, the social life rhythm speeding up, the contradictions of people increasingly te

4、nd to highlight, but limited by geographical and time urgent, some negotiation and consultation, and communicate with each other more need the support of network software. Network negotiation system is imperative, therefore, this system based on system design and implementation of text watermark in

5、the negotiations, mainly USES the C/S Model development, USES the MVC three-tier architecture: the Model View Controller, is the Model (the Model) - View (View) Controller (the Controller). Layer: 1. The model of data storage is mainly used in SQL Server 2005 is, in the form of a database to store d

6、ata, in order to add or delete of data check and later maintenance. 2. The view layer, using a Java Swing technique to develop and to name the end with the UI. 3. Controller: using Java code, mainly for the business and data processing function. After using MVC, programming method can be more clear,

7、 between each layer are independent of each other and mutual cooperation, is advantageous to the system robustness, and later maintenance extension. The Java development language; For Myeclipse development tools, database SQL Server 2005. Main technology is: Interface technology (Interface), polymor

8、phism technology, encapsulation and inheritance of class and override and overloading technology,And use text watermark to maintain the copyright information.Keyword:Chat online negotiations, text watermark, negotiations, Java, C/S, SQL Server 2005目 录摘要Abstract1 前言.41.1系统简介.41.2系统需求分析及目标.51.3业务流程分析.

9、51.4功能需求分析.62 系统概念模型描述.72.1用户信息实体E-R图.72.2部门信息实体E-R图.73 系统设计.73.1系统数据库的物理结构设计和逻辑结构描述.73.2系统数据库转化为关系数据模型.83.3数据库表的结构.83.3.1表dbo_td_userinfo用于保存用户信息.83.3.2表dbo_td_department用于保存部门信息.84 系统运行平台.94.1系统运行环境.94.2系统开发平台.95 系统实现和核心模块的描述.95.1登陆界面及代码实现.95.2 聊天界面及聊天接口代码.155.3数据库操作函数及代码实现.165.4文字水印代码实现.25总结.25参考

10、文献.25致谢.251 前言 在当今信息化爆炸的时代,互联网的作用越来越大,将人们联系成一体,人们可以足不出户的进行信息的交流和共享。计算机的用应普及了各行各业,这就使得人们和计算机的联系愈来愈广泛而密切,网络交流可以是人们足不出户的解决问题,大大削弱了地域和时间的紧迫性,各种交流软件应运而生,网络谈判系统就是专门用来解决人际关系,使人们进行协商,交流,解决问题。本文下面将具体的介绍基于文字水印的谈判系统设计与实现。1.1 系统简介基于文字水印的谈判系统设计与实现,主要用于用户双方在聊天软件上实现互相沟通,协商,洽谈。由注册页面:用于用户的注册功能,使用户添加进入数据库SQL Server 2

11、005,登录页面:用于检验登录账号是否合法,是否账号存在 ,主界面:用于显示好友及在线好友的通讯录,聊天界面:用于通信的双方互相聊天沟通,谈判等。采用MVC三层建构模式,m -model模型层也是实体层,一般与数据库的一个表对应;v-view,视图层,主要用Java Swing 实现;c-control,控制层,一般是把页面提交的信息进行处理,或者是与数据库建立的连接操作都放在这里。这样使各个层之间互不干扰,又相互合作,便于后期维护和扩展。最后采用文字水印的功能实现版权的维护功能,以防止盗用。基于文字水印的谈判系统设计与实现,主要采用的技术:接口技术,类的封装继承以及多态技术,重载和重写等。基

12、于文字水印的谈判系统的设计与实现总体设计图如下:1.2 系统需求分析及目标a. 良好的界面管理及人际交互b. 实现用户的注册,登录,退出c. 实现系统对用户的增删改查d. 方便迅速的信息传递和流通e.实现超级管理员的功能f.接口技术实现后期系统升级与维护1.3 业务流程分析业务流程图能更好的反映业务情况:1.4 功能需求分析2 系统概念模型描述2.1用户信息实体E-R图2.2部门信息实体E-R图 部门号部门信息表 部门名 部门职责3 系统设计3.1 系统数据库的物理结构设计和逻辑结构描述物理结构:数据结构在计算机中的表示(映像)称为数据的物理(存储)结构,系统搭建在win7系统下,采用java

13、语言进行编写,它包括数据元素的表示和关系的表示。逻辑结构:是对数据之间关系的描述,有时就把逻辑结构简称为数据结构。逻辑结构形式地定义为(K,R)(或(D,S),其中,K是数据元素的有限集,R是K上的关系的有限集, 并采用SQL Server 2005来进行数据的管理支配,逻辑设计阶段的主要任务,是把E-R图转化为所选用DBMS产品支持的数据模型。由于该系统采用SQL Server关系型数据库系统,因此,应将概念设计的E-R模型转化为关系数据模型。3.2 系统数据库转化为关系数据模型用户(账号,密码,昵称,性别,年龄,部门号,电话,邮箱,姓名)部门(部门号,部门名,部门职责)3.3 数据库表的结

14、构通过以上得出关系数据模型之后,设计数据库如下:3.3.1表dbo_td_userinfo用于保存用户信息字段名称数据类型字段大小说明userIDint4用户账号nicknamevarchar20昵称passwordvarchar50密码sexvarchar2性别ageint4年龄departIDint4部门号photoint4电话emailvarchar50邮箱地址namevarchar50姓名3.3.2表dbo_td_department用于保存部门信息字段名称数据类型字段大小说明departIDint4部门号departNamevarchar50部门名称departMemovarchar

15、100部门职责具体数据库内容展示:4 系统运行平台4.1 系统运行环境系统运行平台:操作系统winAll/winXP,数据库:安装了SQL Server 20054.2 系统开发平台系统采用MyEclipse开发,而后台数据的存储采用数据可SQL Server 20055 系统实现和核心模块的描述5.1登陆界面及代码实现 登陆界面用户名格式必须正确且必须注册过,登陆界面如图所示:代码实现:/* * (#)client.JQClient.java 2013-2-26 * Copy Right Information: 淮阴师范学院 计算机科学与技术学院(软件工程) * author : 刘 超(

16、计科0903 学号:210910018) * Project: 基于文字水印谈判系统的设计与实现 * JDK version used: jdk1.6.0 * Comments: java类 * Environment :Win7/Win8/Win XP * Version: 1.0.1 * SrDate Modified By : * null * *日本語版* * (#)client.JQClient.java 2013-2-26 * Copy Right Information: 淮陰師範学院科学技術学院(工程) * author : ( 計科0903 番号210910018) * Pr

17、oject: 文字基透交渉設計実現 * JDK version used: jdk1.6.0 * Comments: java類 * Environment :Win7/Win8/Win XP * Version: 1.0.1 * SrDate Modified By : * null */package client.UI;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.util.Vector;import java.util.regex.Pattern;import jav

18、a.awt.*;import java.io.BufferedReader;import java.io.FileReader;import javax.swing.*;import javax.swing.text.AttributeSet;import javax.swing.text.BadLocationException;import javax.swing.text.PlainDocument;import client.interfaces.ILoginDao;/* * 登陆界面类 * author 刘 超 * */public class LoginUI extends JFr

19、ameprivate static final long serialVersionUID = 1L;private JComboBox cbUserId;private JPasswordField passwordField;private JButton loginBtn;private JButton cancelBtn;private double screenWidth;/当前屏幕的宽度private double srceenHeight;/当前屏幕的高度private static final int width=360,height=280;private ILoginDao

20、 loginHandle;private Vector userID; /* * 登陆界面有参构造函数 * param loginDao */public LoginUI(ILoginDao loginDao)super(用户登录界面);this.loginHandle = loginDao;userID = new Vector();userID = readUserIDFromFile();cbUserId = new JComboBox(userID);cbUserId.setEditable(true);JTextField txtField = (JTextField)cbUserI

21、d.getEditor().getEditorComponent();MyDocument document = new MyDocument();document.setAccpetPattern(d+);document.setMaxSize(10);txtField.setDocument(document);cbUserId.setToolTipText(请在这里输入用户号码用户号码只能输入数字,最多输入10位);passwordField = new JPasswordField(10);passwordField.setEchoChar();passwordField.setToo

22、lTipText(请在这里密码密码必须是字符和数字);MyDocument documents = new MyDocument();documents.setAccpetPattern(pAlnum);documents.setMaxSize(8);passwordField.setDocument(documents);loginBtn = new JButton();cancelBtn = new JButton(退出);cancelBtn.setActionCommand(Cancel);cancelBtn.addActionListener(new ActionListener()p

23、ublic void actionPerformed(ActionEvent e) System.exit(1););Action loginMessage = new AbstractAction() /发送消息Actionprivate static final long serialVersionUID = 1L;public void actionPerformed(ActionEvent e)sendLoginMessage(); /更新消息显示框;passwordField.getInputMap().put(KeyStroke.getKeyStroke(ENTER),login)

24、; /键盘事件处理,接受回车事件passwordField.getActionMap().put(login,loginMessage); /回车时的处理(调用发送消息Action)loginBtn.setAction(loginMessage);loginBtn.setText(登录);loginBtn.setActionCommand(Login);/* * 登陆界面的布局设置函数 */public void setLayout()JPanel contentPane = (JPanel)getContentPane();contentPane.setBorder(BorderFactor

25、y.createLineBorder(Color.ORANGE, 2);GridBagLayout gridbag = new GridBagLayout();contentPane.setLayout(gridbag);contentPane.add(new JLabel(new ImageIcon(imagelogin.gif),new GridBagConstraints(0,0,3,1,0.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,20,0),0,0);contentPane.add(n

26、ew JLabel(用户名:),new GridBagConstraints(0,1,1,1,0.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.HORIZONTAL,new Insets(15,50,0,5),0,0);contentPane.add(cbUserId,new GridBagConstraints(1,1,2,1,1.0,0.0,GridBagConstraints.WEST,GridBagConstraints.HORIZONTAL,new Insets(15,5,0,40),0,0);contentPane.add(n

27、ew JLabel(密 码:),new GridBagConstraints(0,2,1,1,0.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.HORIZONTAL,new Insets(10,50,0,5),0,0);contentPane.add(passwordField,new GridBagConstraints(1,2,2,1,0.0,0.0,GridBagConstraints.WEST,GridBagConstraints.HORIZONTAL,new Insets(10,5,0,40),0,0);contentPane.

28、add(loginBtn,new GridBagConstraints(1,3,1,1,0.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(15,4,50,50),0,0);contentPane.add(cancelBtn,new GridBagConstraints(2,3,1,1,0.0,0.0,GridBagConstraints.NORTHWEST,GridBagConstraints.NONE,new Insets(15,35,50,40),0,0);setSize(width, height);

29、Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();screenWidth = dimension.getWidth();srceenHeight = dimension.getHeight();super.setLocation(int)screenWidth/2-width/2, (int)srceenHeight/2-height/2);setVisible(true);setResizable(false);setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);/*

30、* 自定义文档模型 * author 刘 超 * */public class MyDocument extends PlainDocumentprivate static final long serialVersionUID = 1L;Pattern pattern;int maxSize = 10;public void setAccpetPattern(String pattern)this.pattern = Ppile(pattern);public void setMaxSize(int size)maxSize = size;public void insertString(i

31、nt offs,String str,AttributeSet a) throws BadLocationExceptionif(getLength() = maxSize)return;if(getLength() + str.length() maxSize)int i = maxSize - getLength();str = str.substring(0, i);if(pattern.matcher(str).matches()super.insertString(offs, str, a); /* * 发送登陆信息 */private void sendLoginMessage()

32、char pw = passwordField.getPassword();String userId= (String)cbUserId.getSelectedItem();String password = new String(pw);if (!userId.equals()& !password.equals()if(loginHandle != null)loginHandle.login(Integer.valueOf(userId).intValue(), password); else this.setVisible(false);JOptionPane.showMessage

33、Dialog(this, 用户号码和密码不能为空用户号码只能是1-10位数字密码必须是字符和数字,登录消息, JOptionPane.INFORMATION_MESSAGE);this.clearTextContent();this.setVisible(true); /* * 清除文本内容 */public void clearTextContent()cbUserId.setSelectedIndex(-1);passwordField.setText();/* * 从txt文本文档中读取历史登陆的账号信息 * return */public Vector readUserIDFromFi

34、le()try BufferedReader br=new BufferedReader(new FileReader(Info/user.txt);String msg = null;while(msg = br.readLine() != null)String temp = msg.trim();if (!temp.equals()if ( !userID.contains(temp)userID.add(temp); catch (Exception e) e.printStackTrace();return userID;5.2 聊天界面及聊天接口代码/* * (#)client.J

35、QClient.java 2013-2-26 * Copy Right Information: 淮阴师范学院 计算机科学与技术学院(软件工程) * author : 刘 超(计科0903 学号:210910018) * Project: 基于文字水印谈判系统的设计与实现 * JDK version used: jdk1.6.0 * Comments: java类 * Environment :Win7/Win8/Win XP * Version: 1.0.1 * SrDate Modified By : * null */package client.interfaces;import re

36、source.*;/* * 客户端的接口 2013-2-7 * * author 刘 超 * version 1.0.1 * since JDK1.6(建议) */public interface IClient /* * 发送信息包 * param packet */public void sendChatMessage(MessagePacket packet); /* * 清空函数 */public void clear();5.3 数据库操作函数及代码实现/* * (#)client.JQClient.java 2013-2-26 * Copy Right Information: 淮

37、阴师范学院 计算机科学与技术学院(软件工程) * author : 刘 超(计科0903 学号:210910018) * Project: 基于文字水印谈判系统的设计与实现 * JDK version used: jdk1.6.0 * Comments: java类 * Environment :Win7/Win8/Win XP * Version: 1.0.1 * SrDate Modified By : * null */package server;import java.sql.CallableStatement;import java.sql.Connection;import ja

38、va.sql.DriverManager;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.SQLException;import java.sql.Statement;import java.util.Vector;import resource.*;/* * 数据库操作类 * author 刘 超 * */public class BaseDaoApp implements IBaseDao private Connection con = null;public static final

39、 String DRIVER=net.sourceforge.jtds.jdbc.Driver;public static final String URL=jdbc:jtds:sqlserver:/localhost:1433;databasename=chatSystem;public static final String USER_NAME=sa;public static final String USER_PASS=123;private Connection getConnection() tryClass.forName(DRIVER);con=DriverManager.getConnection(URL,USER_NAME,USER_PASS);catch(Exception e)e.printStackTrace();return con; public void closeAll(Connection con,St

展开阅读全文
相似文档                                   自信AI助手自信AI助手
猜你喜欢                                   自信AI导航自信AI导航
搜索标签

当前位置:首页 > 学术论文 > 毕业论文/毕业设计

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2024 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服