Book a Demo

Author Topic: Additional Profile Woes  (Read 5925 times)

fwoolz

  • EA User
  • **
  • Posts: 435
  • Karma: +0/-0
  • We have met the enemy, and he is us.<Pogo, 1970>
    • View Profile
Additional Profile Woes
« on: August 29, 2006, 02:35:34 pm »
All,

Note that these comments relate to EA 6.5 Beta 2:

1. Stereotypes based (both redefinitions and extensions) on the the "Send" and "Receive" metaclasses refuse to pay attention to the Shape Script attached via the (undocumented, I think) "_image" tag. Dropping these items, either from the toolbox or the Resource tab, results in the standard shape, not the one defined by the Shape Script.
2. Stereotypes based on the "Event" metaclass do, however, obey the Shape Script. Unfortunately, the image rectangle that results is twice the height of the actual image, so connectors stop in "mid-air", as it were.
3. "Send" and "Receive" events are differentiated by different Subtype values. Is there any way to access this value in a profile definition? Otherwise, stereotypes elements based on "Event" come in as "Send" events (Subtype = 0) by default; also, the profile image can't change based on this value since "HasTag" has no Subtype tag to check against.

Cheers,
Fred Woolsey
Interfleet Technology Inc.

Always be ready to laugh at yourself; that way, you beat everyone else to the punch.


«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Additional Profile Woes
« Reply #1 on: August 29, 2006, 03:39:27 pm »
Your concerns, at least 1 and 2, appear to be valid bugs in the beta, particularly given the recent Sparx post regarding the "_image" tag. Your third point is certainly a concern, although I don't know for sure if it is a bug or not.

If you have not already done so, you should definitely mention the first two, and IMHO the third as well, to Sparx directly, since the beta period compresses the time available to evaluate and resolve such bugs.

The correct page to report a beta bug is: http://www.sparxsystems.com.au/registered/reg_bug_report_beta.html

David
No, you can't have it!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Additional Profile Woes
« Reply #2 on: August 29, 2006, 07:14:49 pm »
Quote
2. Stereotypes based on the "Event" metaclass do, however, obey the Shape Script. Unfortunately, the image rectangle that results is twice the height of the actual image, so connectors stop in "mid-air", as it were.

It sounds like you aren't using the whole drawing area. Note that the numbers in a command like Rectangle(0,0,100,50); are percentages of the working area, not pixel values. Can you post your shape script here or e-mail to me and I'll be able to advise.

Quote
3. "Send" and "Receive" events are differentiated by different Subtype values. Is there any way to access this value in a profile definition? Otherwise, stereotypes elements based on "Event" come in as "Send" events (Subtype = 0) by default;

What you can do is have an add-in that responds to the OnPostNewElement broadcast event. Something like...

Code: [Select]
Function EA_OnPostNewElement(Repository As EA.Repository, Info As EA.EventProperties) As Boolean
   Dim HasBeenUpdated As Boolean
   HasBeenUpdated = False
   
   Dim ElementID As Long
   ElementID = Info.Get(0)
   Dim Element As EA.Element
   Set Element = Repository.GetElementByID(ElementID)

   Select Case Element.Stereotype
   Case "myReceive"
       Element.Subtype = 1
       Element.Update
       HasBeenUpdated = True
   End Select

   EA_OnPostNewElement = HasBeenUpdated
End Function


Question 1 and the last part of 3 look like oversights - I've put bug reports in the system for you.
« Last Edit: August 29, 2006, 07:28:14 pm by KP »
The Sparx Team
[email protected]

fwoolz

  • EA User
  • **
  • Posts: 435
  • Karma: +0/-0
  • We have met the enemy, and he is us.<Pogo, 1970>
    • View Profile
Re: Additional Profile Woes
« Reply #3 on: August 30, 2006, 06:05:02 am »
Thanks for the tips...I wasn't using the entire drawing area...correcting the numbers resulted in the image taking up the entire drawing area. However, when the stereotyped Event is dropped on the diagram, it appears for an instant at the preferred height and width set in the script, but then expands to the same fixed height and width (much too tall) regardless of the script settings. The same thing happens, by the way, to an unadorned "Event" image (redefined in the profile without an alternative image) when dropped...it blows up to twice the height (more or less) of the standard "Receive" or "Send" images.

Here's the script:

shape main
{
preferredHeight = 50;
preferredWidth = 150;
layouttype = "border";
ellipse(0,0,20,30);
moveto(10,30);
lineto(10,70);
moveto(10,70);
lineto(0,100);
moveto(10,70);
lineto(20,100);
moveto(10,44);
lineto(20,44);
moveto(10,44);
lineto(0,44);
startpath();
moveto(25,0);
lineto(80,0);
lineto(100,50);
lineto(80,100);
lineto(25,100);
lineto(25,0);
endpath();
fillandstrokepath();
addsubshape("padding","N");
addsubshape("name","CENTER");

shape name
{
h_align = "CENTER";
printwrapped("#NAME#");
}

shape padding
{
preferredHeight=25;
preferredWidth=50;
}

}

Cheers,
« Last Edit: August 30, 2006, 06:05:47 am by fwoolz »
Fred Woolsey
Interfleet Technology Inc.

Always be ready to laugh at yourself; that way, you beat everyone else to the punch.


KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Additional Profile Woes
« Reply #4 on: August 30, 2006, 09:25:42 pm »
The way to force the default size for a stereotype in a profile is to give it attributes _sizeX and _sizeY with initial values set to the absolute size in pixels that you want the elements to be. (to give an idea, a class is 90x70 by default, an actor 45x90, a package 130x80 etc). You will then need to check the "Element Size" option when saving the profile. If you check this option and don't supply these attributes, EA will take the size of the stereotype class as its default size.
The Sparx Team
[email protected]

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Additional Profile Woes
« Reply #5 on: August 31, 2006, 04:00:52 am »
And we continue to wait for the updated documentation Neil.

I know this is expected by production time, and trust the "_*" attributes will be covered.

In the meantime these morsels are quite informative.

Thanks much, David
No, you can't have it!