Book a Demo

Author Topic: Stereotype Icons in UML Profiles  (Read 8504 times)

Martin Spamer

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Stereotype Icons in UML Profiles
« on: December 19, 2007, 06:58:58 am »
I've created a UML Profile for SOA and exported it successfully.  However I want to change the icon that appears on the upper right of my stereotyped classes.  I can see this is possible on some predefined stereotype but cannot figure how to do it and as far as I can see it's not documented in the EA help system.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Stereotype Icons in UML Profiles
« Reply #1 on: December 19, 2007, 07:15:49 am »
I think you'll have to use a shape script.
No, you can't have it!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Stereotype Icons in UML Profiles
« Reply #2 on: December 19, 2007, 02:31:17 pm »
Shape script would look like this:
Code: [Select]

decoration foo
{
  orientation="NE";
  image("nameOfYourIcon",0,0,100,100);
}
The Sparx Team
[email protected]

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Stereotype Icons in UML Profiles
« Reply #3 on: December 19, 2007, 03:07:17 pm »
Neil,

Can you use a decoration script with your own (main) shape script?

David
No, you can't have it!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Stereotype Icons in UML Profiles
« Reply #4 on: December 19, 2007, 03:29:55 pm »
Quote
Neil,

Can you use a decoration script with your own (main) shape script?

David

Yes, it will draw the shape first and then add the decoration on top. Try this one:
Code: [Select]

decoration foo
{
   orientation="NE";
   setfillcolor(0,255,0);
   rectangle(0,0,100,100);
}

shape main
{
   setfillcolor(255,0,0);
   rectangle(0,0,100,100);
}
The Sparx Team
[email protected]

Miracleworker

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Stereotype Icons in UML Profiles
« Reply #5 on: December 20, 2007, 12:30:00 am »
You can also make your own:

shape main{

//Initialisation attributes
h_align = "center";
v_align = "center";


// Draw component diagram
setpenwidth(2);
rectangle(0,0,120,90);
image ("Logo.bmp",0,0,20,18);

startpath();
moveto(105,5);
lineto(115,5);
lineto(115,30);
lineto(105,30);
endpath();
fillandstrokepath();

startpath();
moveto(100,10);
lineto(110,10);
lineto(110,15);
lineto(100,15);
endpath();
fillandstrokepath();

startpath();
moveto(100,20);
lineto(110,20);
lineto(110,25);
lineto(100,25);
endpath();
fillandstrokepath();

// Print name and status in the component element
println("#stereotype#");
println("#name#");
}

Greetings,

Eric

danm

  • EA User
  • **
  • Posts: 88
  • Karma: +0/-0
    • View Profile
Re: Stereotype Icons in UML Profiles
« Reply #6 on: December 20, 2007, 10:40:56 am »
Sweet! That was exactly my next question, which was I wanted to decorate a component element with a graphic on the upper left hand corner.

I changed the pen width to 1, and added <<>> to the stereotype, and finally made it the default shape (0,0,100,100)

Quote
You can also make your own:

shape main{

//Initialisation attributes
h_align = "center";
v_align = "center";


// Draw component diagram
setpenwidth(2);
rectangle(0,0,120,90);
image ("Logo.bmp",0,0,20,18);

startpath();
moveto(105,5);
lineto(115,5);
lineto(115,30);
lineto(105,30);
endpath();
fillandstrokepath();

startpath();
moveto(100,10);
lineto(110,10);
lineto(110,15);
lineto(100,15);
endpath();
fillandstrokepath();

startpath();
moveto(100,20);
lineto(110,20);
lineto(110,25);
lineto(100,25);
endpath();
fillandstrokepath();

// Print name and status in the component element
println("#stereotype#");
println("#name#");
}

Greetings,

Eric