软件工程个人电子相册详细设计2.doc_第1页
软件工程个人电子相册详细设计2.doc_第2页
软件工程个人电子相册详细设计2.doc_第3页
软件工程个人电子相册详细设计2.doc_第4页
软件工程个人电子相册详细设计2.doc_第5页
已阅读5页,还剩11页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

一、实验目的1通过对所选题目进行详细设计,掌握算法的设计方法与算法的描述;2掌握常用算法描述工具的使用;3. 完成一个小型软件系统的算法设计。二、实验准备1. 熟悉算法描述工具的使用三、实验要求完成所选题目的详细设计,提交实验报告四、实验内容:1. 背景在完成了针对电子相册管理软件市场的前期调查,同时与多位软件使用者进行了全面深入地探讨和分析的基础上,提出了这份软件需求规格说明书。此需求规格说明书对电子相册管理系统软件做了全面细致的用户需求分析,明确所要开发的软件应具有的功能、性能与界面,使系统分析人员及软件开发人员能清楚地了解用户的需求,并在此基础上进一步提出概要设计说明书和完成后续设计与开发工作。本说明书的预期读者为用户、业务或需求分析人员、测试人员、项目管理人员。2. 程序(模块)系统的组织结构(1) 用户注册进入注册界面录入基本及必填信息提交数据是否注册取消服务,等待用户下步操作YesNo进入登录首界面(2) 用户登入是否登录取消服务,退出界面YesNo管理员进入登录首界面输入用户名及密码进入管理员界面系统查询匹配YesNo(3) 用户管理功能进入个人档案用户界面选择相应操作进入个人相册查看、修改相应数据选择相应操作打开相册上传相片删除相册浏览相片3. 界面设计要求(1)用户注册(2)用户登录(3) 用户个人相册管理4 本软件系统中各程序(模块)的设计说明(1) 用户注册的代码import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.ButtonGroup;import javax.swing.JButton;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JOptionPane;import javax.swing.JRadioButton;import javax.swing.JScrollPane;import javax.swing.JTextArea;import javax.swing.JTextField;public class qwe extends JFrame implements ActionListenerprivate static final String ADD = ADD;private static final String CANCEL = CANCEL;private static final long serialVersionUID = -196950585230726337L;private JLabel name_lab;private JLabel age_lab;private JLabel sex_lab;private JRadioButton man;private JRadioButton woman;private JLabel jLabel0;private JTextArea info_ta;private JScrollPane jScrollPane0;private JTextField name_jf;private JTextField age_jf;private JButton add;private JButton cancel;private ButtonGroup bg=new ButtonGroup();public static void main(String args)new qwe();private void initComponents() setTitle(注册);setLayout(null);add(getName_lab();add(getAge_lab();add(getSex_lab();add(getMan();add(getWoman();add(getJLabel0();add(getJScrollPane0();add(getName_jf();add(getAge_jf();add(getAdd();add(getCancel();setSize(316, 320);setVisible(true);setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);this.setResizable(false);private JButton getCancel()if (cancel = null)cancel = new JButton();cancel.setText(取消);cancel.setActionCommand(CANCEL);cancel.setBounds(177, 203, 81, 28);cancel.addActionListener(this);return cancel;private JButton getAdd()if (add = null)add = new JButton();add.setText(注册);add.setActionCommand(ADD);add.setBounds(69, 203, 81, 28);add.addActionListener(this);return add;private JTextField getAge_jf()if (age_jf = null)age_jf = new JTextField();age_jf.setText();age_jf.setBounds(61, 41, 138, 22);age_jf.setHorizontalAlignment(JTextField.RIGHT);return age_jf;private JTextField getName_jf()if (name_jf = null)name_jf = new JTextField();name_jf.setText();name_jf.setBounds(62, 10, 178, 22);return name_jf;private JScrollPane getJScrollPane0()if (jScrollPane0 = null)jScrollPane0 = new JScrollPane();jScrollPane0.setBounds(63, 103, 210, 80);jScrollPane0.setViewportView(getInfo_ta();return jScrollPane0;private JTextArea getInfo_ta()if (info_ta = null)info_ta = new JTextArea();info_ta.setText();return info_ta;private JLabel getJLabel0()if (jLabel0 = null)jLabel0 = new JLabel();jLabel0.setText(简历);jLabel0.setBounds(17, 99, 41, 18);return jLabel0;private JRadioButton getWoman() if (woman = null) woman = new JRadioButton();bg.add(woman);woman.setSelected(true);woman.setText(女);woman.setBounds(105, 65, 45, 26);return woman;private JRadioButton getMan()if (man = null)man = new JRadioButton();bg.add(man);man.setText(男);man.setBounds(58, 66, 47, 26);return man;private JLabel getSex_lab()if (sex_lab = null)sex_lab = new JLabel();sex_lab.setText(性别);sex_lab.setBounds(16, 70, 41, 18);return sex_lab;private JLabel getAge_lab()if (age_lab = null)age_lab = new JLabel();age_lab.setText(年龄);age_lab.setBounds(14, 42, 41, 18);return age_lab;private JLabel getName_lab()if (name_lab = null)name_lab = new JLabel();name_lab.setText(姓名);name_lab.setBounds(15, 11, 41, 20);return name_lab;public qwe()initComponents();public void actionPerformed(ActionEvent e)String action = e.getActionCommand();System.out.println(action);if (action != null & ADD.equals(action)StringBuffer sb=new StringBuffer();sb.append(姓名: ).append(name_jf.getText().append(n).append(年龄: ).append(age_jf.getText().append(n).append(性别: );if(woman.isSelected()sb.append(女n);elsesb.append(男n);sb.append(简历: ).append(info_ta.getText();JOptionPane.showMessageDialog(this, sb.toString();else if (action != null & action.equals(CANCEL)name_jf.setText();age_jf.setText();woman.setSelected(true);man.setSelected(false);info_ta.setText();(2) 用户登录的代码import javax.swing.*;import java.awt.*;import java.awt.event.*;class MyJPanel extends JPanel implements ActionListenerprivate int count=0;private JLabel label1,label2;private JTextField text;private JPasswordField pass;private JButton button1,button2;MyJPanel()label1=new JLabel(用户名);label2=new JLabel(密码);button1=new JButton(确定);button2=new JButton(取消);text=new JTextField(20);pass=new JPasswordField(20);button1.setMnemonic(KeyEvent.VK_O);/设置按钮快捷键button2.setMnemonic(KeyEvent.VK_C);button1.setActionCommand(entry);button2.setActionCommand(cancel);button1.addActionListener(this);/注册按钮事件button2.addActionListener(this);/注册按钮事件setBackground(Color.cyan);/设定面板背景色add(label1);add(text);add(label2);add(pass);add(button1);add(button2);public void actionPerformed(ActionEvent e)if (e.getActionCommand().equals(entry)count+; /计数String username,password;if (count3) username=text.getText();password=pass.getText();if (username.equals(abcd)&password.equals(123456)text.setText(用户名及密码正确!);pass.setText();elsetext.setText();pass.setText();elseSystem.exit(0);/退出程序else System.exit(0);/退出程序public class dengru extends JFrame public static void main(String args) MyJPanel jp=new MyJPanel();/定义面板jp.setBorder(BorderFactory.createTitledBorder(输入用户名和密码);/设定边界JFrame frame=new JFrame(用户登录);frame.setSize(300,150);frame.setContentPane(jp);/在框架中加载面板frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);/设置框架关闭按钮事件frame.setVisible(true);(3) 用户个人电子相册管理的代码import java.awt.BorderLayout;import java.awt.Color;import java.awt.Image;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.io.File;import java.sql.Time;import javax.swing.ImageIcon;import javax.swing.JButton;import javax.swing.JFileChooser;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JOptionPane;import javax.swing.JPanel;import javax.swing.Timer;public class task extends JFrame implements ActionListenerJPanel p_photo=new JPanel();JLabel l_photo=new JLabel();JPanel p_button=new JPanel();JButton jb_open=new JButton(打开);JButton jb_prev=new JButton(上一个);JButton jb_next=new JButton(下一个);JButton jb_auto=new JButton(自动);JButton jb_fangda=new JButton(放大);JButton jb_suoxiao=new JButton(缩小);JButton jb_close=new JButton(关闭);int c=500,d=380;JFileChooser fc=new JFileChooser();File files;ImageIcon ii;Timer t;public task() super(电子相册); l_photo.setOpaque(true); BorderLayout bb=new BorderLayout(); p_photo.setLayout(bb); p_photo.add(l_photo,BorderLayout.CENTER); this.add(p_photo,BorderLayout.CENTER); p_button.add(jb_open); jb_open.addActionListener(this); p_button.add(jb_prev); jb_prev.addActionListener(this); p_button.add(jb_next); jb_next.addActionListener(this); p_button.add(jb_auto); jb_close.addActionListener(this); p_button.add(jb_fangda); jb_fangda.addActionListener(this); p_button.add(jb_suoxiao); jb_suoxiao.addActionListener(this); jb_auto.addActionListener(this); p_button.add(jb_close); this.add(p_button,BorderLayout.SOUTH); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setSize(500,420); this.setLocationRelativeTo(null); this.setVisible(true);public static void main(String args) new task();int index;int flag;public void actionPerformed(ActionEvent e) String str=e.getActionCommand(); System.out.println(str); if(str.equals(打开) open(); if(str.equals(上一个) c=500;d=380; prev(); if(str.equals(下一个) c=500;d=380; next(); if(str.equals(自动) auto(); if(str.equals(放大) c+=10; d+=10; cd(); if(str.equals(缩小) c-=10; d-=10; cd(); if(str.equals(关闭) System.exit(0); public boolean open() fc.setMultiSelectionEnabled(true); fc.showOpenDialog(null); files=fc.get

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论