Astah

From HerzbubeWiki
Jump to: navigation, search

This page contains a few notes about the UML modeling software Astah. I took these notes a long time ago, and since I use Astah only very rarely (despite it being very good software! see my evaluation of free UML tools) the notes might have become seriously out-of-date.


HOWTOs

Associations to self

For associations to self, it's usually best to use line style "right angle".

Associations to self are always created at the top edge of a class shape. So how do I create an association to self so that the line is located at the left/right/lower edge of a class shape? If this is not possible, how do I move the association ends?

  • I have not found out how to initially place an association to self at the left/right/lower edge.
  • To move the line to a different edge, drag one of the nodes. Do NOT drag one of the association ends - you can change the ends' placement after the line has switched sides.


How do I fix a diagonal relationship line so that it runs horizontally or vertically straight?

  • Choose line style "right angle"
  • If the line still has segments, move the nodes so that they overlap and Astah removes them


How do I hide the return types of operations in a class diagram?

  • Hide on the entire diagram
    • Select diagram
    • In the properties pane select the tab "Visibility"
    • Set "Operation Return Type Visibility" to false
    • At the top of the property list, click the button "Apply to existing elements"
  • Hide on a class
    • Right-click on a class to display the context menu
    • Disable "Extended Visibility > Operation Return Type Visibility"
  • Hide an individual operation: Not possible (or I have not found this option)
  • Hide in future projects: Preferences > Visibility 1 (Initial) > Operation Return Type = false


Is it possible to repeatedly add a class without having to go back to the toolbar and reselect the "Class" button?

  • Double-clicking the "Class" button, as it is usally done in other modeling tools, does not work in Astah
  • But there is a toolbar button labelled "Lock selected mode" at the right end of the toolbar. If this is toggled on, then the "Class" button will not deselect after a class has been added.


How can I quickly add multiple attributes or operations to a class?

  • Add the first attribute or operation
  • Afterwards pressing the "Enter" key will add another attribute or operation. You can immediately start typing to give the attribute or operation a name.


Open questions

  • When I change the size of a class shape in the class diagram, Astah moves the end points of relationships whose line style is "right angle". If the lines were not segmented before, they now become segmented. Is it possible to disable the segmentation behaviour? This is really annoying, if a line is straight it should stay straight...
  • When I select a different association, the tab in the properties pane always switches back to "Base". How can I prevent this? Sometimes I would like to change the role name or multiplicity of several associations in a row. This scenario is tedious because for every association I have to click multiple times until I get to one of the tabs that define properties for association ends.
    • The association line displays handle looking like a "-" (minus) sign and an "m" character at each end. Clicking on these allows to set role name and multiplicity for an association end. The context menu, if you right-click near one end of the association end, also allows to set these (menu entry "Set association end name" and submenu "Multiplicity").
  • For an association to self, how can I move all segments of the line as one? The behaviour that I now find is that segments can be moved only individually. When I want to move the association without its lines changing their proportions, I therefore have to move at least twice: once for each of the segments that go out of the class shape.
  • Is it possible to rotate a label so that it follows a diagonal or vertical association line?
  • When I resize a class shape I often would like to set it to the same width or height of neighbouring shapes in the diagram. Is it possible to get some help for this? Guidelines are only displayed when moving, but not when resizing. Another possibility would be a tool similar to the alignment functions, but I have not found one.


Modeling guidelines