BX121028俞佳星软件开发环境与工具实验3.docx
- 文档编号:30739471
- 上传时间:2023-08-20
- 格式:DOCX
- 页数:13
- 大小:617.30KB
BX121028俞佳星软件开发环境与工具实验3.docx
《BX121028俞佳星软件开发环境与工具实验3.docx》由会员分享,可在线阅读,更多相关《BX121028俞佳星软件开发环境与工具实验3.docx(13页珍藏版)》请在冰豆网上搜索。
BX121028俞佳星软件开发环境与工具实验3
电子信息学院
实验报告书
课程名软件开发环境与工具
题目:
美化界面
实验类别【设计型】
班级:
BX1210
学号:
121003531028
姓名:
俞佳星
1.实验目的与要求
通过编写一个裁判系统来熟悉软件开发环境与开发工具。
2.实验内容或题目
(1)用java或c++来编写一个裁判程序;
(2)要有界面的实现。
(3)对界面进行美化。
所有文件
主界面
选中查找运动员选项。
查找运动员
比赛查找
先选中比赛,然后可以对尚未开始的比赛进行修改
对尚未开始的比赛修改信息
对选中比赛选择开始比赛
比赛开始
比赛结束,显示比赛结果
关于我们
主要控制部分代码:
publicclasscontrol{
staticMainLayoutmfx;
staticmodifyPlayermodifyPlayerDialog;//编辑运动员对话框
staticmodifyGamemodifyGameDialog;//编辑比赛对话框
staticSearchMatchLayoutsearchGameDialog;//搜索比赛对话框
staticSearchMatchListenersearchGameControl;//搜索比赛监听器类
staticSearchPlayerLayoutsearchPlayerDialog;//搜索运动员对话框
staticSearchPlayerListenersearchPlayerControl;//搜索运动员监听器类
staticexcutegameExcute;//执行比赛对话框
staticaboutUSabout;
staticplayersGamePlayer=newplayers();//运动员
staticgamesGames=newgames();//未完成比赛
staticgamescomGames=newgames();//已完成比赛
publicstaticvoidmain(Stringargs[]){
//mfx=newmainframe();
/////////////////////启动主界面///////////////////
mfx=newMainLayout("跳水比赛计分系统");
mfx.init();
newMainActionListener(mfx);
mfx.setLocationRelativeTo(null);
modifyPlayerDialog=newmodifyPlayer(mfx,GamePlayer);//编辑运动员界面
modifyGameDialog=newmodifyGame(mfx,GamePlayer,Games);//编辑比赛界面
/////////////搜索比赛对话框/////////////
searchGameDialog=newSearchMatchLayout(mfx,"比赛查找",GamePlayer,Games);
searchGameDialog.init();
searchGameControl=newSearchMatchListener(searchGameDialog);
///////////////////搜索运动员对话框/////////////////////////////
searchPlayerDialog=newSearchPlayerLayout(mfx,"运动员查找",GamePlayer,Games);
searchPlayerDialog.init();
searchPlayerControl=newSearchPlayerListener(searchPlayerDialog);
//////////////////////执行比赛对话框//////////////////////////////
gameExcute=newexcute(mfx,GamePlayer,Games,comGames);
about=newaboutUS(mfx);
}
///////////////////////////显示编辑运动员对话框////////////////////
staticvoidshowModifyPlayerDialog(){
modifyPlayerDialog.setVisible(true);
}
///////////////////////////显示添加比赛对话框////////////////////////
staticvoidshowAddGameDialog(){
modifyGameDialog.addGameInit();
modifyGameDialog.setVisible(true);
}
////////////////////////显示修改比赛对话框//////////////////////////
staticvoidshowModifyGameDialog(intindex){
modifyGameDialog.modifyGameInit(index);
modifyGameDialog.setVisible(true);
}
//////////////////////////取消比赛/////////////////////////////
staticvoidcancelGame(intindex){
Games.cancelGame(index);
modifyGameDialog.Games=Games;
mfx.unCompletedListShow(Games);//////////////////////////////////
}
/////////////////////////显示搜索运动员界面/////////////////////////////
staticvoidshowSearchPlayerDialog(){
searchPlayerDialog.selectListShow(GamePlayer);
searchPlayerControl.beforeShow();
searchPlayerDialog.setLocationRelativeTo(null);
searchPlayerDialog.setVisible(true);
}
/////////////////////////显示搜索运比赛界面///////////////////////////
staticvoidshowSearchGameDialog(){
searchGameDialog.selectListShow(Games);//test
searchGameControl.beforeShow();
searchGameDialog.setLocationRelativeTo(null);
searchGameDialog.setVisible(true);
}
///////////////////////显示执行比赛对话框////////////////////////////
staticvoidshowExcuteDialog(intindex){
gameExcute.beforeShow(index);
gameExcute.setVisible(true);
gameExcute.inputText[0].requestFocus();
}
//////////////////////////显示关于我们对话框///////////////////////
staticvoidshowAboutDialog(){
about.setVisible(true);
}
////////////////////////数据保存////////////////////////////
staticvoidsave(){
FileDialogfouDialog=newFileDialog(mfx,"保存",FileDialog.SAVE);
fouDialog.show();
StringfilePath=fouDialog.getDirectory()+fouDialog.getFile();
//System.out.println(filePath);
try{
FileOutputStreamfout=newFileOutputStream(newFile(filePath));
ObjectOutputStreamoOut=newObjectOutputStream(fout);
oOut.writeObject(GamePlayer);
oOut.writeObject(Games);
oOut.writeObject(comGames);
oOut.close();
fout.close();
}catch(IOExceptione){
e.printStackTrace();
}
}
/////////////////////////读取数据//////////////////////////////
staticvoidread(){
FileDialogfouDialog=newFileDialog(mfx,"读取",FileDialog.LOAD);
fouDialog.show();
StringfilePath=fouDialog.getDirectory()+fouDialog.getFile();
try{
FileInputStreamfin=newFileInputStream(newFile(filePath));
ObjectInputStreamoIn=newObjectInputStream(fin);
GamePlayer=(players)oIn.readObject();
modifyPlayerDialog.GamePlayer=GamePlayer;
modifyPlayerDialog.playerListShow();
modifyGameDialog.GamePlayer=GamePlayer;
Games=(games)oIn.readObject();
modifyGameDialog.Games=Games;
mfx.unCompletedListShow(Games);/////////////////////////////////////
comGames=(games)oIn.readObject();
pletedListShow(comGames,GamePlayer);
/////////////////比赛查询界面获得运动和比赛////////////////////
searchGameDialog.Games=Games;
searchGameDialog.GamePlayer=GamePlayer;
searchGameControl.beforeShow();
//////////////////运动员查询界面获得运动员和比赛////////////////////
searchPlayerDialog.Games=Games;
searchPlayerDialog.GamePlayer=GamePlayer;
searchPlayerControl.beforeShow();
/////////////////////比赛执行界面获取所有数据////////////////////////
gameExcute.Games=Games;
gameExcute.GamePlayer=GamePlayer;
gameEGames=comGames;
oIn.close();
fin.close();
}catch(IOException|ClassNotFoundExceptione){
e.printStackTrace();
}
}
}
3.结果分析与实验体会
在本次实验中,我们小组对上次的裁判程序做了大规模的修改和优化。
重新设计了7个界面,来提高人机互动的效率。
并且极大的扩展了上次的程序的功能,和使用范围。
当然,在本次实验中也不是一帆风顺的。
出现了各种各样的问题和错误,由不同的组员写的界面在整合到一起的时候,总是会有不少问题,每个人都有自己不同的命名方式,参数的位置、类型,提供的函数、方法,功能各不相同。
不仅使得最终的编码效率低下,而且容易发生大量的错误。
每个组员的各自的模块在整合到一起发生错误、异常时,除错是个极其困难的事情,每个人的代码量都非常大,而每个人都坚信自己的模块是不会出错的。
要排除错误需要熟悉每个模块的代码,这样的出错效率非常低下,需要花费大量的时间。
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- BX121028 俞佳星 软件 开发 环境 工具 实验