Sie sind auf Seite 1von 10

HowtoUseNetbeansUMLTools 1. Iassumethemachinehaveinstalledthissoftware: a. JDK6Update18(alsoworkforotherJDK6or5). b. Netbeans6.5.1. 2. RunNetbeans. 3. Selecttools>pluginsfrommenu 4. Whenpluginsdialogboxappear,selectavailablepluginstab,thentypeumlinsearchtextbox (A) A PARTI.

UMLToolsInstallation

SayedMuchallil CSE5324

5. CheckUMLinthecatalog,andClickinstallbutton. 6. WhenNetbeansIDEpluginsinstallerdialogboxappearpressNextbutton.

SayedMuchallil CSE5324

7. AccepttheLicenseAgreement,andpressInstallButton 8. Waituntilinstallationprocessfinished.WhenNetbeansnotifiesyoutheinstallationprocessfor UMLdone.PressFinishbutton. SayedMuchallil CSE5324

PARTIICodeGeneration 1. TocreateaUMLdiagram,chooseFile>newproject.Whennewprojectdialogappears,clickon UMLontherightsideandJavaPlatformModelontheleftside.ThenpressNextbutton. 2. GiveaprojectName,andthenchoosewhatdiagramyouwanttocreate.InthisexampleIuse WeatherForecastasmyprojectNameandusecasediagramasmyfirstdiagram.

SayedMuchallil CSE5324

3. Intheprojectwindow,youwillseetheprojectName,andyourdiagram.Tocreateother diagrams,rightclickonthediagramsintheprojectwindow,choosenew>diagram. 4. Thistime,wechooseClassDiagram. 5. Drawyourdiagram. SayedMuchallil CSE5324

6. After drawing your diagram, you can generate code from the diagram by choosing generate codeinmenuthatappearsafterrightclickatthemodelprojectname.Buttodoso,youhaveto have at least one active project in the project window. If you do not have, just create a new project from menu, file>new Project. Chose java on the left side and java application on the rightside. 7. GiveprojectNameWeatherForecastApplication SayedMuchallil CSE5324

8. Nowwecangeneratecodefromthemodel. 9. ChooseprojectNamewhereyouwantthecodetobesaved.

SayedMuchallil CSE5324

10. Finally, you can see the WeatherForecastApplication has been added two classes from the class diagram,Now.javaandForecast.javacreatedautomaticallyfromtheclassdiagram.

SayedMuchallil CSE5324

PARTIIIReverseEngineering

1. To create class diagram from the code. Just right click from the project name and choose reverseengineer.

SayedMuchallil CSE5324

2. When Reverse Engineer dialog appears, you should uncheck the test package folder, because you do not save your source code there. And then press OK button because your UML project namewillbegivenautomatically.Youcanchangeitifyouwant. 3. Now you can open the UML project name. There is no diagram yet but you can add new diagram.Andjustdraganddropclassfrommodels.

SayedMuchallil CSE5324

Das könnte Ihnen auch gefallen