Book a Demo

Author Topic: stereotypes.  (Read 9249 times)

Nonchalant

  • EA User
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
stereotypes.
« on: December 07, 2006, 03:13:32 am »
How do i hide all the stereotypes displayed on the class diagrams, I dont want to delete them but just hide them so visually cannot be seen.
Thanks!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: stereotypes.
« Reply #1 on: December 07, 2006, 12:59:38 pm »
Each diagram has two options in its properties "Show Element Stereotypes" and "Show Feature Stereotypes".  There is also a general option in the General page of the options dialog to "Show Stereotypes".

chrisHauert

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: stereotypes.
« Reply #2 on: December 10, 2006, 05:43:47 am »
I've got another problem in the same context. How can I hide stereotypes in relationships that I've created in a profile?
I use the following shape script :

shape main
{

//Initialisation attributes - must be before drawing commands
noshadow = "true";
v_align = "center";
setpencolor(getUserBorderColor()); // border color from user selection
setpenwidth(getUserPenSize()); // border color from user selection

startpath();
moveto(0,0);  // (x1,y1)
lineto(100,0);  // (x1,y1)
endpath();
fillandstrokepath();
}

shape label
// no label for stereotype
{
hidelabel ("stereotype");
}

shape target
// shape for filled arrow head

{
//set shape colors
setfillcolor(getuserbordercolor()); // fill color from user selection
setpencolor(getuserbordercolor()); // border color from user selection

// draw filled triangular arrow head
startpath();
moveto(0,0);
lineto(8,-5);
lineto(8,5);
lineto(0,0);
endpath();
fillandstrokepath();

}

The hidelabel ()command doesn't work as I expect it (not enough documented in the ea help ???)
Does someone has an idea about how to hide the stereotype of the relationship by means of a shape script?
cheers, Christoph
Cheers, Christoph

Nonchalant

  • EA User
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: stereotypes.
« Reply #3 on: December 10, 2006, 12:28:33 pm »
that does not work! ???

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: stereotypes.
« Reply #4 on: December 10, 2006, 02:06:38 pm »
Quote
The hidelabel ()command doesn't work as I expect it (not enough documented in the ea help ???)
Does someone has an idea about how to hide the stereotype of the relationship by means of a shape script?


You can either use

 HideLabel("middlebottomlabel");

or you can override the label with

 label MiddleBottomLabel
 {
 }
The Sparx Team
[email protected]

chrisHauert

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: stereotypes.
« Reply #5 on: December 10, 2006, 09:19:40 pm »
With
Quote
HideLabel("middlebottomlabel");
added in the shape main section it works, thanks a lot!!
But with
Quote
 label MiddleBottomLabel
  {
  }

the stereotype still appears. Do I have to add it in the shape label section or where?
I'm keen to know more about how to use the "shape label" feature, there is really not a lot of documentation around.
Regards, Christoph
Cheers, Christoph

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: stereotypes.
« Reply #6 on: December 10, 2006, 09:30:57 pm »
Ah, maybe you need to have something inside the label block. Try:

label MiddleBottomLabel
{
   print("");
}
The Sparx Team
[email protected]

chrisHauert

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: stereotypes.
« Reply #7 on: December 11, 2006, 06:29:59 am »
Didn't work, but I could use this:
Code: [Select]
shape middlebottomlabel
{
//Hide label for stereotype name

HideLabel("middlebottomlabel");
}

together with standard shape for stereotype with metaclass "association" etc.

Yet some other issues with stereotypes:
  • font color cannot be set by shape script even though there exists a command "getUserFontColor()"
  • When using the metaclass "boundary" for a stereotype eg. "scope", the stereotype doesn't appear in the toolbox. When drawing it from the ressource view from the profile, ea doesn't draw the shape on the diagram.
    When using the metaclass "SysBoundary" for e.g. stereotype "scope", the stereotype appears in the toolbox, but when drawn on the diagram, it shows up as an normal boundary.When looking up in the  menue Settings - UML - Stereotypes, a second entry for "scope" (besides base class "SysBoundary") is defined with Base Class "boundary". One has to load the shapescript for this second stereotype in order to get it work properly.
  • When using the metaclass "SysBoundary" for e.g. stereotype "scope"  and having defined attributes in the stereotype as tagged values. these will not be added to the element when created on the diagramm. Nevertheless, ea allows for manual creation of such tagged values and the shapescript reacts in correspondance to these added tags.
  • with "setpenwidth(getUserPenSize()); " when you want to refresh the preview EA hangs up !!?
  • "setlineStyle("dash");" doesn't work, doesn't show up in blue in the editor!?


I'm not shure if that's the right place to put all these issues, hopefully it is :)
I'd be glad about any hint
Cheers, Christoph

« Last Edit: December 11, 2006, 06:32:48 am by chrisHauert »
Cheers, Christoph

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: stereotypes.
« Reply #8 on: December 11, 2006, 01:05:24 pm »
Hi Chris,

In no particular order...

This is as good a place as any to bring these points up. However, if you are making "Requests and Suggestions" perhaps the appropriately named section of the forum would be better.

The GetUserFontColor() function appears to be informative - it tells you the current default font color set by this user (versus the EA default, which could be different). You can use it to, for example, change back to the default color after highlighting some text, or perhaps to ensure that highlighted text is in a non-default color. Use something like SetPenColor() to change colors before you write text - you should be fine.

Boundaries exhibit all kinds of strange behavior in EA. Perhaps you should post this issue to a dedicated thread. then issue a bug report to Sparx - with a hyperlink to the thread - and then keep us up to date on Sparx' response.

As to the SetPenWidth() hang, Sparx definitely needs to hear about this in a bug report. Please proceed as above.

What do you mean by "doesn't show up in blue...?" Are you saying that is the only time it does not work, or what?

Regarding a bug report, the easiest way to submit one is from within EA itself. From the main menu choose Help | On-line Features | Bug Report Page. That will take you to the correct place for either the registered or trial versions.

HTH, David
No, you can't have it!

Nonchalant

  • EA User
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: stereotypes.
« Reply #9 on: December 12, 2006, 03:17:17 am »
errr. what about my original post!  ::)

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: stereotypes.
« Reply #10 on: December 12, 2006, 04:00:37 am »
Sorry Nonchalant, that was a reply to Chris - and thus the suggestion that he start a thread to that effect.
No, you can't have it!

mikewhit

  • EA User
  • **
  • Posts: 608
  • Karma: +0/-0
  • Accessing ....
    • View Profile
Re: stereotypes.
« Reply #11 on: December 12, 2006, 04:13:59 am »
Looked like you were happy with simonm's 7th Dec answer to the original post. Hence (I presume) the hijacking !

Nonchalant

  • EA User
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: stereotypes.
« Reply #12 on: December 12, 2006, 06:05:56 am »
Hi Mark,

Please see my reply above posted on the 10th of december.
cheers.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: stereotypes.
« Reply #13 on: December 12, 2006, 01:10:49 pm »
Okay, the global option I mentioned only effects the project browser not diagrams.  Is that what you said doesn't work?

The two diagram options that I mentioned do definately hide stereotypes on class diagrams though so you can use them.

mark.myers

  • EA User
  • **
  • Posts: 97
  • Karma: +0/-0
    • View Profile
Re: stereotypes.
« Reply #14 on: January 01, 2007, 05:02:19 pm »
I am trying this same approach with sourcetoplabel and targettoplabel but it doesn't work.  I can successfully hide the middletoplabel but not the source or target toplabel.  Is a different approach needed?  More documentation would be good!
Cheers, Mark