zoukankan      html  css  js  c++  java
  • 第三篇 Scrum冲刺博客

    一、站立式会议

    1.1 会议照片

    1.2成员工作情况

    成员 昨天已完成的工作 今天计划完成的工作 工作中遇到的困难
    马文辉 完成水平方向和竖直方向的布局管理器,设置组件内边距和外边距的工具类 完成图片显示组件和图片大小的调整工具类 刚开始未考虑到图片布满页面比例会失调的问题
    卢力衔 简单的实现了一些游戏规则 尝试使用线程监控模拟环境下的拼图块 线程的相关知识不熟悉,翻了资料
    张朝阳 进行简单的主界面的设置,添加按钮,背景图片 完善了主界面的按钮、背景,熟悉git团队上传操作 基本没有
    张龙伟 设计倒计时程序 用swing实现计时程序,设计计时窗口 设计窗口是不难,但是怎么把计时程序融入到窗口里是一个大问题
    周勇铨 构思排名榜模块的整体架构 完成排名榜模块只在闯关模式中运行的功能 其他科目作业占用时间,时间不足以完成

    二、项目燃尽图

    三、代码/文档签入记录

    3.1 代码签入

    3.2 Issue链接

    成员 Issue链接
    马文辉 实现一些工具组件类2
    卢力衔 闯关模式
    张朝阳 主界面
    张龙伟 计时器模块
    周勇铨 排行榜

    3.3 CodeReview代码规范文档

    四、最新程序/模块

    4.1 程序代码

    package cn.homework.util;
    
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.text.DecimalFormat;
    
    
    import javax.swing.JButton;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.SwingConstants;
    
    //计时器类
    public class CountClock {
    
    	public static final boolean LIANXI = true;
    	public static final boolean CHUANGGUAN = true;
    	private boolean StopCountFlag = false;
    	
    	JLabel TimeLabel;			//显示时间的标签
    	int time ;					//接收的输入的时间
    	int min;					//分
    	int sec;					//秒
    	boolean CountModel;			//计时方向		true:练习模式	false:闯关模式
    	
    	
    	//四个按钮 ,可以用开始游戏、重新游戏、暂停游戏、继续游戏替代这四个。对应监听器也给
    	JButton Start;
    	JButton Reset;
    	JButton Stop;
    	JButton KeepOn;
    	
    	JPanel jpanelTime;  //计时框的面板
    	JPanel jpanelButton;  //计时操作按钮的面板
    	
    	
    	public CountClock(int time, JPanel jpanelTime, JPanel jpanelButton, boolean CountModel) {
    		super();
    		this.time = time;
    		this.jpanelTime = jpanelTime;
    		this.jpanelButton = jpanelButton;
    		this.CountModel = CountModel;
    		
    	}
    
    	//线程
    	TimerThread timerThread = new TimerThread();
    	Thread th;
    	
    	public void setStopCountFlag(boolean stopCountFlag) {
    		StopCountFlag = stopCountFlag;
    	}
    
    	public boolean isStopCountFlag() {
    		return StopCountFlag;
    	}
    
    	public Thread getth() {
    		return th;
    	}
    	
    	//初始化窗口,并传入设定好的时间。
    	public void init() {
    		
    		//显示时间
    		TimeLabel = new JLabel("00:00");
    		TimeLabel.setFont(new Font("宋体",1,36));
    		TimeLabel.setPreferredSize(new Dimension(600, 100));
    		TimeLabel.setBackground(Color.white);
    		TimeLabel.setHorizontalAlignment(JLabel.CENTER);
    		TimeLabel.setVerticalAlignment(JLabel.CENTER);
    		
    		TimeLabel.setForeground(Color.blue);
    		jpanelTime.add(TimeLabel);
    		
    		//练习模式
    		if(CountModel == LIANXI)
    		{
        		min = time/60;
            	sec = time%60;
       
    	    	//开启一个新线程并执行
    	    	th = new Thread(timerThread);
    	    	th.start();
    		}
    		
    		//闯关模式
    		else {
    			//设置开始按钮
    			Dimension preferredSize = new Dimension(160, 25); //设置按钮尺寸
    			Start = new JButton("开始");
    			Start.setPreferredSize(preferredSize);//将按钮修改成设置好的尺寸
    			Start.addActionListener(new StartCountListener());//添加监听
    			//jpanelButton.add(Star);//添加按钮到面板*/
    					
    			//设置重置按钮
    			Reset = new JButton("重置");
    			Reset.addActionListener(new ResetCountListener());
    			
    			//设置暂停按钮
    			Stop = new JButton("暂停");
    			Stop.addActionListener(new StopActionListener());
    			
    			//设置继续按钮
    			KeepOn = new JButton("继续");
    			KeepOn.addActionListener(new KeepOnActionListener());
    		}
    
    	
    	}
    	
    	
    	
    	//计时线程执行的程序
    	class TimerThread implements Runnable{
    		public void run() {
    			while(StopCountFlag == false) {
    				//顺序计时模式
    				if(CountModel == true) {
    					if(sec==60) {
    			        	min=min+1;
    			        	sec=sec-60;
    			        }
    					DecimalFormat f1 = new DecimalFormat("00");
    					TimeLabel.setText(f1.format(min)+":"+f1.format(sec));
    					try {
    						Thread.sleep(1000);//线程休眠一秒,秒针+1
    						sec++;
    					}catch(InterruptedException e) {
    						break;
    				    }
    				}
    				//倒计时模式
    				else {
    					if(sec<0&&min>0) {
    						sec=59;
    						min--;
    					}
    					//规定显示的格式
    					//让时间便签显示时间,每秒刷新一次
    					DecimalFormat f1 = new DecimalFormat("00");
    					TimeLabel.setText(f1.format(min)+":"+f1.format(sec));
    					
    					//判断时间是否走完,走完就删除暂停按钮
    					//TODO	闯关模式下需要更改
    					if(sec==0 && min==0) {
    						TimeLabel.setText("00:00");
    						/*jpanelButton.remove(Stop);
    						jpanelButton.remove(KeepOn);
    						jpanelTime.updateUI();
    						Start.setEnabled(true);*/
    						return;
    					}
    					
    					try {
    						Thread.sleep(1000);//线程休眠一秒,秒针-1
    						sec--;
    					}catch(InterruptedException e) {
    						break;
    					}
    				}
    			}
    		}
    	}
    	
    	//TODO 需要将开始计时事件添加到图片选择确认的按钮上
    	//开始计时按钮按钮单击事件
    	 class StartCountListener implements ActionListener {
    	        @Override
    	        public void actionPerformed(ActionEvent e) {
    	        	//将开始按钮设为不可用
    	        	Start.setEnabled(false);
    	        	//删除原面板
    
    	        	jpanelButton.remove(Start);
    	        	
    	        	//添加重置跟暂停
    	        	jpanelButton.add(Reset);
    	        	jpanelButton.add(Stop);
    	        	//把标签放到面板中
    	        	jpanelTime.add(TimeLabel);  
    	        
    	        	//刷新面板  
    	        	jpanelTime.updateUI();
    	        	jpanelButton.updateUI();
    
    //规定的时间
    	        	//接收输入的字符,即时间
    	        		min = time/60;
    	            	sec = time%60;
    	       
    	        	//开启一个新线程并执行
    	        	th = new Thread(timerThread);
    	        	th.start();
    	        }
    	    }
    	 
    	 //TODO 下列三个事件在闯关模式有应用
    	 //重置计时事件
    	 class ResetCountListener implements ActionListener {
    			@Override
    			public void actionPerformed(ActionEvent e) {
    				// 终止线程
    				th.interrupt();
    				timerThread = new TimerThread();
    				// 删除面板中的时间显示、重置按钮、暂停按钮、继续按钮
    				jpanelTime.remove(TimeLabel);
    				jpanelButton.remove(Reset);
    				jpanelButton.remove(Stop);
    				jpanelButton.remove(KeepOn);
    				
    				// 添加开始按钮和初始时间显示
    				jpanelButton.add(Start);
    				jpanelTime.add(TimeLabel);
    				TimeLabel.setText("00:00");
    				Start.setEnabled(true);
    				
    	        	// 刷新面板
    	        	jpanelTime. updateUI();
    	        	jpanelButton.updateUI();
    			}
    	    }
    	 
    	 //暂停计时事件
    	 class StopActionListener implements ActionListener {
    
    			@Override
    			public void actionPerformed(ActionEvent e) {
    				// 终止线程
    				th.interrupt();
    				// 将暂停按钮变成继续按钮
    				jpanelButton.remove(Stop);
    				jpanelButton.add(KeepOn);	
    				jpanelButton.updateUI();
    			}
    	    	
    	    }
    
    	 //继续计时事件
    	 class KeepOnActionListener implements ActionListener {
    	    	
    	    	@Override
    	    	public void actionPerformed(ActionEvent e) {
    	    		// 继续线程
    	    		th = new Thread(timerThread);
    	    		th.start();
    	    		// 讲继续按钮变成暂停按钮
    				jpanelButton.remove(KeepOn);
    				jpanelButton.add(Stop);	
    				jpanelButton.updateUI();
    	    	}
    	    	
    	    }
    	
    	 //TODO	可自己添加或删除各类按钮加不加入按钮面板中
    	 public void addStartButtonToJPanelButton() {
    		 jpanelButton.add(Start);
    	 }
    	 
    	 public void addStopButtonToJPanelButton() {
    		 jpanelButton.add(Stop);
    	 }
    }
    
    

    4.2 运行截图

    五、每人每日总结

    成员 小结
    马文辉 好累..好困..好饿,还是要加快进度
    卢力衔 之前学习的理论应用于实际出现了困难,需要多实践
    张朝阳 完善了主界面的按钮、背景。摸索着git团队项目的上传操作,这点耗费了不少时间。
    张龙伟 java计时程序跟用swing实现计时器,几乎没啥关系,昨天的功夫几乎白费了,今天相当于重头开始
    周勇铨 计划赶不上变化,有变化了也就只能跟着改变了
  • 相关阅读:
    如何改变常用编辑器(eclipse)的字号大小
    IOConsole Updater error
    RNAfold的使用方法
    单因素方差分析(oneway ANOVA)
    Perl内部保留变量(系统变量)
    Perl 中的正则表达式
    Perl Eclipse 格式化代码
    卸载Oracle 9i
    Ubuntu的菜鸟常用的基础命令
    linux as4u2 下安装openssh
  • 原文地址:https://www.cnblogs.com/Mhuihui/p/12976932.html
Copyright © 2011-2022 走看看