Author Topic: Create custom Boundary Stereotype  (Read 4613 times)

André Ribeiro

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Create custom Boundary Stereotype
« on: November 07, 2013, 08:03:55 am »
Hi everyone!

In my UML Profile I've created a stereotype which extends the metaclass Boundary and consequently is represented as a rectangle.
Now, I would like to know how can I represent it instead as a rectangle with rounded corners.

Thanks in advance!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Create custom Boundary Stereotype
« Reply #1 on: November 07, 2013, 08:28:10 am »
You can right click on any Boundary in EA and select Appearance | Shape | Rounded Rectangle.

What I'm not sure of is if you can specify that as the default from a profile.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Create custom Boundary Stereotype
« Reply #2 on: November 07, 2013, 09:50:57 pm »
Could you write a shape script for a boundary???

q.

André Ribeiro

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Create custom Boundary Stereotype
« Reply #3 on: November 09, 2013, 12:55:19 am »
Thank you for the answers, but I never used Shape scripts.
Is it possible to achieve what I want?
Some hints would be appreciated.

Many thanks!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Create custom Boundary Stereotype
« Reply #4 on: November 09, 2013, 01:10:03 am »
Well, I just assigned a simple shape to a boundary and that worked. There are quite some examples in the help. Should not be too difficult when using RoundedRect.

q.

André Ribeiro

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Create custom Boundary Stereotype
« Reply #5 on: November 12, 2013, 04:43:24 am »
Hi everyone,

I was able to create a boundary with the rounded corners, but now I would like to know how can I specify a transparent background color to this boundary?

My script:
Code: [Select]
shape main
{
      SetPenWidth(2);
      RoundRect(0, 0, 100, 100, 20, 20);
      
      addsubshape("stereotypecompartment", 100, 10);
      addsubshape("namecompartment", 100, 10);
      
      shape stereotypecompartment
      {
            h_align = "center";
            editablefield = "stereotype";
            println("«#stereotype#»");
      }

      shape namecompartment
      {
            h_align = "center";
            editablefield = "name";
            println("#name#");
      }
}

Thanks in advance!
« Last Edit: November 12, 2013, 04:43:52 am by krypton »

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Create custom Boundary Stereotype
« Reply #6 on: November 12, 2013, 09:44:54 am »
Quote
None of the elements has transparency. Neither shape script offers that.

q.
To create a transparent shape in a shape script, use StrokePath() instead of FillAndStrokePath(), e.g.

Code: [Select]
shape main
{
    startpath();
    roundrect(0,0,100,100,30,30);
    endpath();
    strokepath();
}
Commands like rectangle(), roundrect() and ellipse() have an implicit FillAndStrokePath() but this technique bypasses that.
The Sparx Team
[email protected]

André Ribeiro

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Create custom Boundary Stereotype
« Reply #7 on: November 12, 2013, 09:55:10 pm »
It worked!  ;D
Many thanks KP!