7

I am making a use case diagram, and the problem is:

I type some text and it is always display in one line, making my use case elipse too big. Does anyone know how to make it go to the next line? I think this option is called wrap text in StarUML...

Thank you in advance!

Nanek

skaffman
  • 381,978
  • 94
  • 789
  • 754
nanek23
  • 71
  • 1
  • 1
  • 2

10 Answers10

4

In Microsoft Visio 2007 first you need to select your shape, right click it and choose "Format", then "Protection..." and uncheck "Text" checkbox, click OK. This will allow to edit shape text. When that is done you can select your use case shape, choose "Text Tool" from standard toolbar. Use case text will appear as text box. You can hit enter where necessary and then click "Pointer Tool" to complete operation.

Skull
  • 86
  • 4
  • Visio 2010 does not have the "Protection" item in the "Format" submenu. I have added another answer that worked for me. – utapyngo Jun 14 '13 at 03:42
3
  1. Right-click the use case.
  2. Select "Show ShapeSheet".
  3. Scroll down to the "Protection" section.
  4. Change the value near "LockTextEdit" to 0.
  5. Close the ShapeSheet.

Now press F2 and edit the name. Add line breaks with Enter.

It is tedious to unprotect each use case individually. If you are starting a new diagram, you may want to unprotect one use case and copy it instead of adding new use cases from the palette.

The downside of adding line breaks to the name of use case is that when you modify its properties, the name truncates to the first line break. Luckily, use cases do not have much useful properties other than name and documentation.

utapyngo
  • 6,236
  • 2
  • 39
  • 62
  • Great! This answer is really good but I think I need to add something. To see the "Show ShapeSheet" option you need to activate the Developer Mode. If you want to activate it, click on **File**, then click on **Options**. In the options, go to the **Advanced** tab. Search and mark the **Run in Developer Mode** option. Now you can follow the above instructions. – Gilberto Sánchez Jul 18 '16 at 17:56
2

First remove the protection on the Text by: right click the use case and select "Format" then "Protection", uncheck "Text"

Next, select the use case again then press the key "F2" and now you can enter your text. press the key "Enter" to edit more than one line Enjoy

Fathi
  • 21
  • 2
2

When you wish to edit a shape, you need to unlock the protection attributes applied on the shape. None of the answers here have informed you how to show the "Shape Data".

  1. You need to select File menu on the top. Select "Options" and select "Advanced"
  2. Scroll down till the end and select "Run in Developer mode". Press Ok.
  3. Select Home menu at the top to return to your diagram.
  4. Right click on your Shape (let's say you're editing a Use case shape)
  5. Select "Show ShapeSheet" option.
  6. You will be able to see a window below the diagram window. In this window, scroll down until you can see the "Protection" preferences.
  7. Select "LockTextEdit" variable and double click and change 1 to 0. Press enter to save your preference.
  8. Now click on the shape and select "Text" from format menu.
  9. Click on the text and you will be able to Edit it. Press Enter key in between the text where you need to insert line break.
thandasoru
  • 1,488
  • 2
  • 14
  • 38
  • When I add a new "class" all the line wraps go back to one single line! Help! How do I prevent all my changes from being discarded? Thanks – atom88 May 02 '18 at 18:23
2

Procedure for applying Word Wrap:

  1. Select from the diagram area an element for which to apply Word Wrap.

  2. Right-click and select the [Format] -> [Word Wrap Name] menu.

Perform the steps above once again to removed Word Wrap.

Marko
  • 21
  • 2
1

I found that by putting extra spaces in between the words I could get Visio to wrap the text. I had to add enough spaces so that it would push a word beyond the margin of the use case's textbox. Sometimes this would cause a line break between two different words, so I had to add additional spaces elsewhere in the use case name.

This does cause the use cases to be displayed oddly in Visio's Model Explorer task window but this didn't bother me.

Holistic Developer
  • 2,263
  • 1
  • 17
  • 25
0

Select the shape. use this menu: [Home] -> [Tools] -> [Text] now text editing is available on the shape. Now by just hitting shift+enter on every place you want to end the line, you can wrap text manually. Good Luck

0

Real text wrap; no bloody carriage returns.

Visio 2010. SysML Stencil (source unknown) 'Activity' shape in 'Activity Diagram' shapes collection.

  1. If you cannot see the 'Developer' tab on the ribbon:
      File > Options > Customize Ribbon > [Select 'Developer' in 'Main Tabs' list]
  2. Right-click shape of interest and select 'Show Shapesheet'
  3. Find the width property of interest
      Text Transform > TxtWidth
  4. Change the formula in the TxtWidth property cell
    • from (something like) '=MAX(Char.Size,TEXTWIDTH(TheText))'
    • to '=MIN(Width-0.08,MAX(Char.Size,TEXTWIDTH(TheText)))'
    • Enjoy.

    The magic here is the decrementer -0.08. Without it, I couldn't make the shape any smaller because the formula would not allow the text width to be smaller than the shape width, and the shape width appeared to automatically limit itself to, at minimum, the text width. Fun. You may find you need a larger decrementer or that you can get away with a finer one.

    Save the shape to which you've made this change into the stencil if you can.

    Here is the quick/dirty VBA I used to apply the formula change across all the 'Action' blocks:

    Public Sub ApplyWrapTextPropertyToAllActionBlocks()
    Const STR_ACTION_BLOCK_NAME As String = "Action with Wrap Text."
    Const STR_DECREMENTER       As String = "-0.08"
    
    Dim objShape                As Shape
    Dim objActionBlock          As Shape
    
    For Each objShape In ActivePage.Shapes
        If InStr(1, objShape.Name, STR_ACTION_BLOCK_NAME, vbBinaryCompare) <> 0 Then
            Debug.Print "Found one: " & objShape.Name
    
            Set objActionBlock = objShape
    
            objActionBlock.CellsU("TxtWidth").Formula = "=MIN(Width" & STR_DECREMENTER & ",MAX(Char.Size,TEXTWIDTH(TheText)))"
        End If
    Next objShape
    

    End Sub

    Tom
    • 11
    • 1
    0

    Try editing the TextBox properties in the object properties dialog.

    mpez0
    • 2,643
    • 18
    • 10
    -1

    click into the text box and hit enter between the text you want on the next line.

    dustin
    • 7
    • 1
    • The Use Case stencil is protected and doesn't let you directly edit the text. Instead, you have to use the Use Case Properties dialog to set the name of the use case -- and you can't enter line breaks here. – Holistic Developer Sep 30 '12 at 21:08