Hiding the stereotype - enterprise-architect

We have created an MDG by extending the features of interface. We have an element called "Design" of type interface defined in MDG. On Selecting the toolbox and droping an element "Design" in the diagram we are getting an element with stereotype "Design" in diagram . On Right Click of diagram and selecting the Advance properties of elements and tries to uncheck the show element stereotype. After unchecking the property the diagram is hiding the stereotype and replacing the sterotype "Design" with stereotype «interface» .So how can we even hide the "interface" in Diagram

«Interface» is not a stereotype but a keyword (although visually the same).
You can hide that by choosing Advanced | Use Circle Notation. Using the rectangular notation without the «interface» keyword would simply be wrong as you wouldn't be able to visually see the difference between a class and an interface.
If you want to completely create your own visualization then you'll have to use a shapescript on your stereotype.

Related

Specifying values in enumeration: Sparx Enterprise Architect

Easy to drop an enumeration object into a class diagram, but they've changed how you actually specify the values. Where is that?
Values in an Enumeration can be added in the Features window.
The easiest way to make the Features window appear is to select your enumeration in a diagram and press F9
Enumeration values are added in the Attributes tab of the features window.

Display Notes of Custom Stereotypes in Enterprise Architect

I want to create my own custom toolbox. Therefore I created a metaclass and a stereotype. In the stereotype I wrote a note that gives some instructions about how to populate the object.
Problem is, when I create my MDG Technology, the Notes won't display in the objects I create in my diagram..
How can I fix this and display the Notes for every object I create?
You can either
Write and MDG-Addin to populate the notes for your elements.
Add an element with your stereotype to the template package and add the required notes there. This will have to be done on each model that uses your MDG.
Firstly I'm assuming that you can see the notes you seek on the Properties page of an element you create using your toolbox i.e. the notes field is populated.
If it is, check that notes visibility is turned on by doing these two things:
1) Select the element and go to Element->Feature and Compartment Visibility. Check the Show Notes box. Hit OK
2) Right click on an element and choose Advanced->Use Rectangle Notation

Default diagram for Toolbox

I have a custom toolbox with a foo element.
I would like the foo to be green on an class diagram and red on flow chart diagram by default.
Adding more than one stereotype to non- UML type is impossible (as far as I know).
Is it possible to create 2 toolboxes- one for class diagrams and one for flow charts, specifying the default diagram for each toolbox in the profile?
Not quite the way you describe it.
Toolboxes don't specify which diagram they open, it's the other way around: you create a custom diagram type and associate it with a toolbox. Different custom diagrams may use the same custom toolbox.
You can create two custom diagram types, one for class ("Logical") and one for flow chart ("Activity"), but if you're only after getting the same stereotyped element (foo) to display differently in the diagrams, you don't need to.
The solution is to create a shape script for the stereotype, which checks the diagram type and changes the color accordingly. The diagram type can be queried from the shape script using the diagram.type property (for the base UML diagram type), or diagram.mdgtype (for the custom diagram type, if you've defined one). There is no need to create an Add-In, as another answer suggests, at least not in EA 11.
Check the help file under Extending UML Models -- MDG Technology SDK -- Shape Scripts -- Write Scripts -- Display Element/Connector Properties.
A simple script might look like this:
shape main {
if (hasproperty("diagram.type", "Logical")) {
setfillcolor(0, 255, 70);
} else if (hasproperty("diagram.type", "Activity")) {
setfillcolor(255, 87, 87);
}
drawnativeshape();
};
No. You need to have two different stereotypes. The target diagram is independent of the element. If you want the element appear different on the type of the diagram where you use it you need to adapt the shape script so it calls an add-in which detects the diagram type.
Well, writing the last sentence I would not know how to detect the diagram where the element in question is in. Needs investigation. But other than that - no solution I know of.
Edit: Since the add-in just receives the element GUID it has no way to figure out the diagram from where the call is made. Probably worth a feature request. But the time where we saw those realized in the next build are gone (since more than 10 years).
A last though: template packages. I almost never used them. Maybe they offer coloring depending on diagram/element.
Edit2: Last resort EA_OnPostNewDiagramObject. Catch that and you can get all information you need to apply the color.

Is "Part Decomposition" supported in EA?

I am trying to draw a part decomposition diagram with EA10. It should look like below.
But I couldn't find how. Is this UML diagram ever supported by EA?
Found it. I need to activate the "More tools..." -> "Composite" first. And choose "Port".
BTW, this is really a bad user experience.
You're doing it wrong. Sorry, but there's no kinder way to say it. :)
If the lifeline (:Class) is associated with a classifier (Class) which has properly defined ports (as it should be), then the following applies:
If you create the lifeline by dropping the classifier onto the sequence diagram, you get the option of displaying the ports (aka "structural elements") immediately.
Regardless of how the lifeline was created, you can right-click it and select "Structural Elements" which allows you to select the ports from the classifier (which may have been added since the lifeline was created).
If you want to create ports under a lifeline which has no classifier, you can do that too. Simply right-click and select "Structural Elements". The dialog allows you to create new ports.
The :Class lifeline presumably gets its type information from a Class element, so the first thing you need to do is find the Class element and give it two ports. Once you have done that, you can right-click the lifeline, select the Embedded Elements dialog and include the ports on the lifeline. (The Embedded Elements dialog may have been renamed Structural Elements in recent versions).

Changing association type to aggregation results in diamond symbol on wrong side

In Enterprise Architect (EA) 9.3 I do the following on a UML class diagram:
Select an Association link between two classes
Right-click and choose Advanced / Change Type from context menu
Change type from Association to Aggregation and click OK
What I find is that the diamond symbol for an aggregation is drawn on the wrong side (the destination side).
Is this a known bug? Is there a easy workaround? Thanks.
In enterprise architect the lines are drawn from part to whole, so source is without the diamond.
If you want to change it:
Go to Tools-> Options -> Links
And set the "Draw Aggregations Reversed" Option
Don't change an Association to an Aggregation. Instead, open the Association's properties and go to either the Source Role or Target Role page and set the "Aggregation" value to "shared" or "composite".