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 ... 154 155 [156] 157 158 ... 163
2326
You can set the size of stereotyped ports to something other than the 16x16 default, and you need to be aware of that if you are checking the "Element Size" option on the Save as UML Profile dialog. In that case, give the stereotype element the attributes: _sizeX=16 and _sizeY=16.

2327
Automation Interface, Add-Ins and Tools / Re: Deploy An MDG Technology
« on: August 14, 2008, 09:21:01 am »
Quote
I'm not sure where to put this function in order EA  execute it on start up

It would help to know what language you are using. In C# you put your broadcast handlers as shown:
Code: [Select]
namespace MyAddin
{
      public class Main
      {
            // insert your broadcast handlers here
      }
}
If this doesn't answer your question, please post your code (or send it to Sparx Support if you prefer) and that will make it easier to help you.

2328
The database field is t_connector->PDATA4 which changes from 0 to 1. In automation, that will be Connector.Miscdata(3). Is that field still read-only? If so, worth a feature request through the normal channels.

2329
Automation Interface, Add-Ins and Tools / Re: Shape script issues
« on: July 30, 2008, 09:05:09 am »
This one seems to work:
Code: [Select]
shape main
{
      noshadow=true;
      setpencolor(255,0,0);
      moveto(0,-[highlight]10[/highlight]);
      lineto(100,-[highlight]10[/highlight]);
      setpencolor(0,255,0);
      moveto(0,[highlight]10[/highlight]);
      lineto(100,[highlight]10[/highlight]);
}
Change the highlighted numbers to increase or decrease the gap, to taste.

HTH

2330
Automation Interface, Add-Ins and Tools / Re: More shape script fun
« on: July 10, 2008, 09:12:54 am »
It appears that the drawnativeshape() command and gradient fills are in conflict. Could you send in a bug report please? Thanks.

2331
Automation Interface, Add-Ins and Tools / Re: Shape script woes !
« on: July 03, 2008, 09:26:49 am »
Quote
shape main
{
    SetFillColor(255,0,0);
    drawnativeshape();      
  
}
Hmmm... for reasons unknown, this shape script works when applied to a stereotype in the stereotypes table ("Settings > UML" from the main menu) but doesn't work when applied in a profile. Can you send in a bug report please because this will need investigating. Thanks.

2332
Automation Interface, Add-Ins and Tools / Re: Shape script woes !
« on: July 01, 2008, 08:41:31 am »
Quote
The first problem I got is that there is no attribute (“_color” or something like that) to change the actual default color for the new stereotype.
When creating a profile, select a stereotype class, press F4 and choose your colours. If your stereotype extends a connector then change the border colour to set the line colour. When you save the profile, tick the option "Color and Appearance".


Quote
So, I was wondering whether this sort of customization is available on EA, changing the color in a native shape when you invoke drawnativeshape() function in a Shape Script.


{
    if (HasTag("color","red"))
    {
        drawnativeshape();
        setfillcolor(255,0,0); // New color for the feature shape
        return;
   }
}
The setfillcolor() needs to be before the drawnativeshape() command.

EDIT: My two answers above give two different solutions to your problem - it's either/or, you don't need to do both.

2333
Automation Interface, Add-Ins and Tools / Re: Icons and UML Profiles
« on: June 18, 2008, 09:20:34 am »
Quote
I find that if I replace the default graphic that a Profile uses with a shape using a shape script or a wmf picture file I am unable to display the tagged values, stereotype information etc on the diagram as well as my fancy graphic.
Displaying a stereotype in a shape script is easy:

Code: [Select]
println("«#stereotype#»");
To display tagged values, you'd need to look at linked notes.

2334
It's best if you don't change your profile XML by hand. Rather, set the colours of your profile elements in EA, then save your profile by right-clicking your diagram (right-clicking the package won't do it) and tick the "Color and Appearance" option.

2335
Have a look at the BPMN technology for our solution (work-around) to this same problem. The spec says a business process diagram has a number of defined properties; our solution was to create a business process element which is a composite element that owns the diagram and also owns the tagged values.

2336
Quote
How can I cancel the default EA behavior e.g. double click on an Class in the project view?
Search the help file for EA_OnContextItemDoubleClicked...

2337
Quote
Thanks.

My intention is for example to prevent that the user can select in the properties of a Class-Element the "Visibility" Protected.

The User should only select Private or Public.

Is it possible to do this?
Have a look at the possibility of writing a model validation add-in. You can define a rule to check the value of the visibility field. There is example model validation code in the help file.

2338
Works for me...
Code: [Select]
shape main
{
      v_align="center";
      h_align="center";
      rectangle(0,0,100,100);
      printwrapped("#name#");
}
And it looks like this:


2339
Quote
Actually the online manual explicitely states that there is no way to change the font size, type or colour of a text, and that setpencolor only affects line drawing commands but not any text commands.
Unfortunately, correct.

Quote
I have no idea how to show all attributes either. Loops are not supported, so probably it's not possible at all.
Unfortunately, correct.

Quote
Probably there's nothing in the profile defining mechanism to support preconfigured attributes, operations, or whatever features.
Tagged values only.

Quote
It could be done by complementing the MDG with an AddIn using broadcast event (adding preconfigured stuff in the EA_PostNewElement event).
Yes, I have had success doing this.

Quote
This would mean, of course, to have half the logic for an MDG technology in the profiles, and the other half in the AddIn
You would have the add-in load the technology, so the technology effectively becomes the add-in's data.

2340
Maybe you can do something in an add-in by intercepting the EA_OnContextItemDoubleClicked broadcast?

Pages: 1 ... 154 155 [156] 157 158 ... 163