I have used MagicDraw v18.5 to draw a class diagram. My diagram has classes, attributes, stereotypes, and notes.
My business users find my diagram too technical. I would like a way to give them a dumbed-down, business-friendly view that shows only classes and associations, without the attributes or stereotypes.
I tried the one thing I know: select everything in the diagram, edit the compartments, and hide the attributes and stereotypes. But the result looks terrible: the content of the compartments disappears as intended, but the compartments aren't resized. Each class is a box with a big empty Attributes compartment. I could never show this to a business user without manually resizing.
Is there a more straightforward way to do this?
Note this is using MagicDraw 19.0-SP2, so there might be some differences.
I'll use block elements as an example, instead of classes, but they are just "fancy" SysML classes. Your symbols probably look something like this as described:
with my empty compartments being "values" and "operations", instead of "attributes" and "stereotypes". The principle is the same for any compartment.
Suppress/Hide the compartments, rather than remove the properties from them.
Per the comments, it appears you have removed the elements from the compartments, rather than hiding/removing the compartments themselves. If you click on the class element symbol, on the left there should be small minus signs that you can click to "Suppress", or hide, each compartment completely.
Alternatively, you can click the "..." Compartments icon on the left at the top (to the left of the symbol name/header) and then remove the checkmark for any compartment you want to hide.
There is also an entry on the Compartments menu to "Suppress All" which will turn all of them off.
After suppressing the compartments, click the auto-size icon at the bottom right and you should get something with just the name:
Bulk Edit multiple symbols at once
You can select all the class symbols at once, and edit them in bulk, rather than following the above for each symbol on your diagram.
To do this, click on a class symbol, then use ctrl-shift-s to select all other symbols of the same type. If you click on multiple types of objects (e.g. hold shift and select both a class and a comment symbol at the same time), then it will select all of the symbols that match the type any of the elements already selected.
Now you can right-click and select symbol properties and will have access to the common properties of all those symbol types at once. Doing it this way will avoid snagging all element types, such as labels and relationships, which often do not have the same symbol properties, and therefore cannot be bulk edited together.
Alternatively, you can open or select the Properties window, then select the "Symbol" tab, to have access to the same properties for bulk edit. The other tabs in the Properties window provide a power means of editing element, tag, and traceability properties in bulk:
In either window, starting typing "Suppress" in the search bar, and you will get all the options for suppressing things from being visible on your selected elements. In the case of a SysML block, which can be True (checked), False (unchecked), or a black box with <undefined>, which will happen if some symbols are currently set True while others are False.
Setting the "Suppress Operations" and "Suppress Values" in my case are the two items I need to hide those compartments on my test Block symbol.
Bulk Autosize
After hiding the compartments, you can click on the auto-resize button in the bottom right, but I recommend going into the awful keyboard shortcut editor and struggling with it until you have setup a shortcut key for auto-size. Then you can hit ctrl-a to select all symbols at once, or ctrl-shift-s for all elements of a specific type, and use the shortcut key to autosize all of them at once.
They have updated it recently to make it not-quite-so-awful, so it's different than 18.5, so I'll leave the steps as an exercise for the reader. I use this shortcut all the time.
Apply word wrap if needed.
You can use the 'word wrap' symbol attribute to allow you to resize to a smaller size and have long names wrap into multiple rows, allowing you to make a symbol thinner.
Note: Word wrap only shows up under the "All" view, not even under "Expert" in Symbol Properties.
Switch from "Standard" or "Expert" to "All" in the view dropdown on the upper right of the symbol properties window.
Type "wr" in the search to find the "Wrap Words" property, and set it to true.
Now you can resize your symbol to a thinner version with a name or other properties that wrap onto multiple rows. Why they don't have this property set by default is beyond me...
Unfortunately, you will need to resize elements manually to get them to actually wrap the words, but once you have the width the way you want, auto-size will work fine.
You can also make everything really skinny, then use the "Layout -> Make same width" command to make all elements the same width as the widest selected symbol, if you want uniformity.
Related
What I want to achieve: an easier way to edit longer text (one or two paragraphs) in a QTableWidget cell.
The problem: resizeRows wraps the text in the cell when the table is displayed. However, if I try to edit the cell, all the text appears on one line which makes it awkward to edit.
What I've tried: I tried implementing a QTextEdit widget for editing:
class EditDelegate(QStyledItemDelegate):
def createEditor(self, parent, option, index):
editor = super().createEditor(parent, option, index)
if isinstance(editor, QLineEdit):
textedit = QTextEdit(parent)
textedit.setPlainText(editor.text())
return textedit
That fixed the editing problem, although I have to rely on the edit box losing focus to save the text. However, after editing, the default QTableWidgetItem now shows HTML in the edited cell. I had thought that using setPlainText() would prevent this. The only text entered was "THE NOTE TEXT", seen in the middle of this screenshot:
If I then try to edit the cell again, the HTML is stripped out and just the original text ("THE NOTE TEXT") remains in the QTextEdit box until again I exit the editor.
Questions:
Is my approach a good way to implement multiline editing in a
QTableWidget?
If so, how can I get rid of the HTML markup that the
QTableWidgetItem is now displaying?
Since you only need a multiple line editor and no formatting (colors, text style, etc.) then use QPlainTextEdit.
The reason behind the returned HTML is that the default property (see the USER attribute) of QTextEdit is html: item delegates use the USER property as default to set the value of the editor and then set it back on the model, meaning that setEditorData() will behave like using setHtml() and setModelData() like toHtml().
The user property for QPlainTextEdit is just plainText, so there will be no conversion in either case.
Also note that your implementation of createEditor() will potentially raise an exception if the default editor is not a QLineEdit (if the data uses numbers or Qt dates/times), since textexit is only declared in the if, but that's a bad way to do so anyway (you're creating a widget that won't be used).
Besides, calling textedit.setPlainText(editor.text()) is useless, because at that point the editor is still empty and it will be filled only by setEditorData() (which would overwrite its contents anyway).
A more correct approach would check the data type and return the editor accordingly, then let the delegate fill the widget in its own.
def createEditor(self, parent, option, index):
if isinstance(index.data(), str):
return QTextEdit(parent)
return super().createEditor(parent, option, index)
Finally, be aware that many have tried to implement multiple line editors in item views, and very few attempts actually achieve a valid result. Many issues are related with the available item geometry, cursor navigation, UX aspects and focus management, and almost any solution has to accept some level of compromise that many users might find annoying. The most common acceptable (and less "hated") solution is to use an external editor, either shown in another part of the UI or through a dialog window.
in word pressing alt+F9 can display "FieldCodes"
How can I access this programmatically using vba and pair them with the formfields?
You can access the field code by ? Application.ActiveDocument.Fields(1).Code
And you can access the form fields by Application.ActiveDocument.FormFields(1)
But is there any guarantee's about the indices matching?
Can a formfield ever not be a Field? can a Field ever not be a formfield?
Will changing these away from FORMTEXT have any unintended side effects, or are these basically nice and friendly linking id's / display values allowing you to view them and swap between them with ease?
Edit: I've come up with the following to get the fields Code. I'm still unsure if it's a good idea to edit them or not, or what they represent.
Application.ActiveDocument.FormFields(1).Range.Fields(1).Code
Fields are general objects, they can be :
document's properties (built-in or custom),
mailing / mergemail,
calculation,
form fields,
...
A form fields is an field for inputs.
Take a look at the links in the tag info of word-field, there is a lot of interesting things!
And you can access them by their own collections (press F2 in VBE to use Object Browser).
For Fields the general collection is in Application.ActiveDocument.Fields,
but you can find them in a lot of objects (check with Object Browser!).
Take a look at that answer to have an idea of the other objects in which you can find it! ;)
To my knowledge, there is no possibility nest something inside a FormField, like you can do in a Field.
I'm not sure to understand that question :
"Will changing these away from FORMTEXT have any unintended side effects,
or are these basically nice and friendly linking id's / display values
allowing you to view them and swap between them with ease?"
If you want to create a Form that users can fill, you'll need to stick with FormFields.
If you want to display values at specific places in a document, Fields is the way to go.
I'd even suggest Custom Document Properties for a general use, and MergeMail for Mailings. ;)
I starting using LabVIEW about 1 week ago. In a tutorial I watched this picture
I am wondering how can I assign the value "Disabled and Grayed out" to disabled property value of the button?
There are a couple of ways to create property nodes in LabVIEW. This method is the quickest and easiest and matches your picture.
Add the button to your front panel.
Right-Click and go to Create >> Property Node >> Disabled in the menus. Click on this.
LabVIEW will automatically switch to the block diagram and let you drop the property node.
By default it is a read node. Right-Click on the block where it says "Disabled" and select Change To Write in the menu (There is also Change All To Write if you have multiple properties.
Hover over the input so you get the wiring symbol. Right-Click and select Create Constant to create the correct Enum constant to write to it.
That is the basics and the way most people start out - a couple of extra tips:
The node is expandable hover at the bottom and you get the resize block, drag this down and you can set more than one property on the same node. These are set in order from top to bottom.
Left click on each property to change which property it is.
Right-Click and go to Link To... in the menu to change which button it applies to.
I've noticed that certain dropdowns, despite having e.g. five different options in the set, only display two at a time, which makes scrolling an inconvenience. On the very same form, another dropdown displays three and a half rows and, as far I could see, there's no relation between the number of rows displayed and the placement on the form nor does such a relation exist related to the number of the elements in the option set.
(How) can I control (or at the very least affect) the number of elements displayed in a dropdown? I didn't find any options for that in the settings (format has only the num er of columns to span across).
Judging from what I've seen, CRM lets dropdowns lower bound expand until the lower end of the container tab. Because of this, one is forced to add spacers (creating "holes" in the form) when the optionset sits at the bottom...
There doesn't seem to be a way to manipulate this behavior, unless one strays outside supported customizations and goes on manipulating the DOM.
How many times have we seen this type of selector:
List Box Selector http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/MoveItemsListBox.jpg
I was just about to start creating this in a WinForms app, when I thought that others may have some ideas for doing this better. We need it to sort - so the right hand list will need up/down buttons. But this seems so old school. I love devexpress components, and was thinking of asking them if they would consider adding a component that handles this functionality with a slick UI.
I am thinking that a graphical representation of the objects, and a graphical representation of the listboxes - that would be a more intuitive way to move items around.
Has anyone seen an open source project like this?
If a CheckListBox won't suffice (and it usually will), then the "modern" approach would be to use a ListView or similar component with a "Transfer" column. Render the button inline in that column, one for each row, so that it only takes one click to move an item from one to the other.
You see this everywhere in Vista, usually with hyperlinks as opposed to buttons. Instead of clicking on an item and then choosing an action, you click the action at the item level.
I wouldn't go overboard with slickness as it can impair functionality, but the dual-listbox screen is definitely old-school.
Also, if there's a very large amount of data to manage, it helps to provide a progressive search at the bottom of one or both lists.
I have done this type of selection using (essentially) a single CheckListBox that displays each item as an image. Part of the image looks like a LED, which is on (bright) if the item is selected or off (dark) if it is not selected.
This works well if you have a reasonable amount of data to select from, and also works well in a multi-column format if you can predict that the options will have reasonably similar lengths.
Allow users to drag items in/out of list 2, and also drag to reorder in list2.
(All items dragged out of list2, and dropped anywhere outside the list, get put back into list 1, in their correct place in the list by alphabetical or natural order.)
You can merge the two list boxes into one with the help of groups (LVGF_GROUPID flag): one group for selected and one for not selected.
You can also implement group membership changes with drag-drop between them. This way single drag-drop can move an item into the other group at the appropriate position, saving most/all of the other buttons.
Additionaly the bottom of each group can have one pseudo item with help text (i.e. "Drag items here to...") that is visible only when relevant.