On this page
The MagicDraw User Interface Modeling diagram becomes even more powerful and valuable when used with Magic Model Analyst. Supported UI components are as follows
You need to drag a Classifier to a UI Frame to bind them together (Magic Model Analyst will automatically apply a «UI» stereotype and set its represents tag to the Classifier). Once bound, the UI Frame can represent the Classifier. The source tag of the applied «UI» stereotype will also be set as com.nomagic.magicdraw.simulation.uiprototype.UIDiagramFrame by default.
|
A UI Panel can hold any supported UI components, such as buttons, labels, sliders, check boxes, text fields, combo boxes, spinners, radio buttons, and even panels themselves.
During runtime, UI components in the UI Panel can also display their documentation as a tooltip.
Group boxes have similar usages to Panels.
Drag a Property to one of these three UI components to bind the Property with that particular UI component. The «RuntimeValue» stereotype will be automatically applied, its "element" tag will be set to the Property, and its "Text" tag will also be set to the name of that Property. In this case, the UI component represents the Property. Once represented, the UI component will reflect the value of the represented Property in the Variables pane during simulation, and vice versa.
Drag a Property to a UI Label to bind the Property with that particular UI Label. The «RuntimeValue» stereotype will be automatically applied, its "element" tag will be set to the Property, and its "Text" tag will also be set to the name of that Property. In this case, the UI Label represents the Property. Once represented, the UI Label will display the value of the represented Property in the Variables pane during simulation.
You can use a UI button to send Signal(s), call Operation(s), or call Behavior(s).
To use a UI button to send a Signal
In addition, runtime values will be automatically created for all of the attributes and placed under the UI button if the signal has attributes. You can specify the values to be used at runtime in the "value" tag of these runtime values. If you click this UI button during simulation, it will send the associated Signal along with its runtime values.
To use a UI button to call an operation
If you click this UI button is during simulation, it will call the associated Operation.
To use a UI button to call a behavior
If you click this UI button during simulation, it will call the associated Behavior.
Drag a Property typed by Enumeration to one of these two UI components (ComboBoxes and Spinners) to bind the Property to that particular UI component. The «RuntimeValue» stereotype will be automatically applied, its "element" tag will then be set to the Property, and its "Text" tag will also be set to the name of that Property. In this case, the UI component will represent the Property typed by Enumeration. Once represented, the UI component will reflect the value (the selected Enumeration Literal) of the represented Property in the Variables pane during simulation, and vice versa.
Drag a Property typed by Enumeration to a UI Panel or GroupBox to bind the Property to that particular UI panel or GroupBox. The «RuntimeValue» stereotype will be automatically applied, its "element" tag will then be set to the Property, and its "Text" tag will also be set to the name of that Property. All Enumeration Literals of the Property type will be automatically created as a vertical list of UI RadioButtons. Each UI RadioButton will represent Enumeration Literal of the Property type accordingly. Once represented, the UI RadioButton will display the value of the represented Property in the Variables pane during simulation.
In addition, you can assign or re-assign other Enumeration Literals to an existing UI RadioButton by dragging other Enumeration Literals of the same Property type to the existing UI RadioButton. Also, you can create a single UI RadioButton to represent a particular Enumeration Literal by dragging the Enumeration Literal to a UI Panel or GroupBox. The «RuntimeValue» stereotype will be automatically applied, its "element" tag will then be set to Enumeration Literal, and its "Text" tag will also be set to the name of the Enumeration Literal.
The following figure demonstrates an example of using MagicDraw's User Interface Modeling Diagram with Magic Model Analyst.
The steps in this example are as follows
See the Calculator.mdzip sample for detailed instructions. When you drag any GUI elements to a diagram, click Run to simulate the animation.
|
The models used on this page are the CarBrakingAnalysis and Calculator sample models that come with MagicDraw. To open a sample, do either of the following