Tutorial

This section describes the operation procedures step by step aiming for completing a class diagram shown below.

orig/tutorial-finish.png

Creating a New Class

Create “ParentClass” first.

  1. Press c.

    A rectangle named “no name” is created.

    orig/tutorial-create-noname-674575d0ff0144dea0b491e0b4958a9ba2d00aa1523439da8f709986c1a0b1f9.png

  2. Press i with the cell of the created class selected.

    The mode switches to the NORMAL MODE (CLASS). In this state, you can perform the cursor operation etc. for the text in the class. You cannot enter text in this mode.

    orig/tutorial-normal-mode-674575d0ff0144dea0b491e0b4958a9ba2d00aa1523439da8f709986c1a0b1f9.png

  3. Press dd.

    This is a key pattern to delete a line in the NORMAL MODE (CLASS). As a result, “no name” is deleted and a blank space is displayed.

    orig/tutorial-empty-674575d0ff0144dea0b491e0b4958a9ba2d00aa1523439da8f709986c1a0b1f9.png

  4. Press i.

    The mode switches to the INSERT MODE (NORMAL). In this state, you can edit the text in the class.

  5. Enter “ParentClass”.

    Here, a rectangle named “ParentClass” is created.

    orig/tutorial-insert-mode-674575d0ff0144dea0b491e0b4958a9ba2d00aa1523439da8f709986c1a0b1f9.png

  6. Press ESC.

    Return to the NORMAL MODE (CLASS) for the next procedure.

Adding the Operation (Method) and Attribute (Property)

