Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Marcus Wieschalla

Pages: [1]
1
When you select Tools | Customize | Tools tab, you may use parameters such as $P for the GUID of the current package.

There are even the parameters $e and $E for element IDs and GUIDs of elements in the current diagram.

However, I miss a parameter (let's say $N) for the Node GUID of the currently selected node (package or element) in the Project Browser.

When you select Context menu | Copy Reference | Copy Node GUID to Clipboard, you do get the GUID of the current node in the Project Browser. It'd be great if there was a parameter for this GUID.

Thanks
Marcus

2
General Board / Re: Transformation Templates: constraints of class
« on: November 05, 2009, 11:18:40 pm »
Quote
You will need to select a type of Constraint, not '<None>'.

Hi Simon

Thanks for the answer. But how do I select a type of Constraint if these are the only options available in the drop-down box?
 - <None>
 - Attribute
 - Class
 - Class Base
 - Class Interface
 - Class Parameter
 - Connector
 - Import
 - Linked Attribute
 - Linked Class Interface
 - Namespace
 - Operation
 - Parameter

Could you please give me a precise example how to access constraint information in transformation templates?

Thanks
Marcus

3
General Board / Transformation Templates: constraints of classes
« on: October 23, 2009, 11:05:35 pm »
Hi!

I fail to access constraints defined on the "Constraints" tab of the "Class" dialog in transformation templates.

Chapter 5 "Code Template Framework in SDK" of the SDK documentation mentions macro names such as "constraintName" and states that "Constraint" is a template name which may be used with the list macro.

That’s why I suspect that a line in the Class template such as

   %list="Constraint" @separator="\n" @indent="  "%

should be fine and that I should be able to transform constraints into the target model.

But how does that work? There is no template type for constraints.

I’ve tried the following but nothing has worked (no corresponding text in the intermediary file):

1) In Class template:
   %list="Constraint" @separator="\n" @indent="  "%

Custom template with type "<none>" and name "Constraint"


2) In Class template:
   %list="Class__Constraint" @separator="\n" @indent="  "%

Custom template with type "Class" and name "Constraint"

3) In Class template:
   %list="Class__Constraints" @separator="\n" @indent="  "%

Custom template with type "Class" and name "Constraint" (without "s")

4) In Class template:
   %list="Class__Constraints" @separator="\n" @indent="  "%

Custom template with type "Class" and name "Constraints" (with "s")

It would be great if someone knows how to do it.

Thanks
Marcus

4
Thanks for the hint to DiagramObject.Style.

If I got you right, this would mean that I could only read the color of an element which has been placed on a diagram.

I haven't checked it but I guess that the color that I would get would be -1 for default unless I have changed the color of that particular diagram object. So I still wouldn't know the default background color. Please note that you may choose via Fill Color a particular color or Default Color.

What's more, I try to color elements before I place them into diagrams eventually. Elements themselves do have a default style. I can see it in the XMI export (see posting above) and I deduce it from the fact that I might place the same element into several diagrams, change the default background color and even place the element into a further diagram. All these diagram objects representing the element have the same color.

As we set the background color only via the Automation Interface according to the primary stereotype of each element, I've finally chosen the workaround of placing the RGB code in a tagged value "bgcolor".

When the external "refresh program" is executed, it determines the background color according to the primary stereotype and sets the background color only if the RGB code is different from the value in that tagged value "bgcolor". As I try to avoid concurrency conflicts, I don't want to reset the color of all elements again and again.

By the way, I wouldn't bother if "Synch Stereotype" refreshed not just the tagged values but also the default appearance. But that's another story...

Thanks again for your time.
Marcus

5
Yes, I've tried that one because the background color can be found
in <UML:TaggedValue tag="style" value="BackColor=16763025; ... > when you export the package to an XMI file.

Unfortunately, Element.StyleEx is always empty ("").

6
Using the Automation Interface, you may set the appearance of an element (background color, font color, ...) with the SetAppearance() method.

Unfortunately, there is no getAppearance() function. Is there a way to read the appearance of an element?

7
When I assign a stereotype to an element (such as a class) and call "Synchronize Stereotype" for that stereotype in the toolbox, tagged values and constraints of that stereotype are copied to that element.

Unfortunately, the same mechanism doesn't work for the Default Appearance. Is there a workaround for that?

I want to define a background color for a stereotype, assign that stereotype to a larger number of elements and then "copy" the background color of that stereotype to those elements.

Thanks
Marcus

Pages: [1]