资源描述
1,BuildingtheCarryDropSimulationinJBuilderX,ByDeddyKoesrindartoto08/16/2004,2,Introduction,Thistutorialwillexplain,stepbystep,howtocreateanewprojectusingexistingRePast/JavacodeforaRePastTutorialbyJohnMurphy.TobeconsistentwithMurphysTutorial,theprojectnamewillbeDemo.jpx,anditwillcontainthreeJavaclass:CarryDropModel.java;CarryDropSpace.java;CarryDropAgent.java.Tofollowthistutorialyouwillneed:JBuilderXinstalledandrunningRePastlibraryinstalledAccesstothesourcecodeofJohnMurphysRePastTutorialat:http:/www.u.arizona.edu/jtmurphy/H2R/HowTo01.htm,3,CreatingaDemoProject,StartJBuilderXGotoFile-NewProjectIntheProjectWizarddialogbox(Fig2.A)fillintheprojectname.UseDemoasprojectname.InJBuilder,thisprojectnamewillalsobeusedasthepackagename.Leavethedefaultsettingsfortherestofthefields.,Fig1,4,CreatingaprojectDemocontinued:,Fig2.A,Fig2.B,InFig2.AclicktheNextbutton(1)toconfigurethelibrary/librariesthatwillbeusedinDemoproject.Dialogbox(Fig2.B)willappear.PresstheRequiredLibraries(2),andpressAddbuttontoproceed(3).Leavethedefaultsettingsfortherestofthefields.,(1),(2),(3),5,Settinguprequiredlibraries:,Fig3.A,Fig3.B,NavigatethroughthelistoflibrariesshowninFig3.A.SelectRePast-2.2library(1)andpresstheOKbutton(2).Thenewdialogbox(Fig.3.B)willacknowledgethattheRePast-2.2libraryhasbeenadded(3)totheDemoproject.Leavethedefaultsettingsfortherestofthefields,andclicktheFinishbutton(4).,(1),(2),(3),(4),6,SettinguprequiredlibrariesContinued:,Fig4,Atthispoint,theprocessofcreatingtheDemoprojectisfinished.Demo.jpxisnowlistedattheJBuilderprojectpane(1).However,theprojectisstillempty.Therearenoclassesassociatedwiththisproject.Thenextstepswillexplainhowtoaddclassestothisproject.,(1),7,AddingaJavaclasstotheDemoproject:,ThenextstepswillshowhowtoaddCarryDropModel.javaclassestotheDemoproject.GotoFile-NewClassAClassWizarddialogboxshouldappear.,Fig5,8,AddingaJavaclasstotheDemoproject.continued:,Fig6.A,AsshowninFig6.A,typeCarryDropModel(1)astheClassname,andleaveallothersettingsatdefaultvalues.Notethat,ifnothingischeckedintheOptionschoices(2),itwillgenerateanemptyclasswhichcontainsonlytheclassnameandtherespectivepackageusedinthisclass.Hitthe“OK”button(3)Fig6.BshowshowtheCarryDropModelclassnowappearsinthestructurepane(4).Meanwhile,theCarryDropModelsourcecodeappearsincontentpane(5).,9,CopyingMurphyssourcecodeforCarryDropModel.javafromhiswebsite:,Openyourbrowser,andgoto:http:/www.u.arizona.edu/jtmurphy/H2R/HowTo03.htm.SelectandcopythewholesourcecodefortheCarryDropModeltotheclipboard.,10,CopyingMurphyssourcecodeforCarryDropModel.javacontinued:,GotoJBuildercontentpaneofCarryDropModel.java.PressEdit-SelectAll(1)andthenEdit-Paste(2).ItwillautomaticallypastethecodeyoucopiedearlierfromthewebsiteforCarryDropModel.javaintothecontentpane.,11,AddingotherclassestotheDemoprojectcontinued:,RepeatthesameprocessforaddingcodefortheCarryDropSpaceandCarryDropAgentJavaclassesfromMurphyswebsite.Whenallthreeclassesareadded,theywillbelistedbynameinprojectpane(1)andtheircodewillbeshownincontentpane(2).FollowtheMurphyTutorialandmodifythesethree.javaclassesasneeded.,(1),(2),
展开阅读全文