Author Topic: Icon Shape Scripts for Database and SaaS Solutions  (Read 3242 times)

Mike Hatch

  • EA Novice
  • *
  • Posts: 4
  • Karma: +1/-0
    • View Profile
Icon Shape Scripts for Database and SaaS Solutions
« on: August 06, 2015, 07:36:46 am »
For anyone that would like to use them, here are a couple of Shape Scripts for decorating stereotypes 'SaaS' and 'Database' respectively (or whatever stereotypes you with to use them on).  

To use these:
1. Go to Project, Settings, UML Types (in EA v12)
2. Select the stereotype you wish to decorate in the list
3. Select 'Shape Script' under 'Override Appearance'
4. Click the 'Assign' button (may be 'Edit' if shape script already assigned).
5. Paste the appropriate script code into the edit box.

For SaaS:
Code: [Select]
decoration CloudNE
{
      orientation = "NE";
      noshadow = true;
      startcloudpath(5,3,0.5);
      SetFillColor(255,255,255);
      ellipse(-90,20,100,120);
      endpath();
      fillandstrokepath();
}

For Database:
Code: [Select]
decoration DatabaseNE
{
      orientation = "NE";
      noshadow = true;
      //move the shape a little down and left to it sits
      //just left the default component icon
      setorigin("NE", -25, 1);
      //fill white
      SetFillColor(255,255,255);
      //set starting cursor point
      moveto(0, 25);
      startpath();
      lineto(0, 100); //left vertical line
      bezierto(0, 125, 100, 120, 100, 100); //Bottom arc
      lineto(100, 25); //right vertical line
      bezierto(100, 0, 0, 0, 0, 25); //Top arc
      //finish the main shape so it fills in
      endpath();
      fillandstrokepath();
      bezierto(0, 50, 100, 50, 100, 25); //Middle arc
}

Note: If you want the main shape to maintain its default color, you may have to (re)select 'Default' under the Fill options.
« Last Edit: August 06, 2015, 07:42:07 am by mihatch »

shimon

  • EA User
  • **
  • Posts: 85
  • Karma: +1/-0
    • View Profile
Re: Icon Shape Scripts for Database and SaaS Solutions
« Reply #1 on: January 01, 2016, 02:33:48 am »
Thanks for sharing.
Shimon J.