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 - KP

Pages: 1 ... 153 154 [155] 156 157 ... 165
No, tagged values cannot be sorted, they are always in alphabetical order. Probably worth sending in a feature request...

Automation Interface, Add-Ins and Tools / Re: Profile Creation
« on: June 04, 2009, 09:24:44 am »
Go to Settings > UML > Tagged Value Types and create a tagged value type with Type=DateTime;  Give your stereotype class an attribute with the same name as your tagged value type. Save your profile. Create an MDG Technology which bundles your profile and tagged value type definition. Full instructions in the help.

newQueueDiagramObject.Style = oldStyle + "Lollipop = 1;";
I don't know if this is the issue, but there probably shouldn't be any spaces in "Lollipop=1;"

You could export to XMI, very carefully edit the XMI in a text editor, then import it back in again (don't strip GUIDs on the import)

Hi Uffe,

What you have described was the recommended method up until EA 6.5. From EA 7.0, it has been possible to define custom toolboxes as part of an MDG Technology. This is all described in the help file, here:

Regarding Rafael's difficulties, I can't tell what you've done wrong from your description. If you would like to send in a support request to Sparx support, somebody will have a look at it for you. Useful things to send in would include a zipped up copy of the model with your profiles in (or an XMI export of them) and/or a copy of your technology XML file.

Neil :)

At the time EA_OnPreNewElement is called, the element doesn't have a name yet. EA_OnPreNewElement should be used for making "should I allow it to be created or not?" type decisions. Have a look at EA_OnPostNewElement instead which works better for "It's created, how do I make sure it's valid?" type decisions.

Automation Interface, Add-Ins and Tools / Re: Decoration Shape Script
« on: March 31, 2009, 01:12:52 pm »
Attribute settings must appear at the beginning of a shape, so move orientation="NE"; outside the if{}:

Code: [Select]
//Basic Shape
decoration top_right

Automation Interface, Add-Ins and Tools / Re: Create project browser
« on: March 19, 2009, 09:14:22 am »
If the tree structure you're creating is the same every time you run your add-in, you could use EA.Project.ImportPackageXMI().

With an add-in, you can get something working. Search the EA help for 'EA_OnPreNewAttribute'. If you implement this broadcast handler, you can examine the element an attribute is being added to and the stereotype of the attribute being added and either allow or disallow the creation of the attribute.

There is no way in EA to enforce the constraints "A class with stereotype X cannot have operations" or "A class with stereotype X can only have attributes with stereotype Y". However, you can write an add-in to perform model validation and report on violations of the constraints. Search the help for "Model Validation Broadcasts"...

Automation Interface, Add-Ins and Tools / Re: Diagram Import/Export
« on: March 03, 2009, 09:27:31 am »
It's probably hidden in the DiagramLink.Geometry string (which looks like "SX=0;SY=0;EX=0;EY=0;EDGE=3;$LLB=;LLT=;LMT=;LMB=;LRT=CX=101:CY=14:OX=0:OY=0:HDN=0:BLD=0:ITA=0:UND=0:CLR=-1:ALN=0:DIR=0:ROT=0;LRB=;IRHS=;ILHS=;" or the like), but don't ask me what this all means.
Specifically, it will be held in SX,SY for the source and EX,EY for the target (S=start, E=end). I don't know what the values mean, possibly the offset of the centre of the shape (you aim your line at the centre of the shape and attach it at the position where it intersects the edge of the shape).

Automation Interface, Add-Ins and Tools / Re: MDG Technologies
« on: March 02, 2009, 08:45:53 am »
I have loaded the technology using the ressources view.
Don't do that! Delete the technology from the Resources view, go to Settings > MDG Technologies > Advanced > Add > Add Path, OK, OK, OK and restart EA...

It's hard to know for certain without seeing your shape script, but it sounds like a "pixel count vs percentage" confusion. With shape script functions such as moveto(), lineto(), rectangle() and ellipse(), their parameters all represent a percentage of the overall size. If you want a rectangle that is 25x20 pixels, it is tempting to use the command rectangle(0,0,25,20); but that would be wrong. First define the area as 25x20 and then use 100% of it, as follows:

shape main

I hope this helps. If not, please post your shape script to this thread and we can see what is going wrong.

I then want MyStereoA to have a tag of type MyTagA, and MyStereoB to have a tag of type MyTagB. I can do this - but the tags cannot have the same name (MyTag). I must name them differently, eg aMyTag and bMyTag.
Yes, I'm afraid tag names must be unique at the profile level.

Secondly, I can specify that a Stereotype should be composite (_makeComposite, _defaultDiagramType) - but if I do that on the abstract MyStereo, the concrete MyStereoA and MyStereoB are not made composite when dragged in from the Resources tab.
EDIT: see Simon's answer below. Rightly or wrongly, _makeComposite and _defaultDiagramType aren't inherited. You will need to add them to all subclasses that need them (which is pretty easy: just drag and drop from the project browser).

Pages: 1 ... 153 154 [155] 156 157 ... 165