Violet - Home.insightbb

Transcription

Violet v0.21.1Violet is an executable Java jar file that lets you do basic UML diagrams.It can be found at: http://horstmann.com/violet/Example of Violet and a Case diagram in progress.Start UpWhen you start up Violet, if you didn’t have a UML diagram open, you will see a menu that will let youchoose what type of diagram to open as well as a list of recently edited files. If you exit Violet with oneor more diagrams open, they will be loaded upon startup on the application. Once you select new, adiagram, or open an existing file, you’ll see the above menu.Example of initial startup of VioletPage 1

The Menu OptionsFile – Lets you create new diagrams, close, save, print, open (you can even do open a file from a remotelocation), or export to the clipboard or a PNG image file (which can be opened by Microsoft paint).Edit – Lets you undo, redo, delete objects, cut, copy, paste, select the next/previous object.View – Lets you zoom in and out and change the size of the drawing areaHelp – Links to an online user guide and home pageStandards ButtonsFrom left to right and top to bottom: Undo, zoom in, zoom out, delete, redo, cut, copy, pasteDiagram ToolsThese vary depending upon the diagram you use.Use CaseClassObjectStateActivitySequencePage 2

Extended functionsBasically these are print and copy to the clipboard (so you can paste the UML diagram into a wordprocessor program).Jump StartMost likely you’ll be creating class diagrams, so let’s start there.Select File New Class DiagramNote: If you want to close a UML diagram without saving, you will need toselect the tab of the diagram you want to close and then select File CloseCreating a ClassSelect Class from the Diagram Tools MenuClick anywhere on the grid.Double click the new class box that was createdCreating a new classHere you can enter in the name, attributes, and methods.Note: There are UML standards for indicating abstract classes and staticdata members. You cannot use italics (for abstract classes) and underscores(for static data members). So you will have to add the words “abstract” or“static” to indicate these.Page 3

Example of a finished classNote: when you click OK to save the changes, there will always be three sections to eachclass, regardless of whether or not you put any elements in that section.Creating a relationshipIf you want to do inheritance, implements, or other relationships of classes, you will need twoclasses.To set up the relationship, select the appropriate diagram tool (we used inheritance in our example)and select one class in the grid area and hold down the left mouse button and drag to the secondclass. You will see a purple line as you do this. When you let go of the left mouse button, you willsee the inheritance (or whatever relationship you chose).Creating a relationship (inheritance)If you want to move a class, click on select from the diagram tools, hold down the left mouse buttonwhile selecting the class and move it where you want.Page 4

Removing a RelationshipTo remove an relationship, click “Select” from the diagram tools and click the relationship path thatyou want to remove. You’ll see small violet boxes at the start and the end of the relationship path.Then hit delete.Example of the selected relationship that we want to remove.Additional Resource InformationFor information on UML, I found this website to be very useful:http://dn.codegear.com/article/31863About the Author:Ken Cooney is a professional programmer, amateur cartoonist, avid boardgamer, music fanatic,zealous book reader, and a Yankee from New England. I’m current living in NorthernKentucky, trying to adjust, and working towards my MSCS.You can visit my website at http://www.kencooney.com for other fun and useless facts about meand my interests.Page 5

Violet v0.21.1 Violet is an executable Java jar file that lets you do basic UML diagrams. It can be found at: http://horstmann.com/violet/ Example of Violet and a Case diagram in progress. Start Up When you start up Violet, if you didn’t have a UML diagram open, you will see a menu that will let you