在 Microsoft Visio 中的用例中自动换行文本

发布于 2024-10-17 03:09:31 字数 127 浏览 5 评论 0原文

我正在制作一个用例图,问题是:

我输入一些文本,它总是显示在一行中,使我的用例椭圆太大。有谁知道如何让它转到下一行?我认为这个选项在 StarUML 中称为换行文本...

提前谢谢您!

纳内克

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

仙气飘飘 2024-10-24 03:09:32
  1. 右键单击用例。
  2. 选择“显示形状表”。
  3. 向下滚动到“保护”部分。
  4. 将“LockTextEdit”附近的值更改为 0
  5. 关闭形状表。

现在按 F2 并编辑名称。使用 Enter 添加换行符。

单独取消对每个用例的保护是很乏味的。如果您要开始一个新图表,您可能希望取消对一个用例的保护并复制它,而不是从调色板添加新用例。

在用例名称中添加换行符的缺点是,当您修改其属性时,名称会被截断为第一个换行符。幸运的是,除了名称和文档之外,用例没有太多有用的属性。

  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.

哀由 2024-10-24 03:09:32

当您想要编辑形状时,您需要解锁应用于形状的保护属性。这里的答案都没有告诉您如何显示“形状数据”。

  1. 您需要选择顶部的“文件”菜单。选择“选项”并选择“高级”
  2. 向下滚动直到最后并选择“在开发人员模式下运行”。按“确定”。
  3. 选择顶部的主页菜单返回到您的图表。
  4. 右键单击您的形状(假设您正在编辑用例形状),
  5. 选择“显示 ShapeSheet”选项。
  6. 您将能够在图表窗口下方看到一个窗口。在此窗口中,向下滚动,直到您可以看到“保护”首选项。
  7. 选择“LockTextEdit”变量并双击并将 1 更改为 0。按 Enter 键保存您的首选项。
  8. 现在单击形状并从格式菜单中选择“文本”。
  9. 单击文本,您将能够对其进行编辑。在需要插入换行符的文本之间按 Enter 键。

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.
动听の歌 2024-10-24 03:09:32

应用自动换行的过程:

  1. 从图表区域中选择要应用自动换行的元素。

  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.

旧伤慢歌 2024-10-24 03:09:32

首先通过以下方式取消对文本的保护:
右键单击用例并选择“格式”,然后选择“保护”,取消选中“文本”

下一步,再次选择用例
然后按“F2”键
现在您可以输入文本了。按“Enter”键编辑多行
享受

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

枯叶蝶 2024-10-24 03:09:32

真实文本换行;没有该死的回车符。

Visio 2010。
SysML Stencil(来源未知)“活动图”形状集合中的“活动”形状。

  1. 如果您在功能区上看不到“开发人员”选项卡:
      文件 >选项>自定义功能区> [在“主选项卡”列表中选择“开发人员”]
  2. 右键单击感兴趣的形状并选择“显示形状表”
  3. 找到感兴趣的宽度属性
      文本转换> TxtWidth
  4. 更改 TxtWidth 属性单元格中的公式
    • 来自(类似)'=MAX(Char.Size,TEXTWIDTH(TheText))'
    • Char.Size,TEXTWIDTH(TheText)) 到 '=MIN(Width-0.08,MAX(Char.Size,TEXTWIDTH(TheText)))'

  5. 享受吧。

这里的神奇之处在于减量器 -0.08。如果没有它,我无法使形状变得更小,因为公式不允许文本宽度小于形状宽度,并且形状宽度似乎自动将自身限制为至少文本宽度。乐趣。您可能会发现您需要一个更大的减量器,或者您可以使用更好的减量器。

如果可以的话,将所做更改的形状保存到模具中。

这是我用来在所有“Action”块中应用公式更改的快速/肮脏的 VBA:

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

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)))'
  5. 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

绝不服输 2024-10-24 03:09:32

我发现通过在单词之间添加额外的空格,我可以让 Visio 将文本换行。我必须添加足够的空格,以便将单词推到用例文本框的边缘之外。有时这会导致两个不同单词之间出现换行,因此我必须在用例名称的其他位置添加额外的空格。

这确实会导致用例在 Visio 的模型资源管理器任务窗口中显示得很奇怪,但这并没有困扰我。

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.

枫林﹌晚霞¤ 2024-10-24 03:09:32

尝试在对象属性对话框中编辑文本框属性。

Try editing the TextBox properties in the object properties dialog.

你是年少的欢喜 2024-10-24 03:09:32

选择形状。
使用此菜单:[主页] -> [工具]-> [文本]
现在可以在形状上进行文本编辑。
现在,只需在要结束行的每个位置按 Shift+Enter,即可手动换行。
祝你好运

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

不爱素颜 2024-10-24 03:09:32

单击文本框,然后在下一行所需的文本之间按 Enter 键。

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

清风夜微凉 2024-10-24 03:09:31

在 Microsoft Visio 2007 中,首先您需要选择形状,右键单击它并选择“格式”,然后选择“保护...”并取消选中“文本”复选框,单击“确定”。这将允许编辑形状文本。
完成后,您可以选择用例形状,从标准工具栏中选择“文本工具”。用例文本将显示为文本框。您可以根据需要按回车键,然后单击“指针工具”即可完成操作。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文