哈尔滨工业大学(威海)实验报告用纸第1页ReportofSoftwareArchitectureHomework4.3-1:CommandPatternBasicinformationTeamname:_______________________________Classnumber:___________________________Department/school:Teammemberswithstudentnumbers:_______________________Instructor’scommentsandscorecomments:score:signatureoftheinstructor:Yearmonthdate(威海)哈尔滨工业大学(威海)实验报告用纸第页Homeworkdescriptions:Seethediagrambelowforexample11.2designedbyusingtheCommandpattern.Runthesourcecodebeforeyoudoanything.Homeworkrequirement:ifyourteamleaderasksyoutocanceltheInvokerclassfromtheclassdiagramintheabovedesignandmergesitintotheClientUIclassandyouarenotallowedtochangeanyoftheotherclasses.Allthefunctionalitiesshouldbethesameastheoriginalsoftware.Youpleaseredesigntheprogramandimplementyournewdesign.Hint:ConsiderputtingtheInvokerclassintoClientUIasaninnerclass.interfaceCommandexecute()Invoker+callCommand()调用者类ClientUIcreatesusesGFan+startRotate()+stopRotate()usescreatesGWindow+open()+close()FanOnCmdexecute()FanOffCmdexecute()WindowOpenCmdexecute()WindowCloseCmdexecute()哈尔滨工业大学(威海)实验报告用纸第1页ReportPart.1.Drawyournewdesignclassdiagram2.Describeyournewdesign:a)Whatclasseshavebeencanceledfromtheexistingclasshierarchy?Invoker.java被取消了b)WhatpartoftheClientUIclasshasbeenchanged?clientUI中增添了内部类Invoker.javainterfaceCommandexecute()Invoker+callCommand()调用者类ClientUIcreatesusesGFan+startRotate()+stopRotate()usescreatesGWindow+open()+close()FanOnCmdexecute()FanOffCmdexecute()WindowOpenCmdexecute()WindowCloseCmdexecute()哈尔滨工业大学(威海)实验报告用纸第页3.Ifauserclickonthebutton“StartFan”,whatmethodsinthisprogramhavebeencalled?Listthemincorrectorder.先调用ClientUI.java中的setUpChoicePanel()方法,然后调用监听器的actionPerformed()方法,然后是Invoker的Invoker()方法,最后是FanOnCmd类的execute()方法。4.Typicalinputandoutputfromrunningyourprogram