Book a Demo

Author Topic: Positioning prints on custom shapes  (Read 2875 times)

emusty

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Positioning prints on custom shapes
« on: October 30, 2008, 09:58:40 pm »
Hi,

I need some help in custom shapes defined in shape scripts. Basically, I'd like my use cases to visually emphasize some relevant stereotypes like user goal or user interaction. For the user goal, for example, I have created a custom shape showin a target-cross-like figure on its left-top segment.

Now I'd like to add the use case name to the figure just as it appears on normal use cases. I have come thru several scenarios but I seem to be unable to position the text label at the center of the use case ellipse no matter what tricks I'm trying. I think the one below is close to what it should look like but unfortunately it positions the label somewhere below and to the left of the ellipse.


Code: [Select]
shape main

{
      startpath();
                ellipse(0,0,100,100);
      endpath();
      fillandstrokepath();

      moveto(0,0);
      addsubshape("qualifier",100,100);
      moveto(0,0);
                addsubshape("textlabel",100,100);
          
      shape qualifier
      {                
            startpath();
                          ellipse(6,6,24,24);
            moveto(3,15);
            lineto(27,15);
            moveto(15,3);
            lineto(15,27);
            endpath();
            strokepath();
      }
      
      decoration textlabel
      {
            orientation = "NE";
            h_align = "left";
            v_align = "top";            
            bottomAnchorOffset=(0,-10);
            topAnchorOffset=(0,10);
            leftAnchorOffset=(10,0);      
            rightAnchorOffset=(-10,0);
            printwrapped("#name#");
      }      
      return;
}

Thanks for your efforts,
eM