Add the attribute “property\ and operation “method” to “ParentClass” created earlier. Make sure that the above procedure is completed (the mode is the NORMAL MODE (CLASS)).

  1. Press Shift + Enter.

    An area for entering the attribute or operation is created under the class name.

    orig/tutorial-add-property-674575d0ff0144dea0b491e0b4958a9ba2d00aa1523439da8f709986c1a0b1f9.png

  2. Press j.

    The cursor moves to the created area. Gridraw allows you to perform operations using key bindings similar to vi / vim. For example, you can use : h, j, k, l to move the cursor. You can of course use the Arrow keys instead to move the cursor. For more details, refer to key-bindings.

    orig/tutorial-move-property-674575d0ff0144dea0b491e0b4958a9ba2d00aa1523439da8f709986c1a0b1f9.png

  3. Press i.

    The mode switches to the INSERT MODE (NORMAL). Now you can edit the text.

  4. Enter “+ property : int”.

    In Gridraw, you can enter any text you want, even if the text does not comply with UML specification.

    orig/tutorial-input-property-674575d0ff0144dea0b491e0b4958a9ba2d00aa1523439da8f709986c1a0b1f9.png

  5. Enter Shift + Enter.

    An area for entering the operation is created under the attribute area. Shift + Enter is effective in the INSERT MODE (NORMAL) too.

    orig/tutorial-add-method-674575d0ff0144dea0b491e0b4958a9ba2d00aa1523439da8f709986c1a0b1f9.png

  6. Press .

    In the INSERT MODE (NORMAL) you can use the Arrow keys to move the cursor. If you do not want to take your fingers off of the home position for Arrow keys}, you should return to the {%mode NORMAL MODE (CLASS).

    orig/tutorial-move-method-674575d0ff0144dea0b491e0b4958a9ba2d00aa1523439da8f709986c1a0b1f9.png

  7. Enter “+ method() : void”.

    orig/tutorial-input-method-674575d0ff0144dea0b491e0b4958a9ba2d00aa1523439da8f709986c1a0b1f9.png

  8. Press ESC and ESC.

    Return to the CELL MODE for the next procedure. When returning from the INSERT MODE (NORMAL) to the CELL MODE, you need to press : ESC twice.

Associating with Other Class

Create a new class “ChildClass”. Generalize this class from the class “ParentClass” created earlier.

  1. Press j several times.

    The selected cell (active cell) moves downward. In the CELL MODE too, you can move the cursor using key bindings of vi / vim: h, j, k, l. (You can also use the Arrow keys.) For more details, refer to (key-bindings).

    orig/tutorial-move-cell-674575d0ff0144dea0b491e0b4958a9ba2d00aa1523439da8f709986c1a0b1f9.png

  2. Press c.

    A rectangle named “no name” is created.

  3. Press i with the cell of the created class selected.

    The mode switches to the NORMAL MODE (CLASS).

  4. Press dd.

    “no name” is deleted and a blank space is displayed.

  5. Press i.

    INSERT MODE (NORMAL) に切り替わります。

  6. Enter “ChildClass”.

    Here, a rectangle named “ChildClass” is created.

    orig/tutorial-create-childclass-674575d0ff0144dea0b491e0b4958a9ba2d00aa1523439da8f709986c1a0b1f9.png

  7. Press ESC and ESC.

    Return to the CELL MODE.

  8. Press G on the cell in which “ChildClass” is located.

    The mode switches to the CONNECT MODE. This mode is for connecting various connectors. As you pressed G here, you can connect a connector for “generalization.” For more details, refer to connection.

  9. Press k several time.

    The selected cell moves up to the position of “ParentClass”. In the CONNECT MODE too, you can move the selected cell by the method similar to the CELL MODE.

    orig/tutorial-connect-parent-674575d0ff0144dea0b491e0b4958a9ba2d00aa1523439da8f709986c1a0b1f9.png

  10. Press Enter.

    Press Enter to establish the connection of the connector. You can use ESC to cancel until it is established. When the connection is established, the mode automatically returns to the CELL MODE.

Operating a Row/Column

Like spreadsheet software, Gridraw allows you to edit the units of rows/columns.

There is too much space between “ParentClass” and “ChildClass”. Delete the rows to reduce the space.

  1. Press k several times.

    Move the active cell to the row to be deleted between “ParentClass” and “ChildClass”.

    orig/tutorial-move-del-cell-674575d0ff0144dea0b491e0b4958a9ba2d00aa1523439da8f709986c1a0b1f9.png

  2. Press t several times and adjust the layout.

    Pressing t in the CELL MODE deletes the cell in a single row.

    orig/tutorial-delete-row-674575d0ff0144dea0b491e0b4958a9ba2d00aa1523439da8f709986c1a0b1f9.png

Outputting an Image File

You can output the created diagram as an image file (.png format). Let’s output the diagram you created.

  1. Select the cell in which “ParentClass” is located.

    orig/tutorial-v-select-start-674575d0ff0144dea0b491e0b4958a9ba2d00aa1523439da8f709986c1a0b1f9.png

  2. Press v.

    The mode switches to the SELECT CELL MODE. This mode is for selecting multiple cells. For more details, refer to mode.

  3. Press j several times to move to the cell in which “ChildClass” is located.

    The selection rage is extended with “ParentClass” as the starting point. The selected cells are highlighted.

    orig/tutorial-v-select-end-674575d0ff0144dea0b491e0b4958a9ba2d00aa1523439da8f709986c1a0b1f9.png

  4. Press :.

    You are prompted to enter a command line (at the lower left).

    orig/tutorial-v-cmdline-674575d0ff0144dea0b491e0b4958a9ba2d00aa1523439da8f709986c1a0b1f9.png

  5. Enter the xp tutorial.png command and then press Enter.

    xp is the command to export an image. The following tutorial.png is the output file name. Therefore, an image file named tutorial.png is output here.

    orig/tutorial-v-cmd-input-674575d0ff0144dea0b491e0b4958a9ba2d00aa1523439da8f709986c1a0b1f9.png

    (Output result) orig/tutorial.png

    Although all the operations described in this section use the keyboard, you can perform the same operations using the mouse, toolbar, and menu. For more details, refer to each item later described.