[Skip Navigation] [CSUSB] / [CNS] / [Comp Sci & Eng Dept] / [R J Botting] / [CSci202] / lab02
[Text Version] [Syllabus] [Schedule] [Glossary] [Resources] [Grading] [Contact] [Question] [Search ]
Notes: [01] [02] [03] [04] [05] [06] [07] [08] [09] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20]
Labs: [01] [02] [03] [04] [05] [06] [07] [08] [09]
Tue Apr 14 16:26:23 PDT 2009

Contents


    CSci202 Laboratory 02 Diagrams


      (previous): See [ lab01.html ]

      Goals

      By the end of the lab you should know how to draw and print diagrams using the Dia tool.

      Dia is a simple, free, and useful diagramming tool. It runs on UNIX and MSWindows platforms (Mac users had similar program 20 years ago).

      Deliverables Due at end of Lab Period

      Show me some diagrams that includes at least two UML diagrams. These should be based on any of the UML diagrams in the book. There are lots. Pick one and see how well you can duplicate it.

      Hints

      I will start the lab with a demo of how dia works.

      Have the book ready!

      Don't forget to have fun with Dia.

      Ideal Procedure

      1. Start Dia. This may be on the desktop, in a "Start" menu (under Graphics?), or you may have to open a terminal window and type the command
         			dia &
        The "&" means that "dia" starts up in a new window and returns control to your terminal. You can use the terminal and "Dia" windows at the same time.
      2. Wait for a "Dia" control/toolkit window to pop up.
      3. In the toolkit look for the drop down menu of diagram types and select UML.
      4. Stretch the toolkit window to see all the "UML" symbols. This is important.
      5. Use the "File"->"New Diagram" to start a new diagram.
      6. Select a shape in the toolkit, and use the mouse in the drawing window to draw something.
      7. Repeat with different figures in the tool kit.
      8. Select a figure by clicking on it. Right click and a menu pops up. The Edit submenu lets you copy, cut, paste, delete, etc. the selected figure. Try it.
      9. Double click a symbol to see what other options are available. These are fun and useful.

      10. At the bottom of the toolkit is a line and arrow menu. You can specify just about any kind of arrow or line. The left box is the first end as you draw it, and the right hand box selects the other end. The middle selects dots, dashes, solid, etc. Select the symbols in the third line of the top toolkit to get lines, curves, rectilinear lines, etc. Experiment with drawing some arrowhead lines of different types.
      11. When you draw a line, you can drop one end on to a blue connection point and the line will attach itself so that when the symbol moves, so does the end of the arrow. Try this out.
      12. You can draw an arrow from one blue cross to another and connect two symbols.
      13. Before you print from Dia you may have to select a default printer for it to use. Select the System Menu -> Preferences -> Hardware -> ...Printer and pick the printer in your laboratory.
      14. To print a diagram, first Right Click in the drawing and pull down to File->Page Setup In this dialog select "Fit to 1 by 1" in the scaling section. Then "OK".
      15. Print by right Click->File->Print diagram.

      16. In the toolkit: T means Text. Try using it to add words to a diagram.
      17. Double click text to change font.

      18. Double clicking most objects lets you change their colors and other properties... try this out. Creating UML classes and objects always involves double clicking and filling in some tabs.

      19. When in doubt: double click a symbol to change details. This is how you change the name of a class and add attributes and operations. Try it!
      20. You can also attributes and operations by double clicking and selecting optins. Try this. Simplified diagrams with just names make complex software and data bases much clearer.

      21. Also look at some of my diagrams and see if you can duplicate them.

      . . . . . . . . . ( end of section Ideal Procedure) <<Contents | End>>

      Dia options

      1. To save a file: right-click the diagram and select File->Save...
      2. Reopen a saved file by menu File->Open in the Dia Tool window.
      3. Use File->Defaults/Options/Properties? menu to change things you dislike about Dia.
      4. To learn how to put your diagram on the WW, take CSci320 with me!

      . . . . . . . . . ( end of section Dia options) <<Contents | End>>

      Next

      Classes [ lab03.html ]

    . . . . . . . . . ( end of section CSci202 Laboratory 02 Diagrams) <<Contents | End>>

    Abbreviations

  1. Algorithm::=A precise description of a series of steps to attain a goal, [ Algorithm ] (Wikipedia).
  2. class::="A description of a set of similar objects that have similar data plus the functions needed to manipulate the data".
  3. Data_Structure::=A small data base.
  4. Function::programming=A selfcontained and named piece of program that knows how to do something.
  5. Gnu::="Gnu's Not Unix", a long running open source project that supplies a very popular and free C++ compiler.
  6. KDE::="Kommon Desktop Environment".
  7. object::="A little bit of knowledge -- some data and some know how", and instance of a class".
  8. OOP::="Object-Oriented Programming", Current paradigm for programming.
  9. Semantics::=Rules determining the meaning of correct statements in a language.
  10. SP::="Structured Programming", a previous paradigm for programming.
  11. STL::="The standard C++ library of classes and functions" -- also called the "Standard Template Library" because many of the classes and functions will work with any kind of data.
  12. Syntax::=The rules determining the correctness and structure of statements in a language, grammar.
  13. Q::software="A program I wrote to make software easier to develop",
  14. TBA::="To Be Announced", something I should do.
  15. TBD::="To Be Done", something you have to do.
  16. UML::="Unified Modeling Language".
  17. void::C++Keyword="Indicates a function that has no return".

End